Skip to content

Commit 27896af

Browse files
ayushsawlherbertx
authored andcommitted
crypto: chelsio - calculating tx_channel_id as per the max number of channels
chcr driver was not using the number of channels from lld and assuming that there are always two channels available. With following patch chcr will use number of channel as passed by cxgb4. Signed-off-by: Ayush Sawal <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 27f4adf commit 27896af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/crypto/chelsio/chcr_algo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,8 @@ static int chcr_device_init(struct chcr_context *ctx)
13791379
txq_perchan = ntxq / u_ctx->lldi.nchan;
13801380
spin_lock(&ctx->dev->lock_chcr_dev);
13811381
ctx->tx_chan_id = ctx->dev->tx_channel_id;
1382-
ctx->dev->tx_channel_id = !ctx->dev->tx_channel_id;
1382+
ctx->dev->tx_channel_id =
1383+
(ctx->dev->tx_channel_id + 1) % u_ctx->lldi.nchan;
13831384
spin_unlock(&ctx->dev->lock_chcr_dev);
13841385
rxq_idx = ctx->tx_chan_id * rxq_perchan;
13851386
rxq_idx += id % rxq_perchan;

0 commit comments

Comments
 (0)