Skip to content

Commit bc16efd

Browse files
vinaychelsiodavem330
authored andcommitted
ch_ktls: fix device connection close
When sge queue is full and chcr_ktls_xmit_wr_complete() returns failure, skb is not freed if it is not the last tls record in this skb, causes refcount never gets freed and tls_dev_del() never gets called on this connection. Fixes: 5a4b9fe ("cxgb4/chcr: complete record tx handling") Signed-off-by: Vinay Kumar Yadav <[email protected]> Signed-off-by: Rohit Maheshwari <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1a73e42 commit bc16efd

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • drivers/net/ethernet/chelsio/inline_crypto/ch_ktls

drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,9 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info,
17351735
struct sge_eth_txq *q, u32 skb_offset,
17361736
u32 tls_end_offset, bool last_wr)
17371737
{
1738+
bool free_skb_if_tx_fails = false;
17381739
struct sk_buff *nskb = NULL;
1740+
17391741
/* check if it is a complete record */
17401742
if (tls_end_offset == record->len) {
17411743
nskb = skb;
@@ -1758,6 +1760,8 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info,
17581760

17591761
if (last_wr)
17601762
dev_kfree_skb_any(skb);
1763+
else
1764+
free_skb_if_tx_fails = true;
17611765

17621766
last_wr = true;
17631767

@@ -1769,6 +1773,8 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info,
17691773
record->num_frags,
17701774
(last_wr && tcp_push_no_fin),
17711775
mss)) {
1776+
if (free_skb_if_tx_fails)
1777+
dev_kfree_skb_any(skb);
17721778
goto out;
17731779
}
17741780
tx_info->prev_seq = record->end_seq;

0 commit comments

Comments
 (0)