Message ID | 20240722163930.2171568-6-g.singh@nxp.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C938245683; Mon, 22 Jul 2024 18:40:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C9DBB40BA2; Mon, 22 Jul 2024 18:39:57 +0200 (CEST) Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011067.outbound.protection.outlook.com [52.101.65.67]) by mails.dpdk.org (Postfix) with ESMTP id 901BC40DD0 for <dev@dpdk.org>; Mon, 22 Jul 2024 18:39:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NYbJpcWN2OjnJkJDJsyYwjtkZbQmbIveXNfI7cg3aCHL2WsHu5fQ2ehS1OLRE3OqEFrmZq/O5dslxSMqBSWxqLIXjbb1lxV04v3e1WBw3/GTUc9Zhg+zvKXnoNFQnuDUvnHs5FnJJB9p8A+Bh97P81U13pEzzmuuY+MEwglN81ltDbPdKByzqEYvl8HsmWOx7INmK46LerTJiB0zkQT9nYrUOEaiim6/fguGV7Cm3STaPNjCE06aVKG36Gg+mf4tavkjLIWU/uHr72o4XWgShoSTn6Trvc6ZQww4KR0VqO+ACtG0xsIqqnDRwEbYKCRNTIMeOyBdZbSHj/XTN0ESbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=R3I2CbozqdX/wxPkntlHtXmEeXPH9HZ97SnNOw5UesQ=; b=lCOtPe2q3EZJ95yTFSgl8nV3qvSKWt7lxRt3+n+iky8Bmqtrqp5b1yD3X3ubDz4dV956FXvRXQFk4p9g8RdHF3mdUq0oLlk4KjevBwl9CNLGFKJH8NGX/hIVuacAmCRQOQcg0R7rZs1cK9MDs9Ts622QaCkGQsASGxAHO+g1XcKfZmbrqr4zbQssAyjTSNkQKiv6r+lvJa1gDH7/OKR3sGAnAbr87bYJbb10KOeOOhTPoQrLg1Xcdv1MbMVJ1xhuvDFptZalzTHhhkpQhpGATNgneiftRQUSfp4qBuXhRlOQLBOSsVemrHfgyvCqYJruuXubkI6e0t2HaYA7pELrfw== 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=R3I2CbozqdX/wxPkntlHtXmEeXPH9HZ97SnNOw5UesQ=; b=D4xGvj80whKaZ52nqMLqEekfBu+iTMNxVOdhEu86zF/Oi/7gpnyz7VHpWnaTwngqvx7qCWyESrACUYxlRSUBXqZf9oXErnIgihMmsCpWFskUMHbHrUXU1da+TkOB20yYZOjnHwd2jIFrhWS8fz8w3yYcueCO2bQXPhysD0pIHok= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) by VI1PR04MB6798.eurprd04.prod.outlook.com (2603:10a6:803:131::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16; Mon, 22 Jul 2024 16:39:54 +0000 Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325]) by AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325%7]) with mapi id 15.20.7784.017; Mon, 22 Jul 2024 16:39:54 +0000 From: Gagandeep Singh <g.singh@nxp.com> To: dev@dpdk.org, Hemant Agrawal <hemant.agrawal@nxp.com> Cc: Jun Yang <jun.yang@nxp.com> Subject: [v3 05/30] dma/dpaa2: add sanity check for SG entry Date: Mon, 22 Jul 2024 22:09:05 +0530 Message-Id: <20240722163930.2171568-6-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240722163930.2171568-1-g.singh@nxp.com> References: <20240722115843.1830105-1-g.singh@nxp.com> <20240722163930.2171568-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG3P274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::26) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|VI1PR04MB6798:EE_ X-MS-Office365-Filtering-Correlation-Id: 78256043-cca5-497e-5016-08dcaa6cea18 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: I6auqe77UdlOSojiXDxbohhaYpxHYFWGs0is4VjSZ0/nE/rgiEsQD7uDRGC6AioAg9bkzk2gpVp4kiycLVz1MrjpDz53+5hFo/TpHPF+AI0yZEdypWYgQfKTnf6dA6RFwwbI6+GSrKvt0TIGQcSUAdR42VtulYvDXE9Kzx4RG5LP+uffuoOxCKfdE3tqt6vJpSPOuOUHh21PFX4J1Dk/CQPvCCYJrq5CSLH5seyzuXudvApyj2s6MkI8zZokqKOMrRqhFEGi3WiLUNEFQwqJsuxPiMDuGDMIlFsIwrC/19LA8YwbdG2WMw7OzL7qU3EUf4TasVax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HhdNzyzxauTquoTVP+A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8SPR01MB0024.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WGZKEbEAdW3Pz4I8FyhL3a6aHTbJuB8QhZmkiNNQ7j7SBehqcRw/ziX895K1w0Rd3fsOSsjdXOnlpif7kV/c5fZligOv6uIeZyV1Ys2fb1a17nkiJgUUPGtXJ0OysTPhOx7cQY0OexP9DwWueFtAhETOznJE9QG8xfaAqwTRT9K7dkZpqPLgz/0XK5uXuDO1VCo6y4clERdwAYe1Mhf9HoCQUvzb6RbVWvYCl3ibF0W5R/c4tvWkNVyZYHGya5yRtKZ61xgptdPqpiWe7T+DWXXT7d7nsH78iiC+GrXC/tNImwJtn2ZbirjCQEW++dI87SOmgSmfwQbkItTWrtbV9Fs8xqqzM9ejGPjPxqovezuVfE3QoOWv/i7mXGlD84U1dv42cW8S83TQlgHP4l80CD7PoapDuKGnUTRGYMI0Je0gL7cMNubEvMqvbtMPGR4k8B3PgB1/wNxp0a3CGcZmDzxJxaUJO7an9/f9AURz6qJO8gZ4PDL17wrb1gLMNcv82/0offTqW/Mt5KN65cNLHhPbOuf+6unioU5Ef0MZeQ1mCpmv5wniDZI6PhBr/iTVq0toxirdr8EP7h5E0uXvxWIOS7scljdTxZxjkUOvLvA3+fkfxvBXbMHf5BqfZg7IAawn9re73MuTITvgC4LTuMLCAfoaMrOH1wS/+EhheGa5Suzim88YpJLh363CDfhIGSEaSafA5iLM80HoKj34ZlUfCt4kUO0C8NYDsHa2aiXoSXJxLNQLQqngdKDOoMgQrq+O6RIAuBEaWE3sf8CJi1j9AqLUn35n18mJkacyhrkIiorXqNqTtr7L/IVh5CPZ+u4wJafJN1+ybkUGSvAv+lSuJ2RklO2JM+KZOc5tP63oMbqEp3lw/Xocg+XymvabKXciw4v4+HokslzLSwHempNcS157wAGyQPPOydA52WrXBJiW/gyWA6No9UioRALs9lKvSyICQMo6f9YZeEeaFYfdZYdUkn1U82yoAb5HOuP8KpEVRVkSi7nWlfPaR0grL+ftsgF2jD92nYZdJ0nwbz3m506JuoOsfthWdTRpzBuAkmQtlw2/+Xcd39XnMZKCDNoL0IWX44NkZUNQxK1r3Xap8U3eHGm7qUkvJ1r6nuYHnMtQ4s/jtoO23jn+Q4cUrq7YSfw4qqSLLwym4xbMp375QrHidWptQ1S4FIWUYGXSPzE0Uri/aGEfOOW0MiBtVpCz20AZbZwmmcPgLAe4chKhvUVoczqi4EPSFF+35V3y9iNjp7xxrKqZu4EXCE9sKKz1KiNJWdYp2PcQHwVEm0vPDuT11gFfMXZollVaUZtTtkXjg0umdSchOniKoRdIAjQf0kp44mI6QXYXnxeWV1GxaumnNIXGYjcEIqUWGHTXuMDu+tJ/qKIec3bfOIsNerMZiFpesRdMubz+YtnCEYOpKzU82EdlU7wFG+A9B2qnLAijvABUc/lJOWZvCUQ1ws3i2C4oHwXwWfxJ868vpGs/c8jZpjNIXFEHgScFkPRGbdM4ZIB5i8vRllDF9L8TQIn/VzB1wutURPYQLVxlifPlT5FC8xHxx5nnRCIOitMYrXoaP5rSHZIwjoCbOXJu X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78256043-cca5-497e-5016-08dcaa6cea18 X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2024 16:39:54.3184 (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: wAVER2D30tY/jcMT0WBohcKNaMB/pWs5iQ6ghmeDGU58/TnwaU+mNvDhxwPOUR17 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6798 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
NXP DMA driver fixes and Enhancements
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
Commit Message
Gagandeep Singh
July 22, 2024, 4:39 p.m. UTC
From: Jun Yang <jun.yang@nxp.com> Make sure the SG entry number doesn't overflow. Signed-off-by: Jun Yang <jun.yang@nxp.com> --- drivers/dma/dpaa2/dpaa2_qdma.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
Comments
On Mon, 22 Jul 2024 22:09:05 +0530 Gagandeep Singh <g.singh@nxp.com> wrote: > From: Jun Yang <jun.yang@nxp.com> > > Make sure the SG entry number doesn't overflow. > > Signed-off-by: Jun Yang <jun.yang@nxp.com> > --- Please do not use the term 'sanity check'. It is on the Inclusive Naming word list as a Tier 2: strongly consider replacing. https://inclusivenaming.org/word-lists/tier-2/sanity-check/
diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 44b82c139e..7f6ebcb46b 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -615,8 +615,17 @@ dpaa2_qdma_copy_sg(void *dev_private, struct qbman_fle *fle; struct qdma_sdd *sdd; - if (unlikely(nb_src != nb_dst)) + if (unlikely(nb_src != nb_dst)) { + DPAA2_QDMA_ERR("SG entry src num(%d) != dst num(%d)", + nb_src, nb_dst); return -ENOTSUP; + } + + if (unlikely(nb_src > RTE_DPAA2_QDMA_JOB_SUBMIT_MAX)) { + DPAA2_QDMA_ERR("SG entry number(%d) > MAX(%d)", + nb_src, RTE_DPAA2_QDMA_JOB_SUBMIT_MAX); + return -EINVAL; + } memset(fd, 0, sizeof(struct qbman_fd));