DPDK patches and discussions
 help / color / mirror / Atom feed
* rte_ring_elem_pvt historical question
@ 2022-07-04 11:35 Morten Brørup
  2022-07-05  8:54 ` Konstantin Ananyev
  0 siblings, 1 reply; 3+ messages in thread
From: Morten Brørup @ 2022-07-04 11:35 UTC (permalink / raw)
  To: dev

Does anyone here remember why the __rte_ring_enqueue/dequeue_elems_64/128() functions support unaligned object arrays, when the __rte_ring_enqueue/dequeue_elems_32() functions require 4 byte aligned object arrays?

I'm wondering if the compiler could do better with a simpler implementation than the manually implemented loop unrolls, and if the unalignment silliness would stand in the way.

Med venlig hilsen / Kind regards,
-Morten Brørup


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

* Re: rte_ring_elem_pvt historical question
  2022-07-04 11:35 rte_ring_elem_pvt historical question Morten Brørup
@ 2022-07-05  8:54 ` Konstantin Ananyev
  2022-07-05 13:40   ` Morten Brørup
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Ananyev @ 2022-07-05  8:54 UTC (permalink / raw)
  To: Morten Brørup, dev

04/07/2022 12:35, Morten Brørup пишет:
> Does anyone here remember why the __rte_ring_enqueue/dequeue_elems_64/128() functions support unaligned object arrays, when the __rte_ring_enqueue/dequeue_elems_32() functions require 4 byte aligned object arrays?

As I remember, we added 'unaligned' to be able to use rte_ring with 
elements that might have smaller alignment.
For 32 - as I remember we never explicitly require 4B aligned
objects for the rings ... Am I missing something here?
My guess, we just never hit such problem so it gets unnoticed.
Probably worth updating 32-bit version too with explicit 'unaligned' type.


> 
> I'm wondering if the compiler could do better with a simpler implementation than the manually implemented loop unrolls, and if the unalignment silliness would stand in the way.
> 
> Med venlig hilsen / Kind regards,
> -Morten Brørup
> 


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

* RE: rte_ring_elem_pvt historical question
  2022-07-05  8:54 ` Konstantin Ananyev
@ 2022-07-05 13:40   ` Morten Brørup
  0 siblings, 0 replies; 3+ messages in thread
From: Morten Brørup @ 2022-07-05 13:40 UTC (permalink / raw)
  To: Konstantin Ananyev, dev

> From: Konstantin Ananyev [mailto:konstantin.v.ananyev@yandex.ru]
> Sent: Tuesday, 5 July 2022 10.55
> 
> 04/07/2022 12:35, Morten Brørup пишет:
> > Does anyone here remember why the
> __rte_ring_enqueue/dequeue_elems_64/128() functions support unaligned
> object arrays, when the __rte_ring_enqueue/dequeue_elems_32() functions
> require 4 byte aligned object arrays?
> 
> As I remember, we added 'unaligned' to be able to use rte_ring with
> elements that might have smaller alignment.

Was there a use case behind this, or just trying to future proof the ring library?

Using arrays of unaligned objects seems quite exotic to me.

> For 32 - as I remember we never explicitly require 4B aligned
> objects for the rings ... Am I missing something here?

Not related to my question; I was only referring to 32 to show the difference for the 64/128 functions.

> My guess, we just never hit such problem so it gets unnoticed.
> Probably worth updating 32-bit version too with explicit 'unaligned'
> type.

I would suggest doing the opposite, i.e. removing unaligned from 64/128, unless there is a real use case requiring unaligned elements.

Either way, we agree that it should be consistent across the 32-bit version too.

> >
> > I'm wondering if the compiler could do better with a simpler
> implementation than the manually implemented loop unrolls, and if the
> unalignment silliness would stand in the way.
> >
> > Med venlig hilsen / Kind regards,
> > -Morten Brørup
> >
> 


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

end of thread, other threads:[~2022-07-05 13:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 11:35 rte_ring_elem_pvt historical question Morten Brørup
2022-07-05  8:54 ` Konstantin Ananyev
2022-07-05 13:40   ` 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).