Message ID | 20240722115843.1830105-6-g.singh@nxp.com (mailing list archive) |
---|---|
State | Superseded, archived |
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 CD5C04567F; Mon, 22 Jul 2024 13:59:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63F304029F; Mon, 22 Jul 2024 13:59:16 +0200 (CEST) Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012015.outbound.protection.outlook.com [52.101.66.15]) by mails.dpdk.org (Postfix) with ESMTP id 0BD7C4003C for <dev@dpdk.org>; Mon, 22 Jul 2024 13:59:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=n89Zv8Z3By9oAwcUQyWThab5dHKt41iN+kxxi4P4k116zaaObEvELwlni2eIZ9TE+fdaunGM8UCCkfaz4odP12GUS3z1n1Id0HP+l3WrI0fJD/VHZtEjbqWNLsqImbQaAyuTj6o3QZFCSaRmPAkqJeh70/xns9EOB5sVcVbbx20gyKWAvrj+PW+YGlMrL9M2ndo2wlTZq3woYij5ccAYk+LNGSxCjYLloNvP7BBiTxl0vWh4QDhYtL1/yUcZhwOeFTqGbmuywKPcI7m1veSnjLBRpsdg/kv/EhU0Hws2NXeTrmujcyScUD/5L6XIeeaHQmuiuzyK1ru8OSR0GkWSsw== 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=Gu5hl+LC4JIIZ9JDrsDJVqZDFeW0MnlGhovN7kB6OdiG5/FosyxZmVjcJeQ6IeqcXTFjT19WVKaPoGqJ/+Ghp7DlJxWG12f2L+XHt6HUODNt8P9fi3gO9Q85CQW1egLAM7HQlP6UqMgIe8WUL7POPsEi1rVPwj8R0SN3uSpH+x5TlTnbfoSSzwzgNrEHYto5Bjqv2Rlao6sW89M5sOczmvuDPe60QpqO1JJ+bbcMceM4vOlttHhUsX0PQntdMQQpCwMPtHLrqOMP9sa7xKUL3iJ7Klc5T2fUOT7dJ8vFNp6VhjlRO3qlnNJdGEHNMPS6n/lH7FlmiZzoZBkcTA0wSw== 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=Qf8DKxvr+eY/neGrkJd/iwgbbFMBXceAqgWnexULsqGC6qOJ4yzf6gGOyPQ0UYf3WuMC8Ofa/v1YdHxDd2xttVWaa5sOvgovfhEnba89cYs+0cT5+3kk3XdDl94eXCS2yemhfMQLF2q3xnizXw/cesah+7DEDYPVONjAyFtwim8= 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 AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Mon, 22 Jul 2024 11:59:09 +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 11:59:09 +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: [v2 05/30] dma/dpaa2: add sanity check for SG entry Date: Mon, 22 Jul 2024 17:28:18 +0530 Message-Id: <20240722115843.1830105-6-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240722115843.1830105-1-g.singh@nxp.com> References: <20240719100126.1150373-1-g.singh@nxp.com> <20240722115843.1830105-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0025.apcprd02.prod.outlook.com (2603:1096:4:195::21) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|AM8PR04MB7970:EE_ X-MS-Office365-Filtering-Correlation-Id: 16843711-f975-45ee-a706-08dcaa45b1d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: 3m+BR3PGcQaV1Ma4+3ao/usSjZMOrDc5TA/AnvlrPoBHseJOJavm2bFeVPpn4GJjgx6cFY9UElgyrTUEerOe/eSokrIBoyD8VMF7YilvOK0Tl63TPvaa0wqQTPf5Lv1V6Rd8bDfd9w4thPKEioDMJSqpB/raeeB0StUH2aty0H6XNN4ciUFswjrypR0udyQpu3Cmwxrxdy9/BTTSQG9as4FYhx7M5CpwDz+DvRsQDACLcSBXKFf2A4egfyS74HJjapMwzhbcnWt0cBlurhAXAdG7a2w5RphrjeO9oLrRWL7tIJE1tg4SuQ2HgamKsCZX9h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J0t3R54EcfNYWxhtiTtCkKJIrpFbTrEojZNBA== 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)(1800799024)(366016)(52116014)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WZExKutP7E4qB2JTtJYoaXo+UCsl9LBdqIUYgUJPfok3OfH1pI7TGRM15BKhsiV2fCPwkyeNCYeFUKg09OQxVsUQtJ05FbsEu23ooen2FuqjH04l0mQMqrfkpnLiU6kpxwejbtZGv3HsfCvUQYnpbqWiCHIixbVJVAwXUX1TXUSwMWVIC41WEYiaUJKJvXkUrZ4gw4TF27wl5Ve3ktNYhkTGdqeKkIL9Lv+tGQsXg5yTEvz2ZqXc09nKKd/ueecPsAHYTVswih1ORw3uIFHveQWJokMrz/9kOSS1XxEKOs5Wy6RREyNzY5ES9WBK61G9CJGpZ7Fd2C1ISlC0f+9FC9EH02R3oraq/n/D8e0nYu5QtXrEdaViIcd8F8/gs+kLSmfSaqJiwteVflIfHkTAAcRJdhUpiLvQdjl2Sb/D8WUMz7jy86lBzOCJevHaZMOfSMI2HjiyUqu6DFGnNB+Xk6rgjAjACnZTG2sD8qO7jetVCUU//5naepquCMm/vvUE0Hg2AKDJs9pSpiTfb56GpHjuypkBxGn1oeJfqWwLgUG4JOUGSgdNajxTcFNARyS4kYGqgQmOpKTP+JrSmgFBDEjqUJ/OGPszsBdpeqEeQ2VhoZXkEP6cPH08q/jHKhfd5aTw4UCJltUG0LlzI4xH/2YhvKzd/+cQSGIm2BL9XXkKFEYuEfOUDevkyei9JDZImunuu5jxip4g01PnEQAobeTw/nMc56CxhJ7xeeCtGpBNVjYFDt8PVkkHVlL8rqEiCtEFPDHiwzUTbkrVPaGRccCj+PYA7TrlaS4oOVE3tElBHorzNptz74hyOEuQ05E1ZkhAESzXSVv/J1UKd4A0Sb/5DtN1UYaEU97JEBooqw6GowJWspXEzU3smyjfY9/rUAwMm3yeleAx9lBg3mIef6lzRrGVI7gX7sRQZCluQvxLGgq7j7Z9o2ZQ+84JeFI/e6pE1wmOXOo1XcPHo0NlwPiPpQqANeP2mMRqOpNRn3hnHoZWtN3oBzg2p635w/SKnSsJrouGirFxfATD2VR02/Rhea6+aFKoxlsaWVQD19Eu9ko7P30UM670MGQhHQXrfenGXzCYKh2kX3uztlRNn8AqSetgaYkc35iEtEkvM5TttE4xuEBBLruHzl49CrUzXz+kwIu3gGA75eaLCpje83smNN4iZz4EbTc9JwT4YGxHGXSzjiPVqZerp9r5pjyKgiVNgd6n6hZsg3mbbxmbGPwMSWhMo0FwKqonkd8RSGLiW8s7UestrwgPsk9QpCN2F7EoIKJbWowkJXBX2Y+kelwSEwF+YJznbYq7qZfAVxu0WReCJyctufcAirh2gXF/Pl+ZdWYctZvupbp9FPZ3BcHrhD81ABqZOX29pOmFvtCw0XE9evsqi7aBsiO6SaB/Lg/zbzFOSkV0wxSvfulEdZRX6y5YETyzQaF21ghXBZsGSmp0puoLArNV2gUgxPvPX8tK4Bjo/abkC/UpYIOBKlskgeDDCdKiJ5q33M1zhRiwb5LgoMku03az0KTbNyZhHCqagpYp51jW472pFRPoxtwDo8wFf9nL42yhUYF8c1Wm8fTJTbe0xDmsSW0IHiln X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16843711-f975-45ee-a706-08dcaa45b1d1 X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2024 11:59:09.6969 (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: 5ZfKwMVNJerBCDzVOXJMpbJhrqPmr7XT/D8HZ4nVc+dkpypVDtrCF3DiQlOpv4yR X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7970 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, 11:58 a.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(-)
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));