From patchwork Wed Nov 6 05:17:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 178602 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp127386ilf; Tue, 5 Nov 2019 21:22:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwyXpxHweP8NYgsSNThig4ceWn5+Kt/10NS5l6Vya41NKhvw1bCLuNhgmrlwD7izAMNBig3 X-Received: by 2002:a05:6402:284:: with SMTP id l4mr637488edv.19.1573017729784; Tue, 05 Nov 2019 21:22:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573017729; cv=none; d=google.com; s=arc-20160816; b=eZfQztXCANtuA8EdfALiLUdY8hvXyIyCiQXvjB4HDPBMduF5i6ffznDLjREZue+pND eiIN0ZvX+X/u8FCPI19q8E4OsPAxnmm4Ui082pj6kvrmRLHeiJdZe25eoXwxrDWVYk8d xqsOV6SbB/HJ2VCjjdoX8jKaUIHgbVBC7KYokmh3IltX8y4kKO6SiUM7ng4az73IxVr+ J9IEPr7tblypHbgLyrxOfQnbWfJKR409HgAhFgd5nnyn3mpgJSG4cMU/iahLggi0b5NT dSzs5IxxYZ5IIW9Yvmi6Qy4b1RHKUcgY0fusEYb8kO1+UTRi3FjRNL2J+vYPDKEOFVQh BI+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=5EGeYSvIDb74un+96FSxBwVJfCgnDqQYLMhnuc6zABU=; b=da3hJZLcMpFwh94qsYZKr/syhHTzXK/KBLfXturn6EmgbPD4W0S5Qeuysj2Wm08ukE RxNipOwNFuloxrqEEJI+r/C3jiBfz6RU5URRHef0k58oqITT7DoUUcs1+NuoPYhowhbO dTjCrS0d3Tnb15HXlvFu2Al45DjKbJi/aS1x/7Nn7J7Nj+HKuM9RreEJSNk0X1Gdy+l7 UE6vsarnRWnvyQW/B82h086poswd3G1Tfp2cOkxPfOpcx1zaUIdEFO2gD+ZNotZu0SSZ vLH+nKclhVJbNOhKLCTbpzZkLo0PVNoa5o1J3etYk76eiFHdx+pDrNNlaNrqeINg6H4y xifA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id o3si12985645edi.374.2019.11.05.21.22.09; Tue, 05 Nov 2019 21:22:09 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A454B1BFF7; Wed, 6 Nov 2019 06:20:59 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id C7F771BF96 for ; Wed, 6 Nov 2019 06:20:44 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 69AE3200334; Wed, 6 Nov 2019 06:20:44 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0583B20058D; Wed, 6 Nov 2019 06:20:43 +0100 (CET) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3DE7240314; Wed, 6 Nov 2019 13:20:40 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: akhil.goyal@nxp.com Date: Wed, 6 Nov 2019 10:47:29 +0530 Message-Id: <20191106051731.3625-11-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106051731.3625-1-hemant.agrawal@nxp.com> References: <20191101175141.4663-1-hemant.agrawal@nxp.com> <20191106051731.3625-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 11/13] crypto/dpaa_sec: use macros in queue attach and detach X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Gagandeep Singh Align the cleanup and allocation for the queues. Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa_sec/dpaa_sec.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index e729ed7db..990708de4 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2303,7 +2303,7 @@ dpaa_sec_attach_rxq(struct dpaa_sec_dev_private *qi) { unsigned int i; - for (i = 0; i < qi->max_nb_sessions * MAX_DPAA_CORES; i++) { + for (i = 0; i < RTE_DPAA_MAX_RX_QUEUE; i++) { if (qi->inq_attach[i] == 0) { qi->inq_attach[i] = 1; return &qi->inq[i]; @@ -2319,9 +2319,10 @@ dpaa_sec_detach_rxq(struct dpaa_sec_dev_private *qi, struct qman_fq *fq) { unsigned int i; - for (i = 0; i < qi->max_nb_sessions; i++) { + for (i = 0; i < RTE_DPAA_MAX_RX_QUEUE; i++) { if (&qi->inq[i] == fq) { - qman_retire_fq(fq, NULL); + if (qman_retire_fq(fq, NULL) != 0) + DPAA_SEC_WARN("Queue is not retired\n"); qman_oos_fq(fq); qi->inq_attach[i] = 0; return 0; @@ -3408,7 +3409,7 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev) flags = QMAN_FQ_FLAG_LOCKED | QMAN_FQ_FLAG_DYNAMIC_FQID | QMAN_FQ_FLAG_TO_DCPORTAL; - for (i = 0; i < MAX_DPAA_CORES * internals->max_nb_sessions; i++) { + for (i = 0; i < RTE_DPAA_MAX_RX_QUEUE; i++) { /* create rx qman fq for sessions*/ ret = qman_create_fq(0, flags, &internals->inq[i]); if (unlikely(ret != 0)) {