DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org, Olivier Matz <olivier.matz@6wind.com>
Cc: akhil.goyal@nxp.com
Subject: [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: fix SPI byte order in flow item
Date: Thu, 11 Jan 2018 10:15:59 +0100	[thread overview]
Message-ID: <a014eabcbdfcd8b20640cc6ef91885f631dc5e3e.1515662067.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <e3a23acbc34bf1a632a32a56580cb403644ca268.1515662067.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <e3a23acbc34bf1a632a32a56580cb403644ca268.1515662067.git.nelio.laranjeiro@6wind.com>

SPI field is defined in the RFC2406 [1] as a big endian field it should be
provided in its final form to the drivers through RTE flow.

Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")
Cc: akhil.goyal@nxp.com

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

[1] https://tools.ietf.org/html/rfc2406
---
 examples/ipsec-secgw/ipsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index 580e09a3a..8df0f00ab 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -195,7 +195,7 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa)
 			sa->pattern[2].type = RTE_FLOW_ITEM_TYPE_ESP;
 			sa->pattern[2].spec = &sa->esp_spec;
 			sa->pattern[2].mask = &rte_flow_item_esp_mask;
-			sa->esp_spec.hdr.spi = sa->spi;
+			sa->esp_spec.hdr.spi = rte_cpu_to_be_32(sa->spi);
 
 			sa->pattern[3].type = RTE_FLOW_ITEM_TYPE_END;
 
-- 
2.11.0

  reply	other threads:[~2018-01-11  9:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11  9:15 [dpdk-dev] [PATCH 1/2] net: fix ESP header byte ordering definition Nelio Laranjeiro
2018-01-11  9:15 ` Nelio Laranjeiro [this message]
2018-01-11  9:53   ` [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: fix SPI byte order in flow item Akhil Goyal
2018-01-19  9:34   ` De Lara Guarch, Pablo
2018-01-16 14:24 ` [dpdk-dev] [PATCH 1/2] net: fix ESP header byte ordering definition Olivier Matz
2018-01-16 15:52   ` Nélio Laranjeiro
2018-01-19  9:33     ` De Lara Guarch, Pablo
2018-01-19  9:34 ` De Lara Guarch, Pablo
2018-01-19  9:35   ` De Lara Guarch, Pablo

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=a014eabcbdfcd8b20640cc6ef91885f631dc5e3e.1515662067.git.nelio.laranjeiro@6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.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).