[dpdk-dev,1/2] net: fix ESP header byte ordering definition

Message ID e3a23acbc34bf1a632a32a56580cb403644ca268.1515662067.git.nelio.laranjeiro@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Nélio Laranjeiro Jan. 11, 2018, 9:15 a.m. UTC
  ESP header is defined in the RFC2406 [1] as Big Endian fields it should use
the corresponding types in DPDK as well.

Fixes: d4b684f7197a ("net: add ESP header to generic flow steering")
Cc: borisp@mellanox.com

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

[1] https://tools.ietf.org/html/rfc2406
---
 lib/librte_net/rte_esp.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Olivier Matz Jan. 16, 2018, 2:24 p.m. UTC | #1
On Thu, Jan 11, 2018 at 10:15:58AM +0100, Nelio Laranjeiro wrote:
> ESP header is defined in the RFC2406 [1] as Big Endian fields it should use
> the corresponding types in DPDK as well.
> 
> Fixes: d4b684f7197a ("net: add ESP header to generic flow steering")

I wonder if we should really mark this as a fix.

> Cc: borisp@mellanox.com
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> 
> [1] https://tools.ietf.org/html/rfc2406

Acked-by: Olivier Matz <olivier.matz@6wind.com>
  
Nélio Laranjeiro Jan. 16, 2018, 3:52 p.m. UTC | #2
On Tue, Jan 16, 2018 at 03:24:09PM +0100, Olivier Matz wrote:
> On Thu, Jan 11, 2018 at 10:15:58AM +0100, Nelio Laranjeiro wrote:
> > ESP header is defined in the RFC2406 [1] as Big Endian fields it should use
> > the corresponding types in DPDK as well.
> > 
> > Fixes: d4b684f7197a ("net: add ESP header to generic flow steering")
> 
> I wonder if we should really mark this as a fix.

I also agree, the point is some examples application have started using
it as CPU order instead of Network order, this patch also needs to be
applied in stable branch before fixing the code using it.

> > Cc: borisp@mellanox.com
> > 
> > Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> > 
> > [1] https://tools.ietf.org/html/rfc2406
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
  
De Lara Guarch, Pablo Jan. 19, 2018, 9:33 a.m. UTC | #3
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nélio Laranjeiro
> Sent: Tuesday, January 16, 2018 3:52 PM
> To: Olivier Matz <olivier.matz@6wind.com>
> Cc: dev@dpdk.org; borisp@mellanox.com
> Subject: Re: [dpdk-dev] [PATCH 1/2] net: fix ESP header byte ordering
> definition
> 
> On Tue, Jan 16, 2018 at 03:24:09PM +0100, Olivier Matz wrote:
> > On Thu, Jan 11, 2018 at 10:15:58AM +0100, Nelio Laranjeiro wrote:
> > > ESP header is defined in the RFC2406 [1] as Big Endian fields it
> > > should use the corresponding types in DPDK as well.
> > >
> > > Fixes: d4b684f7197a ("net: add ESP header to generic flow steering")
> >
> > I wonder if we should really mark this as a fix.
> 
> I also agree, the point is some examples application have started using it as
> CPU order instead of Network order, this patch also needs to be applied in
> stable branch before fixing the code using it.

If you want a patch to be applied in stable branch, don't forget to CC stable@dpdk.org,
and add it under the fixes tag.

Thanks,
Pabo
  
De Lara Guarch, Pablo Jan. 19, 2018, 9:34 a.m. UTC | #4
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nelio Laranjeiro
> Sent: Thursday, January 11, 2018 9:16 AM
> To: dev@dpdk.org; Olivier Matz <olivier.matz@6wind.com>
> Cc: borisp@mellanox.com
> Subject: [dpdk-dev] [PATCH 1/2] net: fix ESP header byte ordering definition
> 
> ESP header is defined in the RFC2406 [1] as Big Endian fields it should use
> the corresponding types in DPDK as well.
> 
> Fixes: d4b684f7197a ("net: add ESP header to generic flow steering")
> Cc: borisp@mellanox.com
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> 
> [1] https://tools.ietf.org/html/rfc2406
> ---

Applied to dpdk-next-crypto.
Thanks,

Pablo
  
De Lara Guarch, Pablo Jan. 19, 2018, 9:35 a.m. UTC | #5
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of De Lara Guarch,
> Pablo
> Sent: Friday, January 19, 2018 9:34 AM
> To: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>; dev@dpdk.org; Olivier
> Matz <olivier.matz@6wind.com>
> Cc: borisp@mellanox.com
> Subject: Re: [dpdk-dev] [PATCH 1/2] net: fix ESP header byte ordering
> definition
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nelio Laranjeiro
> > Sent: Thursday, January 11, 2018 9:16 AM
> > To: dev@dpdk.org; Olivier Matz <olivier.matz@6wind.com>
> > Cc: borisp@mellanox.com
> > Subject: [dpdk-dev] [PATCH 1/2] net: fix ESP header byte ordering
> > definition
> >
> > ESP header is defined in the RFC2406 [1] as Big Endian fields it
> > should use the corresponding types in DPDK as well.
> >
> > Fixes: d4b684f7197a ("net: add ESP header to generic flow steering")
> > Cc: borisp@mellanox.com
> >
> > Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> >
> > [1] https://tools.ietf.org/html/rfc2406

CC'ing stable ML.

> > ---
> 
> Applied to dpdk-next-crypto.
> Thanks,
> 
> Pablo
  

Patch

diff --git a/lib/librte_net/rte_esp.h b/lib/librte_net/rte_esp.h
index e228af092..148c06e09 100644
--- a/lib/librte_net/rte_esp.h
+++ b/lib/librte_net/rte_esp.h
@@ -49,8 +49,8 @@  extern "C" {
  * ESP Header
  */
 struct esp_hdr {
-	uint32_t spi;  /**< Security Parameters Index */
-	uint32_t seq;  /**< packet sequence number */
+	rte_be32_t spi;  /**< Security Parameters Index */
+	rte_be32_t seq;  /**< packet sequence number */
 } __attribute__((__packed__));
 
 #ifdef __cplusplus