diff mbox series

[Crypto/chcr] calculating tx_channel_id as per the max number of channels

Message ID 1576237132-15580-1-git-send-email-ayush.sawal@chelsio.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series [Crypto/chcr] calculating tx_channel_id as per the max number of channels | expand

Commit Message

Ayush Sawal Dec. 13, 2019, 11:38 a.m. UTC
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>
---
 drivers/crypto/chelsio/chcr_algo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Herbert Xu Dec. 20, 2019, 7:07 a.m. UTC | #1
On Fri, Dec 13, 2019 at 05:08:52PM +0530, Ayush Sawal wrote:
> 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>
> ---
>  drivers/crypto/chelsio/chcr_algo.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c
index 1b4a566..586dbc6 100644
--- a/drivers/crypto/chelsio/chcr_algo.c
+++ b/drivers/crypto/chelsio/chcr_algo.c
@@ -1379,7 +1379,8 @@  static int chcr_device_init(struct chcr_context *ctx)
 		txq_perchan = ntxq / u_ctx->lldi.nchan;
 		spin_lock(&ctx->dev->lock_chcr_dev);
 		ctx->tx_chan_id = ctx->dev->tx_channel_id;
-		ctx->dev->tx_channel_id = !ctx->dev->tx_channel_id;
+		ctx->dev->tx_channel_id =
+			(ctx->dev->tx_channel_id + 1) %  u_ctx->lldi.nchan;
 		spin_unlock(&ctx->dev->lock_chcr_dev);
 		rxq_idx = ctx->tx_chan_id * rxq_perchan;
 		rxq_idx += id % rxq_perchan;