patches for DPDK stable branches
 help / color / mirror / Atom feed
From: wenxuanx.wu@intel.com
To: beilei.xing@intel.com, qiming.yang@intel.com,
	qi.z.zhang@intel.com, dev@dpdk.org, yidingx.zhou@intel.com
Cc: Wenxuan Wu <wenxuanx.wu@intel.com>, stable@dpdk.org
Subject: [PATCH] net/i40e: max frame size config regardless of link status
Date: Fri, 15 Apr 2022 03:34:19 +0000	[thread overview]
Message-ID: <20220415033419.316323-1-wenxuanx.wu@intel.com> (raw)

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


                 reply	other threads:[~2022-04-15  3:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220415033419.316323-1-wenxuanx.wu@intel.com \
    --to=wenxuanx.wu@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    --cc=yidingx.zhou@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).