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 8EBC7A034F for ; Tue, 1 Mar 2022 11:44:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 84397426DD; Tue, 1 Mar 2022 11:44:45 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id D0661407FF for ; Tue, 1 Mar 2022 11:44:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646131483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d5lo5L2EkPNPlZTU9lFX0P5zgoqaO/ErZ8szif/m+uk=; b=G0Ih+XJinm9bHKm06+QIqUowjWTJ8+4V+MWT/t/jGKwBIrlJe064Bs/duuDGCX4HfroV0z ZgFudxsn32HX7VgLpkLAHdIiJrQCXpyafO6c7Odm63OI4F3b/K/GxodsbDTBkS7eFMJ24/ ayTHPBG49a1BTWjc5zoJhorM2c6WnoI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-401-JjBqxW5IOySpZtYyNnjXJA-1; Tue, 01 Mar 2022 05:44:40 -0500 X-MC-Unique: JjBqxW5IOySpZtYyNnjXJA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DDB3451DC; Tue, 1 Mar 2022 10:44:38 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id A759F6FB02; Tue, 1 Mar 2022 10:44:36 +0000 (UTC) From: Kevin Traynor To: Junjie Wan Cc: Ferruh Yigit , Min Hu , dpdk stable Subject: patch 'net/bonding: fix slaves initializing on MTU setting' has been queued to stable release 21.11.1 Date: Tue, 1 Mar 2022 10:41:59 +0000 Message-Id: <20220301104300.334382-43-ktraynor@redhat.com> In-Reply-To: <20220301104300.334382-1-ktraynor@redhat.com> References: <20220301104300.334382-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/06/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/387187932f2b578f1a714ce06d099358a72b54b2 Thanks. Kevin --- >From 387187932f2b578f1a714ce06d099358a72b54b2 Mon Sep 17 00:00:00 2001 From: Junjie Wan Date: Tue, 15 Feb 2022 18:59:40 +0800 Subject: [PATCH] net/bonding: fix slaves initializing on MTU setting [ upstream commit b3eaaf1d08ec70646bdd69416253dfb355480492 ] If a initial process for the bonding device is like: rte_eth_dev_configure rte_eth_dev_set_mtu queue setup and start, etc. Pass the vdev args to application, and init bonding device only. -a 0000:af:00.0 --vdev="net_bonding0,mode=2,slave=0000:af:00.0" It will fail and complain for the slave device "Port 0 must be configured before MTU set" Test can be reproduced with ovs. Fixes: b26bee10ee37 ("ethdev: forbid MTU set before device configure") Signed-off-by: Junjie Wan Tested-by: Ferruh Yigit Acked-by: Min Hu (Connor) --- app/test/test_link_bonding.c | 4 +++ app/test/test_link_bonding_rssconf.c | 4 +++ drivers/net/bonding/eth_bond_private.h | 4 +++ drivers/net/bonding/rte_eth_bond_api.c | 6 ++++ drivers/net/bonding/rte_eth_bond_pmd.c | 43 ++++++++++++++++++++++---- 5 files changed, 55 insertions(+), 6 deletions(-) diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c index dc6fc46b9c..12c50ef393 100644 --- a/app/test/test_link_bonding.c +++ b/app/test/test_link_bonding.c @@ -182,4 +182,8 @@ configure_ethdev(uint16_t port_id, uint8_t start, uint8_t en_isr) "rte_eth_dev_configure for port %d failed", port_id); + int ret = rte_eth_dev_set_mtu(port_id, 1550); + RTE_TEST_ASSERT(ret == 0 || ret == -ENOTSUP, + "rte_eth_dev_set_mtu for port %d failed", port_id); + for (q_id = 0; q_id < test_params->nb_rx_q; q_id++) TEST_ASSERT_SUCCESS(rte_eth_rx_queue_setup(port_id, q_id, RX_RING_SIZE, diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c index f9eae93973..7228965ced 100644 --- a/app/test/test_link_bonding_rssconf.c +++ b/app/test/test_link_bonding_rssconf.c @@ -129,4 +129,8 @@ configure_ethdev(uint16_t port_id, struct rte_eth_conf *eth_conf, port_id); + int ret = rte_eth_dev_set_mtu(port_id, 1550); + RTE_TEST_ASSERT(ret == 0 || ret == -ENOTSUP, + "rte_eth_dev_set_mtu for port %d failed", port_id); + for (rxq = 0; rxq < RXTX_QUEUE_COUNT; rxq++) { TEST_ASSERT(rte_eth_rx_queue_setup(port_id, rxq, RXTX_RING_SIZE, diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h index 156335c425..8222e3cd38 100644 --- a/drivers/net/bonding/eth_bond_private.h +++ b/drivers/net/bonding/eth_bond_private.h @@ -247,4 +247,8 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, struct rte_eth_dev *slave_eth_dev); +int +slave_start(struct rte_eth_dev *bonded_eth_dev, + struct rte_eth_dev *slave_eth_dev); + void slave_remove(struct bond_dev_private *internals, diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 8840d9e17b..919c580fb8 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -567,4 +567,10 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) return -1; } + if (slave_start(bonded_eth_dev, slave_eth_dev) != 0) { + internals->slave_count--; + RTE_BOND_LOG(ERR, "rte_bond_slaves_start: port=%d", + slave_port_id); + return -1; + } } diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index bfa931098e..58dad0a0e3 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1679,12 +1679,8 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, struct rte_eth_dev *slave_eth_dev) { - struct bond_rx_queue *bd_rx_q; - struct bond_tx_queue *bd_tx_q; uint16_t nb_rx_queues; uint16_t nb_tx_queues; int errval; - uint16_t q_id; - struct rte_flow_error flow_error; struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; @@ -1759,4 +1755,17 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, return errval; } + return 0; +} + +int +slave_start(struct rte_eth_dev *bonded_eth_dev, + struct rte_eth_dev *slave_eth_dev) +{ + int errval = 0; + struct bond_rx_queue *bd_rx_q; + struct bond_tx_queue *bd_tx_q; + uint16_t q_id; + struct rte_flow_error flow_error; + struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; /* Setup Rx Queues */ @@ -1807,8 +1816,11 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, } - if (internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id] != NULL) - rte_flow_destroy(slave_eth_dev->data->port_id, + if (internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id] != NULL) { + errval = rte_flow_destroy(slave_eth_dev->data->port_id, internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id], &flow_error); + RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_destroy: port=%d, err (%d)", + slave_eth_dev->data->port_id, errval); + } errval = bond_ethdev_8023ad_flow_set(bonded_eth_dev, @@ -2002,4 +2014,11 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) goto out_err; } + if (slave_start(eth_dev, slave_ethdev) != 0) { + RTE_BOND_LOG(ERR, + "bonded port (%d) failed to start slave device (%d)", + eth_dev->data->port_id, + internals->slaves[i].port_id); + goto out_err; + } /* We will need to poll for link status if any slave doesn't * support interrupts @@ -3848,4 +3867,16 @@ bond_ethdev_configure(struct rte_eth_dev *dev) } + /* configure slaves so we can pass mtu setting */ + for (i = 0; i < internals->slave_count; i++) { + struct rte_eth_dev *slave_ethdev = + &(rte_eth_devices[internals->slaves[i].port_id]); + if (slave_configure(dev, slave_ethdev) != 0) { + RTE_BOND_LOG(ERR, + "bonded port (%d) failed to configure slave device (%d)", + dev->data->port_id, + internals->slaves[i].port_id); + return -1; + } + } return 0; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-01 10:41:02.474376869 +0000 +++ 0043-net-bonding-fix-slaves-initializing-on-MTU-setting.patch 2022-03-01 10:41:01.320244101 +0000 @@ -1 +1 @@ -From b3eaaf1d08ec70646bdd69416253dfb355480492 Mon Sep 17 00:00:00 2001 +From 387187932f2b578f1a714ce06d099358a72b54b2 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b3eaaf1d08ec70646bdd69416253dfb355480492 ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org @@ -34 +35 @@ -index 82a9b8e01a..194ed5a7ec 100644 +index dc6fc46b9c..12c50ef393 100644 @@ -73 +74 @@ -index b78867b125..4ac191c468 100644 +index 8840d9e17b..919c580fb8 100644 @@ -88 +89 @@ -index 846a131916..b305b6a35b 100644 +index bfa931098e..58dad0a0e3 100644 @@ -148 +149 @@ -@@ -3849,4 +3868,16 @@ bond_ethdev_configure(struct rte_eth_dev *dev) +@@ -3848,4 +3867,16 @@ bond_ethdev_configure(struct rte_eth_dev *dev)