On Sun, Oct 20, 2019 at 07:23:00PM -0500, Honnappa Nagarahalli wrote: > Improved copy function to copy to/from ring elements. > > Signed-off-by: Honnappa Nagarahalli <honnappa.nagaraha...@arm.com> > Signed-off-by: Konstantin Ananyev <konstantin.anan...@intel.com> > --- > lib/librte_ring/rte_ring_elem.h | 165 ++++++++++++++++---------------- > 1 file changed, 84 insertions(+), 81 deletions(-)
(...) > +static __rte_always_inline void > +copy_elems(uint32_t du32[], const uint32_t su32[], uint32_t nr_num) > +{ > + uint32_t i; > + > + for (i = 0; i < (nr_num & ~7); i += 8) > + memcpy(du32 + i, su32 + i, 8 * sizeof(uint32_t)); > + > + switch (nr_num & 7) { > + case 7: du32[nr_num - 7] = su32[nr_num - 7]; /* fallthrough */ > + case 6: du32[nr_num - 6] = su32[nr_num - 6]; /* fallthrough */ > + case 5: du32[nr_num - 5] = su32[nr_num - 5]; /* fallthrough */ > + case 4: du32[nr_num - 4] = su32[nr_num - 4]; /* fallthrough */ > + case 3: du32[nr_num - 3] = su32[nr_num - 3]; /* fallthrough */ > + case 2: du32[nr_num - 2] = su32[nr_num - 2]; /* fallthrough */ > + case 1: du32[nr_num - 1] = su32[nr_num - 1]; /* fallthrough */ > + } > +} minor comment: I suggest src32 and dst32 instead of su32 and du32.