DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Neil Horman" <nhorman@tuxdriver.com>,
	"Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"Wiles, Keith" <keith.wiles@intel.com>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
	"Olivier Matz" <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH] net: introduce big and little endian types
Date: Thu, 8 Dec 2016 15:10:51 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB9772583F0E5804@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <20161208150721.GB4657@hmsreliant.think-freely.org>



> -----Original Message-----
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Thursday, December 8, 2016 3:07 PM
> To: Nélio Laranjeiro <nelio.laranjeiro@6wind.com>
> Cc: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; Wiles,
> Keith <keith.wiles@intel.com>; Morten Brørup <mb@smartsharesystems.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Olivier Matz
> <olivier.matz@6wind.com>
> Subject: Re: [PATCH] net: introduce big and little endian types
> 
> On Thu, Dec 08, 2016 at 10:30:05AM +0100, Nélio Laranjeiro wrote:
> > Hi all,
> >
> > Following previous discussions, I would like to gather requirements for
> > v2, currently we have:
> >
> > 1. Introduction of new typedefs.
> > 2. Modification of network headers.
> > 3. Modification of rte_*_to_*() functions.
> >
> > Point 1. seems not to be an issue, everyone seems to agree on the fact
> > having those types could help to document some parts of the code.
> >
> No objection here
> 
> > Point 2. does not cause any ABI change as it is only a documentation
> > commit, not sure if anyone disagrees about this.
> >
> I have an objection here, and I think it was stated by others previously.  While
> its fine to offer endian encoded types so that developers can use them
> expediently, I don't like the idea of coding them into network headers
> specifically.  I assert that because network headers represent multiple views of
> network data (both network byte order if the data is taken off the wire and cpu
> byte order if its translated.  To implement such a network header change
> efficiently what you would need is something like the following:
> 
> struct rte_ip_network_hdr {
> 	rte_le_u32 dst;
> 	rte_le_u32 src;
> 	...
> };
> 
> struct rte_ip_cpu_hdr {
> 	rte_cpu_u32 dst;
> 	rte_cpu_u32 src;
> 	...
> };
> 
> where rte_cpu_* is defined to a big endian or little endian type based on the
> cpu being targeted.
> 
> Then of course you need to define translation macros to do all the appropriate
> conversions convieniently (or you need to do specific translations on the
> network byte order as needed, which may lead to lots of repeated conversions).
> Regardless, this seems to be unscalable. Endian types are the sort of thing that
> you should only use sparingly, not by default.

+1

> 
> > Point 3. documentation commit most people are uncomfortable with.
> > I propose to drop it from v2.
> >
> > Any objection to this plan?
> >
> > --
> > Nélio Laranjeiro
> > 6WIND
> >

      reply	other threads:[~2016-12-08 15:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 15:04 Nelio Laranjeiro
2016-12-05 10:09 ` Ananyev, Konstantin
2016-12-05 12:06   ` Nélio Laranjeiro
2016-12-06 11:23     ` Ananyev, Konstantin
2016-12-06 11:55       ` Bruce Richardson
2016-12-06 12:41         ` Ananyev, Konstantin
2016-12-06 13:34           ` Bruce Richardson
2016-12-06 14:45             ` Ananyev, Konstantin
2016-12-06 14:56               ` Wiles, Keith
2016-12-06 15:34                 ` Morten Brørup
2016-12-06 16:28                   ` Nélio Laranjeiro
2016-12-06 16:31                     ` Wiles, Keith
2016-12-06 16:36                       ` Richardson, Bruce
2016-12-06 17:00                     ` Ananyev, Konstantin
2016-12-06 17:29                       ` Neil Horman
2016-12-06 13:14         ` Nélio Laranjeiro
2016-12-06 13:30           ` Bruce Richardson
2016-12-06 14:06     ` Wiles, Keith
2016-12-08  9:30 ` Nélio Laranjeiro
2016-12-08 13:59   ` Wiles, Keith
2016-12-08 16:06     ` Thomas Monjalon
2016-12-08 15:07   ` Neil Horman
2016-12-08 15:10     ` Ananyev, Konstantin [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=2601191342CEEE43887BDE71AB9772583F0E5804@irsmsx105.ger.corp.intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.com \
    --cc=mb@smartsharesystems.com \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=nhorman@tuxdriver.com \
    --cc=olivier.matz@6wind.com \
    --cc=wenzhuo.lu@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).