Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <ayush.sawal@chelsio.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Ayush Sawal and committed by
Herbert Xu
27896aff 27f4adf7

+2 -1
+2 -1
drivers/crypto/chelsio/chcr_algo.c
··· 1379 1379 txq_perchan = ntxq / u_ctx->lldi.nchan; 1380 1380 spin_lock(&ctx->dev->lock_chcr_dev); 1381 1381 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; 1383 1384 spin_unlock(&ctx->dev->lock_chcr_dev); 1384 1385 rxq_idx = ctx->tx_chan_id * rxq_perchan; 1385 1386 rxq_idx += id % rxq_perchan;