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 33224A0093; Wed, 9 Nov 2022 03:22:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 191D5400D7; Wed, 9 Nov 2022 03:22:16 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id C45A4400D4 for ; Wed, 9 Nov 2022 03:22:11 +0100 (CET) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4N6THl4v9WzmVRH; Wed, 9 Nov 2022 10:21:55 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 9 Nov 2022 10:22:08 +0800 Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 9 Nov 2022 10:22:07 +0800 From: Huisong Li To: CC: , , <3chas3@gmail.com>, , , , , Subject: [PATCH V2] net/bonding: fix bond3 and bond4 process mbuf fast free Date: Wed, 9 Nov 2022 10:22:37 +0800 Message-ID: <20221109022237.49757-1-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221108084038.25136-1-lihuisong@huawei.com> References: <20221108084038.25136-1-lihuisong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600004.china.huawei.com (7.193.23.242) 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 The RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE offload can't be used in bonding mode Broadcast and mode 8023AD. Currently, bonding driver forcibly removes from the dev->data->dev_conf.txmode.offloads and processes as success in bond_ethdev_configure(). But this still cause that rte_eth_dev_configure() fails to execute because of the failure of validating Tx offload in the eth_dev_validate_offloads(). So this patch moves the modification of txmode offlaods to the stage of adding slave device to report the correct txmode offloads. Fixes: 18c41457cbae ("net/bonding: fix mbuf fast free usage") Cc: stable@dpdk.org Signed-off-by: Huisong Li --- -v2: report the correct txmode offloads based on bonding mode in the bonding driver, and not in testpmd. --- drivers/net/bonding/rte_eth_bond_api.c | 5 +++++ drivers/net/bonding/rte_eth_bond_pmd.c | 11 ----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 694fe86115..c0178369b4 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -544,6 +544,11 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) return ret; } + /* Bond mode Broadcast & 8023AD don't support MBUF_FAST_FREE offload. */ + if (internals->mode == BONDING_MODE_8023AD || + internals->mode == BONDING_MODE_BROADCAST) + internals->tx_offload_capa &= ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; + bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &= internals->flow_type_rss_offloads; diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 864e073db8..2efaad1e8e 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -3643,7 +3643,6 @@ bond_ethdev_configure(struct rte_eth_dev *dev) const char *name = dev->device->name; struct bond_dev_private *internals = dev->data->dev_private; struct rte_kvargs *kvlist = internals->kvlist; - uint64_t offloads; int arg_count; uint16_t port_id = dev - rte_eth_devices; uint32_t link_speeds; @@ -3708,16 +3707,6 @@ bond_ethdev_configure(struct rte_eth_dev *dev) } } - offloads = dev->data->dev_conf.txmode.offloads; - if ((offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) && - (internals->mode == BONDING_MODE_8023AD || - internals->mode == BONDING_MODE_BROADCAST)) { - RTE_BOND_LOG(WARNING, - "bond mode broadcast & 8023AD don't support MBUF_FAST_FREE offload, force disable it."); - offloads &= ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; - dev->data->dev_conf.txmode.offloads = offloads; - } - link_speeds = dev->data->dev_conf.link_speeds; /* * The default value of 'link_speeds' is zero. From its definition, -- 2.33.0