> From: Bruce Richardson [mailto:bruce.richard...@intel.com]
> Sent: Friday, 22 August 2025 19.07
> 
> Rather than calling the mempool function rte_mempool_get_bulk we update
> the code to use the mbuf function rte_mbuf_raw_alloc_bulk, which
> properly supports debug flags and checks - when enabled.
> 
> Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>

Acked-by: Morten Brørup <m...@smartsharesystems.com>

With a slightly unrelated comment inline below.

> ---
> 
> diff --git a/drivers/net/intel/common/rx_vec_arm.h
> b/drivers/net/intel/common/rx_vec_arm.h
> index 2e48d4b6c0..f7e7b8c396 100644
> --- a/drivers/net/intel/common/rx_vec_arm.h
> +++ b/drivers/net/intel/common/rx_vec_arm.h
> @@ -16,19 +16,19 @@
>  static inline int
>  _ci_rxq_rearm_get_bufs(struct ci_rx_queue *rxq)
>  {
> -     struct ci_rx_entry *rxp = &rxq->sw_ring[rxq->rxrearm_start];
> +     struct rte_mbuf **rxp = &rxq->sw_ring[rxq->rxrearm_start].mbuf;

A comment not directly related to this patch, and something I noticed before 
without mentioning it...

The "ci_rx_entry" is defined as follows [1]:
struct ci_rx_entry {
        struct rte_mbuf *mbuf; /* mbuf associated with RX descriptor. */
};

Which makes it equivalent to an mbuf pointer.
Type casting an array of "struct ci_rx_entry" to an array of "struct rte_mbuf 
*" relies on the "struct ci_rx_entry" not having any more fields.
Having this extra (technically superfluous) wrapper makes it somewhat difficult 
to review the code, and requires more type casting.
I suppose there are good reasons for having this extra wrapper. (Perhaps 
something like the reason for the rte_atomic32_t type being a struct with an 
integer counter field, instead of a simple typedef.)

Anyway, for the benefit of the reviewer, you should consider adding a 
"static_assert(sizeof(struct ci_rx_entry) == sizeof(struct rte_mbuf *))" and a 
comment when you do this type casting.

[1]: 
https://elixir.bootlin.com/dpdk/v25.07/source/drivers/net/intel/common/rx.h#L25

Reply via email to