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 74EA9A0542; Fri, 28 Oct 2022 04:36:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5531C40223; Fri, 28 Oct 2022 04:36:22 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 146ED40146 for ; Fri, 28 Oct 2022 04:36:19 +0200 (CEST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Mz64F3sGMzVjKk; Fri, 28 Oct 2022 10:31:25 +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; Fri, 28 Oct 2022 10:36:15 +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; Fri, 28 Oct 2022 10:36:14 +0800 From: Huisong Li To: CC: , , , , Subject: [PATCH] net/bonding: fix slave device Rx/Tx offload configuration Date: Fri, 28 Oct 2022 10:36:46 +0800 Message-ID: <20221028023646.32585-1-lihuisong@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: dggems705-chm.china.huawei.com (10.3.19.182) 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 Normally, the Rx/Tx offload capability of bonding interface is the intersection of the capability of all slave devices. And Rx/Tx offloads configuration of slave device comes from bonding interface. But now there is a risk that slave device retains its previous offload configurations which is not within the offload configurations of bond interface. Fixes: 57b156540f51 ("net/bonding: fix offloading configuration") Cc: stable@dpdk.org Signed-off-by: Huisong Li --- drivers/net/bonding/rte_eth_bond_pmd.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index dc74852137..ca87490065 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1741,20 +1741,11 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, slave_eth_dev->data->dev_conf.link_speeds = bonded_eth_dev->data->dev_conf.link_speeds; - 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); + slave_eth_dev->data->dev_conf.txmode.offloads = + bonded_eth_dev->data->dev_conf.txmode.offloads; + slave_eth_dev->data->dev_conf.rxmode.offloads = + bonded_eth_dev->data->dev_conf.rxmode.offloads; nb_rx_queues = bonded_eth_dev->data->nb_rx_queues; nb_tx_queues = bonded_eth_dev->data->nb_tx_queues; -- 2.33.0