From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: "Charles (Chas) Williams" <3chas3@gmail.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
Date: Wed, 02 Dec 2015 11:44:38 +0100 [thread overview]
Message-ID: <2551799.Q5hrDerVeS@xps13> (raw)
In-Reply-To: <1449051535.2645.49.camel@gmail.com>
2015-12-02 05:18, Charles Williams:
> On Wed, 2015-12-02 at 02:04 +0100, Thomas Monjalon wrote:
> > 2015-12-01 18:58, Charles Williams:
> > > On Wed, 2015-12-02 at 00:34 +0100, Thomas Monjalon wrote:
> > > > 2015-12-01 14:37, Stephen Hemminger:
> > > > > Harish Patil <harish.patil@qlogic.com> wrote:
> > > > > > >2015-11-03 12:26, Chas Williams:
> > > > > > >> --- a/drivers/net/bnx2x/bnx2x.c
> > > > > > >> +++ b/drivers/net/bnx2x/bnx2x.c
> > > > > > >> - tx_start_bd->vlan_or_ethertype = eh->ether_type;
> > > > > > >> + tx_start_bd->vlan_or_ethertype
> > > > > > >> + = rte_cpu_to_le_16(rte_be_to_cpu_16(eh->ether_type));
> > > > > >
> > > > > > Minor question - any specific reason to use rte_be_to_cpu_16() on
> > > > > > ether_type alone before converting from native order to le16?
> > > > >
> > > > > ether_type is in network byte order (big endian)
> > > > > and hardware wants little endian. On x86 the second step is a nop.
> > > >
> > > > Doesn't it deserve a macro rte_ntole16()?
> > > > It may be in lib/librte_eal/common/include/generic/rte_byteorder.h.
> > >
> > > I looked I didn't see anything. This value, according to the linux
> > > driver, wants to be little endian regardless of the host endian.
> >
> > Yes, that's why I suggest to create some macros to do this kind of conversion.
> > Example: rte_ntole16 means "network to little endian 16-bit".
> > Do you think it would be clearer to use?
>
> This is the only example of this kind of conversion in the source code
> so it would be a macro for one user. If you create rte_ntole16() you
> might feel obligated to create the various permutations for which there
> are no consumers.
Yes, that's why I was not sure of the interest.
next prev parent reply other threads:[~2015-12-02 10:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 17:26 Chas Williams
2015-11-24 13:42 ` Thomas Monjalon
2015-12-01 21:53 ` Harish Patil
2015-12-01 22:37 ` Stephen Hemminger
2015-12-01 22:47 ` Harish Patil
2015-12-01 23:34 ` Thomas Monjalon
2015-12-01 23:58 ` Charles (Chas) Williams
2015-12-02 1:04 ` Thomas Monjalon
2015-12-02 10:18 ` Charles (Chas) Williams
2015-12-02 10:44 ` Thomas Monjalon [this message]
2015-12-06 21:55 ` Thomas Monjalon
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=2551799.Q5hrDerVeS@xps13 \
--to=thomas.monjalon@6wind.com \
--cc=3chas3@gmail.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).