netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] iavf: fix double-broken HW hash report
@ 2023-02-28 16:46 Alexander Lobakin
  2023-02-28 16:46 ` [PATCH net 1/2] iavf: fix inverted Rx hash condition leading to disabled hash Alexander Lobakin
  2023-02-28 16:46 ` [PATCH net v2 2/2] iavf: fix non-tunneled IPv6 UDP packet type and hashing Alexander Lobakin
  0 siblings, 2 replies; 5+ messages in thread
From: Alexander Lobakin @ 2023-02-28 16:46 UTC (permalink / raw)
  To: Tony Nguyen, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Alexander Lobakin, Michal Kubiak, Larysa Zaremba,
	Maciej Fijalkowski, Jesse Brandeburg, intel-wired-lan, netdev,
	linux-kernel

Currently, passing HW hash from descriptors to skb is broken two times.
The first bug effectively disables hash from being filled at all, unless
%NETIF_F_RXHASH is *disabled* via Ethtool. The second incorrectly says
that IPv6 UDP packets are L3, which also triggers CPU hashing when
needed (the networking core treats only L4 HW hash as "true").
The very same problems were fixed in i40e and ice, but not in iavf,
although each of the original commits bugged at least two drivers.
It's never too late (I hope), so fix iavf this time.

Alexander Lobakin (2):
  iavf: fix inverted Rx hash condition leading to disabled hash
  iavf: fix non-tunneled IPv6 UDP packet type and hashing

 drivers/net/ethernet/intel/iavf/iavf_common.c | 2 +-
 drivers/net/ethernet/intel/iavf/iavf_txrx.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

---
To Tony: this is very trivial and tested for a while already, I hope it
could hit one of the first couple RCs :p
-- 
2.39.2


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

* [PATCH net 1/2] iavf: fix inverted Rx hash condition leading to disabled hash
  2023-02-28 16:46 [PATCH net 0/2] iavf: fix double-broken HW hash report Alexander Lobakin
@ 2023-02-28 16:46 ` Alexander Lobakin
  2023-02-28 16:46 ` [PATCH net v2 2/2] iavf: fix non-tunneled IPv6 UDP packet type and hashing Alexander Lobakin
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Lobakin @ 2023-02-28 16:46 UTC (permalink / raw)
  To: Tony Nguyen, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Alexander Lobakin, Michal Kubiak, Larysa Zaremba,
	Maciej Fijalkowski, Jesse Brandeburg, intel-wired-lan, netdev,
	linux-kernel

Condition, which checks whether the netdev has hashing enabled is
inverted. Basically, the tagged commit effectively disabled passing flow
hash from descriptor to skb, unless user *disables* it via Ethtool.
Commit a876c3ba59a6 ("i40e/i40evf: properly report Rx packet hash")
fixed this problem, but only for i40e.
Invert the condition now in iavf and unblock passing hash to skbs again.

Fixes: 857942fd1aa1 ("i40e: Fix Rx hash reported to the stack by our driver")
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
index 18b6a702a1d6..e989feda133c 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
@@ -1096,7 +1096,7 @@ static inline void iavf_rx_hash(struct iavf_ring *ring,
 		cpu_to_le64((u64)IAVF_RX_DESC_FLTSTAT_RSS_HASH <<
 			    IAVF_RX_DESC_STATUS_FLTSTAT_SHIFT);
 
-	if (ring->netdev->features & NETIF_F_RXHASH)
+	if (!(ring->netdev->features & NETIF_F_RXHASH))
 		return;
 
 	if ((rx_desc->wb.qword1.status_error_len & rss_mask) == rss_mask) {
-- 
2.39.2


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

* [PATCH net v2 2/2] iavf: fix non-tunneled IPv6 UDP packet type and hashing
  2023-02-28 16:46 [PATCH net 0/2] iavf: fix double-broken HW hash report Alexander Lobakin
  2023-02-28 16:46 ` [PATCH net 1/2] iavf: fix inverted Rx hash condition leading to disabled hash Alexander Lobakin
@ 2023-02-28 16:46 ` Alexander Lobakin
  2023-02-28 16:52   ` Alexander Lobakin
  1 sibling, 1 reply; 5+ messages in thread
From: Alexander Lobakin @ 2023-02-28 16:46 UTC (permalink / raw)
  To: Tony Nguyen, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Alexander Lobakin, Michal Kubiak, Larysa Zaremba,
	Maciej Fijalkowski, Jesse Brandeburg, intel-wired-lan, netdev,
	linux-kernel

Currently, IAVF's decode_rx_desc_ptype() correctly reports payload type
of L4 for IPv4 UDP packets and IPv{4,6} TCP, but only L3 for IPv6 UDP.
Originally, i40e, ice and iavf were affected.
Commit 73df8c9e3e3d ("i40e: Correct UDP packet header for non_tunnel-ipv6")
fixed that in i40e, then
commit 638a0c8c8861 ("ice: fix incorrect payload indicator on PTYPE")
fixed that for ice.
IPv6 UDP is L4 obviously. Fix it and make iavf report correct L4 hash
type for such packets, so that the stack won't calculate it on CPU when
needs it.

Fixes: 206812b5fccb ("i40e/i40evf: i40e implementation for skb_set_hash")
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c b/drivers/net/ethernet/intel/iavf/iavf_common.c
index 16c490965b61..dd11dbbd5551 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_common.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
@@ -661,7 +661,7 @@ struct iavf_rx_ptype_decoded iavf_ptype_lookup[BIT(8)] = {
 	/* Non Tunneled IPv6 */
 	IAVF_PTT(88, IP, IPV6, FRG, NONE, NONE, NOF, NONE, PAY3),
 	IAVF_PTT(89, IP, IPV6, NOF, NONE, NONE, NOF, NONE, PAY3),
-	IAVF_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP,  PAY3),
+	IAVF_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP,  PAY4),
 	IAVF_PTT_UNUSED_ENTRY(91),
 	IAVF_PTT(92, IP, IPV6, NOF, NONE, NONE, NOF, TCP,  PAY4),
 	IAVF_PTT(93, IP, IPV6, NOF, NONE, NONE, NOF, SCTP, PAY4),
-- 
2.39.2


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

* Re: [PATCH net v2 2/2] iavf: fix non-tunneled IPv6 UDP packet type and hashing
  2023-02-28 16:46 ` [PATCH net v2 2/2] iavf: fix non-tunneled IPv6 UDP packet type and hashing Alexander Lobakin
@ 2023-02-28 16:52   ` Alexander Lobakin
  2023-02-28 23:07     ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Lobakin @ 2023-02-28 16:52 UTC (permalink / raw)
  To: Tony Nguyen, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Michal Kubiak, Larysa Zaremba, Maciej Fijalkowski,
	Jesse Brandeburg, intel-wired-lan, netdev, linux-kernel

From: Alexander Lobakin <aleksander.lobakin@intel.com>
Date: Tue, 28 Feb 2023 17:46:13 +0100

> [PATCH net v2 2/2] iavf: fix non-tunneled IPv6 UDP packet type and hashing
> v2

How this got here ._.
Lemme know if I should resend (it's probably okay for Git, but may broke
Patchwork, dunno).

> Currently, IAVF's decode_rx_desc_ptype() correctly reports payload type
> of L4 for IPv4 UDP packets and IPv{4,6} TCP, but only L3 for IPv6 UDP.
> Originally, i40e, ice and iavf were affected.
> Commit 73df8c9e3e3d ("i40e: Correct UDP packet header for non_tunnel-ipv6")
> fixed that in i40e, then
> commit 638a0c8c8861 ("ice: fix incorrect payload indicator on PTYPE")
> fixed that for ice.
> IPv6 UDP is L4 obviously. Fix it and make iavf report correct L4 hash
> type for such packets, so that the stack won't calculate it on CPU when
> needs it.
> 
> Fixes: 206812b5fccb ("i40e/i40evf: i40e implementation for skb_set_hash")
> Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
> Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
> Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> ---
>  drivers/net/ethernet/intel/iavf/iavf_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c b/drivers/net/ethernet/intel/iavf/iavf_common.c
> index 16c490965b61..dd11dbbd5551 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_common.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
> @@ -661,7 +661,7 @@ struct iavf_rx_ptype_decoded iavf_ptype_lookup[BIT(8)] = {
>  	/* Non Tunneled IPv6 */
>  	IAVF_PTT(88, IP, IPV6, FRG, NONE, NONE, NOF, NONE, PAY3),
>  	IAVF_PTT(89, IP, IPV6, NOF, NONE, NONE, NOF, NONE, PAY3),
> -	IAVF_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP,  PAY3),
> +	IAVF_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP,  PAY4),
>  	IAVF_PTT_UNUSED_ENTRY(91),
>  	IAVF_PTT(92, IP, IPV6, NOF, NONE, NONE, NOF, TCP,  PAY4),
>  	IAVF_PTT(93, IP, IPV6, NOF, NONE, NONE, NOF, SCTP, PAY4),

Thanks,
Olek

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

* Re: [PATCH net v2 2/2] iavf: fix non-tunneled IPv6 UDP packet type and hashing
  2023-02-28 16:52   ` Alexander Lobakin
@ 2023-02-28 23:07     ` Jakub Kicinski
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2023-02-28 23:07 UTC (permalink / raw)
  To: Alexander Lobakin
  Cc: Tony Nguyen, David S. Miller, Eric Dumazet, Paolo Abeni,
	Michal Kubiak, Larysa Zaremba, Maciej Fijalkowski,
	Jesse Brandeburg, intel-wired-lan, netdev, linux-kernel

On Tue, 28 Feb 2023 17:52:56 +0100 Alexander Lobakin wrote:
> > [PATCH net v2 2/2] iavf: fix non-tunneled IPv6 UDP packet type and hashing
> > v2  
> 
> How this got here ._.
> Lemme know if I should resend (it's probably okay for Git, but may broke
> Patchwork, dunno).

Also patch 1 is not versioned and patch 2 is v2 :S

I think repost would be good, and please put on the To: line the
person/group who you expect to apply the patch - either netdev
maintainers or Tony.

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

end of thread, other threads:[~2023-02-28 23:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-28 16:46 [PATCH net 0/2] iavf: fix double-broken HW hash report Alexander Lobakin
2023-02-28 16:46 ` [PATCH net 1/2] iavf: fix inverted Rx hash condition leading to disabled hash Alexander Lobakin
2023-02-28 16:46 ` [PATCH net v2 2/2] iavf: fix non-tunneled IPv6 UDP packet type and hashing Alexander Lobakin
2023-02-28 16:52   ` Alexander Lobakin
2023-02-28 23:07     ` Jakub Kicinski

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).