回复: [V11 13/18] net/hinic3: add dev ops

wangfeifei (J) wangfeifei40 at huawei.com
Fri Sep 19 09:57:17 CEST 2025


> +
> +/**
> + * Clear the reference to the copy memory pool without freeing it.
> + *
> + * @param[in] nic_dev
> + * Pointer to NIC device structure.
> + */
> +static void
> +hinic3_copy_mempool_uninit(struct hinic3_nic_dev *nic_dev)
> +{
> +	nic_dev->cpy_mpool = NULL;
> +}
> +
> +/**
[Feifei] Hi,Stephen. 
For cpy mbuf, we do not change this in this version. Reasons are as follows:

For Huawei SPx NIC, one mtu pkt seg max is 38.
1. in no tso case, we can use 'nb_mtu_seg_max = 38'  to restrict user not to use much nb segs. 
2. in tso case, Huawei SPx NIC can support 127 segs with each continuous 38 segs total_length must be more than MTU.

Thus there will be a case, users give driver a mbuf chain with 127 segs, but each seg size is very small (first 38 seg pkt length is less than MTU), and he/she open tso offload.
Then in tso mode, Huawei SPx NIC start processing pkts when the total_length reach MTU length.

When it process first MTU packet, it find first 38 seg pkts length is less than MTU, to make the packet total length achieve MTU size, an extra cpy mbuf is needed to replace the 38th mbuf,
Driver will continue to copy subsequent seg pkts to this copy mbuf until total length more than MTU size. 


More information about the dev mailing list