2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/net/ethernet/intel/igc
Song Yoong Siang d5b97c01ce igc: Add wildcard rule support to ethtool NFC using Default Queue
Introduce support for a lowest priority wildcard (catch-all) rule in
ethtool's Network Flow Classification (NFC) for the igc driver. The
wildcard rule directs all unmatched network traffic, including traffic not
captured by Receive Side Scaling (RSS), to a specified queue. This
functionality utilizes the Default Queue feature available in I225/I226
hardware.

The implementation has been validated on Intel ADL-S systems with two
back-to-back connected I226 network interfaces.

Testing Procedure:
1. On the Device Under Test (DUT), verify the initial statistic:
   $ ethtool -S enp1s0 | grep rx_q.*packets
        rx_queue_0_packets: 0
        rx_queue_1_packets: 0
        rx_queue_2_packets: 0
        rx_queue_3_packets: 0

2. From the Link Partner, send 10 ARP packets:
   $ arping -c 10 -I enp170s0 169.254.1.2

3. On the DUT, verify the packet reception on Queue 0:
   $ ethtool -S enp1s0 | grep rx_q.*packets
        rx_queue_0_packets: 10
        rx_queue_1_packets: 0
        rx_queue_2_packets: 0
        rx_queue_3_packets: 0

4. On the DUT, add a wildcard rule to route all packets to Queue 3:
   $ sudo ethtool -N enp1s0 flow-type ether queue 3

5. From the Link Partner, send another 10 ARP packets:
   $ arping -c 10 -I enp170s0 169.254.1.2

6. Now, packets are routed to Queue 3 by the wildcard (Default Queue) rule:
   $ ethtool -S enp1s0 | grep rx_q.*packets
        rx_queue_0_packets: 10
        rx_queue_1_packets: 0
        rx_queue_2_packets: 0
        rx_queue_3_packets: 10

7. On the DUT, add a EtherType rule to route ARP packet to Queue 1:
   $ sudo ethtool -N enp1s0 flow-type ether proto 0x0806 queue 1

8. From the Link Partner, send another 10 ARP packets:
   $ arping -c 10 -I enp170s0 169.254.1.2

9. Now, packets are routed to Queue 1 by the EtherType rule because it is
   higher priority than the wildcard (Default Queue) rule:
   $ ethtool -S enp1s0 | grep rx_q.*packets
        rx_queue_0_packets: 10
        rx_queue_1_packets: 10
        rx_queue_2_packets: 0
        rx_queue_3_packets: 10

10. On the DUT, delete all the NFC rules:
    $ sudo ethtool -N enp1s0 delete 63
    $ sudo ethtool -N enp1s0 delete 64

11. From the Link Partner, send another 10 ARP packets:
    $ arping -c 10 -I enp170s0 169.254.1.2

12. Now, packets are routed to Queue 0 because the value of Default Queue
    is reset back to 0:
    $ ethtool -S enp1s0 | grep rx_q.*packets
         rx_queue_0_packets: 20
         rx_queue_1_packets: 10
         rx_queue_2_packets: 0
         rx_queue_3_packets: 10

Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
Co-developed-by: Blanco Alcaine Hector <hector.blanco.alcaine@intel.com>
Signed-off-by: Blanco Alcaine Hector <hector.blanco.alcaine@intel.com>
Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com>
Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2025-07-18 09:02:28 -07:00
..
igc_base.c igc: return early when failing to read EECD register 2025-01-07 09:01:15 -08:00
igc_base.h igc: move TXDCTL and RXDCTL related macros 2025-06-11 08:52:14 -07:00
igc_defines.h igc: Add wildcard rule support to ethtool NFC using Default Queue 2025-07-18 09:02:28 -07:00
igc_diag.c igc: remove autoneg parameter from igc_mac_info 2024-11-13 10:30:21 -08:00
igc_diag.h
igc_dump.c
igc_ethtool.c igc: Add wildcard rule support to ethtool NFC using Default Queue 2025-07-18 09:02:28 -07:00
igc_hw.h igc: Remove unused igc_read/write_pcie_cap_reg 2025-01-06 13:32:44 -08:00
igc_i225.c igc: field get conversion 2023-12-18 11:20:43 -08:00
igc_i225.h
igc_leds.c igc: Fix LED-related deadlock on driver unbind 2024-04-24 20:09:30 -07:00
igc_mac.c igc: remove autoneg parameter from igc_mac_info 2024-11-13 10:30:21 -08:00
igc_mac.h
igc_main.c igc: Add wildcard rule support to ethtool NFC using Default Queue 2025-07-18 09:02:28 -07:00
igc_nvm.c igc: Remove unused igc_acquire/release_nvm 2025-01-06 13:32:44 -08:00
igc_nvm.h igc: Remove unused igc_acquire/release_nvm 2025-01-06 13:32:44 -08:00
igc_phy.c igc: remove autoneg parameter from igc_mac_info 2024-11-13 10:30:21 -08:00
igc_phy.h
igc_ptp.c igc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() 2025-07-03 09:38:33 -07:00
igc_regs.h igc: add support to get frame preemption statistics via ethtool 2025-04-18 09:17:14 -07:00
igc_tsn.c igc: Make the const read-only array supported_sizes static 2025-06-19 15:39:21 -07:00
igc_tsn.h igc: add preemptible queue support in mqprio 2025-06-11 10:06:24 -07:00
igc_xdp.c igc: Fix XSK queue NAPI ID mapping 2025-04-02 08:51:41 -07:00
igc_xdp.h
igc.h igc: Add wildcard rule support to ethtool NFC using Default Queue 2025-07-18 09:02:28 -07:00
Makefile net: intel: Use *-y instead of *-objs in Makefile 2024-06-10 19:52:44 -07:00