igc: Fix NFC rule overwrite cases

When the 'loc' argument is passed in ethtool, the input rule overwrites
any rule present in that location. In this situation we must disable the
old rule otherwise it is left enabled in hardware. This patch fixes
the issue by always calling igc_disable_nfc_rule() when deleting the
old rule, no matter the value of 'input' argument.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
Andre Guedes 2020-04-24 13:16:15 -07:00 коммит произвёл Jeff Kirsher
Родитель b500350a36
Коммит 4bdf89e85e
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -1270,8 +1270,7 @@ static int igc_ethtool_update_nfc_rule(struct igc_adapter *adapter,
/* if there is an old rule occupying our place remove it */
if (rule && rule->location == location) {
if (!input)
err = igc_disable_nfc_rule(adapter, rule);
err = igc_disable_nfc_rule(adapter, rule);
hlist_del(&rule->nfc_node);
kfree(rule);