DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rmody@marvell.com>
To: <dev@dpdk.org>, <jerinj@marvell.com>, <ferruh.yigit@intel.com>
Cc: Shahed Shaikh <shshaikh@marvell.com>,
	<GR-Everest-DPDK-Dev@marvell.com>, <stable@dpdk.org>
Subject: [dpdk-dev] [PATCH 2/3] net/qede: fix to modify MTU update flow
Date: Sat, 19 Oct 2019 22:20:50 -0700	[thread overview]
Message-ID: <20191020052051.9905-2-rmody@marvell.com> (raw)
In-Reply-To: <20191020052051.9905-1-rmody@marvell.com>

From: Shahed Shaikh <shshaikh@marvell.com>

New MTU value is not propagated to vport in HW when MTU update request
is sent while ports are stopped.

This patch fixes the logic error for above mentioned condition.

Fixes: d121a6b5f781 ("net/qede: fix VF MTU update")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Reviewed-by: Rasesh Mody <rmody@marvell.com>
---
 drivers/net/qede/qede_ethdev.c | 8 +++++---
 drivers/net/qede/qede_ethdev.h | 1 +
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 53fdfde9a..42e2b5083 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1038,9 +1038,11 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev)
 	PMD_INIT_FUNC_TRACE(edev);
 
 	/* Update MTU only if it has changed */
-	if (eth_dev->data->mtu != qdev->mtu) {
-		if (qede_update_mtu(eth_dev, qdev->mtu))
+	if (qdev->new_mtu && qdev->new_mtu != qdev->mtu) {
+		if (qede_update_mtu(eth_dev, qdev->new_mtu))
 			goto err;
+		qdev->mtu = qdev->new_mtu;
+		qdev->new_mtu = 0;
 	}
 
 	/* Configure TPA parameters */
@@ -2248,7 +2250,7 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 		restart = true;
 	}
 	rte_delay_ms(1000);
-	qdev->mtu = mtu;
+	qdev->new_mtu = mtu;
 
 	/* Fix up RX buf size for all queues of the port */
 	for (i = 0; i < qdev->num_rx_queues; i++) {
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 21115a077..b988a73f2 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -225,6 +225,7 @@ struct qede_dev {
 	struct qede_fastpath *fp_array;
 	struct qede_fastpath_cmt *fp_array_cmt;
 	uint16_t mtu;
+	uint16_t new_mtu;
 	bool enable_tx_switching;
 	bool rss_enable;
 	struct rte_eth_rss_conf rss_conf;
-- 
2.18.0


  reply	other threads:[~2019-10-20  5:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20  5:20 [dpdk-dev] [PATCH 1/3] net/qede/base: fix for FW bug Rasesh Mody
2019-10-20  5:20 ` Rasesh Mody [this message]
2019-10-20  5:20 ` [dpdk-dev] [PATCH 3/3] net/qede: fix to set VLAN strip mode Rasesh Mody
2019-10-21 10:58 ` [dpdk-dev] [PATCH 1/3] net/qede/base: fix for FW bug Kevin Traynor
2019-10-30 11:25   ` Jerin Jacob

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=20191020052051.9905-2-rmody@marvell.com \
    --to=rmody@marvell.com \
    --cc=GR-Everest-DPDK-Dev@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.com \
    --cc=shshaikh@marvell.com \
    --cc=stable@dpdk.org \
    /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).