linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iwl-next,v3 0/2] igc: Add Default Queue Support
@ 2025-06-20 10:02 Song Yoong Siang
  2025-06-20 10:02 ` [PATCH iwl-next,v3 1/2] igc: Relocate RSS field definitions to igc_defines.h Song Yoong Siang
  2025-06-20 10:02 ` [PATCH iwl-next,v3 2/2] igc: Add wildcard rule support to ethtool NFC using Default Queue Song Yoong Siang
  0 siblings, 2 replies; 7+ messages in thread
From: Song Yoong Siang @ 2025-06-20 10:02 UTC (permalink / raw)
  To: Tony Nguyen, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Richard Cochran, Alexei Starovoitov, Daniel Borkmann,
	Jesper Dangaard Brouer, John Fastabend, Vinicius Costa Gomes,
	Jonathan Corbet, Przemek Kitszel, Shinas Rasheed, Kevin Tian,
	Brett Creeley, Blanco Alcaine Hector, Joshua Hay, Andrew Lunn,
	Jacob Keller, Kurt Kanzenbach, Marcin Szycik, Brett Creeley
  Cc: intel-wired-lan, netdev, linux-kernel

This patch set introduces the support to configure "Default Queue" during runtime
by using ethtool's Network Flow Classification (NFC) wildcard rule approach.

v3:
  - separate macros relocation code that not related to wildcard rule to another patch (Brett)

V2: https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20250619153738.2788568-1-yoong.siang.song@intel.com/
  - use Ethtool wildcard rule instead of extra uAPI (Jakub Kicinski & Jacob Keller)
  - combine MRQC register definitions into a single location (Kurt Kanzenbach)
  - use FIELD_PREP (Kurt Kanzenbach)
  - use RCT rule (Wojciech Drewek)
  - no need brackets for single line code (Wojciech Drewek)
  - use imperative mood in commit message (Marcin Szycik)
  - ensure igc_ prefix in function name (Marcin Szycik)

V1: https://patchwork.ozlabs.org/project/intel-wired-lan/cover/20240730012212.775814-1-yoong.siang.song@intel.com/

Song Yoong Siang (2):
  igc: Relocate RSS field definitions to igc_defines.h
  igc: Add wildcard rule support to ethtool NFC using Default Queue

 drivers/net/ethernet/intel/igc/igc.h         | 15 ++++++-------
 drivers/net/ethernet/intel/igc/igc_defines.h |  4 ++++
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 18 ++++++++++++++++
 drivers/net/ethernet/intel/igc/igc_main.c    | 22 ++++++++++++++++++++
 4 files changed, 52 insertions(+), 7 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH iwl-next,v3 1/2] igc: Relocate RSS field definitions to igc_defines.h
  2025-06-20 10:02 [PATCH iwl-next,v3 0/2] igc: Add Default Queue Support Song Yoong Siang
@ 2025-06-20 10:02 ` Song Yoong Siang
  2025-06-20 10:24   ` [Intel-wired-lan] [PATCH iwl-next, v3 " Loktionov, Aleksandr
                     ` (2 more replies)
  2025-06-20 10:02 ` [PATCH iwl-next,v3 2/2] igc: Add wildcard rule support to ethtool NFC using Default Queue Song Yoong Siang
  1 sibling, 3 replies; 7+ messages in thread
From: Song Yoong Siang @ 2025-06-20 10:02 UTC (permalink / raw)
  To: Tony Nguyen, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Richard Cochran, Alexei Starovoitov, Daniel Borkmann,
	Jesper Dangaard Brouer, John Fastabend, Vinicius Costa Gomes,
	Jonathan Corbet, Przemek Kitszel, Shinas Rasheed, Kevin Tian,
	Brett Creeley, Blanco Alcaine Hector, Joshua Hay, Andrew Lunn,
	Jacob Keller, Kurt Kanzenbach, Marcin Szycik, Brett Creeley
  Cc: intel-wired-lan, netdev, linux-kernel

Move the RSS field definitions related to IPv4 and IPv6 UDP from igc.h to
igc_defines.h to consolidate the RSS field definitions in a single header
file, improving code organization and maintainability.

This refactoring does not alter the functionality of the driver but
enhances the logical grouping of related constants

Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com>
---
 drivers/net/ethernet/intel/igc/igc.h         | 4 ----
 drivers/net/ethernet/intel/igc/igc_defines.h | 3 +++
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 1525ae25fd3e..0b35e593d5ee 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -406,10 +406,6 @@ extern char igc_driver_name[];
 #define IGC_FLAG_RSS_FIELD_IPV4_UDP	BIT(6)
 #define IGC_FLAG_RSS_FIELD_IPV6_UDP	BIT(7)
 
-#define IGC_MRQC_ENABLE_RSS_MQ		0x00000002
-#define IGC_MRQC_RSS_FIELD_IPV4_UDP	0x00400000
-#define IGC_MRQC_RSS_FIELD_IPV6_UDP	0x00800000
-
 /* RX-desc Write-Back format RSS Type's */
 enum igc_rss_type_num {
 	IGC_RSS_TYPE_NO_HASH		= 0,
diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
index 86b346687196..d80254f2a278 100644
--- a/drivers/net/ethernet/intel/igc/igc_defines.h
+++ b/drivers/net/ethernet/intel/igc/igc_defines.h
@@ -383,11 +383,14 @@
 #define IGC_RXDEXT_STATERR_IPE		0x40000000
 #define IGC_RXDEXT_STATERR_RXE		0x80000000
 
+#define IGC_MRQC_ENABLE_RSS_MQ		0x00000002
 #define IGC_MRQC_RSS_FIELD_IPV4_TCP	0x00010000
 #define IGC_MRQC_RSS_FIELD_IPV4		0x00020000
 #define IGC_MRQC_RSS_FIELD_IPV6_TCP_EX	0x00040000
 #define IGC_MRQC_RSS_FIELD_IPV6		0x00100000
 #define IGC_MRQC_RSS_FIELD_IPV6_TCP	0x00200000
+#define IGC_MRQC_RSS_FIELD_IPV4_UDP	0x00400000
+#define IGC_MRQC_RSS_FIELD_IPV6_UDP	0x00800000
 
 /* Header split receive */
 #define IGC_RFCTL_IPV6_EX_DIS	0x00010000
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH iwl-next,v3 2/2] igc: Add wildcard rule support to ethtool NFC using Default Queue
  2025-06-20 10:02 [PATCH iwl-next,v3 0/2] igc: Add Default Queue Support Song Yoong Siang
  2025-06-20 10:02 ` [PATCH iwl-next,v3 1/2] igc: Relocate RSS field definitions to igc_defines.h Song Yoong Siang
@ 2025-06-20 10:02 ` Song Yoong Siang
  2025-07-06 11:01   ` [Intel-wired-lan] [PATCH iwl-next, v3 " Mor Bar-Gabay
  1 sibling, 1 reply; 7+ messages in thread
From: Song Yoong Siang @ 2025-06-20 10:02 UTC (permalink / raw)
  To: Tony Nguyen, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Richard Cochran, Alexei Starovoitov, Daniel Borkmann,
	Jesper Dangaard Brouer, John Fastabend, Vinicius Costa Gomes,
	Jonathan Corbet, Przemek Kitszel, Shinas Rasheed, Kevin Tian,
	Brett Creeley, Blanco Alcaine Hector, Joshua Hay, Andrew Lunn,
	Jacob Keller, Kurt Kanzenbach, Marcin Szycik, Brett Creeley
  Cc: intel-wired-lan, netdev, linux-kernel

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>
---
 drivers/net/ethernet/intel/igc/igc.h         | 11 +++++++---
 drivers/net/ethernet/intel/igc/igc_defines.h |  1 +
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 18 ++++++++++++++++
 drivers/net/ethernet/intel/igc/igc_main.c    | 22 ++++++++++++++++++++
 4 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 0b35e593d5ee..c580ecc954be 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -631,6 +631,7 @@ enum igc_filter_match_flags {
 	IGC_FILTER_FLAG_DST_MAC_ADDR =	BIT(3),
 	IGC_FILTER_FLAG_USER_DATA =	BIT(4),
 	IGC_FILTER_FLAG_VLAN_ETYPE =	BIT(5),
+	IGC_FILTER_FLAG_DEFAULT_QUEUE = BIT(6),
 };
 
 struct igc_nfc_filter {
@@ -658,10 +659,14 @@ struct igc_nfc_rule {
 	bool flex;
 };
 
-/* IGC supports a total of 32 NFC rules: 16 MAC address based, 8 VLAN priority
- * based, 8 ethertype based and 32 Flex filter based rules.
+/* IGC supports a total of 65 NFC rules, listed below in order of priority:
+ *  - 16 MAC address based filtering rules (highest priority)
+ *  - 8 ethertype based filtering rules
+ *  - 32 Flex filter based filtering rules
+ *  - 8 VLAN priority based filtering rules
+ *  - 1 default queue rule (lowest priority)
  */
-#define IGC_MAX_RXNFC_RULES		64
+#define IGC_MAX_RXNFC_RULES		65
 
 struct igc_flex_filter {
 	u8 index;
diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
index d80254f2a278..498ba1522ca4 100644
--- a/drivers/net/ethernet/intel/igc/igc_defines.h
+++ b/drivers/net/ethernet/intel/igc/igc_defines.h
@@ -391,6 +391,7 @@
 #define IGC_MRQC_RSS_FIELD_IPV6_TCP	0x00200000
 #define IGC_MRQC_RSS_FIELD_IPV4_UDP	0x00400000
 #define IGC_MRQC_RSS_FIELD_IPV6_UDP	0x00800000
+#define IGC_MRQC_DEFAULT_QUEUE_MASK	GENMASK(5, 3)
 
 /* Header split receive */
 #define IGC_RFCTL_IPV6_EX_DIS	0x00010000
diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index a7f397b58cd6..ecb35b693ce5 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -1283,6 +1283,24 @@ static void igc_ethtool_init_nfc_rule(struct igc_nfc_rule *rule,
 		rule->flex = true;
 	else
 		rule->flex = false;
+
+	/* The wildcard rule is only applied if:
+	 *  a) None of the other filtering rules match (match_flags is zero)
+	 *  b) The flow type is ETHER_FLOW only (no additional fields set)
+	 *  c) Mask for Source MAC address is not specified (all zeros)
+	 *  d) Mask for Destination MAC address is not specified (all zeros)
+	 *  e) Mask for L2 EtherType is not specified (zero)
+	 *
+	 * If all these conditions are met, the rule is treated as a wildcard
+	 * rule. Default queue feature will be used, so that all packets that do
+	 * not match any other rule will be routed to the default queue.
+	 */
+	if (!rule->filter.match_flags &&
+	    fsp->flow_type == ETHER_FLOW &&
+	    is_zero_ether_addr(fsp->m_u.ether_spec.h_source) &&
+	    is_zero_ether_addr(fsp->m_u.ether_spec.h_dest) &&
+	    !fsp->m_u.ether_spec.h_proto)
+		rule->filter.match_flags = IGC_FILTER_FLAG_DEFAULT_QUEUE;
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 2e12915b42a9..87311ea47018 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -3874,6 +3874,22 @@ static void igc_del_flex_filter(struct igc_adapter *adapter,
 	wr32(IGC_WUFC, wufc);
 }
 
+static void igc_set_default_queue_filter(struct igc_adapter *adapter, u32 queue)
+{
+	struct igc_hw *hw = &adapter->hw;
+	u32 mrqc = rd32(IGC_MRQC);
+
+	mrqc &= ~IGC_MRQC_DEFAULT_QUEUE_MASK;
+	mrqc |= FIELD_PREP(IGC_MRQC_DEFAULT_QUEUE_MASK, queue);
+	wr32(IGC_MRQC, mrqc);
+}
+
+static void igc_reset_default_queue_filter(struct igc_adapter *adapter)
+{
+	/* Reset the default queue to its default value which is Queue 0 */
+	igc_set_default_queue_filter(adapter, 0);
+}
+
 static int igc_enable_nfc_rule(struct igc_adapter *adapter,
 			       struct igc_nfc_rule *rule)
 {
@@ -3912,6 +3928,9 @@ static int igc_enable_nfc_rule(struct igc_adapter *adapter,
 			return err;
 	}
 
+	if (rule->filter.match_flags & IGC_FILTER_FLAG_DEFAULT_QUEUE)
+		igc_set_default_queue_filter(adapter, rule->action);
+
 	return 0;
 }
 
@@ -3939,6 +3958,9 @@ static void igc_disable_nfc_rule(struct igc_adapter *adapter,
 	if (rule->filter.match_flags & IGC_FILTER_FLAG_DST_MAC_ADDR)
 		igc_del_mac_filter(adapter, IGC_MAC_FILTER_TYPE_DST,
 				   rule->filter.dst_addr);
+
+	if (rule->filter.match_flags & IGC_FILTER_FLAG_DEFAULT_QUEUE)
+		igc_reset_default_queue_filter(adapter);
 }
 
 /**
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-next, v3 1/2] igc: Relocate RSS field definitions to igc_defines.h
  2025-06-20 10:02 ` [PATCH iwl-next,v3 1/2] igc: Relocate RSS field definitions to igc_defines.h Song Yoong Siang
@ 2025-06-20 10:24   ` Loktionov, Aleksandr
  2025-06-23 15:46   ` [PATCH iwl-next,v3 " Brett Creeley
  2025-07-06 10:58   ` [Intel-wired-lan] [PATCH iwl-next, v3 " Mor Bar-Gabay
  2 siblings, 0 replies; 7+ messages in thread
From: Loktionov, Aleksandr @ 2025-06-20 10:24 UTC (permalink / raw)
  To: Song, Yoong Siang, Nguyen, Anthony L, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend, Gomes, Vinicius, Jonathan Corbet,
	Kitszel, Przemyslaw, Shinas Rasheed, Tian, Kevin, Brett Creeley,
	Blanco Alcaine, Hector, Hay, Joshua A, Andrew Lunn,
	Keller, Jacob E, Kurt Kanzenbach, Marcin Szycik, Brett Creeley
  Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Song Yoong Siang
> Sent: Friday, June 20, 2025 12:03 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; David S . Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Richard
> Cochran <richardcochran@gmail.com>; Alexei Starovoitov
> <ast@kernel.org>; Daniel Borkmann <daniel@iogearbox.net>; Jesper
> Dangaard Brouer <hawk@kernel.org>; John Fastabend
> <john.fastabend@gmail.com>; Gomes, Vinicius
> <vinicius.gomes@intel.com>; Jonathan Corbet <corbet@lwn.net>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@intel.com>; Shinas Rasheed
> <srasheed@marvell.com>; Tian, Kevin <kevin.tian@intel.com>; Brett
> Creeley <brett.creeley@amd.com>; Blanco Alcaine, Hector
> <hector.blanco.alcaine@intel.com>; Hay, Joshua A
> <joshua.a.hay@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>; Keller,
> Jacob E <jacob.e.keller@intel.com>; Kurt Kanzenbach
> <kurt@linutronix.de>; Marcin Szycik <marcin.szycik@linux.intel.com>;
> Brett Creeley <bcreeley@amd.com>
> Cc: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: [Intel-wired-lan] [PATCH iwl-next, v3 1/2] igc: Relocate RSS
> field definitions to igc_defines.h
> 
> Move the RSS field definitions related to IPv4 and IPv6 UDP from igc.h
> to igc_defines.h to consolidate the RSS field definitions in a single
> header file, improving code organization and maintainability.
> 
> This refactoring does not alter the functionality of the driver but
> enhances the logical grouping of related constants
> 
> Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
> Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>  drivers/net/ethernet/intel/igc/igc.h         | 4 ----
>  drivers/net/ethernet/intel/igc/igc_defines.h | 3 +++
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc.h
> b/drivers/net/ethernet/intel/igc/igc.h
> index 1525ae25fd3e..0b35e593d5ee 100644
> --- a/drivers/net/ethernet/intel/igc/igc.h
> +++ b/drivers/net/ethernet/intel/igc/igc.h
> @@ -406,10 +406,6 @@ extern char igc_driver_name[];
>  #define IGC_FLAG_RSS_FIELD_IPV4_UDP	BIT(6)
>  #define IGC_FLAG_RSS_FIELD_IPV6_UDP	BIT(7)
> 
> -#define IGC_MRQC_ENABLE_RSS_MQ		0x00000002
> -#define IGC_MRQC_RSS_FIELD_IPV4_UDP	0x00400000
> -#define IGC_MRQC_RSS_FIELD_IPV6_UDP	0x00800000
> -
>  /* RX-desc Write-Back format RSS Type's */  enum igc_rss_type_num {
>  	IGC_RSS_TYPE_NO_HASH		= 0,
> diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h
> b/drivers/net/ethernet/intel/igc/igc_defines.h
> index 86b346687196..d80254f2a278 100644
> --- a/drivers/net/ethernet/intel/igc/igc_defines.h
> +++ b/drivers/net/ethernet/intel/igc/igc_defines.h
> @@ -383,11 +383,14 @@
>  #define IGC_RXDEXT_STATERR_IPE		0x40000000
>  #define IGC_RXDEXT_STATERR_RXE		0x80000000
> 
> +#define IGC_MRQC_ENABLE_RSS_MQ		0x00000002
>  #define IGC_MRQC_RSS_FIELD_IPV4_TCP	0x00010000
>  #define IGC_MRQC_RSS_FIELD_IPV4		0x00020000
>  #define IGC_MRQC_RSS_FIELD_IPV6_TCP_EX	0x00040000
>  #define IGC_MRQC_RSS_FIELD_IPV6		0x00100000
>  #define IGC_MRQC_RSS_FIELD_IPV6_TCP	0x00200000
> +#define IGC_MRQC_RSS_FIELD_IPV4_UDP	0x00400000
> +#define IGC_MRQC_RSS_FIELD_IPV6_UDP	0x00800000
> 
>  /* Header split receive */
>  #define IGC_RFCTL_IPV6_EX_DIS	0x00010000
> --
> 2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH iwl-next,v3 1/2] igc: Relocate RSS field definitions to igc_defines.h
  2025-06-20 10:02 ` [PATCH iwl-next,v3 1/2] igc: Relocate RSS field definitions to igc_defines.h Song Yoong Siang
  2025-06-20 10:24   ` [Intel-wired-lan] [PATCH iwl-next, v3 " Loktionov, Aleksandr
@ 2025-06-23 15:46   ` Brett Creeley
  2025-07-06 10:58   ` [Intel-wired-lan] [PATCH iwl-next, v3 " Mor Bar-Gabay
  2 siblings, 0 replies; 7+ messages in thread
From: Brett Creeley @ 2025-06-23 15:46 UTC (permalink / raw)
  To: Song Yoong Siang, Tony Nguyen, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
	Vinicius Costa Gomes, Jonathan Corbet, Przemek Kitszel,
	Shinas Rasheed, Kevin Tian, Brett Creeley, Blanco Alcaine Hector,
	Joshua Hay, Andrew Lunn, Jacob Keller, Kurt Kanzenbach,
	Marcin Szycik
  Cc: intel-wired-lan, netdev, linux-kernel



On 6/20/2025 3:02 AM, Song Yoong Siang wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> Move the RSS field definitions related to IPv4 and IPv6 UDP from igc.h to
> igc_defines.h to consolidate the RSS field definitions in a single header
> file, improving code organization and maintainability.
> 
> This refactoring does not alter the functionality of the driver but
> enhances the logical grouping of related constants
> 
> Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
> Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com>
> ---
>   drivers/net/ethernet/intel/igc/igc.h         | 4 ----
>   drivers/net/ethernet/intel/igc/igc_defines.h | 3 +++
>   2 files changed, 3 insertions(+), 4 deletions(-)

LGTM.

Reviewed-by: Brett Creeley <brett.creeley@amd.com>

> 
> diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
> index 1525ae25fd3e..0b35e593d5ee 100644
> --- a/drivers/net/ethernet/intel/igc/igc.h
> +++ b/drivers/net/ethernet/intel/igc/igc.h
> @@ -406,10 +406,6 @@ extern char igc_driver_name[];
>   #define IGC_FLAG_RSS_FIELD_IPV4_UDP    BIT(6)
>   #define IGC_FLAG_RSS_FIELD_IPV6_UDP    BIT(7)
> 
> -#define IGC_MRQC_ENABLE_RSS_MQ         0x00000002
> -#define IGC_MRQC_RSS_FIELD_IPV4_UDP    0x00400000
> -#define IGC_MRQC_RSS_FIELD_IPV6_UDP    0x00800000
> -
>   /* RX-desc Write-Back format RSS Type's */
>   enum igc_rss_type_num {
>          IGC_RSS_TYPE_NO_HASH            = 0,
> diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
> index 86b346687196..d80254f2a278 100644
> --- a/drivers/net/ethernet/intel/igc/igc_defines.h
> +++ b/drivers/net/ethernet/intel/igc/igc_defines.h
> @@ -383,11 +383,14 @@
>   #define IGC_RXDEXT_STATERR_IPE         0x40000000
>   #define IGC_RXDEXT_STATERR_RXE         0x80000000
> 
> +#define IGC_MRQC_ENABLE_RSS_MQ         0x00000002
>   #define IGC_MRQC_RSS_FIELD_IPV4_TCP    0x00010000
>   #define IGC_MRQC_RSS_FIELD_IPV4                0x00020000
>   #define IGC_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000
>   #define IGC_MRQC_RSS_FIELD_IPV6                0x00100000
>   #define IGC_MRQC_RSS_FIELD_IPV6_TCP    0x00200000
> +#define IGC_MRQC_RSS_FIELD_IPV4_UDP    0x00400000
> +#define IGC_MRQC_RSS_FIELD_IPV6_UDP    0x00800000
> 
>   /* Header split receive */
>   #define IGC_RFCTL_IPV6_EX_DIS  0x00010000
> --
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-next, v3 1/2] igc: Relocate RSS field definitions to igc_defines.h
  2025-06-20 10:02 ` [PATCH iwl-next,v3 1/2] igc: Relocate RSS field definitions to igc_defines.h Song Yoong Siang
  2025-06-20 10:24   ` [Intel-wired-lan] [PATCH iwl-next, v3 " Loktionov, Aleksandr
  2025-06-23 15:46   ` [PATCH iwl-next,v3 " Brett Creeley
@ 2025-07-06 10:58   ` Mor Bar-Gabay
  2 siblings, 0 replies; 7+ messages in thread
From: Mor Bar-Gabay @ 2025-07-06 10:58 UTC (permalink / raw)
  To: Song Yoong Siang, Tony Nguyen, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
	Vinicius Costa Gomes, Jonathan Corbet, Przemek Kitszel,
	Shinas Rasheed, Kevin Tian, Brett Creeley, Blanco Alcaine Hector,
	Joshua Hay, Andrew Lunn, Jacob Keller, Kurt Kanzenbach,
	Marcin Szycik, Brett Creeley
  Cc: intel-wired-lan, netdev, linux-kernel

On 20/06/2025 13:02, Song Yoong Siang wrote:
> Move the RSS field definitions related to IPv4 and IPv6 UDP from igc.h to
> igc_defines.h to consolidate the RSS field definitions in a single header
> file, improving code organization and maintainability.
> 
> This refactoring does not alter the functionality of the driver but
> enhances the logical grouping of related constants
> 
> Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
> Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Reviewed-by: Brett Creeley <brett.creeley@amd.com>
> ---
>   drivers/net/ethernet/intel/igc/igc.h         | 4 ----
>   drivers/net/ethernet/intel/igc/igc_defines.h | 3 +++
>   2 files changed, 3 insertions(+), 4 deletions(-)
> 
Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-next, v3 2/2] igc: Add wildcard rule support to ethtool NFC using Default Queue
  2025-06-20 10:02 ` [PATCH iwl-next,v3 2/2] igc: Add wildcard rule support to ethtool NFC using Default Queue Song Yoong Siang
@ 2025-07-06 11:01   ` Mor Bar-Gabay
  0 siblings, 0 replies; 7+ messages in thread
From: Mor Bar-Gabay @ 2025-07-06 11:01 UTC (permalink / raw)
  To: Song Yoong Siang, Tony Nguyen, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
	Vinicius Costa Gomes, Jonathan Corbet, Przemek Kitszel,
	Shinas Rasheed, Kevin Tian, Brett Creeley, Blanco Alcaine Hector,
	Joshua Hay, Andrew Lunn, Jacob Keller, Kurt Kanzenbach,
	Marcin Szycik, Brett Creeley
  Cc: intel-wired-lan, netdev, linux-kernel

On 20/06/2025 13:02, Song Yoong Siang wrote:
> 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>
> ---
>   drivers/net/ethernet/intel/igc/igc.h         | 11 +++++++---
>   drivers/net/ethernet/intel/igc/igc_defines.h |  1 +
>   drivers/net/ethernet/intel/igc/igc_ethtool.c | 18 ++++++++++++++++
>   drivers/net/ethernet/intel/igc/igc_main.c    | 22 ++++++++++++++++++++
>   4 files changed, 49 insertions(+), 3 deletions(-)
> 
Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-06 11:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20 10:02 [PATCH iwl-next,v3 0/2] igc: Add Default Queue Support Song Yoong Siang
2025-06-20 10:02 ` [PATCH iwl-next,v3 1/2] igc: Relocate RSS field definitions to igc_defines.h Song Yoong Siang
2025-06-20 10:24   ` [Intel-wired-lan] [PATCH iwl-next, v3 " Loktionov, Aleksandr
2025-06-23 15:46   ` [PATCH iwl-next,v3 " Brett Creeley
2025-07-06 10:58   ` [Intel-wired-lan] [PATCH iwl-next, v3 " Mor Bar-Gabay
2025-06-20 10:02 ` [PATCH iwl-next,v3 2/2] igc: Add wildcard rule support to ethtool NFC using Default Queue Song Yoong Siang
2025-07-06 11:01   ` [Intel-wired-lan] [PATCH iwl-next, v3 " Mor Bar-Gabay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).