* [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
@ 2015-11-03 17:26 Chas Williams
2015-11-24 13:42 ` Thomas Monjalon
0 siblings, 1 reply; 11+ messages in thread
From: Chas Williams @ 2015-11-03 17:26 UTC (permalink / raw)
To: dev
Signed-off-by: Chas Williams <3chas3@gmail.com>
---
drivers/net/bnx2x/bnx2x.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index fed7a06..76444eb 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2169,7 +2169,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf **m_head, int m_p
struct ether_hdr *eh
= rte_pktmbuf_mtod(m0, struct ether_hdr *);
- 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));
}
}
--
2.1.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
2015-11-03 17:26 [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16 Chas Williams
@ 2015-11-24 13:42 ` Thomas Monjalon
2015-12-01 21:53 ` Harish Patil
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2015-11-24 13:42 UTC (permalink / raw)
To: Harish Patil, Rasesh Mody; +Cc: dev
Anyone to review please?
2015-11-03 12:26, Chas Williams:
> Signed-off-by: Chas Williams <3chas3@gmail.com>
> ---
> drivers/net/bnx2x/bnx2x.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
> index fed7a06..76444eb 100644
> --- a/drivers/net/bnx2x/bnx2x.c
> +++ b/drivers/net/bnx2x/bnx2x.c
> @@ -2169,7 +2169,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf **m_head, int m_p
> struct ether_hdr *eh
> = rte_pktmbuf_mtod(m0, struct ether_hdr *);
>
> - 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));
> }
> }
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
2015-11-24 13:42 ` Thomas Monjalon
@ 2015-12-01 21:53 ` Harish Patil
2015-12-01 22:37 ` Stephen Hemminger
2015-12-06 21:55 ` Thomas Monjalon
0 siblings, 2 replies; 11+ messages in thread
From: Harish Patil @ 2015-12-01 21:53 UTC (permalink / raw)
To: Thomas Monjalon, Rasesh Mody; +Cc: dev
>
>Anyone to review please?
>
>2015-11-03 12:26, Chas Williams:
>> Signed-off-by: Chas Williams <3chas3@gmail.com>
>> ---
>> drivers/net/bnx2x/bnx2x.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
>> index fed7a06..76444eb 100644
>> --- a/drivers/net/bnx2x/bnx2x.c
>> +++ b/drivers/net/bnx2x/bnx2x.c
>> @@ -2169,7 +2169,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq,
>>struct rte_mbuf **m_head, int m_p
>> struct ether_hdr *eh
>> = rte_pktmbuf_mtod(m0, struct ether_hdr *);
>>
>> - 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));
>> }
>> }
>
>
Acked-by: Harish Patil <harish.patil@qlogic.com>
Minor question - any specific reason to use rte_be_to_cpu_16() on
ether_type alone before converting from native order to le16?
Thanks,
Harish
________________________________
This message and any attached documents contain information from the sending company or its parent company(s), subsidiaries, divisions or branch offices that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
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-06 21:55 ` Thomas Monjalon
1 sibling, 2 replies; 11+ messages in thread
From: Stephen Hemminger @ 2015-12-01 22:37 UTC (permalink / raw)
To: Harish Patil; +Cc: dev
On Tue, 1 Dec 2015 21:53:59 +0000
Harish Patil <harish.patil@qlogic.com> wrote:
> >
> >Anyone to review please?
> >
> >2015-11-03 12:26, Chas Williams:
> >> Signed-off-by: Chas Williams <3chas3@gmail.com>
> >> ---
> >> drivers/net/bnx2x/bnx2x.c | 3 ++-
> >> 1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
> >> index fed7a06..76444eb 100644
> >> --- a/drivers/net/bnx2x/bnx2x.c
> >> +++ b/drivers/net/bnx2x/bnx2x.c
> >> @@ -2169,7 +2169,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq,
> >>struct rte_mbuf **m_head, int m_p
> >> struct ether_hdr *eh
> >> = rte_pktmbuf_mtod(m0, struct ether_hdr *);
> >>
> >> - 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));
> >> }
> >> }
> >
> >
>
> Acked-by: Harish Patil <harish.patil@qlogic.com>
>
>
> 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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
2015-12-01 22:37 ` Stephen Hemminger
@ 2015-12-01 22:47 ` Harish Patil
2015-12-01 23:34 ` Thomas Monjalon
1 sibling, 0 replies; 11+ messages in thread
From: Harish Patil @ 2015-12-01 22:47 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
>
>On Tue, 1 Dec 2015 21:53:59 +0000
>Harish Patil <harish.patil@qlogic.com> wrote:
>
>> >
>> >Anyone to review please?
>> >
>> >2015-11-03 12:26, Chas Williams:
>> >> Signed-off-by: Chas Williams <3chas3@gmail.com>
>> >> ---
>> >> drivers/net/bnx2x/bnx2x.c | 3 ++-
>> >> 1 file changed, 2 insertions(+), 1 deletion(-)
>> >>
>> >> diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
>> >> index fed7a06..76444eb 100644
>> >> --- a/drivers/net/bnx2x/bnx2x.c
>> >> +++ b/drivers/net/bnx2x/bnx2x.c
>> >> @@ -2169,7 +2169,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq,
>> >>struct rte_mbuf **m_head, int m_p
>> >> struct ether_hdr *eh
>> >> = rte_pktmbuf_mtod(m0, struct
>>ether_hdr *);
>> >>
>> >> - 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));
>> >> }
>> >> }
>> >
>> >
>>
>> Acked-by: Harish Patil <harish.patil@qlogic.com>
>>
>>
>> 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.
>
Thanks. Yes the question was for second step, second step would be a no-op
on x86 - thanks for clarifying.
________________________________
This message and any attached documents contain information from the sending company or its parent company(s), subsidiaries, divisions or branch offices that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
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
1 sibling, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2015-12-01 23:34 UTC (permalink / raw)
To: Stephen Hemminger, Chas Williams; +Cc: dev
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
2015-12-01 23:34 ` Thomas Monjalon
@ 2015-12-01 23:58 ` Charles (Chas) Williams
2015-12-02 1:04 ` Thomas Monjalon
0 siblings, 1 reply; 11+ messages in thread
From: Charles (Chas) Williams @ 2015-12-01 23:58 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
2015-12-01 23:58 ` Charles (Chas) Williams
@ 2015-12-02 1:04 ` Thomas Monjalon
2015-12-02 10:18 ` Charles (Chas) Williams
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2015-12-02 1:04 UTC (permalink / raw)
To: Charles (Chas) Williams; +Cc: dev
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?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
2015-12-02 1:04 ` Thomas Monjalon
@ 2015-12-02 10:18 ` Charles (Chas) Williams
2015-12-02 10:44 ` Thomas Monjalon
0 siblings, 1 reply; 11+ messages in thread
From: Charles (Chas) Williams @ 2015-12-02 10:18 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
2015-12-02 10:18 ` Charles (Chas) Williams
@ 2015-12-02 10:44 ` Thomas Monjalon
0 siblings, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2015-12-02 10:44 UTC (permalink / raw)
To: Charles (Chas) Williams; +Cc: dev
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16
2015-12-01 21:53 ` Harish Patil
2015-12-01 22:37 ` Stephen Hemminger
@ 2015-12-06 21:55 ` Thomas Monjalon
1 sibling, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2015-12-06 21:55 UTC (permalink / raw)
To: Chas Williams; +Cc: dev
> >> Signed-off-by: Chas Williams <3chas3@gmail.com>
>
> Acked-by: Harish Patil <harish.patil@qlogic.com>
Applied, thanks
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-12-06 21:56 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-03 17:26 [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16 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
2015-12-06 21:55 ` Thomas Monjalon
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).