DPDK patches and discussions
 help / color / mirror / Atom feed
* Bug in non-power-of-2 rings?
@ 2023-08-20  9:07 Morten Brørup
  2023-08-21  8:39 ` Bruce Richardson
  0 siblings, 1 reply; 4+ messages in thread
From: Morten Brørup @ 2023-08-20  9:07 UTC (permalink / raw)
  To: Bruce Richardson, honnappa.nagarahalli, konstantin.v.ananyev; +Cc: jerinj, dev

Bruce, Honnappa, Konstantin,

Back in 2017, Bruce added support for non-power-of-2 rings with this patch [1].

[1]: https://git.dpdk.org/dpdk/commit/lib/librte_ring/rte_ring.h?id=b74461155543430f5253e96ad6d413ebcad36693

I think that the calculation of "entries" in __rte_ring_move_cons_head() [2][3] is incorrect when the ring capacity is not power-of-2, because it is missing the capacity comparison you added to rte_ring_count() [4]. Please review if I'm mistaken.

[2]: https://elixir.bootlin.com/dpdk/v23.07/source/lib/ring/rte_ring_c11_pvt.h#L159
[3]: https://elixir.bootlin.com/dpdk/v23.07/source/lib/ring/rte_ring_generic_pvt.h#L150
[4]: https://elixir.bootlin.com/dpdk/v23.07/source/lib/ring/rte_ring.h#L502

-Morten


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-21  9:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-20  9:07 Bug in non-power-of-2 rings? Morten Brørup
2023-08-21  8:39 ` Bruce Richardson
2023-08-21  9:29   ` Konstantin Ananyev
2023-08-21  9:36     ` Morten Brørup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).