]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
igc: Fix NFC queue redirection support
authorAndre Guedes <andre.guedes@intel.com>
Fri, 6 Mar 2020 23:54:03 +0000 (15:54 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 17 Apr 2020 17:19:24 +0000 (10:19 -0700)
The support for ethtool Network Flow Classification (NFC) queue
redirection based on destination MAC address is currently broken in IGC.
For instance, if we add the following rule, matching frames aren't
enqueued on the expected rx queue.

$ ethtool -N IFNAME flow-type ether dst 3c:fd:fe:9e:7f:71 queue 2

The issue here is due to the fact that igc_rar_set_index() is missing
code to enable the queue selection feature from Receive Address High
(RAH) register. This patch adds the missing code and fixes the issue.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Acked-by: Sasha Neftin <sasha.neftin@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_defines.h
drivers/net/ethernet/intel/igc/igc_main.c

index 42fe4d75cc0df9ef54ac5a098dd9755bad47924b..af0c03d77a39b246bb0845e446edcde3f2b76218 100644 (file)
  * (RAR[15]) for our directed address used by controllers with
  * manageability enabled, allowing us room for 15 multicast addresses.
  */
+#define IGC_RAH_QSEL_MASK      0x000C0000
+#define IGC_RAH_QSEL_SHIFT     18
+#define IGC_RAH_QSEL_ENABLE    BIT(28)
 #define IGC_RAH_AV             0x80000000 /* Receive descriptor valid */
-#define IGC_RAH_POOL_1         0x00040000
+
 #define IGC_RAL_MAC_ADDR_LEN   4
 #define IGC_RAH_MAC_ADDR_LEN   2
 
index 44366c1bec19d0c1414e9c70cccf75727accdc87..85df9366e172271a2f9fc2e38c3b3d581d68b0dd 100644 (file)
@@ -780,13 +780,18 @@ static void igc_rar_set_index(struct igc_adapter *adapter, u32 index)
        rar_low = le32_to_cpup((__le32 *)(addr));
        rar_high = le16_to_cpup((__le16 *)(addr + 4));
 
+       if (adapter->mac_table[index].state & IGC_MAC_STATE_QUEUE_STEERING) {
+               u8 queue = adapter->mac_table[index].queue;
+               u32 qsel = IGC_RAH_QSEL_MASK & (queue << IGC_RAH_QSEL_SHIFT);
+
+               rar_high |= qsel;
+               rar_high |= IGC_RAH_QSEL_ENABLE;
+       }
+
        /* Indicate to hardware the Address is Valid. */
        if (adapter->mac_table[index].state & IGC_MAC_STATE_IN_USE) {
                if (is_valid_ether_addr(addr))
                        rar_high |= IGC_RAH_AV;
-
-               rar_high |= IGC_RAH_POOL_1 <<
-                       adapter->mac_table[index].queue;
        }
 
        wr32(IGC_RAL(index), rar_low);