[dpdk-dev] [PATCH] net: introduce big and little endian types

Wiles, Keith keith.wiles at intel.com
Tue Dec 6 15:06:32 CET 2016


> On Dec 5, 2016, at 6:06 AM, Nélio Laranjeiro <nelio.laranjeiro at 6wind.com> wrote:
> 
> On Mon, Dec 05, 2016 at 10:09:05AM +0000, Ananyev, Konstantin wrote:
>> Hi Neilo,
>> 
>>> 
>>> This commit introduces new rte_{le,be}{16,32,64}_t types and updates
>>> rte_{le,be,cpu}_to_{le,be,cpu}_*() and network header structures
>>> accordingly.
>>> 
>>> Specific big/little endian types avoid uncertainty and conversion mistakes.
>>> 
>>> No ABI change since these are simply typedefs to the original types.
>> 
>> It seems like quite a lot of changes...
>> Could you probably explain what will be the benefit in return?
>> Konstantin
> 
> Hi Konstantin,
> 
> The benefit is to provide documented byte ordering for data types
> software is manipulating to determine when network to CPU (or CPU to
> network) conversion must be performed.

Why can we not just document the variables with doxygen as to the BE or LE expected type. Adding a new type is not going to solve the problem of someone using it incorrectly. In the function header doc it should state the expected type.

Adding yet another type is just going to confuse people as some drivers or code may never get changed. Also some drivers are common to many other systems, which means we would have to move the typedefs over to those systems like Linux and FreeBSD for the common sections.

> 
> Regards,
> 
> -- 
> Nélio Laranjeiro
> 6WIND

Regards,
Keith



More information about the dev mailing list