crypto: chcr - small packet Tx stalls the queue
authorAtul Gupta <atul.gupta@chelsio.com>
Fri, 30 Nov 2018 09:01:48 +0000 (14:31 +0530)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 7 Dec 2018 06:15:01 +0000 (14:15 +0800)
Immediate packets sent to hardware should include the work
request length in calculating the flits. WR occupy one flit and
if not accounted result in invalid request which stalls the HW
queue.

Cc: stable@vger.kernel.org
Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/chelsio/chcr_ipsec.c

index 461b97e2f1fdcc34462aaa67bb0f5a6b036c5b08..1ff8738631a38d9f7dbcca296b0dfdac5270ac6c 100644 (file)
@@ -303,7 +303,10 @@ static bool chcr_ipsec_offload_ok(struct sk_buff *skb, struct xfrm_state *x)
 
 static inline int is_eth_imm(const struct sk_buff *skb, unsigned int kctx_len)
 {
-       int hdrlen = sizeof(struct chcr_ipsec_req) + kctx_len;
+       int hdrlen;
+
+       hdrlen = sizeof(struct fw_ulptx_wr) +
+                sizeof(struct chcr_ipsec_req) + kctx_len;
 
        hdrlen += sizeof(struct cpl_tx_pkt);
        if (skb->len <= MAX_IMM_TX_PKT_LEN - hdrlen)