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 C5742A0A0E for ; Mon, 10 May 2021 18:12:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1C8D40140; Mon, 10 May 2021 18:12:32 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2060.outbound.protection.outlook.com [40.107.94.60]) by mails.dpdk.org (Postfix) with ESMTP id 6A15840140 for ; Mon, 10 May 2021 18:12:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KeAu8zsBfrlxzxTmawsNBzw87NZ0MbWRX7I4kuZ6+HLjLd2dKpXFJtb6DuEoU/ls/10zK+bxCiv6mfVEO6OWVy4yyZiKOyWsusOccV6daLVsKW12NZm5kAxcaJsD3xZ7SRr5jKTFtL2aQYHcnpaS06x/Zap+3/wKIa2ZDZuqFs/x/lOZxoULkeOu3tWWJkEHC8rzOAuJD+OxOcrRHYJJWfMdcZ+fcC9cu6g0jDCF1PsvVKYtcSen38F1wRQktG8NCfyL1PmKDQTA1L9xNGwYQDzGWDU9YQwQ6tWL02GscBAgQ99kLniQ1vpvUYxmu4V0dXcQCCVJMUYomiBt2UsnIQ== 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-SenderADCheck; bh=kFn6K6yRJ2/IDjM0yW/Mk/ZSTraiA6AV3cHr1wrQNgI=; b=Z45uS6+oFSq7Nv3PD8qIshJ9gJSv7NTT64c4wZi70CE1Dhd55NiRe63/hy/7lj9589sBN1EVAoLEYfToVh3PPvtcIAI+2f3jEM8N3dRro3g0y2q//MnaOdOSgF7tx//+QvHErwh37dP49w7hb1yS6bAdl3lzKXHgmMa4Rz6lwDoXvu/gL+Q+sp+q/0r9+feSn0jRhjZ22afF01/4igDj+EA1m37dpXRqhaQrpMa3AfkoHBicILcu4lgCKkFjGE+SdovpZ2p2lBHjqRv6Cs5fGpu8xnesitmlNMdgoET9DWIAvbop80gSL3l6XDo5St46g2rFZqQlFg/BZdOPB4Zqgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=broadcom.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kFn6K6yRJ2/IDjM0yW/Mk/ZSTraiA6AV3cHr1wrQNgI=; b=eLVBEttDZ+j6IW+6YWx8rZCMi8ews3Z7eEkUAU47f5zyistejaXZx1d4vFWcHDlIlZfhW/jdLEv1vKOeUUuj16VIVhAbEgQkqsmUQsDMSUStH4kOky15jFpWkTWlnMfP21m/3TsGUVTDoJUpJiuQ5DcmohfD6qVXDVGvgcgmailmq0YXG0lR6X8+AE/WipS9aToudjKysCKeYGY4ZcoLB45X8OPKbZT//Kcmsianig14/gnT/NMK+1AgAjNdL/KtF5CluGL6rocGfCsUv1ac5yyEySUvmFIu6QBFM8LZgKTP+r3WMVf2tvq9jIPTscGx0ObxuSyIb9d5jyK/O1wR0A== Received: from MW4PR03CA0239.namprd03.prod.outlook.com (2603:10b6:303:b9::34) by DM5PR12MB2406.namprd12.prod.outlook.com (2603:10b6:4:b7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.29; Mon, 10 May 2021 16:12:29 +0000 Received: from CO1NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b9:cafe::a4) by MW4PR03CA0239.outlook.office365.com (2603:10b6:303:b9::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:12:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; broadcom.com; dkim=none (message not signed) header.d=none;broadcom.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT058.mail.protection.outlook.com (10.13.174.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:12:28 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:12:26 +0000 From: Xueming Li To: Ajit Khaparde CC: Luca Boccassi , Lance Richardson , dpdk stable Date: Tue, 11 May 2021 00:00:44 +0800 Message-ID: <20210510160258.30982-95-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3f530da7-9ed1-4d2b-f527-08d913ce68b7 X-MS-TrafficTypeDiagnostic: DM5PR12MB2406: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FJiUlNS8PY1Aj2hDSFfKb9hfBQ2kVkV8rZNqBkT2zEG/g+qd1yCoYUC9NTltE3B48SWVi+niBTZArKIi2jzV8JTP7z6QAxBgMZlKBS2KL4DDSE+uSI5J4Me3pwSb+xpmas4xDNU2ToGmO1KOTWrz2ENTAQqaPdjNQrEI1Q3lXX1ZvvZ+LYn7DZs55QpTUTEs32cm1P6q/311owK3Z0e+T3rFOkT0p9FZY4Q7msO5BR5jG83+CKW9ybLdoLZRgSFhqaqz/mo1ve8SNu5AOO9TMa7Z/DgBQ3krTWr2NnDVbhTxWPfSxiW3FMCv+nVvqWmwV37UJvx7VTa8+UClbhmcuSfHlEP2w1Y50eMXBgo4Tc/SjExd+JSPzHMeLYP+4JowTX+Gmw3Z1zyF1VZEUFmISN/iSqjQqt7Tg5PijDS6PZzjBoHaPJvnzZfFH7DtRJMfTYmq1WKCLdY848mGXyUPcHnR2Wy4KNmY5PO+BrahdkQswd2rKbvWvxRVi5WsMbnPpnB0Ff38ysGOeUHt2fONQm3E3bFjaA7/3VIoxPh0aSfwsIKcB81HjlwuXifU1l9LC9j7wUUQaHt0+TamVmeNRPeeX/2SgHuA/kJDDExbuCWt/SrV95UaBqYMV8MYRwbfw2gPk3v4hiiaKY949+vXYbArNUEdEpraURW8MAVuXF3NggmIeW+Sd15eJShmHEl+7ng3186pHJUhTjd2bQR6JImQcv77qKqCVczeMJdTqJTH8ZIUG4xl0sME26HLHp9YnYKMjPYgprNKmmVvAtLVaA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(39860400002)(396003)(376002)(346002)(136003)(36840700001)(46966006)(16526019)(186003)(70586007)(26005)(82310400003)(2906002)(53546011)(6666004)(8936002)(47076005)(70206006)(316002)(336012)(86362001)(36906005)(966005)(426003)(5660300002)(8676002)(83380400001)(6286002)(2616005)(6916009)(7636003)(478600001)(54906003)(82740400003)(55016002)(7696005)(36756003)(36860700001)(356005)(1076003)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:12:28.9693 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f530da7-9ed1-4d2b-f527-08d913ce68b7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2406 Subject: [dpdk-stable] patch 'net/bnxt: check kvargs parsing' has been queued to stable release 20.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/34972cfd96876dba2932ccf2565d5a9a88fd7fc1 Thanks. Xueming Li --- >From 34972cfd96876dba2932ccf2565d5a9a88fd7fc1 Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Tue, 16 Mar 2021 18:08:40 -0700 Subject: [PATCH] net/bnxt: check kvargs parsing Cc: Luca Boccassi [ upstream commit 29ce7059e8e7307ac27ff94e7a46035f38d3f97e ] Check return value of rte_kvargs_process() Coverity issue: 357765 Fixes: ba404aacc5cf ("net/bnxt: set maximum flow count") Fixes: 02a95625fe9c ("net/bnxt: add flow stats in extended stats") Fixes: 7b0940653720 ("net/bnxt: support host memory based TruFlow") Signed-off-by: Ajit Khaparde Reviewed-by: Lance Richardson --- drivers/net/bnxt/bnxt_ethdev.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index b719cd74c4..e97a3ab8f6 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -5239,40 +5239,49 @@ bnxt_parse_devarg_rep_fc_f2r(__rte_unused const char *key, return 0; } -static void +static int bnxt_parse_dev_args(struct bnxt *bp, struct rte_devargs *devargs) { struct rte_kvargs *kvlist; + int ret; if (devargs == NULL) - return; + return 0; kvlist = rte_kvargs_parse(devargs->args, bnxt_dev_args); if (kvlist == NULL) - return; + return -EINVAL; /* * Handler for "truflow" devarg. * Invoked as for ex: "-a 0000:00:0d.0,host-based-truflow=1" */ - rte_kvargs_process(kvlist, BNXT_DEVARG_TRUFLOW, - bnxt_parse_devarg_truflow, bp); + ret = rte_kvargs_process(kvlist, BNXT_DEVARG_TRUFLOW, + bnxt_parse_devarg_truflow, bp); + if (ret) + goto err; /* * Handler for "flow_xstat" devarg. * Invoked as for ex: "-a 0000:00:0d.0,flow_xstat=1" */ - rte_kvargs_process(kvlist, BNXT_DEVARG_FLOW_XSTAT, - bnxt_parse_devarg_flow_xstat, bp); + ret = rte_kvargs_process(kvlist, BNXT_DEVARG_FLOW_XSTAT, + bnxt_parse_devarg_flow_xstat, bp); + if (ret) + goto err; /* * Handler for "max_num_kflows" devarg. * Invoked as for ex: "-a 000:00:0d.0,max_num_kflows=32" */ - rte_kvargs_process(kvlist, BNXT_DEVARG_MAX_NUM_KFLOWS, - bnxt_parse_devarg_max_num_kflows, bp); + ret = rte_kvargs_process(kvlist, BNXT_DEVARG_MAX_NUM_KFLOWS, + bnxt_parse_devarg_max_num_kflows, bp); + if (ret) + goto err; +err: rte_kvargs_free(kvlist); + return ret; } static int bnxt_alloc_switch_domain(struct bnxt *bp) @@ -5407,7 +5416,9 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused) bp = eth_dev->data->dev_private; /* Parse dev arguments passed on when starting the DPDK application. */ - bnxt_parse_dev_args(bp, pci_dev->device.devargs); + rc = bnxt_parse_dev_args(bp, pci_dev->device.devargs); + if (rc) + goto error_free; rc = bnxt_drv_init(eth_dev); if (rc) -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:29.077460000 +0800 +++ 0096-net-bnxt-check-kvargs-parsing.patch 2021-05-10 23:59:26.460000000 +0800 @@ -1 +1 @@ -From 29ce7059e8e7307ac27ff94e7a46035f38d3f97e Mon Sep 17 00:00:00 2001 +From 34972cfd96876dba2932ccf2565d5a9a88fd7fc1 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 29ce7059e8e7307ac27ff94e7a46035f38d3f97e ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ -index 646cc94bd8..372475231d 100644 +index b719cd74c4..e97a3ab8f6 100644 @@ -24 +26 @@ -@@ -5484,40 +5484,49 @@ bnxt_parse_devarg_rep_fc_f2r(__rte_unused const char *key, +@@ -5239,40 +5239,49 @@ bnxt_parse_devarg_rep_fc_f2r(__rte_unused const char *key, @@ -83 +85 @@ -@@ -5652,7 +5661,9 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused) +@@ -5407,7 +5416,9 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)