From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 236B8A0350; Thu, 27 Jan 2022 10:18:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8CA394277C; Thu, 27 Jan 2022 10:18:39 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id CEEBE4067C; Thu, 27 Jan 2022 10:18:37 +0100 (CET) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Jkvzz5ZdzzZfTd; Thu, 27 Jan 2022 17:14:39 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Thu, 27 Jan 2022 17:18:35 +0800 Subject: Re: [PATCH] net/bonding: fix MTU set for slaves To: Ferruh Yigit , Chas Williams , Ivan Ilchenko , Andrew Rybchenko CC: , , Andrew Rybchenko , References: <20220126131037.2403369-1-ferruh.yigit@intel.com> From: "Min Hu (Connor)" Message-ID: <24dfb8f2-6d56-e091-7b7d-b88e18121749@huawei.com> Date: Thu, 27 Jan 2022 17:18:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20220126131037.2403369-1-ferruh.yigit@intel.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Acked-by: Min Hu (Connor) ÔÚ 2022/1/26 21:10, Ferruh Yigit дµÀ: > 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 > --- > Cc: Andrew Rybchenko > 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]; >