* [PATCH 1/2] crypto/chelsio: avoid using sa_entry imm
@ 2019-01-17 17:18 Atul Gupta
2019-01-25 10:47 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Atul Gupta @ 2019-01-17 17:18 UTC (permalink / raw)
To: herbert, linux-crypto, dt; +Cc: atul.gupta
use is_eth_imm to determine immediate data than use sa_entry
field which is common for tunnel and not per skb.
Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
---
drivers/crypto/chelsio/chcr_core.h | 2 +-
drivers/crypto/chelsio/chcr_ipsec.c | 10 ++++------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/crypto/chelsio/chcr_core.h b/drivers/crypto/chelsio/chcr_core.h
index 1159dee..ad874d5 100644
--- a/drivers/crypto/chelsio/chcr_core.h
+++ b/drivers/crypto/chelsio/chcr_core.h
@@ -183,7 +183,7 @@ struct chcr_ipsec_aadiv {
struct ipsec_sa_entry {
int hmac_ctrl;
u16 esn;
- u16 imm;
+ u16 resv;
unsigned int enckey_len;
unsigned int kctx_len;
unsigned int authsize;
diff --git a/drivers/crypto/chelsio/chcr_ipsec.c b/drivers/crypto/chelsio/chcr_ipsec.c
index 2fb48cc..4f24646 100644
--- a/drivers/crypto/chelsio/chcr_ipsec.c
+++ b/drivers/crypto/chelsio/chcr_ipsec.c
@@ -415,12 +415,12 @@ inline void *copy_esn_pktxt(struct sk_buff *skb,
iv = skb_transport_header(skb) + sizeof(struct ip_esp_hdr);
memcpy(aadiv->iv, iv, 8);
- if (sa_entry->imm) {
+ if (is_eth_imm(skb, sa_entry)) {
sc_imm = (struct ulptx_idata *)(pos +
(DIV_ROUND_UP(sizeof(struct chcr_ipsec_aadiv),
sizeof(__be64)) << 3));
- sc_imm->cmd_more = FILL_CMD_MORE(!sa_entry->imm);
- sc_imm->len = cpu_to_be32(sa_entry->imm);
+ sc_imm->cmd_more = FILL_CMD_MORE(0);
+ sc_imm->len = cpu_to_be32(skb->len);
}
pos += len;
return pos;
@@ -548,10 +548,8 @@ inline void *chcr_crypto_wreq(struct sk_buff *skb,
if (sa_entry->esn)
ivdrop = 1;
- if (is_eth_imm(skb, sa_entry)) {
+ if (is_eth_imm(skb, sa_entry))
immdatalen = skb->len;
- sa_entry->imm = immdatalen;
- }
if (sa_entry->esn)
esnlen = sizeof(struct chcr_ipsec_aadiv);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] crypto/chelsio: avoid using sa_entry imm
2019-01-17 17:18 [PATCH 1/2] crypto/chelsio: avoid using sa_entry imm Atul Gupta
@ 2019-01-25 10:47 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2019-01-25 10:47 UTC (permalink / raw)
To: Atul Gupta; +Cc: linux-crypto, dt
On Thu, Jan 17, 2019 at 09:18:35AM -0800, Atul Gupta wrote:
> use is_eth_imm to determine immediate data than use sa_entry
> field which is common for tunnel and not per skb.
>
> Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
> ---
> drivers/crypto/chelsio/chcr_core.h | 2 +-
> drivers/crypto/chelsio/chcr_ipsec.c | 10 ++++------
> 2 files changed, 5 insertions(+), 7 deletions(-)
All applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-25 10:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 17:18 [PATCH 1/2] crypto/chelsio: avoid using sa_entry imm Atul Gupta
2019-01-25 10:47 ` Herbert Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.