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 27603A0C4B; Tue, 9 Nov 2021 08:59:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC7F940687; Tue, 9 Nov 2021 08:59:36 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 2C98840151 for ; Tue, 9 Nov 2021 08:59:35 +0100 (CET) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HpL1B3m1BzZcsv; Tue, 9 Nov 2021 15:57:18 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) 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.15; Tue, 9 Nov 2021 15:59:30 +0800 From: "Min Hu (Connor)" To: CC: , Date: Tue, 9 Nov 2021 15:57:26 +0800 Message-ID: <20211109075726.59611-1-humin29@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] net/bonding: fix offloading configuration 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 Sender: "dev" From: Chengchang Tang Currently, part offloadings of the bonding device will not take effect by using dev_configure(). Because the related configuration will not be delivered to the slave devices in this way. The offloading capability of the bonding device is the intersection of the capability of all slave devices. Based on this, the following functions are added to the bonding driver: 1. If a Tx offloading is within the capability of the bonding device (i.e, all the slave devices support this Tx offloading), the enabling status of the offloading of all slave devices depends on the configuration of the bonding device. 2. For the Tx offloading that is not within the Tx offloading capability of the bonding device, the enabling status of the offloading on the slave devices is irrelevant to the bonding device configuration. And it depends on the original configuration of the slave devices. Fixes: e8b3e1a9b1bb ("net/bonding: switch to new offloading API") Cc: stable@dpdk.org Signed-off-by: Chengchang Tang Signed-off-by: Min Hu (Connor) --- drivers/net/bonding/rte_eth_bond_pmd.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 9bbe1291bc..5d7c25d2fb 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1713,17 +1713,24 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, bonded_eth_dev->data->dev_conf.rxmode.mq_mode; } - if (bonded_eth_dev->data->dev_conf.rxmode.offloads & - RTE_ETH_RX_OFFLOAD_VLAN_FILTER) - slave_eth_dev->data->dev_conf.rxmode.offloads |= - RTE_ETH_RX_OFFLOAD_VLAN_FILTER; - else - slave_eth_dev->data->dev_conf.rxmode.offloads &= - ~RTE_ETH_RX_OFFLOAD_VLAN_FILTER; - slave_eth_dev->data->dev_conf.rxmode.mtu = bonded_eth_dev->data->dev_conf.rxmode.mtu; + slave_eth_dev->data->dev_conf.txmode.offloads |= + bonded_eth_dev->data->dev_conf.txmode.offloads; + + slave_eth_dev->data->dev_conf.txmode.offloads &= + (bonded_eth_dev->data->dev_conf.txmode.offloads | + ~internals->tx_offload_capa); + + slave_eth_dev->data->dev_conf.rxmode.offloads |= + bonded_eth_dev->data->dev_conf.rxmode.offloads; + + slave_eth_dev->data->dev_conf.rxmode.offloads &= + (bonded_eth_dev->data->dev_conf.rxmode.offloads | + ~internals->rx_offload_capa); + + nb_rx_queues = bonded_eth_dev->data->nb_rx_queues; nb_tx_queues = bonded_eth_dev->data->nb_tx_queues; -- 2.33.0