Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp723855ybl; Fri, 13 Dec 2019 03:40:09 -0800 (PST) X-Google-Smtp-Source: APXvYqw86Hx6OTzBqquIqHCWZGH7QKbDq0xr4R3m1c2lnZ+SVrSE56+vKYzkLwm6W8OlW7DNKQK7 X-Received: by 2002:a05:6830:1607:: with SMTP id g7mr14255995otr.320.1576237209168; Fri, 13 Dec 2019 03:40:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576237209; cv=none; d=google.com; s=arc-20160816; b=Bx8gHswj/Qz8vh1XLcLiw/gSQ3bpvhPUoacWLybnAeVfj+THbo6iMT7EJ72cOoQhhx 7ntdOSWwTqiR9ZKuwp7i3okrGfglpJS8VN1ygRut3L/J2jD4GXedq5YLhzlkSdvx5QeD cftWwWLJLHiqnGr+sNAHX++JCVEMITxPLQw1ySvptsLKc1oUnbljWHz8WhI2hB66axBY DpUddIINoA5WXgqCeCXVyP3CZV1BhPef42yFW5Vk2e6bnjjY5eQzrOorpr4e1IoqcUCv sLRsWuSDTYLB5v5ArosVa9WURBUKLhXIRpvIfrWRqVFHJNlIdlRAw7Dqtq5h6GS4pm+3 fSrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=kOUQj8OZERZ8ry2Gngxr4WucMHrZ5F1RyooEliMyJck=; b=VmQPF6aRpYWmoD4mKb1C6LTdz08lcqACaZTjInsd0UhBS5+kPReeZQcyHWwpv35ISO IJFjtCW6BDQEcWHsN+XHp//tnw4PBB1bypUaUoXLYW+YHiiW7UpIHVp2cmc7tCPByzFg 6bL4lhis25LBVI+Ny6EHDm+hUCxACeIMqeEACB5yqKEMaFrjbhtPaYQCNtfP04nrmHJx 0d2sqYmAMpcarvutTF6aH6IUbPbwW6EYqDeR031Cbu57iPPCgcG57foW4yUUBJad0wmI PdapmEjowvGrwWLZmpBNLVnhsHvQj0aM1irmn9jil+vGAKzJoPqppSx22yUgKckCdHi1 epew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p124si5643014oib.224.2019.12.13.03.39.47; Fri, 13 Dec 2019 03:40:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725946AbfLMLjq (ORCPT + 99 others); Fri, 13 Dec 2019 06:39:46 -0500 Received: from stargate.chelsio.com ([12.32.117.8]:56925 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbfLMLjq (ORCPT ); Fri, 13 Dec 2019 06:39:46 -0500 Received: from heptagon.asicdesigners.com (heptagon.blr.asicdesigners.com [10.193.186.108]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id xBDBdaGr024768; Fri, 13 Dec 2019 03:39:38 -0800 From: Ayush Sawal To: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org Cc: atul.gupta@chelsio.com, Ayush Sawal Subject: [Crypto/chcr] calculating tx_channel_id as per the max number of channels Date: Fri, 13 Dec 2019 17:08:52 +0530 Message-Id: <1576237132-15580-1-git-send-email-ayush.sawal@chelsio.com> X-Mailer: git-send-email 2.1.4 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- drivers/crypto/chelsio/chcr_algo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.1.4