patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/i40e: max frame size config regardless of link status
@ 2022-04-15  3:34 wenxuanx.wu
  0 siblings, 0 replies; only message in thread
From: wenxuanx.wu @ 2022-04-15  3:34 UTC (permalink / raw)
  To: beilei.xing, qiming.yang, qi.z.zhang, dev, yidingx.zhou
  Cc: Wenxuan Wu, stable

From: Wenxuan Wu <wenxuanx.wu@intel.com>

Previously, max frame size can only be set when link is up, testpmd configuration
when port is down, so there is a confilict to apply this max frame size before
link up.

Actual results:

Set max frame size at port level not applicable on link down
----
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-errors: 1
  RX-nombuf:  0
  TX-packets: 0          TX-errors: 0          TX-bytes:  0  Throughput (since last show)
  Rx-pps:            0          Rx-bps:            0
  Tx-pps:    

Expected results:
----
  RX-packets: 1          RX-missed: 0          RX-bytes:  5061
  RX-errors: 0
  RX-nombuf:  0
  TX-packets: 0          TX-errors: 0          TX-bytes:  0  Throughput (since last show)
  Rx-pps:            0          Rx-bps:         3464
  Tx-pps:            0          Tx-bps:            0

This fix resolve max frame configuration regardless of link status, which means
port mtu can be set whether link is down or up same as ifconfig mtu behavior. 

Fixes: a4ba77367923 
Cc: stable@dpdk.org 
Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>

---
 drivers/net/i40e/i40e_ethdev.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 755786dc10..25c40ffceb 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12100,25 +12100,12 @@ static void
 i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size)
 {
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t rep_cnt = MAX_REPEAT_TIME;
-	struct rte_eth_link link;
 	enum i40e_status_code status;
 
-	do {
-		update_link_reg(hw, &link);
-		if (link.link_status)
-			break;
-
-		rte_delay_ms(CHECK_INTERVAL);
-	} while (--rep_cnt);
-
-	if (link.link_status) {
-		status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL);
-		if (status != I40E_SUCCESS)
-			PMD_DRV_LOG(ERR, "Failed to set max frame size at port level");
-	} else {
-		PMD_DRV_LOG(ERR, "Set max frame size at port level not applicable on link down");
-	}
+	status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL);
+	if (status)
+		PMD_DRV_LOG(ERR, "Failed to set max frame size at port level");
+	return;
 }
 
 RTE_LOG_REGISTER_SUFFIX(i40e_logtype_init, init, NOTICE);
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-15  3:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15  3:34 [PATCH] net/i40e: max frame size config regardless of link status wenxuanx.wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).