All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26
@ 2022-07-26 20:46 Tony Nguyen
  2022-07-26 20:46 ` [PATCH net 1/5] ice: Fix max VLANs available for VF Tony Nguyen
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Tony Nguyen @ 2022-07-26 20:46 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet; +Cc: Tony Nguyen, netdev

This series contains updates to ice driver only.

Przemyslaw corrects accounting for VF VLANs to allow for correct number
of VLANs for untrusted VF. He also correct issue with checksum offload
on VXLAN tunnels.

Ani allows for two VSIs to share the same MAC address.

Maciej corrects checked bits for descriptor completion of loopback

The following are changes since commit 9b134b1694ec8926926ba6b7b80884ea829245a0:
  bridge: Do not send empty IFLA_AF_SPEC attribute
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE

Anirudh Venkataramanan (1):
  ice: Fix VSIs unable to share unicast MAC

Maciej Fijalkowski (2):
  ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS)
  ice: do not setup vlan for loopback VSI

Przemyslaw Patynowski (2):
  ice: Fix max VLANs available for VF
  ice: Fix tunnel checksum offload with fragmented traffic

 drivers/net/ethernet/intel/ice/ice_ethtool.c  |  3 +-
 drivers/net/ethernet/intel/ice/ice_main.c     | 10 +++--
 drivers/net/ethernet/intel/ice/ice_sriov.c    | 40 -------------------
 drivers/net/ethernet/intel/ice/ice_txrx.c     |  8 ++--
 drivers/net/ethernet/intel/ice/ice_virtchnl.c |  3 +-
 5 files changed, 16 insertions(+), 48 deletions(-)

-- 
2.35.1


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

* [PATCH net 1/5] ice: Fix max VLANs available for VF
  2022-07-26 20:46 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26 Tony Nguyen
@ 2022-07-26 20:46 ` Tony Nguyen
  2022-07-26 20:46 ` [PATCH net 2/5] ice: Fix tunnel checksum offload with fragmented traffic Tony Nguyen
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2022-07-26 20:46 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Przemyslaw Patynowski, netdev, anthony.l.nguyen,
	Mateusz Palczewski, Marek Szlosek

From: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>

Legacy VLAN implementation allows for untrusted VF to have 8 VLAN
filters, not counting VLAN 0 filters. Current VLAN_V2 implementation
lowers available filters for VF, by counting in VLAN 0 filter for both
TPIDs.
Fix this by counting only non zero VLAN filters.
Without this patch, untrusted VF would not be able to access 8 VLAN
filters.

Fixes: cc71de8fa133 ("ice: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_virtchnl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
index 4547bc1f7cee..24188ec594d5 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
@@ -2948,7 +2948,8 @@ ice_vc_validate_add_vlan_filter_list(struct ice_vsi *vsi,
 				     struct virtchnl_vlan_filtering_caps *vfc,
 				     struct virtchnl_vlan_filter_list_v2 *vfl)
 {
-	u16 num_requested_filters = vsi->num_vlan + vfl->num_elements;
+	u16 num_requested_filters = ice_vsi_num_non_zero_vlans(vsi) +
+		vfl->num_elements;
 
 	if (num_requested_filters > vfc->max_filters)
 		return false;
-- 
2.35.1


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

* [PATCH net 2/5] ice: Fix tunnel checksum offload with fragmented traffic
  2022-07-26 20:46 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26 Tony Nguyen
  2022-07-26 20:46 ` [PATCH net 1/5] ice: Fix max VLANs available for VF Tony Nguyen
@ 2022-07-26 20:46 ` Tony Nguyen
  2022-07-26 20:46 ` [PATCH net 3/5] ice: Fix VSIs unable to share unicast MAC Tony Nguyen
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2022-07-26 20:46 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Przemyslaw Patynowski, netdev, anthony.l.nguyen, jdamato,
	Mateusz Palczewski, Jedrzej Jagielski, Gurucharan

From: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>

Fix checksum offload on VXLAN tunnels.
In case, when mpls protocol is not used, set l4 header to transport
header of skb. This fixes case, when user tries to offload checksums
of VXLAN tunneled traffic.

Steps for reproduction (requires link partner with tunnels):
ip l s enp130s0f0 up
ip a f enp130s0f0
ip a a 10.10.110.2/24 dev enp130s0f0
ip l s enp130s0f0 mtu 1600
ip link add vxlan12_sut type vxlan id 12 group 238.168.100.100 dev enp130s0f0 dstport 4789
ip l s vxlan12_sut up
ip a a 20.10.110.2/24 dev vxlan12_sut
iperf3 -c 20.10.110.1 #should connect

Offload params: td_offset, cd_tunnel_params were
corrupted, due to l4 header pointing wrong address. NIC would then drop
those packets internally, due to incorrect TX descriptor data,
which increased GLV_TEPC register.

Fixes: 69e66c04c672 ("ice: Add mpls+tso support")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_txrx.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index 3f8b7274ed2f..836dce840712 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1751,11 +1751,13 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
 
 	protocol = vlan_get_protocol(skb);
 
-	if (eth_p_mpls(protocol))
+	if (eth_p_mpls(protocol)) {
 		ip.hdr = skb_inner_network_header(skb);
-	else
+		l4.hdr = skb_checksum_start(skb);
+	} else {
 		ip.hdr = skb_network_header(skb);
-	l4.hdr = skb_checksum_start(skb);
+		l4.hdr = skb_transport_header(skb);
+	}
 
 	/* compute outer L2 header size */
 	l2_len = ip.hdr - skb->data;
-- 
2.35.1


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

* [PATCH net 3/5] ice: Fix VSIs unable to share unicast MAC
  2022-07-26 20:46 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26 Tony Nguyen
  2022-07-26 20:46 ` [PATCH net 1/5] ice: Fix max VLANs available for VF Tony Nguyen
  2022-07-26 20:46 ` [PATCH net 2/5] ice: Fix tunnel checksum offload with fragmented traffic Tony Nguyen
@ 2022-07-26 20:46 ` Tony Nguyen
  2022-07-26 20:46 ` [PATCH net 4/5] ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS) Tony Nguyen
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2022-07-26 20:46 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Anirudh Venkataramanan, netdev, anthony.l.nguyen,
	Sylwester Dziedziuch, Mateusz Palczewski, Jedrzej Jagielski,
	Marek Szlosek

From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>

The driver currently does not allow two VSIs in the same PF domain
to have the same unicast MAC address. This is incorrect in the sense
that a policy decision is being made in the driver when it must be
left to the user. This approach was causing issues when rebooting
the system with VFs spawned not being able to change their MAC addresses.
Such errors were present in dmesg:

[ 7921.068237] ice 0000:b6:00.2 ens2f2: Unicast MAC 6a:0d:e4:70:ca:d1 already
exists on this PF. Preventing setting VF 7 unicast MAC address to 6a:0d:e4:70:ca:d1

Fix that by removing this restriction. Doing this also allows
us to remove some additional code that's checking if a unicast MAC
filter already exists.

Fixes: 47ebc7b02485 ("ice: Check if unicast MAC exists before setting VF MAC")
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c  |  2 ++
 drivers/net/ethernet/intel/ice/ice_sriov.c | 40 ----------------------
 2 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index ff2eac2f8c64..b41a45c03d22 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -4656,6 +4656,8 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
 		ice_set_safe_mode_caps(hw);
 	}
 
+	hw->ucast_shared = true;
+
 	err = ice_init_pf(pf);
 	if (err) {
 		dev_err(dev, "ice_init_pf failed: %d\n", err);
diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
index bb1721f1321d..f4907a3c2d19 100644
--- a/drivers/net/ethernet/intel/ice/ice_sriov.c
+++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
@@ -1309,39 +1309,6 @@ ice_get_vf_cfg(struct net_device *netdev, int vf_id, struct ifla_vf_info *ivi)
 	return ret;
 }
 
-/**
- * ice_unicast_mac_exists - check if the unicast MAC exists on the PF's switch
- * @pf: PF used to reference the switch's rules
- * @umac: unicast MAC to compare against existing switch rules
- *
- * Return true on the first/any match, else return false
- */
-static bool ice_unicast_mac_exists(struct ice_pf *pf, u8 *umac)
-{
-	struct ice_sw_recipe *mac_recipe_list =
-		&pf->hw.switch_info->recp_list[ICE_SW_LKUP_MAC];
-	struct ice_fltr_mgmt_list_entry *list_itr;
-	struct list_head *rule_head;
-	struct mutex *rule_lock; /* protect MAC filter list access */
-
-	rule_head = &mac_recipe_list->filt_rules;
-	rule_lock = &mac_recipe_list->filt_rule_lock;
-
-	mutex_lock(rule_lock);
-	list_for_each_entry(list_itr, rule_head, list_entry) {
-		u8 *existing_mac = &list_itr->fltr_info.l_data.mac.mac_addr[0];
-
-		if (ether_addr_equal(existing_mac, umac)) {
-			mutex_unlock(rule_lock);
-			return true;
-		}
-	}
-
-	mutex_unlock(rule_lock);
-
-	return false;
-}
-
 /**
  * ice_set_vf_mac
  * @netdev: network interface device structure
@@ -1376,13 +1343,6 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
 	if (ret)
 		goto out_put_vf;
 
-	if (ice_unicast_mac_exists(pf, mac)) {
-		netdev_err(netdev, "Unicast MAC %pM already exists on this PF. Preventing setting VF %u unicast MAC address to %pM\n",
-			   mac, vf_id, mac);
-		ret = -EINVAL;
-		goto out_put_vf;
-	}
-
 	mutex_lock(&vf->cfg_lock);
 
 	/* VF is notified of its new MAC via the PF's response to the
-- 
2.35.1


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

* [PATCH net 4/5] ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS)
  2022-07-26 20:46 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26 Tony Nguyen
                   ` (2 preceding siblings ...)
  2022-07-26 20:46 ` [PATCH net 3/5] ice: Fix VSIs unable to share unicast MAC Tony Nguyen
@ 2022-07-26 20:46 ` Tony Nguyen
  2022-07-26 20:46 ` [PATCH net 5/5] ice: do not setup vlan for loopback VSI Tony Nguyen
  2022-07-28  3:50 ` [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26 patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2022-07-26 20:46 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Maciej Fijalkowski, netdev, anthony.l.nguyen, George Kuruvinakunnel

From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

Tx side sets EOP and RS bits on descriptors to indicate that a
particular descriptor is the last one and needs to generate an irq when
it was sent. These bits should not be checked on completion path
regardless whether it's the Tx or the Rx. DD bit serves this purpose and
it indicates that a particular descriptor is either for Rx or was
successfully Txed. EOF is also set as loopback test does not xmit
fragmented frames.

Look at (DD | EOF) bits setting in ice_lbtest_receive_frames() instead
of EOP and RS pair.

Fixes: 0e674aeb0b77 ("ice: Add handler for ethtool selftest")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index 70335f6e8524..4efa5e5846e0 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -658,7 +658,8 @@ static int ice_lbtest_receive_frames(struct ice_rx_ring *rx_ring)
 		rx_desc = ICE_RX_DESC(rx_ring, i);
 
 		if (!(rx_desc->wb.status_error0 &
-		    cpu_to_le16(ICE_TX_DESC_CMD_EOP | ICE_TX_DESC_CMD_RS)))
+		    (cpu_to_le16(BIT(ICE_RX_FLEX_DESC_STATUS0_DD_S)) |
+		     cpu_to_le16(BIT(ICE_RX_FLEX_DESC_STATUS0_EOF_S)))))
 			continue;
 
 		rx_buf = &rx_ring->rx_buf[i];
-- 
2.35.1


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

* [PATCH net 5/5] ice: do not setup vlan for loopback VSI
  2022-07-26 20:46 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26 Tony Nguyen
                   ` (3 preceding siblings ...)
  2022-07-26 20:46 ` [PATCH net 4/5] ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS) Tony Nguyen
@ 2022-07-26 20:46 ` Tony Nguyen
  2022-07-28  3:50 ` [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26 patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: Tony Nguyen @ 2022-07-26 20:46 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Maciej Fijalkowski, netdev, anthony.l.nguyen, George Kuruvinakunnel

From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

Currently loopback test is failiing due to the error returned from
ice_vsi_vlan_setup(). Skip calling it when preparing loopback VSI.

Fixes: 0e674aeb0b77 ("ice: Add handler for ethtool selftest")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index b41a45c03d22..9f02b60459f1 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -6013,10 +6013,12 @@ int ice_vsi_cfg(struct ice_vsi *vsi)
 	if (vsi->netdev) {
 		ice_set_rx_mode(vsi->netdev);
 
-		err = ice_vsi_vlan_setup(vsi);
+		if (vsi->type != ICE_VSI_LB) {
+			err = ice_vsi_vlan_setup(vsi);
 
-		if (err)
-			return err;
+			if (err)
+				return err;
+		}
 	}
 	ice_vsi_cfg_dcb_rings(vsi);
 
-- 
2.35.1


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

* Re: [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26
  2022-07-26 20:46 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26 Tony Nguyen
                   ` (4 preceding siblings ...)
  2022-07-26 20:46 ` [PATCH net 5/5] ice: do not setup vlan for loopback VSI Tony Nguyen
@ 2022-07-28  3:50 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-28  3:50 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, pabeni, edumazet, netdev

Hello:

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

On Tue, 26 Jul 2022 13:46:41 -0700 you wrote:
> This series contains updates to ice driver only.
> 
> Przemyslaw corrects accounting for VF VLANs to allow for correct number
> of VLANs for untrusted VF. He also correct issue with checksum offload
> on VXLAN tunnels.
> 
> Ani allows for two VSIs to share the same MAC address.
> 
> [...]

Here is the summary with links:
  - [net,1/5] ice: Fix max VLANs available for VF
    https://git.kernel.org/netdev/net/c/1e308c6fb712
  - [net,2/5] ice: Fix tunnel checksum offload with fragmented traffic
    https://git.kernel.org/netdev/net/c/01658aeeada6
  - [net,3/5] ice: Fix VSIs unable to share unicast MAC
    https://git.kernel.org/netdev/net/c/5c8e3c7ff3e7
  - [net,4/5] ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS)
    https://git.kernel.org/netdev/net/c/283d736ff7c7
  - [net,5/5] ice: do not setup vlan for loopback VSI
    https://git.kernel.org/netdev/net/c/cc019545a238

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] 7+ messages in thread

end of thread, other threads:[~2022-07-28  3:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-26 20:46 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26 Tony Nguyen
2022-07-26 20:46 ` [PATCH net 1/5] ice: Fix max VLANs available for VF Tony Nguyen
2022-07-26 20:46 ` [PATCH net 2/5] ice: Fix tunnel checksum offload with fragmented traffic Tony Nguyen
2022-07-26 20:46 ` [PATCH net 3/5] ice: Fix VSIs unable to share unicast MAC Tony Nguyen
2022-07-26 20:46 ` [PATCH net 4/5] ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS) Tony Nguyen
2022-07-26 20:46 ` [PATCH net 5/5] ice: do not setup vlan for loopback VSI Tony Nguyen
2022-07-28  3:50 ` [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2022-07-26 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.