DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Robin Jarry" <rjarry@redhat.com>,
	"Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
Cc: <dev@dpdk.org>, "Bruce Richardson" <bruce.richardson@intel.com>
Subject: RE: fib{,6}: questions and proposals
Date: Wed, 20 Mar 2024 08:45:39 +0100	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F30E@smartserver.smartshare.dk> (raw)
In-Reply-To: <CZY0LHKYV4ZO.YRBZ6C6GW6AI@redhat.com>

> From: Robin Jarry [mailto:rjarry@redhat.com]
> Sent: Tuesday, 19 March 2024 21.39
> 
> Hi Vladimir,
> 
> Medvedkin, Vladimir, Mar 19, 2024 at 18:16:

[...]

> > > 4) In rte_fib, every IPv4 address (route *and* next hop) needs to be
> > >    in host order. This is not consistent with fib6 where addresses
> > >    are stored in network order. It took me quite a while to figure
> > >    out what was wrong with my code.
> >
> > This API behavior was created in such a way that it is the same as
> > LPM.
> >
> > As for LPM, I think it was done this way for performance reasons
> > because in some scenarios you only working with the host order ipv4
> > addresses.
> 
> This should really be advertised in strong capital letters in the API
> docs. Or (preferably) hidden to the user. I don't see any valid scenario
> where you would work with host order IPv4 addresses.
> 
> Do you think we could change that API or at least add a flag at FIB/RIB
> creation to make it transparent to the user and consistent between IPv4
> and IPv6?

I agree that it's weird and inconsistent to work with IPv6 addrs in network order, and not do the same for IPv4 addrs.
We should treat IPv4 addrs like IPv6 addrs, instead of dragging around pre-IPv6 legacy host endian IPv4 addresses.
Using a mix of network order and host order for IPv4 addrs is likely to cause bugs.
I would love to see that fixed across all of DPDK, but I suppose API breakage prevents it. :-(


      reply	other threads:[~2024-03-20  7:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19  8:30 Robin Jarry
2024-03-19 17:16 ` Medvedkin, Vladimir
2024-03-19 20:38   ` Robin Jarry
2024-03-20  7:45     ` Morten Brørup [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=98CBD80474FA8B44BF855DF32C47DC35E9F30E@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=rjarry@redhat.com \
    --cc=vladimir.medvedkin@intel.com \
    /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).