• Andre Guedes's avatar
    igc: Fix NFC rule validation · 1894df0c
    Andre Guedes authored
    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: default avatarAndre Guedes <andre.guedes@intel.com>
    Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    1894df0c
igc_ethtool.c 49.8 KB