All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-03-16 (iavf)
@ 2023-03-16 15:53 Tony Nguyen
  2023-03-16 15:53 ` [PATCH net v2 1/3] iavf: fix inverted Rx hash condition leading to disabled hash Tony Nguyen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tony Nguyen @ 2023-03-16 15:53 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev; +Cc: Tony Nguyen, leonro

This series contains updates to iavf driver only.

Alex fixes incorrect check against Rx hash feature and corrects payload
value for IPv6 UDP packet.

Ahmed removes bookkeeping of VLAN 0 filter as it always exists and can
cause a false max filter error message.
---
v2:
- Add VLAN 0 check to iavf_vlan_rx_kill_vid()

v1: https://lore.kernel.org/netdev/20230314174423.1048526-1-anthony.l.nguyen@intel.com/

The following are changes since commit cd356010ce4c69ac7e1a40586112df24d22c6a4b:
  net: phy: mscc: fix deadlock in phy_ethtool_{get,set}_wol()
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 40GbE

Ahmed Zaki (1):
  iavf: do not track VLAN 0 filters

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_main.c     | 8 ++++++++
 drivers/net/ethernet/intel/iavf/iavf_txrx.c     | 2 +-
 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 2 --
 4 files changed, 10 insertions(+), 4 deletions(-)

-- 
2.38.1


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

* [PATCH net v2 1/3] iavf: fix inverted Rx hash condition leading to disabled hash
  2023-03-16 15:53 [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-03-16 (iavf) Tony Nguyen
@ 2023-03-16 15:53 ` Tony Nguyen
  2023-03-16 15:53 ` [PATCH net v2 2/3] iavf: fix non-tunneled IPv6 UDP packet type and hashing Tony Nguyen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2023-03-16 15:53 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Alexander Lobakin, anthony.l.nguyen, leonro, Larysa Zaremba,
	Michal Kubiak, Rafal Romanowski

From: Alexander Lobakin <aleksander.lobakin@intel.com>

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>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@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.38.1


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

* [PATCH net v2 2/3] iavf: fix non-tunneled IPv6 UDP packet type and hashing
  2023-03-16 15:53 [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-03-16 (iavf) Tony Nguyen
  2023-03-16 15:53 ` [PATCH net v2 1/3] iavf: fix inverted Rx hash condition leading to disabled hash Tony Nguyen
@ 2023-03-16 15:53 ` Tony Nguyen
  2023-03-16 15:53 ` [PATCH net v2 3/3] iavf: do not track VLAN 0 filters Tony Nguyen
  2023-03-18  5:50 ` [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-03-16 (iavf) patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2023-03-16 15:53 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Alexander Lobakin, anthony.l.nguyen, leonro, Larysa Zaremba,
	Michal Kubiak, Rafal Romanowski

From: Alexander Lobakin <aleksander.lobakin@intel.com>

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>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@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.38.1


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

* [PATCH net v2 3/3] iavf: do not track VLAN 0 filters
  2023-03-16 15:53 [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-03-16 (iavf) Tony Nguyen
  2023-03-16 15:53 ` [PATCH net v2 1/3] iavf: fix inverted Rx hash condition leading to disabled hash Tony Nguyen
  2023-03-16 15:53 ` [PATCH net v2 2/3] iavf: fix non-tunneled IPv6 UDP packet type and hashing Tony Nguyen
@ 2023-03-16 15:53 ` Tony Nguyen
  2023-03-18  5:50 ` [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-03-16 (iavf) patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2023-03-16 15:53 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Ahmed Zaki, anthony.l.nguyen, leonro, Michal Kubiak

From: Ahmed Zaki <ahmed.zaki@intel.com>

When an interface with the maximum number of VLAN filters is brought up,
a spurious error is logged:

    [257.483082] 8021q: adding VLAN 0 to HW filter on device enp0s3
    [257.483094] iavf 0000:00:03.0 enp0s3: Max allowed VLAN filters 8. Remove existing VLANs or disable filtering via Ethtool if supported.

The VF driver complains that it cannot add the VLAN 0 filter.

On the other hand, the PF driver always adds VLAN 0 filter on VF
initialization. The VF does not need to ask the PF for that filter at
all.

Fix the error by not tracking VLAN 0 filters altogether. With that, the
check added by commit 0e710a3ffd0c ("iavf: Fix VF driver counting VLAN 0
filters") in iavf_virtchnl.c is useless and might be confusing if left as
it suggests that we track VLAN 0.

Fixes: 0e710a3ffd0c ("iavf: Fix VF driver counting VLAN 0 filters")
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_main.c     | 8 ++++++++
 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 2 --
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 3273aeb8fa67..327cd9b1af2c 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -893,6 +893,10 @@ static int iavf_vlan_rx_add_vid(struct net_device *netdev,
 {
 	struct iavf_adapter *adapter = netdev_priv(netdev);
 
+	/* Do not track VLAN 0 filter, always added by the PF on VF init */
+	if (!vid)
+		return 0;
+
 	if (!VLAN_FILTERING_ALLOWED(adapter))
 		return -EIO;
 
@@ -919,6 +923,10 @@ static int iavf_vlan_rx_kill_vid(struct net_device *netdev,
 {
 	struct iavf_adapter *adapter = netdev_priv(netdev);
 
+	/* We do not track VLAN 0 filter */
+	if (!vid)
+		return 0;
+
 	iavf_del_vlan(adapter, IAVF_VLAN(vid, be16_to_cpu(proto)));
 	if (proto == cpu_to_be16(ETH_P_8021Q))
 		clear_bit(vid, adapter->vsi.active_cvlans);
diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index 6d23338604bb..4e17d006c52d 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -2446,8 +2446,6 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
 		list_for_each_entry(f, &adapter->vlan_filter_list, list) {
 			if (f->is_new_vlan) {
 				f->is_new_vlan = false;
-				if (!f->vlan.vid)
-					continue;
 				if (f->vlan.tpid == ETH_P_8021Q)
 					set_bit(f->vlan.vid,
 						adapter->vsi.active_cvlans);
-- 
2.38.1


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

* Re: [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-03-16 (iavf)
  2023-03-16 15:53 [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-03-16 (iavf) Tony Nguyen
                   ` (2 preceding siblings ...)
  2023-03-16 15:53 ` [PATCH net v2 3/3] iavf: do not track VLAN 0 filters Tony Nguyen
@ 2023-03-18  5:50 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-18  5:50 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, pabeni, edumazet, netdev, leonro

Hello:

This series was applied to netdev/net.git (main)
by Tony Nguyen <anthony.l.nguyen@intel.com>:

On Thu, 16 Mar 2023 08:53:13 -0700 you wrote:
> This series contains updates to iavf driver only.
> 
> Alex fixes incorrect check against Rx hash feature and corrects payload
> value for IPv6 UDP packet.
> 
> Ahmed removes bookkeeping of VLAN 0 filter as it always exists and can
> cause a false max filter error message.
> 
> [...]

Here is the summary with links:
  - [net,v2,1/3] iavf: fix inverted Rx hash condition leading to disabled hash
    https://git.kernel.org/netdev/net/c/32d57f667f87
  - [net,v2,2/3] iavf: fix non-tunneled IPv6 UDP packet type and hashing
    https://git.kernel.org/netdev/net/c/de58647b4301
  - [net,v2,3/3] iavf: do not track VLAN 0 filters
    https://git.kernel.org/netdev/net/c/964290ff32d1

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-03-18  5:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16 15:53 [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-03-16 (iavf) Tony Nguyen
2023-03-16 15:53 ` [PATCH net v2 1/3] iavf: fix inverted Rx hash condition leading to disabled hash Tony Nguyen
2023-03-16 15:53 ` [PATCH net v2 2/3] iavf: fix non-tunneled IPv6 UDP packet type and hashing Tony Nguyen
2023-03-16 15:53 ` [PATCH net v2 3/3] iavf: do not track VLAN 0 filters Tony Nguyen
2023-03-18  5:50 ` [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-03-16 (iavf) patchwork-bot+netdevbpf

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.