From: Archana Muniganti <marchana@marvell.com>
To: <gakhil@marvell.com>, <bluca@debian.org>, <ktraynor@redhat.com>
Cc: Archana Muniganti <marchana@marvell.com>, <anoobj@marvell.com>,
<adwivedi@marvell.com>, <ktejasree@marvell.com>, <dev@dpdk.org>,
<stable@dpdk.org>
Subject: [dpdk-stable] [PATCH] crypto/octeontx2: fix ESN seqhi
Date: Thu, 28 Oct 2021 12:52:46 +0530 [thread overview]
Message-ID: <20211028072246.27500-1-marchana@marvell.com> (raw)
For current pkt, previous seqhi is used instead of its
guessed seqhi. Fixed it.
Fixes: 5be562bc5b78 ("crypto/octeontx2: support IPsec ESN and anti-replay")
Cc: stable@dpdk.org
Signed-off-by: Archana Muniganti <marchana@marvell.com>
---
drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index f0b72e05c2..4330cbd1c1 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -736,6 +736,14 @@ otx2_cpt_enqueue_sec(struct otx2_cpt_qp *qp, struct rte_crypto_op *op,
otx2_err("Anti replay check failed");
return IPSEC_ANTI_REPLAY_FAILED;
}
+
+ if (esn) {
+ seq_in_sa = ((uint64_t)esn_hi << 32) | esn_low;
+ if (seq > seq_in_sa) {
+ sa->esn_low = rte_cpu_to_be_32(seql);
+ sa->esn_hi = rte_cpu_to_be_32(seqh);
+ }
+ }
}
ret = process_inb_sa(op, sess, &qp->meta_info, (void **)&req);
@@ -749,14 +757,6 @@ otx2_cpt_enqueue_sec(struct otx2_cpt_qp *qp, struct rte_crypto_op *op,
ret = otx2_cpt_enqueue_req(qp, pend_q, req, op, sess->cpt_inst_w7,
burst_index);
- if (winsz && esn) {
- seq_in_sa = ((uint64_t)esn_hi << 32) | esn_low;
- if (seq > seq_in_sa) {
- sa->esn_low = rte_cpu_to_be_32(seql);
- sa->esn_hi = rte_cpu_to_be_32(seqh);
- }
- }
-
return ret;
}
--
2.22.0
next reply other threads:[~2021-10-28 7:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-28 7:22 Archana Muniganti [this message]
2021-10-28 7:24 ` Anoob Joseph
2021-10-31 20:36 ` Akhil Goyal
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=20211028072246.27500-1-marchana@marvell.com \
--to=marchana@marvell.com \
--cc=adwivedi@marvell.com \
--cc=anoobj@marvell.com \
--cc=bluca@debian.org \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=ktejasree@marvell.com \
--cc=ktraynor@redhat.com \
--cc=stable@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).