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 9E928A04A8; Wed, 26 Jan 2022 14:10:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D70E442733; Wed, 26 Jan 2022 14:10:43 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 8A82042716; Wed, 26 Jan 2022 14:10:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643202642; x=1674738642; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=FVShNabOlgI5h20ZXKvjkozmif8IIXFw3iN86krhbD8=; b=fQ2nEjXR8ZqTKAx6HlHTZ3pHQ6M1cibJswJtZkveGzBGE05YiB7ZDQ5N tSRSVw73EiNIoxJKUQt0qUBgziRMaNA25KiOUTIce3/NaWhWRjLQdXpdD KHbyvHzfAKCJgbOhMWp8AM1efkQLZbc3bmdyKVJw4B+8EgIB3EObKPb0u /W4M8PbisvFIei5gioDGsXF+xHiGX5vTa2GebVJf3eSG4gvFLDLUm+zn4 di5JYCdp2cem1Lqew6Fj37R+NFNsY1T98HivuJtbWYyRusKF1CPOgDYAL o1+hSgAhPIuvXgMtbu9zuoW82rf5rsY6yuxk/+ewnBbeeI47ZFVCKnEw5 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="246323356" X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208";a="246323356" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 05:10:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208";a="477476117" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.27]) by orsmga003.jf.intel.com with ESMTP; 26 Jan 2022 05:10:39 -0800 From: Ferruh Yigit To: Chas Williams , "Min Hu (Connor)" , Ivan Ilchenko , Andrew Rybchenko Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org, Andrew Rybchenko , yux.jiang@intel.com Subject: [PATCH] net/bonding: fix MTU set for slaves Date: Wed, 26 Jan 2022 13:10:37 +0000 Message-Id: <20220126131037.2403369-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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]; -- 2.34.1