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 48412A034F; Sat, 16 Oct 2021 11:12:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 124414116E; Sat, 16 Oct 2021 11:12:43 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2071.outbound.protection.outlook.com [40.107.93.71]) by mails.dpdk.org (Postfix) with ESMTP id 966584116B for ; Sat, 16 Oct 2021 11:12:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oZ9zEWXhB3mygu/CDUtRztvVfu8e5u3FZHxsfgbY0RRucq6uwuvg0CCX2pq8RzKwJoNA8l08tUYPbWPYMZslV+rEvcmwvNl44n5a+KaiOLmui/wjfjfDbzxSHEAyVv7tSMi7LTAxhNJO7ahDyXDr4lbjrkj2dGBldAOvIwX+z7kHB3xCq7bvBfz1zQ4CmLHtt5b+dLya50SEWxAPo85KzLvRj5qNhDTF9ymb/ylHUydismP5DwZDy3n8KVh+ySYddQplyl7IViR3AXEzRPN0Ms5oRUE4CbiLfQE02oMcQo6Xf/ewOXZkcraOpnLYh8G1NerPO+tvWKekfrIeV+1knw== 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=fOjNiv78DMT2gS26N5HL4aPON+lJJIRP+HwtChP9cRo=; b=AlpYHzcMG7lA0IKGaD1ByaTFd2Cuo6f0N8TU1zBctwLHIl0lQSSIn9js14UJaTmjUYH8u19UnwnH6NVvljPch1zF4kSmFhOFJEI653730mPGNZ9XSp2v9E76GqFA3+QF19K1iTKun3COaY0/pl2jWH5JVY3pVxwqog9b2Ylq+yT8JpaGZGwF1QYeOMTnWnkqydXjdx+Uco8d7iG9VFuCr113lLhcjRhOzKTffvXRViJ2n4wGnkDnmmaXmk/ai+HvvW7Va0g0tvnNVqu97P51fW4OwIClEOItlf0LXvGeGPTAq/Bqo6/I1hz68SulzlOgnVkN/mf2DiUPC45wCbrzMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=fOjNiv78DMT2gS26N5HL4aPON+lJJIRP+HwtChP9cRo=; b=SWO6fSISf5GtyQyzopCZ/zM7L5V0t9+9HZxyhYGZvQbu+xshJif8Q/wpZ49pYZ62zTpcnxJTezAuv88jR1nrSC1g5Dl6AUfiPmi3ykBbyDPXx0pax4D0HC9EEY333mX4n6RErBR8iOKH6uTNfeO+w3zzbXsd/9wRdNiQDTt7TCvgkM+VLUAEjpyHsS5l/nFaW9x3aVxGoGmvrmCBN/IYRnLG7beHY81ZNv52EsM1zE9ErahCyB1cBqU5ISlxnrs/p9iqnQZeoHuT5+pIQ8eJntT5u20W9RAicD5iY29vEdyqtfmYOvKLcM5SyEVOBOQdyn95j1bVKv9wWgynAJ3wPA== Received: from BN0PR03CA0029.namprd03.prod.outlook.com (2603:10b6:408:e6::34) by BY5PR12MB5525.namprd12.prod.outlook.com (2603:10b6:a03:1df::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Sat, 16 Oct 2021 09:12:41 +0000 Received: from BN8NAM11FT009.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e6:cafe::be) by BN0PR03CA0029.outlook.office365.com (2603:10b6:408:e6::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16 via Frontend Transport; Sat, 16 Oct 2021 09:12:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 BN8NAM11FT009.mail.protection.outlook.com (10.13.176.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Sat, 16 Oct 2021 09:12:41 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sat, 16 Oct 2021 09:12:39 +0000 From: Xueming Li To: CC: , Lior Margalit , , Matan Azrad , Viacheslav Ovsiienko Date: Sat, 16 Oct 2021 17:12:03 +0800 Message-ID: <20211016091214.1831902-4-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211016091214.1831902-1-xuemingl@nvidia.com> References: <20210926111904.237736-1-xuemingl@nvidia.com> <20211016091214.1831902-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] 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: 9bbe9998-9c55-4478-a0dd-08d990851b51 X-MS-TrafficTypeDiagnostic: BY5PR12MB5525: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CRJBXEU9mV6GrVH6pJmCh1b9ZDc+E2fWhnTwRhmfDoILq9qZVZ84mhzXeuQUslJVJw864zSZ11uGNrnXIiWw0siTXwmY8YcmhViIV1mmaHPbqEfUUIuTZ+TIHZFjJlLbQaK8TD8H0Z0w3O+Qzuz53xBZIjnn54/ik6biN2puYZbhkwa+QizgxKuUVtWm07NdhEs/AjfBXxt844VWdX5R+dpgD/sCc3bZY29HY1izU4SCSN066JptGO1O3GewtRmh5hqKGD9Gd1nGr2YaTdW1JsGpdIIyNMygOEM6BBa/rkZAFZLf0t4AXs3m+2HX7T+cbDshkDY5T3Ci7czF9TChVQ0h/cJ9c0uYGDIKhAgOsq+ukglxHAiwyH0mGWYq2iaZOQMGlYCbQS8Dn9qK+CmcsL4syQe4ed9vEosAk1K01gG8OIhHWFLDaeFhI4OamD5eJTcTQNDmViuZt/FXQYj1ynRLY9Dz1E3FZDUQdOHEUfQxn2NgjJHo1ndtwtLomYLwNLzdydLbtcnSuzyRs6m7sxoxmDfmq+bS02Cjx4Ui4y+YeD8N5Z1o4FyInVc/OBhg/wOHZiVFIh9xo2LB5zSg/RS/GpSANo3joDMiNv9v5DYS9/WOI52UtZvab7fdt7f5xzNKanuZGtJoQ6phfoDRbrKuypMkUFaSGNtw21+aMd+KeAFo83lcJuEkPWLi2VNPfs+KaVHAhy2hY1tdhb1OgA== 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)(36840700001)(46966006)(55016002)(186003)(54906003)(16526019)(4326008)(82310400003)(86362001)(8936002)(336012)(508600001)(36860700001)(6666004)(6286002)(6916009)(26005)(70586007)(2616005)(2906002)(8676002)(426003)(70206006)(107886003)(1076003)(47076005)(36756003)(7636003)(356005)(83380400001)(7696005)(316002)(5660300002)(36906005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2021 09:12:41.1221 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bbe9998-9c55-4478-a0dd-08d990851b51 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: BN8NAM11FT009.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB5525 Subject: [dpdk-dev] [PATCH v2 03/13] net/mlx5: fix Rx queue memory allocation return value 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 Sender: "dev" If error happened during Rx queue mbuf allocation, boolean value returned. From description, return value should be error number. This patch returns negative error number. Fixes: 0f20acbf5eda ("net/mlx5: implement vectorized MPRQ burst") Cc: akozyrev@nvidia.com Signed-off-by: Xueming Li --- drivers/net/mlx5/mlx5_rxq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index fd2b5779fff..4036bcbe544 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -128,7 +128,7 @@ rxq_alloc_elts_mprq(struct mlx5_rxq_ctrl *rxq_ctrl) * Pointer to RX queue structure. * * @return - * 0 on success, errno value on failure. + * 0 on success, negative errno value on failure. */ static int rxq_alloc_elts_sprq(struct mlx5_rxq_ctrl *rxq_ctrl) @@ -219,7 +219,7 @@ rxq_alloc_elts_sprq(struct mlx5_rxq_ctrl *rxq_ctrl) * Pointer to RX queue structure. * * @return - * 0 on success, errno value on failure. + * 0 on success, negative errno value on failure. */ int rxq_alloc_elts(struct mlx5_rxq_ctrl *rxq_ctrl) @@ -232,7 +232,9 @@ rxq_alloc_elts(struct mlx5_rxq_ctrl *rxq_ctrl) */ if (mlx5_rxq_mprq_enabled(&rxq_ctrl->rxq)) ret = rxq_alloc_elts_mprq(rxq_ctrl); - return (ret || rxq_alloc_elts_sprq(rxq_ctrl)); + if (ret == 0) + ret = rxq_alloc_elts_sprq(rxq_ctrl); + return ret; } /** -- 2.33.0