From patchwork Thu Mar 3 15:26:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bing Zhao X-Patchwork-Id: 108520 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: 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 CFD6CA04A2; Thu, 3 Mar 2022 16:27:28 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 631384276B; Thu, 3 Mar 2022 16:27:28 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2065.outbound.protection.outlook.com [40.107.92.65]) by mails.dpdk.org (Postfix) with ESMTP id 38FA140687; Thu, 3 Mar 2022 16:27:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fez6ytMGH6Gf+w8ONMEHGswo5x7wsPISVoQ+OQCNBknWMPrL+EybtIzJouHty8hZYoaiGkUp3tDnJsw5TcHzupzYd2qEmbSurJgp2f+fOGk2r6lPOQhrhjpztAqtZlYr347KfOV3iaQ0W7yNcVnxHpqMJEQNcJ4PR1IHVM43V6buUG5VNakDmo1LO+hn4g3pm9BjdSYoVvTLAkWG6Fj2KhLHig0sHoFFowxr1Lx3DgNs5AEu/w8mQl25TkJkFeZaUCe9LKpb96K0SvKdSUOgwV/9Yv7zFISThpdekB3RtCmU6eggYvYfNTSEzvZExXIiK/Xdmu3t84qBeQBNRRjNQg== 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=Zthid4OtcY3QrC2w3Pk5oeCorRn8reduRYImIkpZnoA=; b=JCHxkHFSLPShyTEg2WTUeuZfI2geusLuxePQQIdvVy9oswFVVQlcTMG3OhLitOWkh9L1BIWDIBgy8MAa4778xo7/qGa4+jBkSnEdYB0q0gdCs5h2EqjrgNin+j84gSiGGXG3A20KY2YPVDEa2Pb9W0Q2BnBOKpZarpCXR8Oi36Pdt8WG3UQog8qH8pJ0dVXW+V6BC9mLP/mVFl8Mf1+EzCXc1iPk2P4Qzn29peH24zEZGS7u1NOFftMrbUAp3BUwHa1jLTQV+E39ptTD1A0R2n9Qk1IWqMdpbLMOgJWXsJWK88VLjntaG8cQr3nzm8Q5COZ7kg0TCXJv4SQpzQ7sPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=Zthid4OtcY3QrC2w3Pk5oeCorRn8reduRYImIkpZnoA=; b=bB6hcTME7br7fYxXRk+g6Z1iAW/C/ZT6vnXgnCQhnjAhjTDgl2r5rFzlA4Q3RkRaST514nk7vZKdM3MGiXXGmowxHbXaDVw7Rbn3amy4PhtwVZDCjELy9XghAPQWg64SXfITnyypBRXmqCr4YRro/NLLAR1WYmMvtoDTPWFS/KeMt1UzkqCRee4NOzMPEhhB6gHA/sqjuYImTtJFsWugeGRBgnyuI7kiM0dRp7lMnrDDHrVdFhq7Tm3y9P/mSYaHi3KYrIt88iGK3dLQutDkwakalW/SSIKcrfEMGdq8N6H5e7AVmAIti3/9PXOejO4zA028cQLeRfbHRMlyeLftdw== Received: from BN0PR10CA0007.namprd10.prod.outlook.com (2603:10b6:408:143::25) by MW3PR12MB4585.namprd12.prod.outlook.com (2603:10b6:303:54::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.15; Thu, 3 Mar 2022 15:27:18 +0000 Received: from BN8NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::f7) by BN0PR10CA0007.outlook.office365.com (2603:10b6:408:143::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.13 via Frontend Transport; Thu, 3 Mar 2022 15:27:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT034.mail.protection.outlook.com (10.13.176.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5038.14 via Frontend Transport; Thu, 3 Mar 2022 15:27:18 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 3 Mar 2022 15:27:17 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Thu, 3 Mar 2022 07:27:14 -0800 From: Bing Zhao To: , CC: , , , Subject: [PATCH] net/mlx5: fix Rx queue private pointers array checking Date: Thu, 3 Mar 2022 17:26:58 +0200 Message-ID: <20220303152658.105403-1-bingz@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0ce1b895-4839-4a19-11fc-08d9fd2a4d9e X-MS-TrafficTypeDiagnostic: MW3PR12MB4585: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: DKwPDEcl9pRbE4hZCfyi0nK7IS6Q+VssrbvqWVodjbyLy4nzoUktt0fV+Cp3jU/sqi2eHXsCSL9Sk9ez0CYjrv/Fr8krFNsQu3vvgAHlwzJ/MGFBZwYwrdXVbAba/l9gvn4in1iWvV93IANipejIqCbzrP8+dGTCx3dF+lMRs3ARcYW7eayifJVyRepmMQ7uFCZrgP5FQ0SihZuLElt/u5S9C17ESV0Ei0sa3QAw+FpV9gtQCfICHHQmlrtjseBbivmDMZK2ledOu2EmiV7dutybfMad6hsq/a93YVhtYFMKH5mMIQ6l4eQtgTpROW3cwss0iPezIbR+YUIpAfKEUxXvYH8ld81V3mpBgc3pBCUnYbBetujebVcK0+h2oZ+hx7b8RlRyZgG9gCBHgE1P6JxAfY/sHawAHOygxkM0WcQtyi8TgLu9u3z1x4Dp5oFrybwfzha18TpnbWFY4yiZW/3hsaIy40kG/KC0jfEOZWb+sqRFPUJPYPKj2327wThU5Fgtk/4a5AM/RG4gAewL+5rYCPuko1DapyRydButMgFEhpyIkGO8Jskg+M3zT4QzK5hnuasIhi/A/mUntmtQTvzey97L4Rz/YMw2oGs85ZFk+2N+pmsTnYni9ZOW1lCh0Al3P5aSZOhDO+PB77GJlLPyvJOtciEyR3YLLr1LZJuWmyKrLxLXfS9dT7Wf1bMf/s5jMOiNNoXM5cyKJ9qgQw== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(5660300002)(2906002)(83380400001)(26005)(36756003)(2616005)(1076003)(54906003)(6636002)(186003)(6666004)(47076005)(16526019)(336012)(7696005)(55016003)(426003)(36860700001)(6286002)(8936002)(316002)(81166007)(356005)(450100002)(86362001)(508600001)(82310400004)(40460700003)(70206006)(70586007)(8676002)(4326008)(110136005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2022 15:27:18.0732 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ce1b895-4839-4a19-11fc-08d9fd2a4d9e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4585 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 None Rx queue configured in a DPDK application should be supported. In this mode, the NIC can be used to generate packets without receiving any ingress traffic. In the current implementation, once there is no Rx queue specified, the array to store the queues' pointers is NULL after allocation. Then the checking of the array allocation prevents the application from starting up. By adding another condition checking of the Rx queue number, the application with none Rx queue can start up successfully. Fixes: 4cda06c3c35e ("net/mlx5: split Rx queue into shareable and private") Cc: xuemingl@nvidia.com Cc: stable@dpdk.org Signed-off-by: Bing Zhao Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index de0ba2b1ff..05c919ed39 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -111,7 +111,7 @@ mlx5_dev_configure(struct rte_eth_dev *dev) MLX5_MEM_RTE | MLX5_MEM_ZERO, sizeof(void *) * rxqs_n, 0, SOCKET_ID_ANY); - if (priv->rxq_privs == NULL) { + if (rxqs_n && priv->rxq_privs == NULL) { DRV_LOG(ERR, "port %u cannot allocate rxq private data", dev->data->port_id); rte_errno = ENOMEM;