Skip to content

Commit

Permalink
net/bonding: fix offloading configuration
Browse files Browse the repository at this point in the history
[ upstream commit 57b1565 ]

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: e8b3e1a ("net/bonding: switch to new offloading API")

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
Chengchang Tang authored and bluca committed Feb 14, 2022
1 parent e93a5f4 commit 8d0afb3
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions drivers/net/bonding/rte_eth_bond_pmd.c
Expand Up @@ -1717,13 +1717,20 @@ 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 &
DEV_RX_OFFLOAD_VLAN_FILTER)
slave_eth_dev->data->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_VLAN_FILTER;
else
slave_eth_dev->data->dev_conf.rxmode.offloads &=
~DEV_RX_OFFLOAD_VLAN_FILTER;
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;
Expand Down

0 comments on commit 8d0afb3

Please sign in to comment.