All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14
@ 2021-10-14 18:19 Tony Nguyen
  2021-10-14 18:19 ` [PATCH net 1/4] ice: Fix failure to re-add LAN/RDMA Tx queues Tony Nguyen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-10-14 18:19 UTC (permalink / raw)
  To: davem, kuba; +Cc: Tony Nguyen, netdev, linux-rdma, shiraz.saleem

This series contains updates to ice driver only.

Brett ensures RDMA nodes are removed during release and rebuild. He also
corrects fw.mgmt.api to include the patch number for proper
identification.

Dave stops ida_free() being called when an IDA has not been allocated.

Michal corrects the order of parameters being provided and the number of
entries skipped for UDP tunnels.

The following are changes since commit 1fcd794518b7644169595c66b1bfe726d1f498ab:
  icmp: fix icmp_ext_echo_iio parsing in icmp_build_probe
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE

Brett Creeley (2):
  ice: Fix failure to re-add LAN/RDMA Tx queues
  ice: Print the api_patch as part of the fw.mgmt.api

Dave Ertman (1):
  ice: Avoid crash from unnecessary IDA free

Michal Swiatkowski (1):
  ice: fix getting UDP tunnel entry

 Documentation/networking/devlink/ice.rst       |  9 +++++----
 drivers/net/ethernet/intel/ice/ice_devlink.c   |  3 ++-
 drivers/net/ethernet/intel/ice/ice_flex_pipe.c |  4 ++--
 drivers/net/ethernet/intel/ice/ice_lib.c       |  9 +++++++++
 drivers/net/ethernet/intel/ice/ice_main.c      |  6 +++++-
 drivers/net/ethernet/intel/ice/ice_sched.c     | 13 +++++++++++++
 drivers/net/ethernet/intel/ice/ice_sched.h     |  1 +
 7 files changed, 37 insertions(+), 8 deletions(-)

-- 
2.31.1


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

* [PATCH net 1/4] ice: Fix failure to re-add LAN/RDMA Tx queues
  2021-10-14 18:19 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14 Tony Nguyen
@ 2021-10-14 18:19 ` Tony Nguyen
  2021-10-14 18:19 ` [PATCH net 2/4] ice: Avoid crash from unnecessary IDA free Tony Nguyen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-10-14 18:19 UTC (permalink / raw)
  To: davem, kuba
  Cc: Brett Creeley, netdev, anthony.l.nguyen, linux-rdma,
	shiraz.saleem, Jerzy Wiktor Jurkowski

From: Brett Creeley <brett.creeley@intel.com>

Currently if the VSI is rebuilt/removed and the RDMA PF driver is active
the RDMA Tx queue scheduler node configuration will not be cleaned up.
This will cause the rebuild/re-add of the VSI to fail due to the
software structures not being correctly cleaned up for the VSI index.
Fix this by always calling ice_rm_vsi_rdma_cfg() for all VSI. If there
are no RDMA scheduler nodes created, then there is no harm in calling
ice_rm_vsi_rdma_cfg(). This change applies to all VSI types, so if
RDMA support is added for other VSI types they will also get this
change.

Fixes: 348048e724a0 ("ice: Implement iidc operations")
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Jerzy Wiktor Jurkowski <jerzy.wiktor.jurkowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lib.c   |  9 +++++++++
 drivers/net/ethernet/intel/ice/ice_sched.c | 13 +++++++++++++
 drivers/net/ethernet/intel/ice/ice_sched.h |  1 +
 3 files changed, 23 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index dde9802c6c72..b718e196af2a 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -2841,6 +2841,7 @@ void ice_napi_del(struct ice_vsi *vsi)
  */
 int ice_vsi_release(struct ice_vsi *vsi)
 {
+	enum ice_status err;
 	struct ice_pf *pf;
 
 	if (!vsi->back)
@@ -2912,6 +2913,10 @@ int ice_vsi_release(struct ice_vsi *vsi)
 
 	ice_fltr_remove_all(vsi);
 	ice_rm_vsi_lan_cfg(vsi->port_info, vsi->idx);
+	err = ice_rm_vsi_rdma_cfg(vsi->port_info, vsi->idx);
+	if (err)
+		dev_err(ice_pf_to_dev(vsi->back), "Failed to remove RDMA scheduler config for VSI %u, err %d\n",
+			vsi->vsi_num, err);
 	ice_vsi_delete(vsi);
 	ice_vsi_free_q_vectors(vsi);
 
@@ -3092,6 +3097,10 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
 	prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce);
 
 	ice_rm_vsi_lan_cfg(vsi->port_info, vsi->idx);
+	ret = ice_rm_vsi_rdma_cfg(vsi->port_info, vsi->idx);
+	if (ret)
+		dev_err(ice_pf_to_dev(vsi->back), "Failed to remove RDMA scheduler config for VSI %u, err %d\n",
+			vsi->vsi_num, ret);
 	ice_vsi_free_q_vectors(vsi);
 
 	/* SR-IOV determines needed MSIX resources all at once instead of per
diff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c
index 9f07b6641705..2d9b10277186 100644
--- a/drivers/net/ethernet/intel/ice/ice_sched.c
+++ b/drivers/net/ethernet/intel/ice/ice_sched.c
@@ -2070,6 +2070,19 @@ enum ice_status ice_rm_vsi_lan_cfg(struct ice_port_info *pi, u16 vsi_handle)
 	return ice_sched_rm_vsi_cfg(pi, vsi_handle, ICE_SCHED_NODE_OWNER_LAN);
 }
 
+/**
+ * ice_rm_vsi_rdma_cfg - remove VSI and its RDMA children nodes
+ * @pi: port information structure
+ * @vsi_handle: software VSI handle
+ *
+ * This function clears the VSI and its RDMA children nodes from scheduler tree
+ * for all TCs.
+ */
+enum ice_status ice_rm_vsi_rdma_cfg(struct ice_port_info *pi, u16 vsi_handle)
+{
+	return ice_sched_rm_vsi_cfg(pi, vsi_handle, ICE_SCHED_NODE_OWNER_RDMA);
+}
+
 /**
  * ice_get_agg_info - get the aggregator ID
  * @hw: pointer to the hardware structure
diff --git a/drivers/net/ethernet/intel/ice/ice_sched.h b/drivers/net/ethernet/intel/ice/ice_sched.h
index 9beef8f0ec76..fdf7a5882f07 100644
--- a/drivers/net/ethernet/intel/ice/ice_sched.h
+++ b/drivers/net/ethernet/intel/ice/ice_sched.h
@@ -89,6 +89,7 @@ enum ice_status
 ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs,
 		  u8 owner, bool enable);
 enum ice_status ice_rm_vsi_lan_cfg(struct ice_port_info *pi, u16 vsi_handle);
+enum ice_status ice_rm_vsi_rdma_cfg(struct ice_port_info *pi, u16 vsi_handle);
 
 /* Tx scheduler rate limiter functions */
 enum ice_status
-- 
2.31.1


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

* [PATCH net 2/4] ice: Avoid crash from unnecessary IDA free
  2021-10-14 18:19 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14 Tony Nguyen
  2021-10-14 18:19 ` [PATCH net 1/4] ice: Fix failure to re-add LAN/RDMA Tx queues Tony Nguyen
@ 2021-10-14 18:19 ` Tony Nguyen
  2021-10-14 18:19 ` [PATCH net 3/4] ice: fix getting UDP tunnel entry Tony Nguyen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-10-14 18:19 UTC (permalink / raw)
  To: davem, kuba
  Cc: Dave Ertman, netdev, anthony.l.nguyen, linux-rdma, shiraz.saleem,
	Jun Miao, Jesse Brandeburg

From: Dave Ertman <david.m.ertman@intel.com>

In the remove path, there is an attempt to free the aux_idx IDA whether
it was allocated or not.  This can potentially cause a crash when
unloading the driver on systems that do not initialize support for RDMA.
But, this free cannot be gated by the status bit for RDMA, since it is
allocated if the driver detects support for RDMA at probe time, but the
driver can enter into a state where RDMA is not supported after the IDA
has been allocated at probe time and this would lead to a memory leak.

Initialize aux_idx to an invalid value and check for a valid value when
unloading to determine if an IDA free is necessary.

Fixes: d25a0fc41c1f ("ice: Initialize RDMA support")
Reported-by: Jun Miao <jun.miao@windriver.com>
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Tested-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 0d6c143f6653..94037881bfd8 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -4224,6 +4224,9 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
 	if (!pf)
 		return -ENOMEM;
 
+	/* initialize Auxiliary index to invalid value */
+	pf->aux_idx = -1;
+
 	/* set up for high or low DMA */
 	err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
 	if (err)
@@ -4615,7 +4618,8 @@ static void ice_remove(struct pci_dev *pdev)
 
 	ice_aq_cancel_waiting_tasks(pf);
 	ice_unplug_aux_dev(pf);
-	ida_free(&ice_aux_ida, pf->aux_idx);
+	if (pf->aux_idx >= 0)
+		ida_free(&ice_aux_ida, pf->aux_idx);
 	set_bit(ICE_DOWN, pf->state);
 
 	mutex_destroy(&(&pf->hw)->fdir_fltr_lock);
-- 
2.31.1


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

* [PATCH net 3/4] ice: fix getting UDP tunnel entry
  2021-10-14 18:19 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14 Tony Nguyen
  2021-10-14 18:19 ` [PATCH net 1/4] ice: Fix failure to re-add LAN/RDMA Tx queues Tony Nguyen
  2021-10-14 18:19 ` [PATCH net 2/4] ice: Avoid crash from unnecessary IDA free Tony Nguyen
@ 2021-10-14 18:19 ` Tony Nguyen
  2021-10-14 18:19 ` [PATCH net 4/4] ice: Print the api_patch as part of the fw.mgmt.api Tony Nguyen
  2021-10-16  0:50 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14 patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-10-14 18:19 UTC (permalink / raw)
  To: davem, kuba
  Cc: Michal Swiatkowski, netdev, anthony.l.nguyen, linux-rdma,
	shiraz.saleem, Gurucharan G

From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

Correct parameters order in call to ice_tunnel_idx_to_entry function.

Entry in sparse port table is correct when the idx is 0. For idx 1 one
correct entry should be skipped, for idx 2 two of them should be skipped
etc. Change if condition to be true when idx is 0, which means that
previous valid entry of this tunnel type were skipped.

Fixes: b20e6c17c468 ("ice: convert to new udp_tunnel infrastructure")
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c
index 06ac9badee77..1ac96dc66d0d 100644
--- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c
+++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c
@@ -1668,7 +1668,7 @@ static u16 ice_tunnel_idx_to_entry(struct ice_hw *hw, enum ice_tunnel_type type,
 	for (i = 0; i < hw->tnl.count && i < ICE_TUNNEL_MAX_ENTRIES; i++)
 		if (hw->tnl.tbl[i].valid &&
 		    hw->tnl.tbl[i].type == type &&
-		    idx--)
+		    idx-- == 0)
 			return i;
 
 	WARN_ON_ONCE(1);
@@ -1828,7 +1828,7 @@ int ice_udp_tunnel_set_port(struct net_device *netdev, unsigned int table,
 	u16 index;
 
 	tnl_type = ti->type == UDP_TUNNEL_TYPE_VXLAN ? TNL_VXLAN : TNL_GENEVE;
-	index = ice_tunnel_idx_to_entry(&pf->hw, idx, tnl_type);
+	index = ice_tunnel_idx_to_entry(&pf->hw, tnl_type, idx);
 
 	status = ice_create_tunnel(&pf->hw, index, tnl_type, ntohs(ti->port));
 	if (status) {
-- 
2.31.1


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

* [PATCH net 4/4] ice: Print the api_patch as part of the fw.mgmt.api
  2021-10-14 18:19 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14 Tony Nguyen
                   ` (2 preceding siblings ...)
  2021-10-14 18:19 ` [PATCH net 3/4] ice: fix getting UDP tunnel entry Tony Nguyen
@ 2021-10-14 18:19 ` Tony Nguyen
  2021-10-16  0:50 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14 patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-10-14 18:19 UTC (permalink / raw)
  To: davem, kuba
  Cc: Brett Creeley, netdev, anthony.l.nguyen, linux-rdma,
	shiraz.saleem, Gurucharan G

From: Brett Creeley <brett.creeley@intel.com>

Currently when a user uses "devlink dev info", the fw.mgmt.api will be
the major.minor numbers as shown below:

devlink dev info pci/0000:3b:00.0
pci/0000:3b:00.0:
  driver ice
  serial_number 00-01-00-ff-ff-00-00-00
  versions:
      fixed:
        board.id K91258-000
      running:
        fw.mgmt 6.1.2
        fw.mgmt.api 1.7 <--- No patch number included
        fw.mgmt.build 0xd75e7d06
        fw.mgmt.srev 5
        fw.undi 1.2992.0
        fw.undi.srev 5
        fw.psid.api 3.10
        fw.bundle_id 0x800085cc
        fw.app.name ICE OS Default Package
        fw.app 1.3.27.0
        fw.app.bundle_id 0xc0000001
        fw.netlist 3.10.2000-3.1e.0
        fw.netlist.build 0x2a76e110
      stored:
        fw.mgmt.srev 5
        fw.undi 1.2992.0
        fw.undi.srev 5
        fw.psid.api 3.10
        fw.bundle_id 0x800085cc
        fw.netlist 3.10.2000-3.1e.0
        fw.netlist.build 0x2a76e110

There are many features in the driver that depend on the major, minor,
and patch version of the FW. Without the patch number in the output for
fw.mgmt.api debugging issues related to the FW API version is difficult.
Also, using major.minor.patch aligns with the existing firmware version
which uses a 3 digit value.

Fix this by making the fw.mgmt.api print the major.minor.patch
versions. Shown below is the result:

devlink dev info pci/0000:3b:00.0
pci/0000:3b:00.0:
  driver ice
  serial_number 00-01-00-ff-ff-00-00-00
  versions:
      fixed:
        board.id K91258-000
      running:
        fw.mgmt 6.1.2
        fw.mgmt.api 1.7.9 <--- patch number included
        fw.mgmt.build 0xd75e7d06
        fw.mgmt.srev 5
        fw.undi 1.2992.0
        fw.undi.srev 5
        fw.psid.api 3.10
        fw.bundle_id 0x800085cc
        fw.app.name ICE OS Default Package
        fw.app 1.3.27.0
        fw.app.bundle_id 0xc0000001
        fw.netlist 3.10.2000-3.1e.0
        fw.netlist.build 0x2a76e110
      stored:
        fw.mgmt.srev 5
        fw.undi 1.2992.0
        fw.undi.srev 5
        fw.psid.api 3.10
        fw.bundle_id 0x800085cc
        fw.netlist 3.10.2000-3.1e.0
        fw.netlist.build 0x2a76e110

Fixes: ff2e5c700e08 ("ice: add basic handler for devlink .info_get")
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 Documentation/networking/devlink/ice.rst     | 9 +++++----
 drivers/net/ethernet/intel/ice/ice_devlink.c | 3 ++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Documentation/networking/devlink/ice.rst b/Documentation/networking/devlink/ice.rst
index a432dc419fa4..5d97cee9457b 100644
--- a/Documentation/networking/devlink/ice.rst
+++ b/Documentation/networking/devlink/ice.rst
@@ -30,10 +30,11 @@ The ``ice`` driver reports the following versions
         PHY, link, etc.
     * - ``fw.mgmt.api``
       - running
-      - 1.5
-      - 2-digit version number of the API exported over the AdminQ by the
-        management firmware. Used by the driver to identify what commands
-        are supported.
+      - 1.5.1
+      - 3-digit version number (major.minor.patch) of the API exported over
+        the AdminQ by the management firmware. Used by the driver to
+        identify what commands are supported. Historical versions of the
+        kernel only displayed a 2-digit version number (major.minor).
     * - ``fw.mgmt.build``
       - running
       - 0x305d955f
diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c
index 14afce82ef63..da7288bdc9a3 100644
--- a/drivers/net/ethernet/intel/ice/ice_devlink.c
+++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
@@ -63,7 +63,8 @@ static int ice_info_fw_api(struct ice_pf *pf, struct ice_info_ctx *ctx)
 {
 	struct ice_hw *hw = &pf->hw;
 
-	snprintf(ctx->buf, sizeof(ctx->buf), "%u.%u", hw->api_maj_ver, hw->api_min_ver);
+	snprintf(ctx->buf, sizeof(ctx->buf), "%u.%u.%u", hw->api_maj_ver,
+		 hw->api_min_ver, hw->api_patch);
 
 	return 0;
 }
-- 
2.31.1


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

* Re: [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14
  2021-10-14 18:19 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14 Tony Nguyen
                   ` (3 preceding siblings ...)
  2021-10-14 18:19 ` [PATCH net 4/4] ice: Print the api_patch as part of the fw.mgmt.api Tony Nguyen
@ 2021-10-16  0:50 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-16  0:50 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, netdev, linux-rdma, shiraz.saleem

Hello:

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

On Thu, 14 Oct 2021 11:19:49 -0700 you wrote:
> This series contains updates to ice driver only.
> 
> Brett ensures RDMA nodes are removed during release and rebuild. He also
> corrects fw.mgmt.api to include the patch number for proper
> identification.
> 
> Dave stops ida_free() being called when an IDA has not been allocated.
> 
> [...]

Here is the summary with links:
  - [net,1/4] ice: Fix failure to re-add LAN/RDMA Tx queues
    https://git.kernel.org/netdev/net/c/ff7e93219442
  - [net,2/4] ice: Avoid crash from unnecessary IDA free
    https://git.kernel.org/netdev/net/c/73e30a62b19b
  - [net,3/4] ice: fix getting UDP tunnel entry
    https://git.kernel.org/netdev/net/c/e4c2efa1393c
  - [net,4/4] ice: Print the api_patch as part of the fw.mgmt.api
    https://git.kernel.org/netdev/net/c/b726ddf984a5

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

end of thread, other threads:[~2021-10-16  0:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 18:19 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14 Tony Nguyen
2021-10-14 18:19 ` [PATCH net 1/4] ice: Fix failure to re-add LAN/RDMA Tx queues Tony Nguyen
2021-10-14 18:19 ` [PATCH net 2/4] ice: Avoid crash from unnecessary IDA free Tony Nguyen
2021-10-14 18:19 ` [PATCH net 3/4] ice: fix getting UDP tunnel entry Tony Nguyen
2021-10-14 18:19 ` [PATCH net 4/4] ice: Print the api_patch as part of the fw.mgmt.api Tony Nguyen
2021-10-16  0:50 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-10-14 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.