patches for DPDK stable branches
 help / color / mirror / Atom feed
From: wenxuanx.wu@intel.com
To: beilei.xing@intel.com, dev@dpdk.org
Cc: wenxuanx.wu@intel.com, yidingx.zhou@intel.com, stable@dpdk.org
Subject: [PATCH] driver/i40e: enable max frame at port level
Date: Thu, 28 Apr 2022 07:45:12 +0000	[thread overview]
Message-ID: <20220428074512.38423-1-wenxuanx.wu@intel.com> (raw)

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

This fix resolve max frame size can only be set when link is up.

hw.type would result in different behavior:
For X710, max frame size can be set regardless of link status.
For X722, link up should be guaranteed.

Fixes: a4ba77367923
Cc: stable@dpdk.org

Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 755786dc10..0bd9e5eac0 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12104,20 +12104,18 @@ i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size)
 	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 (hw->mac.type == I40E_MAC_XL710) { /* I40E_MAC_XL710 */
+		do {
+			update_link_reg(hw, &link);
+			if (link.link_status)
+				break;
+			rte_delay_ms(CHECK_INTERVAL);
+		} while (--rep_cnt);
 
-	if (link.link_status) {
+		if (link.link_status)
+			status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL);
+	} else {/* I40E_MAC_X722 */
 		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");
 	}
 }
 
-- 
2.25.1


                 reply	other threads:[~2022-04-28  8:09 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=20220428074512.38423-1-wenxuanx.wu@intel.com \
    --to=wenxuanx.wu@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --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).