All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e)
@ 2024-02-13  1:05 Tony Nguyen
  2024-02-13  1:05 ` [PATCH net 1/4] i40e: Fix waiting for queues of all VSIs to be disabled Tony Nguyen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tony Nguyen @ 2024-02-13  1:05 UTC (permalink / raw
  To: davem, kuba, pabeni, edumazet, netdev; +Cc: Tony Nguyen

This series contains updates to i40e driver only.

Ivan Vecera corrects the looping value used while waiting for queues to
be disabled as well as an incorrect mask being used for DCB
configuration.

Maciej resolves an issue related to XDP traffic; removing a double call to
i40e_pf_rxq_wait() and accounting for XDP rings when stopping rings.

The following are changes since commit 5b3fbd61b9d1f4ed2db95aaf03f9adae0373784d:
  net: sysfs: Fix /sys/class/net/<iface> path for statistics
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 40GbE

Ivan Vecera (2):
  i40e: Fix waiting for queues of all VSIs to be disabled
  i40e: Fix wrong mask used during DCB config

Maciej Fijalkowski (2):
  i40e: avoid double calling i40e_pf_rxq_wait()
  i40e: take into account XDP Tx queues when stopping rings

 drivers/net/ethernet/intel/i40e/i40e_dcb.c  |  2 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c | 24 +++++++++------------
 2 files changed, 11 insertions(+), 15 deletions(-)

-- 
2.41.0


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

* [PATCH net 1/4] i40e: Fix waiting for queues of all VSIs to be disabled
  2024-02-13  1:05 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e) Tony Nguyen
@ 2024-02-13  1:05 ` Tony Nguyen
  2024-02-13  1:05 ` [PATCH net 2/4] i40e: Fix wrong mask used during DCB config Tony Nguyen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2024-02-13  1:05 UTC (permalink / raw
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Ivan Vecera, anthony.l.nguyen, Jacob Keller, Wojciech Drewek,
	Pucha Himasekhar Reddy

From: Ivan Vecera <ivecera@redhat.com>

The function i40e_pf_wait_queues_disabled() iterates all PF's VSIs
up to 'pf->hw.func_caps.num_vsis' but this is incorrect because
the real number of VSIs can be up to 'pf->num_alloc_vsi' that
can be higher. Fix this loop.

Fixes: 69129dc39fac ("i40e: Modify Tx disable wait flow in case of DCB reconfiguration")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 6e7fd473abfd..7a416e923b36 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5360,7 +5360,7 @@ static int i40e_pf_wait_queues_disabled(struct i40e_pf *pf)
 {
 	int v, ret = 0;
 
-	for (v = 0; v < pf->hw.func_caps.num_vsis; v++) {
+	for (v = 0; v < pf->num_alloc_vsi; v++) {
 		if (pf->vsi[v]) {
 			ret = i40e_vsi_wait_queues_disabled(pf->vsi[v]);
 			if (ret)
-- 
2.41.0


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

* [PATCH net 2/4] i40e: Fix wrong mask used during DCB config
  2024-02-13  1:05 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e) Tony Nguyen
  2024-02-13  1:05 ` [PATCH net 1/4] i40e: Fix waiting for queues of all VSIs to be disabled Tony Nguyen
@ 2024-02-13  1:05 ` Tony Nguyen
  2024-02-13  1:05 ` [PATCH net 3/4] i40e: avoid double calling i40e_pf_rxq_wait() Tony Nguyen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2024-02-13  1:05 UTC (permalink / raw
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Ivan Vecera, anthony.l.nguyen, Przemek Kitszel, Simon Horman,
	Pucha Himasekhar Reddy

From: Ivan Vecera <ivecera@redhat.com>

Mask used for clearing PRTDCB_RETSTCC register in function
i40e_dcb_hw_rx_ets_bw_config() is incorrect as there is used
define I40E_PRTDCB_RETSTCC_ETSTC_SHIFT instead of define
I40E_PRTDCB_RETSTCC_ETSTC_MASK.

The PRTDCB_RETSTCC register is used to configure whether ETS
or strict priority is used as TSA in Rx for particular TC.

In practice it means that once the register is set to use ETS
as TSA then it is not possible to switch back to strict priority
without CoreR reset.

Fix the value in the clearing mask.

Fixes: 90bc8e003be2 ("i40e: Add hardware configuration for software based DCB")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_dcb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb.c b/drivers/net/ethernet/intel/i40e/i40e_dcb.c
index 9d88ed6105fd..8db1eb0c1768 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_dcb.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_dcb.c
@@ -1523,7 +1523,7 @@ void i40e_dcb_hw_rx_ets_bw_config(struct i40e_hw *hw, u8 *bw_share,
 		reg = rd32(hw, I40E_PRTDCB_RETSTCC(i));
 		reg &= ~(I40E_PRTDCB_RETSTCC_BWSHARE_MASK     |
 			 I40E_PRTDCB_RETSTCC_UPINTC_MODE_MASK |
-			 I40E_PRTDCB_RETSTCC_ETSTC_SHIFT);
+			 I40E_PRTDCB_RETSTCC_ETSTC_MASK);
 		reg |= FIELD_PREP(I40E_PRTDCB_RETSTCC_BWSHARE_MASK,
 				  bw_share[i]);
 		reg |= FIELD_PREP(I40E_PRTDCB_RETSTCC_UPINTC_MODE_MASK,
-- 
2.41.0


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

* [PATCH net 3/4] i40e: avoid double calling i40e_pf_rxq_wait()
  2024-02-13  1:05 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e) Tony Nguyen
  2024-02-13  1:05 ` [PATCH net 1/4] i40e: Fix waiting for queues of all VSIs to be disabled Tony Nguyen
  2024-02-13  1:05 ` [PATCH net 2/4] i40e: Fix wrong mask used during DCB config Tony Nguyen
@ 2024-02-13  1:05 ` Tony Nguyen
  2024-02-13  1:05 ` [PATCH net 4/4] i40e: take into account XDP Tx queues when stopping rings Tony Nguyen
  2024-02-15  1:31 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e) Jakub Kicinski
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2024-02-13  1:05 UTC (permalink / raw
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Maciej Fijalkowski, anthony.l.nguyen, Simon Horman, Ivan Vecera,
	Chandan Kumar Rout

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

Currently, when interface is being brought down and
i40e_vsi_stop_rings() is called, i40e_pf_rxq_wait() is called two times,
which is wrong. To showcase this scenario, simplified call stack looks
as follows:

i40e_vsi_stop_rings()
	i40e_control wait rx_q()
		i40e_control_rx_q()
		i40e_pf_rxq_wait()
	i40e_vsi_wait_queues_disabled()
		i40e_pf_rxq_wait()  // redundant call

To fix this, let us s/i40e_control_wait_rx_q/i40e_control_rx_q within
i40e_vsi_stop_rings().

Fixes: 65662a8dcdd0 ("i40e: Fix logic of disabling queues")
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Ivan Vecera <ivecera@redhat.com>
Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 7a416e923b36..06078c4d54e8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4926,7 +4926,7 @@ int i40e_vsi_start_rings(struct i40e_vsi *vsi)
 void i40e_vsi_stop_rings(struct i40e_vsi *vsi)
 {
 	struct i40e_pf *pf = vsi->back;
-	int pf_q, err, q_end;
+	int pf_q, q_end;
 
 	/* When port TX is suspended, don't wait */
 	if (test_bit(__I40E_PORT_SUSPENDED, vsi->back->state))
@@ -4936,16 +4936,10 @@ void i40e_vsi_stop_rings(struct i40e_vsi *vsi)
 	for (pf_q = vsi->base_queue; pf_q < q_end; pf_q++)
 		i40e_pre_tx_queue_cfg(&pf->hw, (u32)pf_q, false);
 
-	for (pf_q = vsi->base_queue; pf_q < q_end; pf_q++) {
-		err = i40e_control_wait_rx_q(pf, pf_q, false);
-		if (err)
-			dev_info(&pf->pdev->dev,
-				 "VSI seid %d Rx ring %d disable timeout\n",
-				 vsi->seid, pf_q);
-	}
+	for (pf_q = vsi->base_queue; pf_q < q_end; pf_q++)
+		i40e_control_rx_q(pf, pf_q, false);
 
 	msleep(I40E_DISABLE_TX_GAP_MSEC);
-	pf_q = vsi->base_queue;
 	for (pf_q = vsi->base_queue; pf_q < q_end; pf_q++)
 		wr32(&pf->hw, I40E_QTX_ENA(pf_q), 0);
 
-- 
2.41.0


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

* [PATCH net 4/4] i40e: take into account XDP Tx queues when stopping rings
  2024-02-13  1:05 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e) Tony Nguyen
                   ` (2 preceding siblings ...)
  2024-02-13  1:05 ` [PATCH net 3/4] i40e: avoid double calling i40e_pf_rxq_wait() Tony Nguyen
@ 2024-02-13  1:05 ` Tony Nguyen
  2024-02-15  1:31 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e) Jakub Kicinski
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2024-02-13  1:05 UTC (permalink / raw
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Maciej Fijalkowski, anthony.l.nguyen, magnus.karlsson, ast,
	daniel, hawk, john.fastabend, bpf, Seth Forshee, Simon Horman,
	Ivan Vecera, Chandan Kumar Rout

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

Seth reported that on his side XDP traffic can not survive a round of
down/up against i40e interface. Dmesg output was telling us that we were
not able to disable the very first XDP ring. That was due to the fact
that in i40e_vsi_stop_rings() in a pre-work that is done before calling
i40e_vsi_wait_queues_disabled(), XDP Tx queues were not taken into the
account.

To fix this, let us distinguish between Rx and Tx queue boundaries and
take into the account XDP queues for Tx side.

Reported-by: Seth Forshee <sforshee@kernel.org>
Closes: https://lore.kernel.org/netdev/ZbkE7Ep1N1Ou17sA@do-x1extreme/
Fixes: 65662a8dcdd0 ("i40e: Fix logic of disabling queues")
Tested-by: Seth Forshee <sforshee@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Ivan Vecera <ivecera@redhat.com>
Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 06078c4d54e8..54eb55464e31 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4926,21 +4926,23 @@ int i40e_vsi_start_rings(struct i40e_vsi *vsi)
 void i40e_vsi_stop_rings(struct i40e_vsi *vsi)
 {
 	struct i40e_pf *pf = vsi->back;
-	int pf_q, q_end;
+	u32 pf_q, tx_q_end, rx_q_end;
 
 	/* When port TX is suspended, don't wait */
 	if (test_bit(__I40E_PORT_SUSPENDED, vsi->back->state))
 		return i40e_vsi_stop_rings_no_wait(vsi);
 
-	q_end = vsi->base_queue + vsi->num_queue_pairs;
-	for (pf_q = vsi->base_queue; pf_q < q_end; pf_q++)
-		i40e_pre_tx_queue_cfg(&pf->hw, (u32)pf_q, false);
+	tx_q_end = vsi->base_queue +
+		vsi->alloc_queue_pairs * (i40e_enabled_xdp_vsi(vsi) ? 2 : 1);
+	for (pf_q = vsi->base_queue; pf_q < tx_q_end; pf_q++)
+		i40e_pre_tx_queue_cfg(&pf->hw, pf_q, false);
 
-	for (pf_q = vsi->base_queue; pf_q < q_end; pf_q++)
+	rx_q_end = vsi->base_queue + vsi->num_queue_pairs;
+	for (pf_q = vsi->base_queue; pf_q < rx_q_end; pf_q++)
 		i40e_control_rx_q(pf, pf_q, false);
 
 	msleep(I40E_DISABLE_TX_GAP_MSEC);
-	for (pf_q = vsi->base_queue; pf_q < q_end; pf_q++)
+	for (pf_q = vsi->base_queue; pf_q < tx_q_end; pf_q++)
 		wr32(&pf->hw, I40E_QTX_ENA(pf_q), 0);
 
 	i40e_vsi_wait_queues_disabled(vsi);
-- 
2.41.0


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

* Re: [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e)
  2024-02-13  1:05 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e) Tony Nguyen
                   ` (3 preceding siblings ...)
  2024-02-13  1:05 ` [PATCH net 4/4] i40e: take into account XDP Tx queues when stopping rings Tony Nguyen
@ 2024-02-15  1:31 ` Jakub Kicinski
  4 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2024-02-15  1:31 UTC (permalink / raw
  To: Tony Nguyen; +Cc: davem, pabeni, edumazet, netdev

On Mon, 12 Feb 2024 17:05:35 -0800 Tony Nguyen wrote:
> Ivan Vecera corrects the looping value used while waiting for queues to
> be disabled as well as an incorrect mask being used for DCB
> configuration.
> 
> Maciej resolves an issue related to XDP traffic; removing a double call to
> i40e_pf_rxq_wait() and accounting for XDP rings when stopping rings.

Looks like this got (silently) applied, thanks!

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

end of thread, other threads:[~2024-02-15  1:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13  1:05 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e) Tony Nguyen
2024-02-13  1:05 ` [PATCH net 1/4] i40e: Fix waiting for queues of all VSIs to be disabled Tony Nguyen
2024-02-13  1:05 ` [PATCH net 2/4] i40e: Fix wrong mask used during DCB config Tony Nguyen
2024-02-13  1:05 ` [PATCH net 3/4] i40e: avoid double calling i40e_pf_rxq_wait() Tony Nguyen
2024-02-13  1:05 ` [PATCH net 4/4] i40e: take into account XDP Tx queues when stopping rings Tony Nguyen
2024-02-15  1:31 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-02-12 (i40e) Jakub Kicinski

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.