All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH] igc: Fix NFC queue redirection support
@ 2020-03-06 23:54 Andre Guedes
  2020-03-07  4:07 ` Neftin, Sasha
  2020-03-18 22:32 ` Brown, Aaron F
  0 siblings, 2 replies; 3+ messages in thread
From: Andre Guedes @ 2020-03-06 23:54 UTC (permalink / raw)
  To: intel-wired-lan

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>
---
 drivers/net/ethernet/intel/igc/igc_defines.h |  5 ++++-
 drivers/net/ethernet/intel/igc/igc_main.c    | 11 ++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
index e5116337b68d..63d3d34763da 100644
--- a/drivers/net/ethernet/intel/igc/igc_defines.h
+++ b/drivers/net/ethernet/intel/igc/igc_defines.h
@@ -63,8 +63,11 @@
  * (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
 
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 025f2e439aef..49a0d0bff727 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -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);
-- 
2.25.0


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

* [Intel-wired-lan] [PATCH] igc: Fix NFC queue redirection support
  2020-03-06 23:54 [Intel-wired-lan] [PATCH] igc: Fix NFC queue redirection support Andre Guedes
@ 2020-03-07  4:07 ` Neftin, Sasha
  2020-03-18 22:32 ` Brown, Aaron F
  1 sibling, 0 replies; 3+ messages in thread
From: Neftin, Sasha @ 2020-03-07  4:07 UTC (permalink / raw)
  To: intel-wired-lan

On 3/6/2020 15:54, Andre Guedes wrote:
> 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>
> ---
>   drivers/net/ethernet/intel/igc/igc_defines.h |  5 ++++-
>   drivers/net/ethernet/intel/igc/igc_main.c    | 11 ++++++++---
>   2 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
> index e5116337b68d..63d3d34763da 100644
> --- a/drivers/net/ethernet/intel/igc/igc_defines.h
> +++ b/drivers/net/ethernet/intel/igc/igc_defines.h
> @@ -63,8 +63,11 @@
>    * (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
>   
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index 025f2e439aef..49a0d0bff727 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -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);
> 
Acked-by: Sasha Neftin <sasha.neftin@intel.com>

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

* [Intel-wired-lan] [PATCH] igc: Fix NFC queue redirection support
  2020-03-06 23:54 [Intel-wired-lan] [PATCH] igc: Fix NFC queue redirection support Andre Guedes
  2020-03-07  4:07 ` Neftin, Sasha
@ 2020-03-18 22:32 ` Brown, Aaron F
  1 sibling, 0 replies; 3+ messages in thread
From: Brown, Aaron F @ 2020-03-18 22:32 UTC (permalink / raw)
  To: intel-wired-lan

> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Andre Guedes
> Sent: Friday, March 6, 2020 3:54 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH] igc: Fix NFC queue redirection support
> 
> 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>
> ---
>  drivers/net/ethernet/intel/igc/igc_defines.h |  5 ++++-
>  drivers/net/ethernet/intel/igc/igc_main.c    | 11 ++++++++---
>  2 files changed, 12 insertions(+), 4 deletions(-)

Tested-by: Aaron Brown <aaron.f.brown@intel.com>

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

end of thread, other threads:[~2020-03-18 22:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 23:54 [Intel-wired-lan] [PATCH] igc: Fix NFC queue redirection support Andre Guedes
2020-03-07  4:07 ` Neftin, Sasha
2020-03-18 22:32 ` Brown, Aaron F

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.