Skip to content

Commit

Permalink
crypto: chelsio - avoid using sa_entry imm
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Atul Gupta authored and Herbert Xu committed Jan 25, 2019
1 parent 2b5ac17 commit 4da66b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/crypto/chelsio/chcr_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 4 additions & 6 deletions drivers/crypto/chelsio/chcr_ipsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4da66b7

Please sign in to comment.