DPDK patches and discussions
 help / color / mirror / Atom feed
From: Aditya Ambadipudi <Aditya.Ambadipudi@arm.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: Question about loop unrolling in rte_ring datastructure.
Date: Mon, 13 Nov 2023 18:14:53 +0000	[thread overview]
Message-ID: <PAVPR08MB9185BCDC0DDF8CB6FB4AAD88EFB3A@PAVPR08MB9185.eurprd08.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1512 bytes --]

Hello all.

My name is Aditya Ambadipudi. I am not the sharpest tool in the shed.

I was reading through the rte_ring datastructure. And I have two questions about the optimizations that are being made there.


  1.  Loop unrolling:
https://github.com/DPDK/dpdk/blob/main/lib/ring/rte_ring_elem_pvt.h#L28-L35
Why are we unrolling these loops manually. GCC will generate SIMD instructions for these loops automatically. Irrespective of wheither or not we unroll the loops

Unrolled loop: https://godbolt.org/z/n97noqYn7
Regular loop:https://godbolt.org/z/h6G9o9773

This is true of both x86 and ARM.

  2.  Normalizing to few fixed types:

It looks like we separate out enqueue/dequeue operations into 3 functions. One for each element size 32, 64, 128.

Again I am not clear on why we are doing this. Both 128 & 64 are multiples of 32. Why can't we just normalize everything to 32?

I feel like this is in some shape or form related to loop unrolling. But I am not able to figure it out on my own.

I am working on a patch that is closely related to this. And I would greatly appreciate any assistance anyone can provide on this.

Thank you,
Aditya Ambadipudi
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[-- Attachment #2: Type: text/html, Size: 4324 bytes --]

             reply	other threads:[~2023-11-14  7:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13 18:14 Aditya Ambadipudi [this message]
2023-11-14  8:26 ` Morten Brørup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PAVPR08MB9185BCDC0DDF8CB6FB4AAD88EFB3A@PAVPR08MB9185.eurprd08.prod.outlook.com \
    --to=aditya.ambadipudi@arm.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).