From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 77BFDA034C; Thu, 28 Apr 2022 13:48:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DB3442831; Thu, 28 Apr 2022 13:48:06 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80082.outbound.protection.outlook.com [40.107.8.82]) by mails.dpdk.org (Postfix) with ESMTP id 3099C40E50; Thu, 28 Apr 2022 13:48:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=knyA3uI+eSvTTuwk4NaNfFcTFmYlOZEBUZNp/vT1cNCRtbo6eKPDl84JxndnZTOmBDHwyAUGvKvKqMqyVDaQOOQF8D4GOH11q5djRqHPGCKob6r8Cey89D32ficoYs6je+yYMn98L61urGqZgCLZp+4C4S/d5IgmMphc1AxJl+Lf+vozWuctca35ydPhtdsURQIK4C2CuWSYIaYRwMPMACrxE0Z4S9sNA3puhSPg7psW+5mMKVC15nuRhfk7I3IAIfY+JDkcPkw/qvxby8K4QYz+UlQGQWGHaBqWmr4KXV69/YxgOm8SbiBEr9NroWwh3UMf1bcXwraBcNTzFyRihQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1k6bDCo9CEpwvd2/JKdAaSDgNoQyelM5RBPZaRN/iO8=; b=TroqAaOnW34a1HIVzwExcKF1T/m+gMXU9wpBvS2iX/0/z3TkQW4cX4yCa9b0h6X5dOB5rtBR3tS8hC1ZPnQqoWhiD4xIKFEYpphmm1V2nxd9CFHXy72aQukF3MTsRON1CpmlVnync4V6KtsbMA2Zy0TVVoIvHksXvargiQvhIuXs9BZS59y7f8uAM2qy0bux7jUX3bmumBTNLdiO6km7K88e+JCEJmACtC65zC5mKWaUIw3DoN8Y7k/7gkk2zCE6WMHKioLdj4E0F0df9wNtixeLGm4RBDJS/wHvjpZxqnfcg1a6jbhk05uK7ZEQWDom93N8GNOUdo3gwI9XjZIe1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1k6bDCo9CEpwvd2/JKdAaSDgNoQyelM5RBPZaRN/iO8=; b=IumoParZv5/xBnBS3PGhO858eb1fE7jE5ZWDrHw3xBQxMyEl4DJArGpW0QQMiCVHj0AyuJ1oWQdmeolSawOCxLnI00AncMp3CS5JiHvUqpG1olfcOswCGzt+ZSLnzU2x947X2QT1n/53ZWiYw5Rlg7ZHdxaC/YA/0EBT1sA/2Jw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by VI1PR04MB4622.eurprd04.prod.outlook.com (2603:10a6:803:76::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.14; Thu, 28 Apr 2022 11:48:02 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2%9]) with mapi id 15.20.5206.014; Thu, 28 Apr 2022 11:48:02 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Gagandeep Singh , stable@dpdk.org Subject: [PATCH v2 02/14] crypto/dpaa2_sec: fix buffer pool ID check Date: Thu, 28 Apr 2022 17:17:21 +0530 Message-Id: <20220428114733.1419957-3-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220428114733.1419957-1-g.singh@nxp.com> References: <20220422035100.3180870-1-g.singh@nxp.com> <20220428114733.1419957-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0002.apcprd02.prod.outlook.com (2603:1096:4:194::22) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eee494f2-45c1-4bfb-0d02-08da290cf2e4 X-MS-TrafficTypeDiagnostic: VI1PR04MB4622:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T+xoil/guTAKSh/A0VIvvB6KfQeF0FV/hdltOWCPRrtS6hw4hdYAJbdgRuqJNnajToHg3+vmxC7SVZtXfZB1eHWF4dTzvpzhRGdLzKP8SE5P9+akh7p6Qml9s7Q9qh735Q4cROV0BjVezm0pDyhLErJU2rLVkvEALZu9OD9zeX5W6qnJDN724nEc5JVwL5E1hIHcpOOGOflsZGUeNkqr8OmdVTZUj+6KXrD3hlLLPk98e75AnOxrfgF1MT7j80IL3tOk00b0bK9yfy2z1CJ3VXES8I/2/oURjjPjdeoffHZhiAuXTlLHzpz20nbhQmdCbZWzrNYCR73UKCBumCJpTLFHQNtHJNWLwctHbcwd2zjEkSprDxsYt8Vd2sHN8Y320LB1N0twGrLDk1//IUKqngXQSt1DBwLFp+XLDv/B02ij1vRvYYOoF/E377aFMYJo9JaUFBoP0wgSqbqSuNXyKFzBusKvpfgu4sDrrtqI9EtkGpd+c5R9COdbpAGE25WaayBmXqTRGmDiegGGqyrSKyhDVwMC4h0uR0xtlHTX9GPxpbQB+m+vwXDS642VifLlitxlJBq0wLs4tvIOvirb6hwVkR/5sBGNZl0qR9YC02e2CFpn6Em4ar3XzV6gg3lwm4e8fI4WD7m1uS+6jmzHizagRf68AVuPpk2F4k1wkEHz/Ok0NKgRlgotq/YTz6K6n4ZBMzVmZ+KACoKgfGs56A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(2906002)(4326008)(8936002)(83380400001)(508600001)(6666004)(6506007)(6512007)(26005)(86362001)(52116002)(55236004)(5660300002)(38100700002)(8676002)(6486002)(316002)(186003)(2616005)(1076003)(36756003)(66946007)(66556008)(66476007)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1Sln9aQxElyGmXkgUMWofDQ7ByHxdYilmJ+fqyscTHXtiPUikn2IL4fuBr1r?= =?us-ascii?Q?7t065JcLAWVJeCGDYNEEsbr1oeO4l92i704og4smduaYk8Por7bl5DjzRElO?= =?us-ascii?Q?seEiIOQFGZmLYE5IVE/LkBaup688V9wjwA6LJ5/zO8UnMxujWtX1pl5ZyD4n?= =?us-ascii?Q?49g7xqAFKZi1pMBo3ta/gMYysUWpsn/gBbqcaDqODN7/2iLZYZ0m7xarcaz7?= =?us-ascii?Q?/J4T4u3Vr8H5RWLORXeHXPZlJrr/LBezLqL5t46pzBUq89OrznbVlFY8Ad4J?= =?us-ascii?Q?3cgdEGeDt23lWfI8UUv4ooPYwAwy2xKhcuYyInbFazl3T+q2BhyswSmCfU9D?= =?us-ascii?Q?szAkG74OCG808bh91JKeQmGpDEWfEvwuFUIMTVnGLLFDAkcbmnviITHyj+HM?= =?us-ascii?Q?ayG3lqt3c3+vf1ME4N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?= =?us-ascii?Q?Xl7tY4nfrXqfgCth5U7YOL4vbI1g7w2ySMKd09duO6AiZhWxMnqkSiZ+WyEM?= =?us-ascii?Q?Hej/f3mQ1pitH4tIqxHx37/2dQJ6KWA0GB0MC91Sz61DsrTHi2PSwsOnCNVs?= =?us-ascii?Q?+pXI99PjPOYXXs42gk/uDFMi3fNCY1/ggaXFdmqaDQviTNO058tCcwQHWqJ4?= =?us-ascii?Q?rPAO79miLvFWexm0yZ8GvBSWYwFhtMzC9MPiwixE2Xoxg0hm8r/Yr5cCitKD?= =?us-ascii?Q?qKtI9ks8muA72xEvstwD4IZuHfATm1ocypnsLLJJdHlaylivqFa84aSdy43w?= =?us-ascii?Q?vnBV51MWXq6ZeNJW97MVY4WfPUeY2FU/hDoh7PuFirGDnkHv7cCbJ2UioCDk?= =?us-ascii?Q?ZN/Z+uGZO60itWJsuUO7uzD4GGKLiCDlCENXFLqWt251D6DhjyYrSWs+qDrm?= =?us-ascii?Q?P3z6CHcMQQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eee494f2-45c1-4bfb-0d02-08da290cf2e4 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2022 11:48:02.0723 (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-CrossTenant-UserPrincipalName: udsKVI+S6W9pcKEIP94RIMP4NSRKXgpg6OJEbHqsmAOnY+F6QDTHJ/qK0CG6HrRF X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4622 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Simple fd rely on bpid of the buffers whereas other FD types can support buffers without bpid of pool. So moving the bpid check to simple fd to mbuf conversion function. Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 03fef5e500..2374d67978 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1566,6 +1566,10 @@ sec_simple_fd_to_mbuf(const struct qbman_fd *fd) int16_t diff = 0; dpaa2_sec_session *sess_priv __rte_unused; + if (unlikely(DPAA2_GET_FD_IVP(fd))) { + DPAA2_SEC_ERR("error: non inline buffer"); + return NULL; + } struct rte_mbuf *mbuf = DPAA2_INLINE_MBUF_FROM_BUF( DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)), rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size); @@ -1612,11 +1616,6 @@ sec_fd_to_mbuf(const struct qbman_fd *fd) * We can have a better approach to use the inline Mbuf */ - if (unlikely(DPAA2_GET_FD_IVP(fd))) { - /* TODO complete it. */ - DPAA2_SEC_ERR("error: non inline buffer"); - return NULL; - } op = (struct rte_crypto_op *)DPAA2_GET_FLE_ADDR((fle - 1)); /* Prefeth op */ -- 2.25.1