[PATCH v5] net/bonding: call Tx prepare before Tx burst

Andrew Rybchenko andrew.rybchenko at oktetlabs.ru
Thu Oct 20 09:07:37 CEST 2022


On 10/15/22 18:26, Chas Williams wrote:
> On 10/11/22 09:20, Chengwen Feng wrote:
>> Normally, to use the HW offloads capability (e.g. checksum and TSO) in
>> the Tx direction, the application needs to call rte_eth_tx_prepare() to
>> do some adjustment with the packets before sending them. But the
>> tx_prepare callback of the bonding driver is not implemented. Therefore,
>> the sent packets may have errors (e.g. checksum errors).
>>
>> However, it is difficult to design the tx_prepare callback for bonding
>> driver. Because when a bonded device sends packets, the bonded device
>> allocates the packets to different slave devices based on the real-time
>> link status and bonding mode. That is, it is very difficult for the
>> bonded device to determine which slave device's prepare function should
>> be invoked.
>>
>> So in this patch, the tx_prepare callback of bonding driver is not
>> implemented. Instead, the rte_eth_tx_prepare() will be called before
>> rte_eth_tx_burst(). In this way, all tx_offloads can be processed
>> correctly for all NIC devices.
>>
>> Note: because it is rara that bond different PMDs together, so just
>> call tx-prepare once in broadcast bonding mode.
>>
>> Also the following description was added to the rte_eth_tx_burst()
>> function:
>> "@note This function must not modify mbufs (including packets data)
>> unless the refcnt is 1. The exception is the bonding PMD, which does not
>> have tx-prepare function, in this case, mbufs maybe modified."
>>
>> Signed-off-by: Chengchang Tang <tangchengchang at huawei.com>
>> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
>> Reviewed-by: Min Hu (Connor) <humin29 at huawei.com>
>>
>> ---
>> v5: address Chas's comments.
>> v4: address Chas and Konstantin's comments.
>> v3: support tx-prepare when Tx internal generate mbufs.
>> v2: support tx-prepare enable flag and fail stats.
 >
 > This looks fine. Thanks for making the changes!
 >
 > Signed-off-by: Chas Williams <3chas3 at gmail.com>

Treat it as
Acked-by: Chas Williams <3chas3 at gmail.com>

Applied to dpdk-next-net/main, thanks.




More information about the dev mailing list