From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 286F0A05D3 for ; Wed, 27 Mar 2019 12:54:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 019C81B3AA; Wed, 27 Mar 2019 12:53:48 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140072.outbound.protection.outlook.com [40.107.14.72]) by dpdk.org (Postfix) with ESMTP id 3F4D11B217; Wed, 27 Mar 2019 12:53:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KTD5ko2L8V4tXaIV48SQzM0uVPw3OcoTZFoZoLGeRFU=; b=jFd4L+1leFkzJkgbxmT93s0YQpV1g/7McnR94YuTYQGyXxlGMYj/zUk5+6zfYH0jJHgWB5Qa2DI3JPmQb8e2mfhmjwLDx4vPxuDfadl57W8rKYs+0NhJ01BT9+9Rs10N4jJYkBXnmx9cWbrjRyiXve9IBHn+FDLH7JdPG2J2Pfk= Received: from VI1PR04MB4893.eurprd04.prod.outlook.com (20.177.49.154) by VI1PR04MB3261.eurprd04.prod.outlook.com (10.170.231.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.19; Wed, 27 Mar 2019 11:53:36 +0000 Received: from VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::d81a:c2cb:6bce:30bb]) by VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::d81a:c2cb:6bce:30bb%4]) with mapi id 15.20.1750.014; Wed, 27 Mar 2019 11:53:36 +0000 From: Akhil Goyal To: "dev@dpdk.org" CC: Hemant Agrawal , Akhil Goyal , "stable@dpdk.org" Thread-Topic: [PATCH 5/6] crypto/dpaa_sec: fix session qp attach/detach Thread-Index: AQHU5JO1IoPT3q86FEKL0fRSTg4lEA== Date: Wed, 27 Mar 2019 11:53:36 +0000 Message-ID: <20190327114407.13697-6-akhil.goyal@nxp.com> References: <20190327114407.13697-1-akhil.goyal@nxp.com> In-Reply-To: <20190327114407.13697-1-akhil.goyal@nxp.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0061.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2c::25) To VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:56::26) x-mailer: git-send-email 2.17.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.68] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c971165c-c348-41e9-9423-08d6b2aad801 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB3261; x-ms-traffictypediagnostic: VI1PR04MB3261: x-microsoft-antispam-prvs: x-forefront-prvs: 0989A7979C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(346002)(39860400002)(136003)(189003)(199004)(478600001)(6512007)(1076003)(52116002)(76176011)(44832011)(6486002)(50226002)(2501003)(14454004)(6916009)(36756003)(6436002)(305945005)(99286004)(7736002)(186003)(3846002)(2906002)(6116002)(97736004)(102836004)(25786009)(386003)(6506007)(26005)(4326008)(446003)(71190400001)(5024004)(1730700003)(256004)(68736007)(8676002)(71200400001)(5660300002)(2616005)(476003)(316002)(11346002)(81156014)(486006)(8936002)(5640700003)(86362001)(2351001)(53936002)(66066001)(105586002)(106356001)(81166006)(54906003)(450100002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB3261; H:VI1PR04MB4893.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ShmmDdW4rEx8iOGZCSGkzWL17jX4TgB3EBaUaw+hll5MmMA8JD/9CJ6dko/YJcGlyTaPvKqI8qqGCY6T3NRohDjB+DoX2Gua/lqVr2u0PVUfcBZsbICy30QOdgoX0DtdfetOGP/MVPMzumz3z6/h1/oBQtxDPCizF4BXTzQaQprpJNbLv2tKXG8rEkDeRBhvPGRshxYsMT6La/0+bi6FihO3YHppuSyivoNhmv881ZzGNqkR/lzPxZaFJZgLUSfX2Ve1W0qHompGQnCdA4je1jTZiSch7TGHKbMqKf/pUV/wkpkl7prlviE/P9zWnaKd3QvvvLMsElPw5TpOAhQgOrMtbbRpvNExJ0Zycunh7+FBZ8bsGrgmElPoRgJ3v7iRWHpZmGthjS4pcvp7kh9Dw3NpkqMwj800GKCBx7060/8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c971165c-c348-41e9-9423-08d6b2aad801 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 11:53:36.0782 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3261 Subject: [dpdk-dev] [PATCH 5/6] crypto/dpaa_sec: fix session qp attach/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" Message-ID: <20190327115336.kn6WPX-ukRzk7LBo9oyq047m09VNLjd7Qvcl04YYWr4@z> session inq and qp are assigned for each core from which the packets arrive. This was not correctly handled while supporting multiple sessions per queue pair. This patch fixes the attach and detach of queues for each core. Fixes: e79416d10fa3 ("crypto/dpaa_sec: support multiple sessions per queue = pair") Cc: stable@dpdk.org Signed-off-by: Akhil Goyal --- drivers/crypto/dpaa_sec/dpaa_sec.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/d= paa_sec.c index cb99be4e1..8305f19a3 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2017-2018 NXP + * Copyright 2017-2019 NXP * */ =20 @@ -1940,13 +1940,13 @@ dpaa_sec_attach_rxq(struct dpaa_sec_dev_private *qi= ) { unsigned int i; =20 - for (i =3D 0; i < qi->max_nb_sessions; i++) { + for (i =3D 0; i < qi->max_nb_sessions * MAX_DPAA_CORES; i++) { if (qi->inq_attach[i] =3D=3D 0) { qi->inq_attach[i] =3D 1; return &qi->inq[i]; } } - DPAA_SEC_WARN("All ses session in use %x", qi->max_nb_sessions); + DPAA_SEC_WARN("All session in use %u", qi->max_nb_sessions); =20 return NULL; } @@ -2115,7 +2115,7 @@ dpaa_sec_sym_session_clear(struct rte_cryptodev *dev, struct rte_cryptodev_sym_session *sess) { struct dpaa_sec_dev_private *qi =3D dev->data->dev_private; - uint8_t index =3D dev->driver_id; + uint8_t index =3D dev->driver_id, i; void *sess_priv =3D get_sym_session_private_data(sess, index); =20 PMD_INIT_FUNC_TRACE(); @@ -2125,9 +2125,12 @@ dpaa_sec_sym_session_clear(struct rte_cryptodev *dev= , if (sess_priv) { struct rte_mempool *sess_mp =3D rte_mempool_from_obj(sess_priv); =20 - if (s->inq[rte_lcore_id() % MAX_DPAA_CORES]) - dpaa_sec_detach_rxq(qi, - s->inq[rte_lcore_id() % MAX_DPAA_CORES]); + for (i =3D 0; i < MAX_DPAA_CORES; i++) { + if (s->inq[i]) + dpaa_sec_detach_rxq(qi, s->inq[i]); + s->inq[i] =3D NULL; + s->qp[i] =3D NULL; + } rte_free(s->cipher_key.data); rte_free(s->auth_key.data); memset(s, 0, sizeof(dpaa_sec_session)); --=20 2.17.1