Skip to content

Commit

Permalink
ch_ktls: tcb update fails sometimes
Browse files Browse the repository at this point in the history
[ Upstream commit 7d01c42 ]

context id and port id should be filled while sending tcb update.

Fixes: 5a4b9fe ("cxgb4/chcr: complete record tx handling")
Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rmchelsio authored and gregkh committed Nov 18, 2020
1 parent d274cd3 commit e2d69c0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/crypto/chelsio/chcr_ktls.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ int chcr_ktls_cpl_set_tcb_rpl(struct adapter *adap, unsigned char *input)
}

static void *__chcr_write_cpl_set_tcb_ulp(struct chcr_ktls_info *tx_info,
u32 tid, void *pos, u16 word, u64 mask,
u32 tid, void *pos, u16 word,
struct sge_eth_txq *q, u64 mask,
u64 val, u32 reply)
{
struct cpl_set_tcb_field_core *cpl;
Expand All @@ -668,7 +669,10 @@ static void *__chcr_write_cpl_set_tcb_ulp(struct chcr_ktls_info *tx_info,

/* ULP_TXPKT */
txpkt = pos;
txpkt->cmd_dest = htonl(ULPTX_CMD_V(ULP_TX_PKT) | ULP_TXPKT_DEST_V(0));
txpkt->cmd_dest = htonl(ULPTX_CMD_V(ULP_TX_PKT) |
ULP_TXPKT_CHANNELID_V(tx_info->port_id) |
ULP_TXPKT_FID_V(q->q.cntxt_id) |
ULP_TXPKT_RO_F);
txpkt->len = htonl(DIV_ROUND_UP(CHCR_SET_TCB_FIELD_LEN, 16));

/* ULPTX_IDATA sub-command */
Expand Down Expand Up @@ -723,15 +727,15 @@ static void *chcr_write_cpl_set_tcb_ulp(struct chcr_ktls_info *tx_info,
} else {
u8 buf[48] = {0};

__chcr_write_cpl_set_tcb_ulp(tx_info, tid, buf, word,
__chcr_write_cpl_set_tcb_ulp(tx_info, tid, buf, word, q,
mask, val, reply);

return chcr_copy_to_txd(buf, &q->q, pos,
CHCR_SET_TCB_FIELD_LEN);
}
}

pos = __chcr_write_cpl_set_tcb_ulp(tx_info, tid, pos, word,
pos = __chcr_write_cpl_set_tcb_ulp(tx_info, tid, pos, word, q,
mask, val, reply);

/* check again if we are at the end of the queue */
Expand Down

0 comments on commit e2d69c0

Please sign in to comment.