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 2AAB345495; Wed, 19 Jun 2024 12:01:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 376F542E6D; Wed, 19 Jun 2024 11:59:26 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2130.outbound.protection.outlook.com [40.107.243.130]) by mails.dpdk.org (Postfix) with ESMTP id C3376427C4 for ; Wed, 19 Jun 2024 11:59:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lC2J+h8fBZCRMSixH4pEpoh8d1kj0tXrTFzXkStNIChF4fq1Sb1t+MLbw0H/rSLfurgX9cSYDykec+wbyI2OmTxGNKtiV6pD+CNCz9VV1rZHTGJnGoxd77XiCshv0V62XAiudgDnsT9+d7TPP3lM5gsuxW1BnAuTcYPsSYQsic/jVBwuOfe/bRZ3c7XtVyuD396yiUnyPnwUKoU7Cd5nrG2RU+RPekzOrG8tTDnr8j1EBgnljnmwXh06Jjc/a7haL7xHuqKZJT5fJvfY1IFPKAVrlhOLQVXl611rJrUfX1CZ5VaFH5U+LkPX8VytJjPgRfCglrNYAPEf3Wk/hhhowQ== 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=XWFgk0XYTRzXxfOQpnanDZp6Bn9v4EKa7+B/V1sW4A4=; b=SAQCQmzSXpM4PQdWpHOIvfObU66cEhlXob6NkhsomHbLXdk41wVpiIUH4fbsYRgLqKiLylcuay9Qk+nG/SYO92RAzctXo9f1+ZFfIIxXHnRoFyEjhWpHuETJ7ms8hYkx3gX0wZMG7ZdiwP5osCwJq3HPUdIZ+B4Nhxuv+G7kn+ztlHSIlhfJkqagnuUo5SsQAIGLbw1KcY/TxpDR2M9IKa2sQYLPIguVH7zKv35HFYJo7/gbQW+S7NhjdEkpsrVBFw/LHYMKC7/jop/luxFhdGPWiz5GEhgRBUEAIRx/10s3AgUizzYnNpYKiEVagFcqsypeWgBROZPljRHtmJPgWA== 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=XWFgk0XYTRzXxfOQpnanDZp6Bn9v4EKa7+B/V1sW4A4=; b=aVkWYI6AeJ99yyYhAhJD203tn/mytKbFNPdpClGTKcCMnNr+OWnvdpWOOxUa621VeMztfIbgcOqYnAhouLYwVyo3tTVV+ZetXcsku90Gjwsnv2byw5o5n7cfghaBO4R7cw8OCtzLEsEBprUCuIDCh2hsvtbM9z+Lni5vAyIwfDA= 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 MN2PR13MB3912.namprd13.prod.outlook.com (2603:10b6:208:263::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Wed, 19 Jun 2024 09:59:22 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7677.030; Wed, 19 Jun 2024 09:59:22 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Peng Zhang , Chaoyong He , Long Wu Subject: [PATCH 17/23] net/nfp: configure the VF queue Date: Wed, 19 Jun 2024 17:58:24 +0800 Message-Id: <20240619095830.3479757-18-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240619095830.3479757-1-chaoyong.he@corigine.com> References: <20240619095830.3479757-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0057.namprd13.prod.outlook.com (2603:10b6:a03:2c2::32) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MN2PR13MB3912:EE_ X-MS-Office365-Filtering-Correlation-Id: ab4c135d-abb6-4db3-d3cf-08dc90467e35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|366013|376011|52116011|1800799021|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?EH82PJXx3V6ZOWGImcis2K2/6kpx7QTN/1CpIk5kh13rx/kYniFQxBVVMWqE?= =?us-ascii?Q?NF1TrLjVnmfX5pNC4CN8Dtl95tEoHZyagAktEX4m6zddVmY+TLL8ChoTTNNB?= =?us-ascii?Q?BcEPxLSnzgiKAoXDxptaz0NPPbCvIDFMIhpVQeDQOmBIZeWxeiWH/bu7HKB5?= =?us-ascii?Q?FvJdCsZKjKaUVjs7FQVcgPstuN4hP903UCknrDO8xsAVokhlz0q86Rd6RYZK?= =?us-ascii?Q?Y7Wvfkkucv4ZE76aVXqxUF0CM22EwjeubZz6QRWzgf7IbzmdhnS7F5ucJa9z?= =?us-ascii?Q?s77ni9GTo8b1ycuXw79hVpdi684Q+cAZm3HFg1GvQUlNe3UVhy3fZLY9wHa1?= =?us-ascii?Q?rOcBAqeQNwPsnWjHGwdtHdNBm5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DVWTUl8T8OxBtE8nXBMNz3okMhvFkYIYuM74tBCMHchj2vEKoPkKTF0G7Hem?= =?us-ascii?Q?ay0WMbxVcnSU1hQzfhuI6jObqcuItccYW2bmWx5M54YKXD/QPrB686/i5+4p?= =?us-ascii?Q?lWNLTUA=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230037)(366013)(376011)(52116011)(1800799021)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xJQ0h+7TJ0ch4f/LfBGIS5waU65jGhuwjkGRU3T2SzsiFgdtfXpEpliQafXq?= =?us-ascii?Q?LNu+xiTUN3/VaMORK7hJ8D9JzTIcNWWPXEL0vqwUecwMN8UZaPqUVgGFa4PU?= =?us-ascii?Q?MdiRSEutAJbilhaF8kiwD/5BO8Ek1qsh61dVxxAiPzoqCo3yBGWjUKBe+pAb?= =?us-ascii?Q?Wsz/tReTPuc4Nju3rKtsuq7NU3Bz6t5EfJDJtBLNOBBst5W6XsWKYtdwU0fd?= =?us-ascii?Q?ECF3WSHxKY478kzgAYRidTkjIs0BvYVeuuK2OSA5QhKVxkTsLO8+A9UHSZ8O?= =?us-ascii?Q?h7bAxZHpUNxELMH0IU8ZgdCUSnbbMHKS2jUli7o85/VAbkZf+R29tzO53EJc?= =?us-ascii?Q?cwWv+k6gqQdUkISEshZhM5quFR73K/cK/DNn4qFA7+ATGB7FyHavYHN6Fp3i?= =?us-ascii?Q?bZ3akbm3AIBdYfkGETH/KgUkq3wnucG1DmidYGZmqyVll1ZD7YGKHh8MZvFs?= =?us-ascii?Q?oZs6ZeoY0RMxNWkgDOyzvT3jSOIEIhB1HbvCRxhsMPVWFmUKLhzYbs+l1SdK?= =?us-ascii?Q?zzVfutVBzJ2F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1P?= =?us-ascii?Q?Yd5ipLlumJOf1C8xuYxS7LepPsR8HX0TOu3K64T2tXeAiMTpgF63C5RWN9yo?= =?us-ascii?Q?08KygAPjLn5UBAY+pajEtwyzsk1bcKsLLis/CXZUKEqwPsYGTZfWxla/fxE2?= =?us-ascii?Q?ieM2E12FVofMtNALEELaRAbAw0y2C2opolHKYEv8VkwjiMqzEIngjmHXD/Aw?= =?us-ascii?Q?dg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab4c135d-abb6-4db3-d3cf-08dc90467e35 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 09:59:22.2586 (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: /iJkTBrZ323HumvXZpb41bgcKCje3gStgqSPfmk0R36rX6fHexR/8dgm70bv1ax93C6SOP51l18ZVJT7tQ+C0udLVLX9UWjE4oVcaCfcFdU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3912 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 Configure the VF queue, now every VF just have one queue. Signed-off-by: Peng Zhang Reviewed-by: Chaoyong He Reviewed-by: Long Wu --- drivers/common/nfp/nfp_common_ctrl.h | 2 ++ drivers/net/nfp/nfp_ethdev.c | 3 +++ drivers/net/nfp/nfp_net_common.c | 38 ++++++++++++++++++++++++++++ drivers/net/nfp/nfp_net_common.h | 2 ++ 4 files changed, 45 insertions(+) diff --git a/drivers/common/nfp/nfp_common_ctrl.h b/drivers/common/nfp/nfp_common_ctrl.h index a52c33508e..69596dd6f5 100644 --- a/drivers/common/nfp/nfp_common_ctrl.h +++ b/drivers/common/nfp/nfp_common_ctrl.h @@ -24,9 +24,11 @@ /* VF config mailbox */ #define NFP_NET_VF_CFG_MB 0x0 #define NFP_NET_VF_CFG_MB_CAP 0x0 +#define NFP_NET_VF_CFG_MB_CAP_QUEUE_CONFIG (0x1 << 7) #define NFP_NET_VF_CFG_MB_CAP_SPLIT (0x1 << 8) #define NFP_NET_VF_CFG_MB_RET 0x2 #define NFP_NET_VF_CFG_MB_UPD 0x4 +#define NFP_NET_VF_CFG_MB_UPD_QUEUE_CONFIG (0x1 << 7) #define NFP_NET_VF_CFG_MB_UPD_SPLIT (0x1 << 8) #define NFP_NET_VF_CFG_MB_VF_CNT 0x6 #define NFP_NET_VF_CFG_MB_VF_NUM 0x7 diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index f9f0884c88..1d88f33756 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -36,6 +36,7 @@ #define NFP_PF_DRIVER_NAME net_nfp_pf #define NFP_PF_FORCE_RELOAD_FW "force_reload_fw" #define NFP_CPP_SERVICE_ENABLE "cpp_service_enable" +#define NFP_QUEUE_PER_VF 1 struct nfp_net_init { /** Sequential physical port number, only valid for CoreNIC firmware */ @@ -1973,6 +1974,8 @@ nfp_net_get_vf_info(struct nfp_pf_dev *pf_dev, if (ret < 0) return ret; + pf_dev->queue_per_vf = NFP_QUEUE_PER_VF; + return 0; } diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index e1cae983b2..f8566d94d7 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -2654,6 +2654,38 @@ nfp_net_sriov_update(struct nfp_net_hw *net_hw, return 0; } +static int +nfp_net_vf_queues_config(struct nfp_net_hw *net_hw, + struct nfp_pf_dev *pf_dev) +{ + int ret; + uint32_t i; + uint32_t offset; + + ret = nfp_net_sriov_check(pf_dev, NFP_NET_VF_CFG_MB_CAP_QUEUE_CONFIG); + if (ret != 0) { + if (ret == -ENOTSUP) { + PMD_INIT_LOG(WARNING, "Set VF max queue not supported"); + return 0; + } + + PMD_INIT_LOG(ERR, "Set VF max queue failed"); + return ret; + } + + offset = NFP_NET_VF_CFG_MB_SZ + pf_dev->max_vfs * NFP_NET_VF_CFG_SZ; + for (i = 0; i < pf_dev->sriov_vf; i++) { + ret = nfp_net_vf_reconfig(net_hw, pf_dev, NFP_NET_VF_CFG_MB_UPD_QUEUE_CONFIG, + pf_dev->queue_per_vf, pf_dev->vf_base_id + offset + i); + if (ret != 0) { + PMD_INIT_LOG(ERR, "Set VF max_queue failed"); + return ret; + } + } + + return 0; +} + static int nfp_net_sriov_init(struct nfp_net_hw *net_hw, struct nfp_pf_dev *pf_dev) @@ -2697,5 +2729,11 @@ nfp_net_vf_config_app_init(struct nfp_net_hw *net_hw, return ret; } + ret = nfp_net_vf_queues_config(net_hw, pf_dev); + if (ret != 0) { + PMD_INIT_LOG(ERR, "Failed to config vf queue"); + return ret; + } + return 0; } diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h index 4b5029f3f4..b5c6152857 100644 --- a/drivers/net/nfp/nfp_net_common.h +++ b/drivers/net/nfp/nfp_net_common.h @@ -158,6 +158,8 @@ struct nfp_pf_dev { uint8_t total_phyports; /** Id of first VF that belongs to this PF */ uint8_t vf_base_id; + /** Number of queues per VF */ + uint32_t queue_per_vf; }; #define NFP_NET_FLOW_LIMIT 1024 -- 2.39.1