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 7D1E1A034C; Fri, 9 Dec 2022 02:35:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21E4240E03; Fri, 9 Dec 2022 02:35:35 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2102.outbound.protection.outlook.com [40.107.93.102]) by mails.dpdk.org (Postfix) with ESMTP id BCD97400D6 for ; Fri, 9 Dec 2022 02:35:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b9QOijl0/O+meJSAhAYMbf/Y2yg0HsP3S+j7vo/MLAUEFJ+ScOtsair+Ye+m58pb3H5NeAjrGLFOJQwWFCHQJK2BqO2S/sumGSolJdhxMeTGZ5SJFIFd4QbDwv9DImqZGFcqnxjRLG1RiVOonzJJzsXoTJhyO9KF37zCyvHs3rubYUoMlAgq+qKXkBolrNgi0IGLNYmvz+X7Kt17JQj+ZBowDOBolYw44pIbLUp4qG2/EUreAHHQomrm3R+pnJjTFpA3c+HWP0jEdWYZ712IjsqDY1TppEWQvys4GYqvtzOFFsraJNc20kGvsiB8dgPugXkVmxf0PY9pfa3aa/HplQ== 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=oIc4mpdV+4qhGbYOSGJ67FGJiMa5niAbx7DISQ5kYCQ=; b=KpcFK/cX/lp/7xf107vvDnUxSogsl9raMumDYXL/5/wDJakaB2RqcGtaApSuzEjK+zFHQ+M3xUArBHZAFVhUR0ghf6q4/iagrRdacQ8CcVQwAxQeJ4NQXpHlYgoSHn1RVbJU+n8MpOJeor9U42Hhx2oddCfi6jU0X5grMdyAf/8H2ObBtHYkxz1qRLUc41Fx7aLHP6K9IHvjMwKlZ5QM3fRPzB7/PtEpw9ckrCYgUN4+TSRayQs3RoKOJh9wv+Kntxw85EUMsmxwkNsGtovcJ8RNn6WsZGIpuZIFzNWlcjKzxmZBHkEgjbsetq5GrmZxCDg8baxnHOp4ov39Hwr+4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oIc4mpdV+4qhGbYOSGJ67FGJiMa5niAbx7DISQ5kYCQ=; b=eSXYqAeRHABEPLGHtfvgRKu6XOUzPHnS7u5DQznKzfKtlbs3MIIfa//yA+2MdBMSZrfLhANopE3Np0Foi3PGDdJNrwK5YFUAwcy4UvEZxZ0Gv/GpvbT2JprUouIwoSpq20Li0Oix2X96dQcYknswPxDNhz7HbnhMsvVHP0oNvog= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by SN4PR13MB5677.namprd13.prod.outlook.com (2603:10b6:806:21d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Fri, 9 Dec 2022 01:35:30 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::5122:8c31:51f3:4ee7]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::5122:8c31:51f3:4ee7%5]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 01:35:30 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Peng Zhang , Chaoyong He Subject: [PATCH] net/nfp: check whether the generated VF can be used Date: Fri, 9 Dec 2022 09:35:12 +0800 Message-Id: <20221209013512.34630-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.29.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0310.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:197::9) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SN4PR13MB5677:EE_ X-MS-Office365-Filtering-Correlation-Id: 3988b11d-53b8-4b68-aa28-08dad985a72b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5HtRg8DYiqxNEe1XpvYfkfOfvllXEQyezoJK1U4RaH2OfRpCE/vPMydILZMm6ofdKaswpffVMiHK0ltOODG4KuywkdI7JR36VVZCtNeXnCvbiUK/Gd5Cx38uVkb8U98ElbTTliuwW9sKmGEqV8bakC6p0Jw+htIEeqb9Hk/0/1DHVW7txpCSYV6c4aYAKnsjdEQmIdtI8L3bHY8YI+MjQf+4ywEvCIE8qrWdiq+5uHUVOHMmdiNjTSyXUhnfpZtdKWpUP/qHHblJDP6P3XurrLVfhi9L2mOkVnMDil5kQVuQiE27+5J16bsAujN8rSAH7H0Lpl3FNTLahZkbl9MRruRA9+nUdgl7v3uqf9R1VnikPEiMtduYAzjLC6quPyb5QbYM0KppPsrgvLeSxpEZqE8zOcxAX4js5ciJrt89fJwdn5lgymtGK30vrKVPs8MXsu27CeVwE+XlDPOs8Hd977RZKPlsxx5XliEZ6ZnTPLrZh9EY57ZM1XGETYbRxSq0hPimm0yDYOOih2z5IRkGj/grbtFPy/ZkcW1Ae5esIjUz+boK7B5Rb5V+k/TLgcEzl3NW73VvOr3e2MO4OAusOh1R9LSpyg/czcM5A06AgN0DYOEsny85JMDlZE+styaAyp9bOZ6/B6EJkvkYlT64K1PDEvvUhZn4iufRe2yP50SYh+KPyumtE1GaIVPBekUvh9DbbqOooZTO+CWbSkIQ+A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(366004)(396003)(136003)(376002)(39840400004)(346002)(451199015)(66946007)(36756003)(186003)(478600001)(2616005)(1076003)(6486002)(107886003)(26005)(6506007)(6512007)(52116002)(38100700002)(86362001)(6666004)(8936002)(8676002)(66556008)(316002)(2906002)(54906003)(4326008)(6916009)(66476007)(41300700001)(5660300002)(44832011)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RytyaGdodEFNb1ltWFBSZlZISk9EbjNtYVZFdlV0bWpVSWJmS1V4NDEwRDBz?= =?utf-8?B?NEs3SUhRRXBqTHJwZlA2K01PU0Z6WG5FNlBkY05lV1lnUzlTczNjblFXdkp2?= =?utf-8?B?YUI4eit0UGpmRkRpRmpFNUxkazJ1NmVaOHpxUzJDNWY1Z0tQb2Y2NmQ4MENQ?= =?utf-8?B?YWRiOTBjTkFwamdWOExHMnlWbzdYcDNlM1hmdEhJTGs3YTNXKzVwa1pzSWlh?= =?utf-8?B?UmsxZlROdFVHckYzQ2ZrOXZiT1hOd2VyZTgxdGFWUDlhOTNzSnlVMnFZNXRz?= =?utf-8?B?U3FXMVNVbTF6QXZMUkJkcVpxV2MycEZuNGZIU3crR3dGVkFMSS9LbTZCaUM2?= =?utf-8?B?SWE4eDl2RGhrTW4yeFhUeXJ6SzlSU2FJMkJuS3ZrSHJ0S2NEd05LbllmRlhL?= =?ut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: 3988b11d-53b8-4b68-aa28-08dad985a72b X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 01:35:30.0812 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QjdvLFmbkz9uPtMbvmrJnH5EmT6yP0Kt2LSh83cT9hBJrSqnNRNCKV43lnzctDxR09GAeNVuD7wc00IaraK+Nj8hV4qmL5IiQ672HRb2Z+8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR13MB5677 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 From: Peng Zhang All the queue pairs are shared between VF and PF for NFP, and there exist different assignment policy for different firmware application. The user can create VFs up to the max number of queue pairs, which will cause the last few VFs has no queue pairs and cannot be used, because PF must occupy some queue pairs by default. This commit add check to prevent this kind of VFs be used. Signed-off-by: Peng Zhang Reviewed-by: Niklas Söderlund Reviewed-by: Chaoyong He --- drivers/net/nfp/nfp_ethdev_vf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index d1427b63bc..3aa0e46150 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -333,6 +333,13 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) hw->max_rx_queues = nn_cfg_readl(hw, NFP_NET_CFG_MAX_RXRINGS); hw->max_tx_queues = nn_cfg_readl(hw, NFP_NET_CFG_MAX_TXRINGS); + if (hw->max_rx_queues == 0 || hw->max_tx_queues == 0) { + PMD_DRV_LOG(ERR, + "Device %s can not be used, there are no valid queue " + "pairs for use, please try to generate less VFs", + pci_dev->name); + return -ENODEV; + } /* Work out where in the BAR the queues start. */ switch (pci_dev->id.device_id) { -- 2.27.0