]> git.baikalelectronics.ru Git - kernel.git/commit
igc: Fix NFC rule validation
authorAndre Guedes <andre.guedes@intel.com>
Fri, 24 Apr 2020 20:16:20 +0000 (13:16 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 23 May 2020 01:21:51 +0000 (18:21 -0700)
commitc6e99f8277c702fb397cf70cf4c4245f74dd0dc9
tree6f5f7dbd5e3deda65d5c36a28af87d9e389ffeea
parent16b403b541d9ff312908cb6b92aecb7ded800031
igc: Fix NFC rule validation

If we try to overwrite an existing rule with the same filter but
different action, we get EEXIST error as shown below.

$ ethtool -N eth0 flow-type ether dst <MACADDR> action 1 loc 10
$ ethtool -N eth0 flow-type ether dst <MACADDR> action 2 loc 10
rmgr: Cannot insert RX class rule: File exists

The second command is expected to overwrite the previous rule in location
10 and succeed.

This patch fixes igc_ethtool_check_nfc_rule() so it also checks the
rules location. In case they match, the rule under evaluation should not
be considered invalid.

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>
drivers/net/ethernet/intel/igc/igc_ethtool.c