[PATCH v2 06/15] net/zxdh: dev start/stop ops implementations
Stephen Hemminger
stephen at networkplumber.org
Fri Dec 13 22:05:41 CET 2024
On Tue, 10 Dec 2024 13:53:24 +0800
Junlong Wang <wang.junlong1 at zte.com.cn> wrote:
> v start/stop implementations, start/stop the rx/tx queues.
>
> Signed-off-by: Junlong Wang <wang.junlong1 at zte.com.cn>
> ---
If I re-enable the warnings for format and unaligned packed then this shows up:
../drivers/net/zxdh/zxdh_queue.c: In function ‘zxdh_dev_rx_queue_setup_finish’:
../drivers/net/zxdh/zxdh_queue.c:321:59: warning: taking address of packed member of ‘struct zxdh_virtnet_rx’ may result in an unaligned pointer value [-Waddress-of-packed-member]
321 | vq->sw_ring[vq->vq_nentries + desc_idx] = &rxvq->fake_mbuf;
| ^~~~~~~~~~~~~~~~
The problem is that the driver is using __rte_packed on structures like zxdh_virtnet_rx.
Unlike some other OS's. DPDK best practice is to only use packed where required
by the hardware. Please don't use __rte_packed unless needed.
To save space, it makes sense to reorder structure members to fill holes
and put hot members together for caching.
You should put fake_mbuf at the end and mark it with __rte_cache_aligned.
More information about the dev
mailing list