* [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-05-16
@ 2023-05-16 17:36 Tony Nguyen
2023-05-16 17:36 ` [PATCH net v2 1/3] ice: Fix stats after PF reset Tony Nguyen
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Tony Nguyen @ 2023-05-16 17:36 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev; +Cc: Tony Nguyen, leonro
This series contains updates to ice and iavf drivers.
Ahmed adds setting of missed condition for statistics which caused
incorrect reporting of values for ice. For iavf, he removes a call to set
VLAN offloads during re-initialization which can cause incorrect values
to be set.
Dawid adds checks to ensure VF is ready to be reset before executing
commands that will require it to be reset on ice.
---
v2:
Patch 2
- Redo commit message
v1: https://lore.kernel.org/netdev/20230425170127.2522312-1-anthony.l.nguyen@intel.com/
The following are changes since commit 225c657945c4a6307741cb3cc89467eadcc26e9b:
net: bcmgenet: Restore phy_stop() depending upon suspend/close
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE
Ahmed Zaki (2):
ice: Fix stats after PF reset
iavf: send VLAN offloading caps once after VFR
Dawid Wesierski (1):
ice: Fix ice VF reset during iavf initialization
.../net/ethernet/intel/iavf/iavf_virtchnl.c | 5 -----
drivers/net/ethernet/intel/ice/ice_lib.c | 5 +++++
drivers/net/ethernet/intel/ice/ice_sriov.c | 8 ++++----
drivers/net/ethernet/intel/ice/ice_vf_lib.c | 19 +++++++++++++++++++
drivers/net/ethernet/intel/ice/ice_vf_lib.h | 1 +
drivers/net/ethernet/intel/ice/ice_virtchnl.c | 1 +
6 files changed, 30 insertions(+), 9 deletions(-)
--
2.38.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net v2 1/3] ice: Fix stats after PF reset
2023-05-16 17:36 [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-05-16 Tony Nguyen
@ 2023-05-16 17:36 ` Tony Nguyen
2023-05-16 17:36 ` [PATCH net v2 2/3] ice: Fix ice VF reset during iavf initialization Tony Nguyen
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2023-05-16 17:36 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev
Cc: Ahmed Zaki, anthony.l.nguyen, Alexander Lobakin, Rafal Romanowski,
Leon Romanovsky
From: Ahmed Zaki <ahmed.zaki@intel.com>
After a core PF reset, the VFs were showing wrong Rx/Tx stats. This is a
regression in commit 6624e780a577 ("ice: split ice_vsi_setup into smaller
functions") caused by missing to set "stat_offsets_loaded = false" in the
ice_vsi_rebuild() path.
Fixes: 6624e780a577 ("ice: split ice_vsi_setup into smaller functions")
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Reviewed-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/ice/ice_lib.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 450317dfcca7..11ae0e41f518 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -2745,6 +2745,8 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
goto unroll_vector_base;
ice_vsi_map_rings_to_vectors(vsi);
+ vsi->stat_offsets_loaded = false;
+
if (ice_is_xdp_ena_vsi(vsi)) {
ret = ice_vsi_determine_xdp_res(vsi);
if (ret)
@@ -2793,6 +2795,9 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
ret = ice_vsi_alloc_ring_stats(vsi);
if (ret)
goto unroll_vector_base;
+
+ vsi->stat_offsets_loaded = false;
+
/* Do not exit if configuring RSS had an issue, at least
* receive traffic on first queue. Hence no need to capture
* return value
--
2.38.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net v2 2/3] ice: Fix ice VF reset during iavf initialization
2023-05-16 17:36 [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-05-16 Tony Nguyen
2023-05-16 17:36 ` [PATCH net v2 1/3] ice: Fix stats after PF reset Tony Nguyen
@ 2023-05-16 17:36 ` Tony Nguyen
2023-05-16 17:36 ` [PATCH net v2 3/3] iavf: send VLAN offloading caps once after VFR Tony Nguyen
2023-05-17 8:30 ` [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-05-16 patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2023-05-16 17:36 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev
Cc: Dawid Wesierski, anthony.l.nguyen, leonro, Kamil Maziarz,
Jacob Keller, Rafal Romanowski
From: Dawid Wesierski <dawidx.wesierski@intel.com>
Fix the current implementation that causes ice_trigger_vf_reset()
to start resetting the VF even when the VF-NIC is still initializing.
When we reset NIC with ice driver it can interfere with
iavf-vf initialization e.g. during consecutive resets induced by ice
iavf ice
| |
|<-----------------|
| ice resets vf
iavf |
reset |
start |
|<-----------------|
| ice resets vf
| causing iavf
| initialization
| error
| |
iavf
reset
end
This leads to a series of -53 errors
(failed to init adminq) from the IAVF.
Change the state of the vf_state field to be not active when the IAVF
is still initializing. Make sure to wait until receiving the message on
the message box to ensure that the vf is ready and initializded.
In simple terms we use the ACTIVE flag to make sure that the ice
driver knows if the iavf is ready for another reset
iavf ice
| |
| |
|<------------- ice resets vf
iavf vf_state != ACTIVE
reset |
start |
| |
| |
iavf |
reset-------> vf_state == ACTIVE
end ice resets vf
| |
| |
Fixes: c54d209c78b8 ("ice: Wait for VF to be reset/ready before configuration")
Signed-off-by: Dawid Wesierski <dawidx.wesierski@intel.com>
Signed-off-by: Kamil Maziarz <kamil.maziarz@intel.com>
Acked-by: Jacob Keller <Jacob.e.keller@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_sriov.c | 8 ++++----
drivers/net/ethernet/intel/ice/ice_vf_lib.c | 19 +++++++++++++++++++
drivers/net/ethernet/intel/ice/ice_vf_lib.h | 1 +
drivers/net/ethernet/intel/ice/ice_virtchnl.c | 1 +
4 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
index f1dca59bd844..588ad8696756 100644
--- a/drivers/net/ethernet/intel/ice/ice_sriov.c
+++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
@@ -1171,7 +1171,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)
if (!vf)
return -EINVAL;
- ret = ice_check_vf_ready_for_cfg(vf);
+ ret = ice_check_vf_ready_for_reset(vf);
if (ret)
goto out_put_vf;
@@ -1286,7 +1286,7 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
goto out_put_vf;
}
- ret = ice_check_vf_ready_for_cfg(vf);
+ ret = ice_check_vf_ready_for_reset(vf);
if (ret)
goto out_put_vf;
@@ -1340,7 +1340,7 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)
return -EOPNOTSUPP;
}
- ret = ice_check_vf_ready_for_cfg(vf);
+ ret = ice_check_vf_ready_for_reset(vf);
if (ret)
goto out_put_vf;
@@ -1653,7 +1653,7 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,
if (!vf)
return -EINVAL;
- ret = ice_check_vf_ready_for_cfg(vf);
+ ret = ice_check_vf_ready_for_reset(vf);
if (ret)
goto out_put_vf;
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
index 89fd6982df09..bf74a2f3a4f8 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
@@ -185,6 +185,25 @@ int ice_check_vf_ready_for_cfg(struct ice_vf *vf)
return 0;
}
+/**
+ * ice_check_vf_ready_for_reset - check if VF is ready to be reset
+ * @vf: VF to check if it's ready to be reset
+ *
+ * The purpose of this function is to ensure that the VF is not in reset,
+ * disabled, and is both initialized and active, thus enabling us to safely
+ * initialize another reset.
+ */
+int ice_check_vf_ready_for_reset(struct ice_vf *vf)
+{
+ int ret;
+
+ ret = ice_check_vf_ready_for_cfg(vf);
+ if (!ret && !test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states))
+ ret = -EAGAIN;
+
+ return ret;
+}
+
/**
* ice_trigger_vf_reset - Reset a VF on HW
* @vf: pointer to the VF structure
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.h b/drivers/net/ethernet/intel/ice/ice_vf_lib.h
index e3cda6fb71ab..a38ef00a3679 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_lib.h
+++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.h
@@ -215,6 +215,7 @@ u16 ice_get_num_vfs(struct ice_pf *pf);
struct ice_vsi *ice_get_vf_vsi(struct ice_vf *vf);
bool ice_is_vf_disabled(struct ice_vf *vf);
int ice_check_vf_ready_for_cfg(struct ice_vf *vf);
+int ice_check_vf_ready_for_reset(struct ice_vf *vf);
void ice_set_vf_state_dis(struct ice_vf *vf);
bool ice_is_any_vf_in_unicast_promisc(struct ice_pf *pf);
void
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
index 97243c616d5d..f4a524f80b11 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
@@ -3955,6 +3955,7 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event,
ice_vc_notify_vf_link_state(vf);
break;
case VIRTCHNL_OP_RESET_VF:
+ clear_bit(ICE_VF_STATE_ACTIVE, vf->vf_states);
ops->reset_vf(vf);
break;
case VIRTCHNL_OP_ADD_ETH_ADDR:
--
2.38.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net v2 3/3] iavf: send VLAN offloading caps once after VFR
2023-05-16 17:36 [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-05-16 Tony Nguyen
2023-05-16 17:36 ` [PATCH net v2 1/3] ice: Fix stats after PF reset Tony Nguyen
2023-05-16 17:36 ` [PATCH net v2 2/3] ice: Fix ice VF reset during iavf initialization Tony Nguyen
@ 2023-05-16 17:36 ` Tony Nguyen
2023-05-17 8:30 ` [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-05-16 patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2023-05-16 17:36 UTC (permalink / raw)
To: davem, kuba, pabeni, edumazet, netdev
Cc: Ahmed Zaki, anthony.l.nguyen, Rafal Romanowski, Leon Romanovsky
From: Ahmed Zaki <ahmed.zaki@intel.com>
When the user disables rxvlan offloading and then changes the number of
channels, all VLAN ports are unable to receive traffic.
Changing the number of channels triggers a VFR reset. During re-init, when
VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS is received, we do:
1 - set the IAVF_FLAG_SETUP_NETDEV_FEATURES flag
2 - call
iavf_set_vlan_offload_features(adapter, 0, netdev->features);
The second step sends to the PF the __default__ features, in this case
aq_required |= IAVF_FLAG_AQ_ENABLE_CTAG_VLAN_STRIPPING
While the first step forces the watchdog task to call
netdev_update_features() -> iavf_set_features() ->
iavf_set_vlan_offload_features(adapter, netdev->features, features).
Since the user disabled the "rxvlan", this sets:
aq_required |= IAVF_FLAG_AQ_DISABLE_CTAG_VLAN_STRIPPING
When we start processing the AQ commands, both flags are enabled. Since we
process DISABLE_XTAG first then ENABLE_XTAG, this results in the PF
enabling the rxvlan offload. This breaks all communications on the VLAN
net devices.
Fix by removing the call to iavf_set_vlan_offload_features() (second
step). Calling netdev_update_features() from watchdog task is enough for
both init and reset paths.
Fixes: 7598f4b40bd6 ("iavf: Move netdev_update_features() into watchdog task")
Signed-off-by: Ahmed Zaki <ahmed.zaki@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_virtchnl.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index 9afbbdac3590..7c0578b5457b 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -2238,11 +2238,6 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
iavf_process_config(adapter);
adapter->flags |= IAVF_FLAG_SETUP_NETDEV_FEATURES;
- /* Request VLAN offload settings */
- if (VLAN_V2_ALLOWED(adapter))
- iavf_set_vlan_offload_features(adapter, 0,
- netdev->features);
-
iavf_set_queue_vlan_tag_loc(adapter);
was_mac_changed = !ether_addr_equal(netdev->dev_addr,
--
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-05-16
2023-05-16 17:36 [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-05-16 Tony Nguyen
` (2 preceding siblings ...)
2023-05-16 17:36 ` [PATCH net v2 3/3] iavf: send VLAN offloading caps once after VFR Tony Nguyen
@ 2023-05-17 8:30 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-17 8:30 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 Tue, 16 May 2023 10:36:07 -0700 you wrote:
> This series contains updates to ice and iavf drivers.
>
> Ahmed adds setting of missed condition for statistics which caused
> incorrect reporting of values for ice. For iavf, he removes a call to set
> VLAN offloads during re-initialization which can cause incorrect values
> to be set.
>
> [...]
Here is the summary with links:
- [net,v2,1/3] ice: Fix stats after PF reset
https://git.kernel.org/netdev/net/c/ab7470bc6d8f
- [net,v2,2/3] ice: Fix ice VF reset during iavf initialization
https://git.kernel.org/netdev/net/c/7255355a0636
- [net,v2,3/3] iavf: send VLAN offloading caps once after VFR
https://git.kernel.org/netdev/net/c/7dcbdf29282f
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-05-17 8:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16 17:36 [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-05-16 Tony Nguyen
2023-05-16 17:36 ` [PATCH net v2 1/3] ice: Fix stats after PF reset Tony Nguyen
2023-05-16 17:36 ` [PATCH net v2 2/3] ice: Fix ice VF reset during iavf initialization Tony Nguyen
2023-05-16 17:36 ` [PATCH net v2 3/3] iavf: send VLAN offloading caps once after VFR Tony Nguyen
2023-05-17 8:30 ` [PATCH net v2 0/3][pull request] Intel Wired LAN Driver Updates 2023-05-16 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.