Skip to content

Commit e8a4155

Browse files
vinaychelsiodavem330
authored andcommitted
ch_ktls: do not send snd_una update to TCB in middle
snd_una update should not be done when the same skb is being sent out.chcr_short_record_handler() sends it again even though SND_UNA update is already sent for the skb in chcr_ktls_xmit(), which causes mismatch in un-acked TCP seq number, later causes problem in sending out complete record. Fixes: 429765a ("chcr: handle partial end part of a record") Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com> Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 21d8c25 commit e8a4155

1 file changed

Lines changed: 0 additions & 53 deletions

File tree

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

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

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,54 +1644,6 @@ static void chcr_ktls_copy_record_in_skb(struct sk_buff *nskb,
16441644
refcount_add(nskb->truesize, &nskb->sk->sk_wmem_alloc);
16451645
}
16461646

1647-
/*
1648-
* chcr_ktls_update_snd_una: Reset the SEND_UNA. It will be done to avoid
1649-
* sending the same segment again. It will discard the segment which is before
1650-
* the current tx max.
1651-
* @tx_info - driver specific tls info.
1652-
* @q - TX queue.
1653-
* return: NET_TX_OK/NET_XMIT_DROP.
1654-
*/
1655-
static int chcr_ktls_update_snd_una(struct chcr_ktls_info *tx_info,
1656-
struct sge_eth_txq *q)
1657-
{
1658-
struct fw_ulptx_wr *wr;
1659-
unsigned int ndesc;
1660-
int credits;
1661-
void *pos;
1662-
u32 len;
1663-
1664-
len = sizeof(*wr) + roundup(CHCR_SET_TCB_FIELD_LEN, 16);
1665-
ndesc = DIV_ROUND_UP(len, 64);
1666-
1667-
credits = chcr_txq_avail(&q->q) - ndesc;
1668-
if (unlikely(credits < 0)) {
1669-
chcr_eth_txq_stop(q);
1670-
return NETDEV_TX_BUSY;
1671-
}
1672-
1673-
pos = &q->q.desc[q->q.pidx];
1674-
1675-
wr = pos;
1676-
/* ULPTX wr */
1677-
wr->op_to_compl = htonl(FW_WR_OP_V(FW_ULPTX_WR));
1678-
wr->cookie = 0;
1679-
/* fill len in wr field */
1680-
wr->flowid_len16 = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(len, 16)));
1681-
1682-
pos += sizeof(*wr);
1683-
1684-
pos = chcr_write_cpl_set_tcb_ulp(tx_info, q, tx_info->tid, pos,
1685-
TCB_SND_UNA_RAW_W,
1686-
TCB_SND_UNA_RAW_V(TCB_SND_UNA_RAW_M),
1687-
TCB_SND_UNA_RAW_V(0), 0);
1688-
1689-
chcr_txq_advance(&q->q, ndesc);
1690-
cxgb4_ring_tx_db(tx_info->adap, &q->q, ndesc);
1691-
1692-
return 0;
1693-
}
1694-
16951647
/*
16961648
* chcr_end_part_handler: This handler will handle the record which
16971649
* is complete or if record's end part is received. T6 adapter has a issue that
@@ -1892,11 +1844,6 @@ static int chcr_short_record_handler(struct chcr_ktls_info *tx_info,
18921844
/* reset tcp_seq as per the prior_data_required len */
18931845
tcp_seq -= prior_data_len;
18941846
}
1895-
/* reset snd una, so the middle record won't send the already
1896-
* sent part.
1897-
*/
1898-
if (chcr_ktls_update_snd_una(tx_info, q))
1899-
goto out;
19001847
atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_middle_pkts);
19011848
} else {
19021849
atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_start_pkts);

0 commit comments

Comments
 (0)