DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
To: Robin Jarry <rjarry@redhat.com>
Cc: Thomas Monjalon <thomas@monjalon.net>, <dev@dpdk.org>,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: Re: fib/rib: allow storing void * instead of nexthop index
Date: Wed, 31 Jul 2024 16:53:44 +0100	[thread overview]
Message-ID: <7bd3a529-fe59-421d-9399-a5b8d8804771@intel.com> (raw)
In-Reply-To: <D33TEQPTXPBU.1Z9S7W669X59U@redhat.com>

Hi Robin,


On 31/07/2024 16:04, Robin Jarry wrote:
> Hi Vladimir,
>
> I noticed that the fib/rib APIs (both IPv4 and IPv6) require the next 
> hops to be represented as integer indexes. Reading the code, I noticed 
> that they are stored as uint64_t with the MSB used for internal purposes.

I believe you are asking about FIB, not RIB. In current FIB 
implementation 1 LSB is used for internal purposes.


>
> This require either having a contiguous array of nexthop objects and 
> choose an index in that array,

As far as I know that's what most of "l3 forward" applications (aka 
routers) are doing, if they are interested in performance. Not only DPDK 
powered.


> or store pointer offsets as nexthop indexes and do pointer arithmetics 
> to reconstruct the real pointers. Both are not very practical and/or 
> hacky.
>
> Would it be possible to store arbitrary pointers? That would mean 
> moving that 64th bit information elsewhere.

For arbitrary pointer - no, since it needs to store 1 more bit for 
internal purpose. However, if you have 2 byte aligned pointer you can 
store the pointer shifted right by 1 bit, and after lookup just shift 
the result back.


>
> I'd love to hear what you think on the matter.
>
> Cheers,
> Robin
>
-- 
Regards,
Vladimir


      reply	other threads:[~2024-07-31 15:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 15:04 Robin Jarry
2024-07-31 15:53 ` Medvedkin, Vladimir [this message]

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=7bd3a529-fe59-421d-9399-a5b8d8804771@intel.com \
    --to=vladimir.medvedkin@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=rjarry@redhat.com \
    --cc=thomas@monjalon.net \
    /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).