On Tue, 10 Dec 2024 13:53:24 +0800
Junlong Wang <wang.junlo...@zte.com.cn> wrote:

> v start/stop implementations, start/stop the rx/tx queues.
> 
> Signed-off-by: Junlong Wang <wang.junlo...@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.


Reply via email to