From: "Min Hu (Connor)" <humin29@huawei.com> To: <dev@dpdk.org> Cc: <ferruh.yigit@intel.com>, <thomas@monjalon.net> Subject: [dpdk-dev] [PATCH] net/bonding: fix offloading configuration Date: Tue, 9 Nov 2021 15:57:26 +0800 Message-ID: <20211109075726.59611-1-humin29@huawei.com> (raw) From: Chengchang Tang <tangchengchang@huawei.com> 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 <tangchengchang@huawei.com> Signed-off-by: Min Hu (Connor) <humin29@huawei.com> --- 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
next reply other threads:[~2021-11-09 7:59 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-09 7:57 Min Hu (Connor) [this message] 2022-01-14 12:13 ` Ferruh Yigit
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20211109075726.59611-1-humin29@huawei.com \ --to=humin29@huawei.com \ --cc=dev@dpdk.org \ --cc=ferruh.yigit@intel.com \ --cc=thomas@monjalon.net \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
DPDK patches and discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \ dev@dpdk.org public-inbox-index dev Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.dev AGPL code for this site: git clone https://public-inbox.org/public-inbox.git