DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Chas Williams <chas3@att.com>,
	"Min Hu (Connor)" <humin29@huawei.com>,
	Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Cc: dev@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>,
	stable@dpdk.org, Andrew Rybchenko <arybchenko@solarflare.com>,
	yux.jiang@intel.com
Subject: [PATCH] net/bonding: fix MTU set for slaves
Date: Wed, 26 Jan 2022 13:10:37 +0000	[thread overview]
Message-ID: <20220126131037.2403369-1-ferruh.yigit@intel.com> (raw)

ethdev requires device to be configured before setting MTU.

In bonding PMD, while configuring slaves, bonding first sets MTU later
configures them, which causes failure if slaves are not configured in
advance.

Fixing by changing the order in slave configure as requested in ethdev
layer, configure first and set MTU later.

Bugzilla ID: 864
Fixes: b26bee10ee37 ("ethdev: forbid MTU set before device configure")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Andrew Rybchenko <arybchenko@solarflare.com>
Cc: yux.jiang@intel.com
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 9607141b393e..6fd52035c9a8 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1741,14 +1741,6 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 		}
 	}
 
-	errval = rte_eth_dev_set_mtu(slave_eth_dev->data->port_id,
-				     bonded_eth_dev->data->mtu);
-	if (errval != 0 && errval != -ENOTSUP) {
-		RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)",
-				slave_eth_dev->data->port_id, errval);
-		return errval;
-	}
-
 	/* Configure device */
 	errval = rte_eth_dev_configure(slave_eth_dev->data->port_id,
 			nb_rx_queues, nb_tx_queues,
@@ -1759,6 +1751,14 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 		return errval;
 	}
 
+	errval = rte_eth_dev_set_mtu(slave_eth_dev->data->port_id,
+				     bonded_eth_dev->data->mtu);
+	if (errval != 0 && errval != -ENOTSUP) {
+		RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)",
+				slave_eth_dev->data->port_id, errval);
+		return errval;
+	}
+
 	/* Setup Rx Queues */
 	for (q_id = 0; q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) {
 		bd_rx_q = (struct bond_rx_queue *)bonded_eth_dev->data->rx_queues[q_id];
-- 
2.34.1


             reply	other threads:[~2022-01-26 13:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 13:10 Ferruh Yigit [this message]
2022-01-27  4:07 ` Jiang, YuX
2022-01-27  9:18 ` Min Hu (Connor)
2022-02-01 11:44   ` Ferruh Yigit

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=20220126131037.2403369-1-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=arybchenko@solarflare.com \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=humin29@huawei.com \
    --cc=ivan.ilchenko@oktetlabs.ru \
    --cc=stable@dpdk.org \
    --cc=yux.jiang@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).