From patchwork Thu Oct 10 09:17:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 145580 X-Patchwork-Delegate: ferruh.yigit@amd.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 1423D45B00; Thu, 10 Oct 2024 11:17:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD2E140611; Thu, 10 Oct 2024 11:17:43 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2100.outbound.protection.outlook.com [40.107.223.100]) by mails.dpdk.org (Postfix) with ESMTP id B07EA402D8 for ; Thu, 10 Oct 2024 11:17:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=y3SR7awdl0mIv8oqZyrBLWcKhcVaAb6LURo0xIgP7N7SsR7/w5kN3iY/ZgPurUzfBlUs6rFDb5crP5SNiZbHuJXPv7ay0h0ZCM2uuu8h+tSNoNPcp2mwm/EzRchhsA3J3ugMYDZ2GGm0N7rGhuRzrzkky/x5DpaGB5R7m5VkmxLC0TiEVJUlkbTdKlIgOtt/bC3A3tRuxILd6hYjiJ8ESH+sT6ug3FByijIBYD1T7WQqFeSjyqT/o4N4o8J57jV5pKtg+3B4stLwk6qBNM4/6As4L4NteqneBQRUJRBZNk8Wq711PIYkx9rf0TFh/eC+09fWUUPFRqWA3ciXORUk2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ol+JsUrFzQlgGbzSntt5Qbi6DaknwY40no0T+HcF7gY=; b=kilw3vt4VdUsZsRMpfLZHC7U3B5YCvgoCVCWkt3/XJxCNG8RS2hu0O8VbPUVh7CHto8xB43h2MT9PBhEGpSp520UnoTMarKTldI592pwGEmHHMbDuM6DS6Ez0B4QjSZwzhNGH/LB1fj/BNFp+Xn+SaYR4o8cnuqurJTSnMBoCoQGIG5PzCWqczVSXhEf2c7njNoVPM1MeKBzOnRUQGRfHZC6heAiBy2q9cyEPD6dIBy4ezmrVe4n4ckpdkiycA4qzm9ejjUv4uBK2FcUrRLNh9qf2ku+/xY7R4wtwhc+YGIybxvKbm5gS7n3uzwhEqROFhRIM5xb4V5djpcZUZ+hpQ== 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=ol+JsUrFzQlgGbzSntt5Qbi6DaknwY40no0T+HcF7gY=; b=s1lKhSm70FTrH7FYnlytu96Zr/m4KXfjSaB/R6iHpzCY0N6RAuSwiWkakUIRiekDwtdoT3+LtN88lJugN7Tv7H58Q6k8OwzHthW1e6DV3TnkiQ5xNXl49Q1DEJOfi/qjyNL6iGAk5/rwEFefJhTi7QXR18K85lzDTPCQ/c6Yr1c= 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 MW3PR13MB3980.namprd13.prod.outlook.com (2603:10b6:303:5c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Thu, 10 Oct 2024 09:17:38 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Thu, 10 Oct 2024 09:17:38 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 01/10] net/nfp: use strlcpy for copying string Date: Thu, 10 Oct 2024 17:17:07 +0800 Message-Id: <20241010091716.3631747-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010091716.3631747-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> X-ClientProxiedBy: TP0P295CA0060.TWNP295.PROD.OUTLOOK.COM (2603:1096:910:3::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW3PR13MB3980:EE_ X-MS-Office365-Filtering-Correlation-Id: 00a41ae6-fee9-46d3-cfea-08dce90c6269 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: zapatdDqNcqI45FSHEAAP4bxBX6AZ0RQo/S78KaT62uVST68bGlet7BLYyN+DE3Tmi/KCfy8a8tRTZ+UfKI7PEnneUAX42KhltRw+w5Y3fq/KCm19VYYSHwPX0D/Q0j/BAUwhYX8DqTEai2S2z8udiVvTmwDEg/EuIA72ySyHU6LZa2RjKAU/psRM+pkSKbB6zGUf40sxSeMRyTcHcDVJ+ugmT4X37iaS2ck8hQkP2bgGQvfFgFQWmQT5p1aKuHwLVrk9NwpEr+wnCudvBnja1R3ke+FS1+0pXSat8OQmBX8HfmEyTsuRdkw4YSAaESGiVb9fADZp8v6ZwmSJRnit9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CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 87trY+TjFyEg41AN2GrYPm0pvRjAmogdrH+QvGInUj/xnf3+gZzOqgIG+V+gfn1vQssaEsSKAkN0SYJcctgpIOWpbr6hoEGdyprzqFV95zxA1UspggmH0XYctpNf1KNJ+RMhsitM62SKWa3jsnAikqID8XupwfLd1UY7Oj+eO3cdy8J1kg5XapzpGOWG2/xoWLgAzuRSwNFWlXRBPifAEKeC2fX6ctqk0EQpGHN4xzHvzRVrDRxWILkBwCHBEO7oyduEdBgmCpH3IJuo+dpVU4V42RtqDHmZWjyts3vmWagIMMStpHEBttyHxu8rbPJN2LbEI3vuT1MscrFTc9RceiUleCvZmumpVgwMhH4wzGjCAVMeaGDb5oyP1vMplei4/T3CagZZGBZBlG/IVRJ7LxHXQuJs40oQ+tQiWk/hLlcJQ/kvMMYB+DshuzKiJTb0Ge0dVPNKQGW9jc2R64qE3PEi60IzpUZ10SZgpR/YrlU0ENRyUa0ocTQ+ng9oAxgP7XWXfwaC+FkCkSYAPC3bFm6vaHKtrBa/OPzR3aUX/ZwxqTkNwjCDFqMX1bejItGdwPac+deYdsSOIbZAMV8LkFxNAdaf1u3BenX1WC7R7KJ8sXzQUEJAExe9SwPhvN6RXdJddraVABsVYIgyU40KtXEsgf53MyKM5vc32N4sGw61zvPAZryu2/DMQ3nDbJXGzYyKQl7MKU1YfZoe5IPo1ZH6uVBQWAighuyPaCbcHcPpx0QFJFR/VwciHEHc5Mm0nJJBin+L7tG+03bClpi2MutWikgfJYX3sKR1IajG6ZCdAU23KRFb7dzDJ6TpY+RdkA9akkNWHU2vF7Z3mMdCTWgkOi9wtnolPTBGbwbwDz0qw9haeFQlRk6+bswzmL0vCXyD8xRydzKrIKu0lP8CPBKw1k9B/QThccl6xDcSu9Lf/HWglPYY/bTpK5TWCAA1ZRko6A20aYrzUt/Ld8zSGeeYXNtCqvdYkvES2G1DV4SiCKCY6hRVyf3p+Pfq3fegzBWEkx36K/Ps02rF4rFhHJ5iSJEsGuvckJl/Mc21Rh6+JbEMdMCBCwu7g179V+Yy8Cu54DGfKXhlswSLi5CJqmcA7PulyGEW1BG1vc1eGd8+pDv5RdOcvqj1fcGsUGjM5ioFdiQY0AqS70Ze7GsN7C51EN2mDelp7r6MGSeokXo7xzvW+dlSARTfF8nSY/vojekTWHVLD52uaF092Mherw5a5643rmivK0Nv74sr8NMU6sA3NJa+8PHdG+Z55qOLgBVGXLFlFfSErtL7rF+G1pakW64cPVLiHQakmPK/E9EXTo8ELavsZUZHzt04gMQhEAHmuRpHxTopsnuntaaNo1zdI35rdnlTcIYNKwBtflpJ39NldPf7r6lGet05TgY9Us7EnTg9Q34u7c0seMphcro0V5rtEbv2XYpazkCeAm03/T04L0vN88ZSM92bVGz4g/o9/2umFlLyX9hs9vEgaWWiU+NXHJe89vxKKXXQzK+53QOuNVFaIoURSd9eAu61TE7NHvm/WEttaIA3j7t/aFGp5yjH+YnZCYG8vrPAkKqUJsejyK/Gaa3j8GPdF7fsmyTobQSYLATUnq5TQpR/XQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00a41ae6-fee9-46d3-cfea-08dce90c6269 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:17:38.1928 (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: B1xFNUJ/zbnc2YwZyLnui6jqLPf4C/Eg6IrTXVoKxbxMOowBihmGn3wPHo/0f2CzSaf96y/Mlxx840pQsVI2tcooriA99kRCO7+0UEDrTn4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB3980 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 Replace 'snprintf()' with 'strlcpy()' where applicable. Using 'strlcpy()' is safe practice when copying strings, as it will include a null terminator. Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang Acked-by: Stephen Hemminger --- drivers/net/nfp/flower/nfp_flower_representor.c | 4 ++-- drivers/net/nfp/nfp_net_common.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 5db7d50618..d1558b905c 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -576,7 +576,7 @@ nfp_flower_pf_repr_init(struct rte_eth_dev *eth_dev, repr->repr_type = init_repr_data->repr_type; repr->app_fw_flower = init_repr_data->app_fw_flower; - snprintf(repr->name, sizeof(repr->name), "%s", init_repr_data->name); + strlcpy(repr->name, init_repr_data->name, sizeof(repr->name)); eth_dev->dev_ops = &nfp_flower_pf_repr_dev_ops; eth_dev->rx_pkt_burst = nfp_net_recv_pkts; @@ -652,7 +652,7 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev, repr->repr_type = init_repr_data->repr_type; repr->app_fw_flower = init_repr_data->app_fw_flower; - snprintf(repr->name, sizeof(repr->name), "%s", init_repr_data->name); + strlcpy(repr->name, init_repr_data->name, sizeof(repr->name)); eth_dev->dev_ops = &nfp_flower_repr_dev_ops; eth_dev->rx_pkt_burst = nfp_flower_repr_rx_burst; diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index 4a2c536704..c9a95ed632 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -2306,7 +2306,7 @@ nfp_net_get_mip_name(struct nfp_net_hw_priv *hw_priv, if (mip == NULL) return; - snprintf(mip_name, FW_VER_LEN, "%s", nfp_mip_name(mip)); + strlcpy(mip_name, nfp_mip_name(mip), FW_VER_LEN); nfp_mip_close(mip); } @@ -2317,13 +2317,13 @@ nfp_net_get_app_name(struct nfp_net_hw_priv *hw_priv, { switch (hw_priv->pf_dev->app_fw_id) { case NFP_APP_FW_CORE_NIC: - snprintf(app_name, FW_VER_LEN, "%s", "nic"); + strlcpy(app_name, "nic", FW_VER_LEN); break; case NFP_APP_FW_FLOWER_NIC: - snprintf(app_name, FW_VER_LEN, "%s", "flower"); + strlcpy(app_name, "flower", FW_VER_LEN); break; default: - snprintf(app_name, FW_VER_LEN, "%s", "unknown"); + strlcpy(app_name, "unknown", FW_VER_LEN); break; } } From patchwork Thu Oct 10 09:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 145581 X-Patchwork-Delegate: ferruh.yigit@amd.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 A349A45B00; Thu, 10 Oct 2024 11:17:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 268974064F; Thu, 10 Oct 2024 11:17:45 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2136.outbound.protection.outlook.com [40.107.223.136]) by mails.dpdk.org (Postfix) with ESMTP id EE722400D6; Thu, 10 Oct 2024 11:17:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L/TaQK0Ks0eAlZSZV8PQnNFdfXmVO3jH+YaLZ0TC/mXYyFMj/84/AD9j9T+p2+9KoQeQrJgrx3zxHNBKN2cmJeSiD1RXkPClJFk0bkdiEgwui02u4/YQ4OeqGznM72oMnRoGtBkDMOQktItoSXIrSHNvxT1cKFkKf395M0xZykey4WSaVxA3wNGpxI6/8RfxUwr2cjqD4L+VI+CViUxw/QEuZwbocR6JA+Y9m85aMaD6rb+XZMGLjidplOoL376lYLSXA5yOEvD7WjYimG0dE2YD4EJQryK4XBioWTvB7csy/nqORDsjaJh2BkaCLbFPjowzYX3Ab4X0PvOk4G2qMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=EKadea9M6MeGbY4rGjlVCmx/DDemtsU0ZZfE2zS3ICA=; b=xTWufiv9dXy+tyvTauPB3bOXQll0z3AeTx66aqzmtL2uCSnc5u9fAzOoBcPOZ2bFImkRyP8AKcS92VPquoTAI8335zGxUZZnZZKwPl2RJINrtjO9Fkfa7BRSfR00Tm74R7Td1SS4IZ261M7Ds6PtAVks1R6jC1B0lAiPicvkmKrD30OCoAcFjuScYstncJNae6qmBFRbtdOht1L/n/LHUtSbmIAw7bEh3pw+XAoN2qSv1ofNR+T+vhU7bZFEnsNGMaEfPFw7LOw12pPnp017WfktKmgI7AhJsfBublhATAOgVHYKbiZyDUF9RJnvOHTwXm/hL8l8EbYoxb6q4K1W1A== 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=EKadea9M6MeGbY4rGjlVCmx/DDemtsU0ZZfE2zS3ICA=; b=W2+qYWqEbkxo0ca1g6na5XTiY1HcpvKjjPp8nJPs3dT/awDcYOjqwx6oyd1iqqnCAGaveWeOkA3XJ49fFmF4JCUf4rcveP1TBoliIeWXQDYpc5kArASmG56LWf2iyvUdkVjnHpKDEWoiKelMnvHDEbZRN07y6x+xBkTaApnclBs= 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 MW3PR13MB3980.namprd13.prod.outlook.com (2603:10b6:303:5c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Thu, 10 Oct 2024 09:17:40 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Thu, 10 Oct 2024 09:17:40 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , peng.zhang@corigine.com, stable@dpdk.org, Long Wu Subject: [PATCH 02/10] net/nfp: fix malloc name problem in secondary process Date: Thu, 10 Oct 2024 17:17:08 +0800 Message-Id: <20241010091716.3631747-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010091716.3631747-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> X-ClientProxiedBy: TP0P295CA0060.TWNP295.PROD.OUTLOOK.COM (2603:1096:910:3::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW3PR13MB3980:EE_ X-MS-Office365-Filtering-Correlation-Id: dc111f84-b184-484f-d895-08dce90c63c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: 27h7u9vs9L3ztbbILJy7Mjt7FKT14czQ1p68bH9/VyOdyjkO5VJqd1/y4vxfbrILc9B3Kr3itBqM6hcKBpru/TiqR5Llt5g2qPKSnhVhYBowiwn3HxiaQp3QC/SWk7iOriV3aEu4wNmm+jSRbopj9a3TQPcOgmaJfoO7DoQ4PvSVAosSulibWh7IMod3+oiaWLSvAZVYGsnSIYB+POgMh+ZB4OSddaVq4nhFwL2czWr8ha5vDhl31DacQHTBwPpvvTJVOk2n/ngyg4C5kSs5/EiU3HyddEFDmCmz6gRJ7qfvQSh5/2Ahp9+U1PbbmIq7Q+jpaPTnUmXGJAedpG6JuGHLOnLJ2M1ulcEnXplW/mrQ+LnSUUllvpC8Jwm9fK8XdkIr/EwP8gGY0sApHMOnbyzg8o4GNrrZjl6T/l3Wo6IXY6TElKoW+Kotx6vjXfIjiJ25CoqARy7mGG3PTzt3c1QP6wefFH1ERZweTzOidq8UrI6ndINnX06HYSV6/6enufpWq0LQp4AhV+aGoUO00Bt7O+b/Es+lkF18rCPCBLpyPtqCVgk8Zibm08KEX/yALANWdR0WPU7esuE4vUo/AFgM/dYDSgcFoi2bic8UWHR5a6i4aKwz36YpUxpTva9536yZ3dgOh7AMftI+j/yb3vGzRI55qfk6Aa9kMUctea4z1sOzZZ7VojSgK+sc+paluscXLXf3WGJaNwC5H83aRPTir73ka6uJOdEvT4QBzvUKULxAhMcnadquL+wSb5hA5JYPw2Ym7TjvhKtqNzChhGm1Fem1HJLF2AnrR+WcwI050wBvjbvI3l9BxMygsrOZGRg44y4XGnomfM6YvW29N3zSZgw97FGqXPWeyoYxI3vn9VhnI9EtJK3zOxfy7QUo0AjnkSrF/cGFBYyoY9aNQdNk2HgGT4tODLE0KRXiimnskiura8mIcpLKMphBhX4InN8xV+Le+WAmKBgr+p0tvJisrAhqWMB7bBRIYGN/KzFt/4JsEVCBF/KQ8gm14urgiagbqGXcZS84fONx9sqOkIOTk6ddhFXj0V79Q0SPM4jd+hHbEno6Q7NVzTVPRIC/+b7yYwbsfqmtUePJUcEsI/RBxs8pqg/PHdwlNCw9FunkiDiiyFAxJH3HL/He977/EU2n9MHTRhNDT2FiHdtBmLpl9KlRny3UYyEmo+GTzLd9DerzeNOzOWEHMlUsL/+qKZ/T7d4LJM+qSCGTDWZO74sNop5JjNxO+65puRJbJ/OEcGZB0RrxSJDiPs9DYJICzUJNQwjz3UC088zzuMihTmlwW7FC2oxo4ZSI6wteH6jNlEkhJ7not4doCcpNHWrrR9H/6vPwtBTtUqhwhqz4bA== 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:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jAxgthDjreFcJfnUj8uE/rZcICN4npQ0xdwGQsdTQls1g+TB/9ji1lyR4EBk2xpTH6O97oCQf6Om73fOzfQwMhy6z2ojs3O1i6mBlwb+csv8MVutkm9c25S/THOowx1dBP6AdIkyKa9u+gL1ZJ3wKCySPqBBJhV0LB8mTKRnjJBKg9Mf3VSsebaLXJhoTVlgknjQ4cZ/tCg431YCcuRXXWfjm8Gtm7SBzJehjfVFDgscmOKrMMEO1IcKIniojjGyGu5Z+Z8HeNnJV0g8zICM2zONRrwOfnpVT75E3PKrcs79TYI6oVP26VpK8hHd5bFBeI09ghKpDQ+E2zts573P9SoLsNtY//w0jA8D/icprDJJtv88B6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HSotiph/F6RpVbtXA9EKSvlW1hkotuWr/njR1miS31LRGJ4XaW6GrUHIb7B8QFhhDx2gPteADTmgnc7kag4OB5Imjg+vJpjpLbGhF4Xo+xumBAHTb6CCmuEfxmoPHtFk50EZQXsffO3RS3/58Ljr5962nZAeNh26xNw7ahtH3g== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc111f84-b184-484f-d895-08dce90c63c9 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:17:40.4839 (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: h6vPpsZujtPxKVir3seQBpwgavcNiDP1bfm+3fQEdr/iisQ73OsZkmgsW25miIJfFiyJL2PKkGitcxeWJXOFDCu+LPREvd1R8AhaQgDhbIw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB3980 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 The original logic keeps using the same name parameter when malloc memory in secondary process, which may cause error when using multiple PF cards. Fixes: 3b00109d2b65 ("net/nfp: add PF ID used to format symbols") Cc: peng.zhang@corigine.com Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/nfp_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 64a06440f5..3732abc9fe 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -2669,7 +2669,8 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) } /* Allocate memory for the PF "device" */ - snprintf(name, sizeof(name), "nfp_pf%d", 0); + function_id = pci_dev->addr.function & 0x7; + snprintf(name, sizeof(name), "nfp_pf%d", function_id); pf_dev = rte_zmalloc(name, sizeof(*pf_dev), 0); if (pf_dev == NULL) { PMD_INIT_LOG(ERR, "Can't allocate memory for the PF device"); @@ -2714,7 +2715,6 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) } /* Read the app ID of the firmware loaded */ - function_id = pci_dev->addr.function & 0x7; snprintf(app_name, sizeof(app_name), "_pf%u_net_app_id", function_id); app_fw_id = nfp_rtsym_read_le(sym_tbl, app_name, &ret); if (ret != 0) { From patchwork Thu Oct 10 09:17:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 145582 X-Patchwork-Delegate: ferruh.yigit@amd.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 C160945B00; Thu, 10 Oct 2024 11:18:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE0DC4065C; Thu, 10 Oct 2024 11:17:46 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2137.outbound.protection.outlook.com [40.107.223.137]) by mails.dpdk.org (Postfix) with ESMTP id 6FC4740647 for ; Thu, 10 Oct 2024 11:17:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JYpHokMJ2lRJiD6fsjaJr0aOirUL8xOFudVyfxaP4516KSy2EQYNT01H7N7gPe5C8DRv7g4ZSe79kMINECB9cefTIHb1C2+NmHQEDEHVCcfKvFth2JM/fyFb2bs7WHynkTiLmhZcjUOPALCO4x7ZXESzhQKgzIrtWcNcMYLi50ToNUzNj/RskCYSzSaRNEJoJxi2UEUT4iJ2gmjwuLEprbgj0RNBUqAo4Y8A2riGf79B7ON5xv4OWVNYnhu220Z/fHOX7iUvoMrKr+bDu9IWLvLVkuXC0EDRe9YJSNXjxj9MZpHrnS6UEwFJmo9Ufg3VEJgL+GKEhj5rJMLpyrFexw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=RC+ONDSaNqDT1nDI0SMp99aJ0Ij7zKKuUAUWH3SRCtI=; b=LAobtEI9iLa9fuVE0bGoTIbM6BlvNnvzUzWqVBQwsKBKYMXBHoIEAY4nUHlM99DNjbvDDgEvP719X9RTYypzNpS8elMjU+XtLq090/2NGyzJo9e/Ujl7gURVklz6crDqONxFy+5FIuS1XGvc5qg0HEVJ6wIuerdytZeeIsvBON1lfTeO6vk78Oq8Dwg0hvJyx+uuLIapf34n6dgKqlBeV9wY+4uAjWmHSjYwihnSNDtGJHJQR1z8fKLsPZoBcwlNjPM/Z0zb9G7JP5GaY4I0YpsEOMWMf4djv32xx/LgVBcheuqsN5RlShsAl4KsFDPNbyELwqIXflTm2i+r9papTQ== 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=RC+ONDSaNqDT1nDI0SMp99aJ0Ij7zKKuUAUWH3SRCtI=; b=plAp2C2zz/v6UPuGFfU3Pv16l8pwXtcjPPJrkC170cSvOKotghfKTiInEudwN3UceEQ++xF/jJUmXG0PgGG3s51+yWif6H7QNaGc3qfK9orNapaLUpAjZT7gcUTPfNjbVdPyc3ypWTVzZ5EV/zBhiOon6HSplq8GBxtVrLln/Bc= 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 MW3PR13MB3980.namprd13.prod.outlook.com (2603:10b6:303:5c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Thu, 10 Oct 2024 09:17:42 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Thu, 10 Oct 2024 09:17:42 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 03/10] net/nfp: simplify some function parameters Date: Thu, 10 Oct 2024 17:17:09 +0800 Message-Id: <20241010091716.3631747-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010091716.3631747-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> X-ClientProxiedBy: TP0P295CA0060.TWNP295.PROD.OUTLOOK.COM (2603:1096:910:3::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW3PR13MB3980:EE_ X-MS-Office365-Filtering-Correlation-Id: 09c181f0-511f-44de-74a3-08dce90c6505 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: M56zId2vD4blXATw0KfuzdfTfvZznLp+M/2oO+TrswQ0n8HpQTIQqS3ZtiCiQkIXdRDyjJ5+29W5M8okmDkk0V4pSBX1zNB0ipbqUmPRXRD6qm5cUOhK/yWsfOgi/5lImMFik85tdqTlUQaaw1Sogm83cqdXmNb0dZNAwqHBH3ne/811X3w4Fw/gQKoD5x5hV2sW3DgAOx9BSOrRWRhgIl7m+9RV3n3pA7Nd49S2e4gnhUPYlDQXmkKsbHw9n1i4GzdBxDnwt7WXPceDqVDnnYxE6YQyKmak/K6mrrBCHSTelbc1JaglfhK9FfCHBTi1nrJ2252bh0lI49NGmEbolWjgCHInWVIQW4LFUVOcVoEYLgJ9+Xfnja905P0g6C73n35gy/OINACg4LH1kgRJUIsppdDKUQ5duFVqriuLbZftspASsdsJ/9PAWveZORiyER3RjRSEfh4Nv43xgPjnWUgwT4ekvvUTBEUIOwcPdjXQ7wkolh3sc46Ns2/3D4nGLB0iPdYBLWnYkO4EaSqxJn3NtwG52gILyLewoLVlpALHiN4UvsXbLV+KIq0V9mkh+HsWfxCWOPIbczRDOqkTTUUHx0c3FKnScetzPDcbwjVG4zUP9TrRredByGxLoMR51iDVkD8vSCdlK2ZUhhjW5RlnthyYbfLum+DopKZTPr1ytNoWcycatqAIg6PQ60JcXvBXFUEp9iZkRq4cbap9rLO7U9Gipc9Tn2DcDp4/ca6jLyj6ButVS54tqhLtf8YPjE1v/rhmbcxieLjCBgLXX4cjrDB+X4Ci88R3+QhZmh0catJ72Fkd7xg7kHczJk0lCn3fTDY+g0Y27WV2MHApFYhJidHErJKjM6fBaTGxyIZazkAFuylRpvhsFYykRDCb7Jw/6hBEQ+GGLBZLUYUmeyes8x/WUcYdcwfWP+B/ki7Uj4lFsh06snieC24LQ59ZBWaoWalVnUZwWGZzIHOfAzoNYTydvSsbRKc4Yzc4ifIm7MvF9FrkNz/dNF+2AEiEgLsAcIOu9AdYtv8E5GSKsyKeAXsZq5Xrt1S3jTTbrR9YBbnSsNzpFVAGGlTiOPf8QJsRHZiAjLwuHOLBseCXI2HSvSfFZbqnGlcKq3akROrKLmg43yzZq76nGplt8qafPLe+gcbIQocIo3/O8E60vHN/7ACE71aNGFXFg6ZunlwvhKe6dDNyTR1yQImraq63cp1a9ocFzoC+j4PAD3cr1Je8qI9Vi3JaBqLStu49vmDCe43M6nxpIOqqDsuJ8Gqk4y5NO5sv3vpYnJBvcNtg+YmD3D+46kxG84DuDIOcbrykjT01bi9ImKf6lbcilm425DJT1c93MoJy9eh3+VLa7w== 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:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zUWxGaKy3UT+QxgiHngkHH5N2yf1x5783DKN1BGsI8j+UwoTIK/NzJPHHY986fXNHUdyEPt6xq38KIPEhWB91Fbxov0FrIOje1mk7cN/bbjXGMqgopmy+ZoF3hsDu8I408y0UXuq5oOxNoWgQQMaiqPTOj6PM6EuIughegWAsHk4lXXY8ehJuIRfO/ff4L8DpxL+lCPY9/eTOO36ZJq8rn45WekogZIx7hWuzXG6fCHFtYq5CO9CDLZKJd5NiBDPqXP0Zx4FHOzRi8jhxNC6W70aQYwbASKx3a9X8Iee/8Z4RajlNwELfciQMuFFDJUlYlvIU91115EkS7AreSp6kfQhTQVLUsjFhOC058JYnn8P3GvFvdoyZA8+Lpz0NVUOgZW9pizLPvJc5vQQSQYS+I+xjHeYxXXWz1858QFL16dy056K2zqtcjrnCQG8XAhwXE1ef+uFqw94bPLVC1XZ4L9tgGG4VoFgiLZ/rkSINJwEcxzT1gdbRuXOU19Z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qYFY1JDQq1atV+xw6GMMYbqCsz7gw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09c181f0-511f-44de-74a3-08dce90c6505 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:17:42.6848 (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: f0t35b3Fo8sfV+AtNAORydtPmf7ZD7o7EoIRpbUuAgEWMaNLQerYRXbZUYzKvtsxZdLMBzDSiJPVnzKyvtv9Rn9ItycE2krp7palIZ8YwRI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB3980 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 Refactor to the logic of initialize process to simplify some function parameters, both for primary and secodary process. Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang Acked-by: Stephen Hemminger --- drivers/net/nfp/nfp_ethdev.c | 153 +++++++++++++++---------------- drivers/net/nfp/nfp_net_common.c | 5 +- drivers/net/nfp/nfp_net_common.h | 3 +- 3 files changed, 76 insertions(+), 85 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 3732abc9fe..121f82af6d 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -1160,14 +1160,15 @@ nfp_net_init(struct rte_eth_dev *eth_dev, } static int -nfp_net_device_activate(struct nfp_cpp *cpp, - struct nfp_multi_pf *multi_pf) +nfp_net_device_activate(struct nfp_pf_dev *pf_dev) { int ret; struct nfp_nsp *nsp; + struct nfp_multi_pf *multi_pf; + multi_pf = &pf_dev->multi_pf; if (multi_pf->enabled && multi_pf->function_id != 0) { - nsp = nfp_nsp_open(cpp); + nsp = nfp_nsp_open(pf_dev->cpp); if (nsp == NULL) { PMD_DRV_LOG(ERR, "NFP error when obtaining NSP handle"); return -EIO; @@ -1185,10 +1186,7 @@ nfp_net_device_activate(struct nfp_cpp *cpp, #define DEFAULT_FW_PATH "/lib/firmware/netronome" static int -nfp_fw_get_name(struct rte_pci_device *dev, - struct nfp_cpp *cpp, - struct nfp_eth_table *nfp_eth_table, - struct nfp_hwinfo *hwinfo, +nfp_fw_get_name(struct nfp_pf_dev *pf_dev, char *fw_name, size_t fw_size) { @@ -1199,11 +1197,11 @@ nfp_fw_get_name(struct rte_pci_device *dev, const char *nfp_fw_model; const uint8_t *cpp_serial; - cpp_serial_len = nfp_cpp_serial(cpp, &cpp_serial); + cpp_serial_len = nfp_cpp_serial(pf_dev->cpp, &cpp_serial); if (cpp_serial_len != NFP_SERIAL_LEN) return -ERANGE; - interface = nfp_cpp_interface(cpp); + interface = nfp_cpp_interface(pf_dev->cpp); /* Looking for firmware file in order of priority */ @@ -1220,15 +1218,15 @@ nfp_fw_get_name(struct rte_pci_device *dev, /* Then try the PCI name */ snprintf(fw_name, fw_size, "%s/pci-%s.nffw", DEFAULT_FW_PATH, - dev->name); + pf_dev->pci_dev->name); PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name); if (access(fw_name, F_OK) == 0) return 0; - nfp_fw_model = nfp_hwinfo_lookup(hwinfo, "nffw.partno"); + nfp_fw_model = nfp_hwinfo_lookup(pf_dev->hwinfo, "nffw.partno"); if (nfp_fw_model == NULL) { - nfp_fw_model = nfp_hwinfo_lookup(hwinfo, "assembly.partno"); + nfp_fw_model = nfp_hwinfo_lookup(pf_dev->hwinfo, "assembly.partno"); if (nfp_fw_model == NULL) { PMD_DRV_LOG(ERR, "firmware model NOT found"); return -EIO; @@ -1244,8 +1242,8 @@ nfp_fw_get_name(struct rte_pci_device *dev, /* Finally try the card type and media */ snprintf(card_desc, sizeof(card_desc), "nic_%s_%dx%d.nffw", - nfp_fw_model, nfp_eth_table->count, - nfp_eth_table->ports[0].speed / 1000); + nfp_fw_model, pf_dev->nfp_eth_table->count, + pf_dev->nfp_eth_table->ports[0].speed / 1000); snprintf(fw_name, fw_size, "%s/%s", DEFAULT_FW_PATH, card_desc); PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name); if (access(fw_name, F_OK) == 0) @@ -1433,15 +1431,15 @@ nfp_fw_reload_from_flash(struct nfp_nsp *nsp) static int nfp_fw_reload_for_single_pf_from_disk(struct nfp_nsp *nsp, char *fw_name, - struct nfp_cpp *cpp, - bool force_reload_fw, + struct nfp_pf_dev *pf_dev, int reset) { int ret; bool fw_changed = true; - if (nfp_nsp_has_fw_loaded(nsp) && nfp_nsp_fw_loaded(nsp) && !force_reload_fw) { - ret = nfp_fw_check_change(cpp, fw_name, &fw_changed); + if (nfp_nsp_has_fw_loaded(nsp) && nfp_nsp_fw_loaded(nsp) && + !pf_dev->devargs.force_reload_fw) { + ret = nfp_fw_check_change(pf_dev->cpp, fw_name, &fw_changed); if (ret != 0) return ret; } @@ -1459,8 +1457,7 @@ nfp_fw_reload_for_single_pf_from_disk(struct nfp_nsp *nsp, static int nfp_fw_reload_for_single_pf(struct nfp_nsp *nsp, char *fw_name, - struct nfp_cpp *cpp, - bool force_reload_fw, + struct nfp_pf_dev *pf_dev, int reset, int policy) { @@ -1473,8 +1470,7 @@ nfp_fw_reload_for_single_pf(struct nfp_nsp *nsp, return ret; } } else if (fw_name[0] != 0) { - ret = nfp_fw_reload_for_single_pf_from_disk(nsp, fw_name, cpp, - force_reload_fw, reset); + ret = nfp_fw_reload_for_single_pf_from_disk(nsp, fw_name, pf_dev, reset); if (ret != 0) { PMD_DRV_LOG(ERR, "Load single PF firmware from disk failed."); return ret; @@ -1490,25 +1486,23 @@ nfp_fw_reload_for_single_pf(struct nfp_nsp *nsp, static int nfp_fw_reload_for_multi_pf_from_disk(struct nfp_nsp *nsp, char *fw_name, - struct nfp_cpp *cpp, const struct nfp_dev_info *dev_info, - struct nfp_multi_pf *multi_pf, - bool force_reload_fw, + struct nfp_pf_dev *pf_dev, int reset) { int err; bool fw_changed = true; bool skip_load_fw = false; - bool reload_fw = force_reload_fw; + bool reload_fw = pf_dev->devargs.force_reload_fw; if (nfp_nsp_has_fw_loaded(nsp) && nfp_nsp_fw_loaded(nsp) && !reload_fw) { - err = nfp_fw_check_change(cpp, fw_name, &fw_changed); + err = nfp_fw_check_change(pf_dev->cpp, fw_name, &fw_changed); if (err != 0) return err; } if (!fw_changed || reload_fw) - skip_load_fw = nfp_fw_skip_load(dev_info, multi_pf, &reload_fw); + skip_load_fw = nfp_fw_skip_load(dev_info, &pf_dev->multi_pf, &reload_fw); if (skip_load_fw && !reload_fw) return 0; @@ -1523,16 +1517,17 @@ nfp_fw_reload_for_multi_pf_from_disk(struct nfp_nsp *nsp, static int nfp_fw_reload_for_multi_pf(struct nfp_nsp *nsp, char *fw_name, - struct nfp_cpp *cpp, const struct nfp_dev_info *dev_info, - struct nfp_multi_pf *multi_pf, - bool force_reload_fw, + struct nfp_pf_dev *pf_dev, int reset, int policy) { int err; + struct nfp_multi_pf *multi_pf; - err = nfp_net_keepalive_init(cpp, multi_pf); + multi_pf = &pf_dev->multi_pf; + + err = nfp_net_keepalive_init(pf_dev->cpp, multi_pf); if (err != 0) { PMD_DRV_LOG(ERR, "NFP init beat failed"); return err; @@ -1551,8 +1546,8 @@ nfp_fw_reload_for_multi_pf(struct nfp_nsp *nsp, goto keepalive_stop; } } else if (fw_name[0] != 0) { - err = nfp_fw_reload_for_multi_pf_from_disk(nsp, fw_name, cpp, - dev_info, multi_pf, force_reload_fw, reset); + err = nfp_fw_reload_for_multi_pf_from_disk(nsp, fw_name, dev_info, + pf_dev, reset); if (err != 0) { PMD_DRV_LOG(ERR, "Load multi PF firmware from disk failed."); goto keepalive_stop; @@ -1627,13 +1622,8 @@ nfp_fw_policy_value_get(struct nfp_nsp *nsp, } static int -nfp_fw_setup(struct rte_pci_device *dev, - struct nfp_cpp *cpp, - struct nfp_eth_table *nfp_eth_table, - struct nfp_hwinfo *hwinfo, - const struct nfp_dev_info *dev_info, - struct nfp_multi_pf *multi_pf, - bool force_reload_fw) +nfp_fw_setup(struct nfp_pf_dev *pf_dev, + const struct nfp_dev_info *dev_info) { int err; int reset; @@ -1641,7 +1631,7 @@ nfp_fw_setup(struct rte_pci_device *dev, char fw_name[125]; struct nfp_nsp *nsp; - nsp = nfp_nsp_open(cpp); + nsp = nfp_nsp_open(pf_dev->cpp); if (nsp == NULL) { PMD_DRV_LOG(ERR, "NFP error when obtaining NSP handle"); return -EIO; @@ -1665,20 +1655,19 @@ nfp_fw_setup(struct rte_pci_device *dev, fw_name[0] = 0; if (policy != NFP_NSP_APP_FW_LOAD_FLASH) { - err = nfp_fw_get_name(dev, cpp, nfp_eth_table, hwinfo, fw_name, - sizeof(fw_name)); + err = nfp_fw_get_name(pf_dev, fw_name, sizeof(fw_name)); if (err != 0) { PMD_DRV_LOG(ERR, "Can't find suitable firmware."); goto close_nsp; } } - if (multi_pf->enabled) - err = nfp_fw_reload_for_multi_pf(nsp, fw_name, cpp, dev_info, - multi_pf, force_reload_fw, reset, policy); + if (pf_dev->multi_pf.enabled) + err = nfp_fw_reload_for_multi_pf(nsp, fw_name, dev_info, + pf_dev, reset, policy); else - err = nfp_fw_reload_for_single_pf(nsp, fw_name, cpp, - force_reload_fw, reset, policy); + err = nfp_fw_reload_for_single_pf(nsp, fw_name, pf_dev, + reset, policy); close_nsp: nfp_nsp_close(nsp); @@ -2063,7 +2052,7 @@ nfp_net_speed_cap_get(struct nfp_pf_dev *pf_dev) uint32_t id; uint32_t count; - count = nfp_net_get_port_num(pf_dev, pf_dev->nfp_eth_table); + count = pf_dev->total_phyports; for (i = 0; i < count; i++) { id = nfp_function_id_get(pf_dev, i); ret = nfp_net_speed_cap_get_one(pf_dev, id); @@ -2078,9 +2067,7 @@ nfp_net_speed_cap_get(struct nfp_pf_dev *pf_dev) /* Force the physical port down to clear the possible DMA error */ static int -nfp_net_force_port_down(struct nfp_pf_dev *pf_dev, - struct nfp_eth_table *nfp_eth_table, - struct nfp_cpp *cpp) +nfp_net_force_port_down(struct nfp_pf_dev *pf_dev) { int ret; uint32_t i; @@ -2088,11 +2075,11 @@ nfp_net_force_port_down(struct nfp_pf_dev *pf_dev, uint32_t index; uint32_t count; - count = nfp_net_get_port_num(pf_dev, nfp_eth_table); + count = pf_dev->total_phyports; for (i = 0; i < count; i++) { id = nfp_function_id_get(pf_dev, i); - index = nfp_eth_table->ports[id].index; - ret = nfp_eth_set_configured(cpp, index, 0); + index = pf_dev->nfp_eth_table->ports[id].index; + ret = nfp_eth_set_configured(pf_dev->cpp, index, 0); if (ret < 0) return ret; } @@ -2322,6 +2309,9 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto hw_priv_free; } + hw_priv->dev_info = dev_info; + hw_priv->pf_dev = pf_dev; + sync = nfp_sync_alloc(); if (sync == NULL) { PMD_INIT_LOG(ERR, "Failed to alloc sync zone."); @@ -2329,6 +2319,8 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto pf_cleanup; } + pf_dev->sync = sync; + /* * When device bound to UIO, the device could be used, by mistake, * by two DPDK apps, and the UIO driver does not avoid it. This @@ -2347,6 +2339,9 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto sync_free; } + pf_dev->cpp = cpp; + pf_dev->pci_dev = pci_dev; + hwinfo = nfp_hwinfo_read(cpp); if (hwinfo == NULL) { PMD_INIT_LOG(ERR, "Error reading hwinfo table"); @@ -2354,6 +2349,8 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto cpp_cleanup; } + pf_dev->hwinfo = hwinfo; + /* Read the number of physical ports from hardware */ nfp_eth_table = nfp_eth_read_ports(cpp); if (nfp_eth_table == NULL) { @@ -2369,10 +2366,12 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto eth_table_cleanup; } + pf_dev->nfp_eth_table = nfp_eth_table; pf_dev->multi_pf.enabled = nfp_check_multi_pf_from_nsp(pci_dev, cpp); pf_dev->multi_pf.function_id = function_id; + pf_dev->total_phyports = nfp_net_get_port_num(pf_dev); - ret = nfp_net_force_port_down(pf_dev, nfp_eth_table, cpp); + ret = nfp_net_force_port_down(pf_dev); if (ret != 0) { PMD_INIT_LOG(ERR, "Failed to force port down"); ret = -EIO; @@ -2386,15 +2385,15 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto eth_table_cleanup; } - ret = nfp_net_device_activate(cpp, &pf_dev->multi_pf); + ret = nfp_net_device_activate(pf_dev); if (ret != 0) { PMD_INIT_LOG(ERR, "Failed to activate the NFP device"); ret = -EIO; goto eth_table_cleanup; } - if (nfp_fw_setup(pci_dev, cpp, nfp_eth_table, hwinfo, - dev_info, &pf_dev->multi_pf, pf_dev->devargs.force_reload_fw) != 0) { + ret = nfp_fw_setup(pf_dev, dev_info); + if (ret != 0) { PMD_INIT_LOG(ERR, "Error when uploading firmware"); ret = -EIO; goto eth_table_cleanup; @@ -2408,6 +2407,8 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto fw_cleanup; } + pf_dev->sym_tbl = sym_tbl; + /* Read the app ID of the firmware loaded */ snprintf(app_name, sizeof(app_name), "_pf%u_net_app_id", function_id); app_fw_id = nfp_rtsym_read_le(sym_tbl, app_name, &ret); @@ -2417,6 +2418,8 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto sym_tbl_cleanup; } + pf_dev->app_fw_id = app_fw_id; + /* Write sp_indiff to hw_info */ ret = nfp_net_hwinfo_set(function_id, sym_tbl, cpp, app_fw_id); if (ret != 0) { @@ -2425,17 +2428,6 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto sym_tbl_cleanup; } - /* Populate the newly created PF device */ - pf_dev->app_fw_id = app_fw_id; - pf_dev->cpp = cpp; - pf_dev->hwinfo = hwinfo; - pf_dev->sym_tbl = sym_tbl; - pf_dev->pci_dev = pci_dev; - pf_dev->nfp_eth_table = nfp_eth_table; - pf_dev->sync = sync; - pf_dev->total_phyports = nfp_net_get_port_num(pf_dev, nfp_eth_table); - pf_dev->speed_updated = false; - ret = nfp_net_speed_cap_get(pf_dev); if (ret != 0) { PMD_INIT_LOG(ERR, "Failed to get speed capability."); @@ -2484,8 +2476,6 @@ nfp_pf_init(struct rte_pci_device *pci_dev) } hw_priv->is_pf = true; - hw_priv->pf_dev = pf_dev; - hw_priv->dev_info = dev_info; /* * PF initialization has been done at this point. Call app specific @@ -2678,6 +2668,9 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) goto hw_priv_free; } + hw_priv->pf_dev = pf_dev; + hw_priv->dev_info = dev_info; + sync = nfp_sync_alloc(); if (sync == NULL) { PMD_INIT_LOG(ERR, "Failed to alloc sync zone."); @@ -2685,6 +2678,8 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) goto pf_cleanup; } + pf_dev->sync = sync; + /* * When device bound to UIO, the device could be used, by mistake, * by two DPDK apps, and the UIO driver does not avoid it. This @@ -2703,6 +2698,9 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) goto sync_free; } + pf_dev->cpp = cpp; + pf_dev->pci_dev = pci_dev; + /* * We don't have access to the PF created in the primary process * here so we have to read the number of ports from firmware. @@ -2714,6 +2712,8 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) goto cpp_cleanup; } + pf_dev->sym_tbl = sym_tbl; + /* Read the app ID of the firmware loaded */ snprintf(app_name, sizeof(app_name), "_pf%u_net_app_id", function_id); app_fw_id = nfp_rtsym_read_le(sym_tbl, app_name, &ret); @@ -2723,16 +2723,9 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) goto sym_tbl_cleanup; } - /* Populate the newly created PF device */ pf_dev->app_fw_id = app_fw_id; - pf_dev->cpp = cpp; - pf_dev->sym_tbl = sym_tbl; - pf_dev->pci_dev = pci_dev; - pf_dev->sync = sync; hw_priv->is_pf = true; - hw_priv->pf_dev = pf_dev; - hw_priv->dev_info = dev_info; /* Call app specific init code now */ ret = nfp_fw_app_secondary_init(hw_priv); diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index c9a95ed632..99f6b61947 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -2724,13 +2724,12 @@ nfp_net_fec_set(struct rte_eth_dev *dev, } uint32_t -nfp_net_get_port_num(struct nfp_pf_dev *pf_dev, - struct nfp_eth_table *nfp_eth_table) +nfp_net_get_port_num(struct nfp_pf_dev *pf_dev) { if (pf_dev->multi_pf.enabled) return 1; else - return nfp_eth_table->count; + return pf_dev->nfp_eth_table->count; } uint8_t diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h index 0b5bba2a3e..fb244383b7 100644 --- a/drivers/net/nfp/nfp_net_common.h +++ b/drivers/net/nfp/nfp_net_common.h @@ -374,8 +374,7 @@ void nfp_net_get_fw_version(struct nfp_cpp *cpp, uint32_t *fw_version); int nfp_net_txrwb_alloc(struct rte_eth_dev *eth_dev); void nfp_net_txrwb_free(struct rte_eth_dev *eth_dev); -uint32_t nfp_net_get_port_num(struct nfp_pf_dev *pf_dev, - struct nfp_eth_table *nfp_eth_table); +uint32_t nfp_net_get_port_num(struct nfp_pf_dev *pf_dev); uint8_t nfp_function_id_get(const struct nfp_pf_dev *pf_dev, uint8_t port_id); int nfp_net_vf_config_app_init(struct nfp_net_hw *net_hw, From patchwork Thu Oct 10 09:17:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 145583 X-Patchwork-Delegate: ferruh.yigit@amd.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 4EE4545B01; Thu, 10 Oct 2024 11:18:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02A654065F; Thu, 10 Oct 2024 11:17:49 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2132.outbound.protection.outlook.com [40.107.223.132]) by mails.dpdk.org (Postfix) with ESMTP id 956C540657 for ; Thu, 10 Oct 2024 11:17:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EeKnVL1f/h8eDPXldAmyP/NnXUf0Hx8SgEFjuecxuYBziuBwR2SNUUV4MhV6EpFe+ogeqPQV/CdliI/Wcw8GwvSIeqeX841NbhlqqQvXAzSp7HZSwKPYrBuWd6XjgnNERyqGLuO/4C5LVsGL/kUv/aXHQbQhEM5xOp/rCr8JDYUCKfQs7VZk/8ScehkbrN1DN7Jh3d7n9HwY9CojCiaPB0Ui7qEZmQtjn8jDh0PkP3LXBNYsgkShXmGwShDYIWsOihAzdxAArbi6a9E1DIk7fVrfxXXqQJ+1ikEEpwZx2TgPRqqsOhrx8rDuHZKz5tDRakVe31q1cg14SURkFOtE6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=WbgaHOrBFPcD1b90icegQ4yaee/z7noTTLbZNLhVEB0=; b=hmQ5O8bP8kxviFu5z0+uNgLKv6Zwp04AwAFgj43vwc3lTZLW5g5+gCGjxGZr9EL+/7RfIu8ECyXcTLYNj/+hVLJDaPtS9hAO1Y25hMAyGDuE8plo2Uv3p3SCRgv8MSLUMN7ndi0xWPHcxotRaahLAg2pqIIHuN+h4vDSqinqWWpba/y1JP4Ky0sIT30oamLVD+0A02EjJoUejwcBYgEGFfXG0/NF2K8PK7NAtFpFuqlPvB1EGqOzlnWia6V3i2vgtSMhyrw9sD6ZgvBPFttmaJR37W/s7iXEwnIhfqa6AVkPj9IRMCnyNTjEshRuMDOwY0CqJaceGCgyA7wSuEFikQ== 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=WbgaHOrBFPcD1b90icegQ4yaee/z7noTTLbZNLhVEB0=; b=ubdVJXQk7otOrIqI69OwBfHsrcMM8x0H36pYVx/DoYs3JX+JTtkA+SpM1ECXfr/PBi0aJDdvYDZ+b8OS6V1KaTZeLRYpybgNMhCCFfpgfQuOZOtb9OptQJEfbHRgyBPVVYFxoyD+yA9QxWzPpq+IAt6m89RHMQA04VkPQMt1Jss= 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 MW3PR13MB3980.namprd13.prod.outlook.com (2603:10b6:303:5c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Thu, 10 Oct 2024 09:17:45 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Thu, 10 Oct 2024 09:17:44 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 04/10] net/nfp: improve the logic readability Date: Thu, 10 Oct 2024 17:17:10 +0800 Message-Id: <20241010091716.3631747-5-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010091716.3631747-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> X-ClientProxiedBy: TP0P295CA0060.TWNP295.PROD.OUTLOOK.COM (2603:1096:910:3::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW3PR13MB3980:EE_ X-MS-Office365-Filtering-Correlation-Id: 89da3e1f-c212-4d42-4f95-08dce90c666f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: I30/83vNRj+iRvi8A29UGxWYQ6bu/XzW5eELffyeAmYL6ASignm5CErw69bU9ZtjSFlYXQYdFLGxKQDwYMTkzV9NfOAiZVaWqKpWKXO5dpvBCMdZrUa+i5e3MzdRdkXfmeOqHlbYMPjhrGk4ipWn6M+CiCx3ATM07DeScv/k+izP6bliL1Fi/e+BfwCuaHWOW/XalnK9dxg+OTwvo6+7vrPwEr2567ImjO8B73t/CuOmUvP9ldGGQzgYBIOTY+aIEY8FX3W8VJ9aNcf+Si7Sghk0W1CUTacx6GBeHyHIDHu/tYhSOTP63Dc7qKgfDVf2o7gp+1oHxo+bnADjVAj0TZsOgflGjAhlHqj5WF2+xENDo4yhGo6ofon0dB/fA2bKJbpzoYkOGb7AolixrFijByNv1KykY62whN4M0wADS0n4DI407qOVGmtbJDyEsFPNwKy5zvF/V6VUNtxjvWv3xYNqDZSa4fgMANMpkOZk47xUiIhO3VFmj4hU7Ikw6lP5JD60UKOMKb9UDVWZKqPzMYSh0UV9Go6n1dqNbEX2PZgfVWxcAnvrr3er3wE5z2rbMv75+tl9HLMv9c1FpLsfYIapr9P2V3IIv7dvD+USBu3k/T2/0vr2TOzUuUONbo7553udXk/DmBCzOxtZqUlvI540tauaXIB4b1OvYDxCVcqtDiaImQDt5hbB2Qk8eytg+FKurQXa0Z2wsV2WTwcncd6sXB/Qn3ojZscwik+r6lKNeRtGcLv0a2yXZNvZFk8+6a/tAunyf7GnCS/XC/rHnUvqwTbqZYmk2Ri+tWNkzVoh9AN5TH9HVBqQSsJ3K38v2SCg8HuGhzV6h+JyEWgQ0zcZLWw/LBvZukcd8ImrVDcyOFEwqVSU9pLIRbGu15TwVGiPIdh8NrQoR92MCVvFf8SdXAajzAKWdtHKUIoXQRpNBR/cv6/e6gdt3Za8dFqLX1onB4Yz11qiJwJ9kVWFXD/C9WtBgLUiLoLo/dhETizWJvhHljR/pm4UUeU1gf9OpQktQvg+o7yjVSbMoYOAtbDvPQPDQSTW23p5u2HfVQiZzntuFdk4rRu50Cw5NL/IGtAU5r2rKClyS3GG5nRaOtJcOXsg03cTPA4Ibiv7fuTo6qCMgnmp983mX2Dr54GYvi7OdwGoYXNznvdwFvKBPrL8LiakMya+monnb/a3Vv1CYBAJ0LrpszfthPOMffu5pCn3AEFOeWjoZA3+ehHei2ZwNREI3nTMHaMyUV5GUaatqfcePnmWQtb40pkzDzOPzyR4DzEaTOtp1sWzN8Kc+tQayQf0PeSlIWy9QR8898/DP8lZjFIB2lfL2+70KkHlUU+Q5vVaphX9HqCyafI4wg== 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:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Xytcc/Hc6DxKoUpGmDID4q4C44ngFVtyFs65P33GK/I3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saZPTkdO/H468ekkzdhMflqAs3YkYBseC+yXS1UjpqkM4K4gIzhM4Juz8ALiLDqAoH6Wf3l9gJrzje7+GzyXK2TPZswc+pT4PKJO3XyCv6+Kfo0uB5TUfdui7ATJZCcaAxHlEKAvpM0+eXWUwO0Kz7vNmbcijHW1naPSQk11wACmWwrRkQ8Gr8UQqHvJ5Clp4055Mpy3MNO5rsQNAnkGCKAqsR+Aqbb5Zf86RtYJGjaLRdPbNbyfqKb31OcDzqG/uBuoLeRsCRmhS4IXL1wJ0JXitfRxegnzKfa6sj9LjtsAJPXuAh2vmYXbRrG1/pqlKTe2uoLIEo8w/bKjjZldPSMmf1TIfGuN9fMvt8ePxOkvlknfm6EMf5oO/jR8RS4TxetHZN3iWRAxci0MuFnv0xHPiy1R41nMl9i7K1mJxkhkDHWmcr0vvfie3tfSRh4CvcXVJ3GMR36cQVp6geTKVLAqIn+ajsLf+OfG2fQcW1MJK+pGJw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89da3e1f-c212-4d42-4f95-08dce90c666f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:17:44.9046 (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: labTKU5KaINgOuyLjkLsN67R6sedNY/NVK6boxczTUiQK12G3ihOKr4aYbwEaeShMCvU3Qc1DCxmrkubfHcg/OKsQBcNEjwx/rauTnXxxK8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB3980 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 Try our best to make the logic in secondary proess the same with the primary process and improve the readability, by add helper functions and rename function. Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/nfp_ethdev.c | 86 +++++++++++++++----------------- drivers/net/nfp/nfp_net_common.c | 22 +++++++- drivers/net/nfp/nfp_net_common.h | 3 +- 3 files changed, 63 insertions(+), 48 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 121f82af6d..405386e882 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -1764,19 +1764,9 @@ nfp_enable_multi_pf(struct nfp_pf_dev *pf_dev) static bool nfp_app_fw_nic_total_phyports_check(struct nfp_pf_dev *pf_dev) { - int ret; - uint8_t id; uint8_t total_phyports; - char vnic_name[RTE_ETH_NAME_MAX_LEN]; - /* Read the number of vNIC's created for the PF */ - id = nfp_function_id_get(pf_dev, 0); - snprintf(vnic_name, sizeof(vnic_name), "nfd_cfg_pf%u_num_ports", id); - total_phyports = nfp_rtsym_read_le(pf_dev->sym_tbl, vnic_name, &ret); - if (ret != 0 || total_phyports == 0 || total_phyports > 8) { - PMD_INIT_LOG(ERR, "%s symbol with wrong value", vnic_name); - return false; - } + total_phyports = nfp_net_get_phyports_from_fw(pf_dev); if (pf_dev->multi_pf.enabled) { if (!nfp_check_multi_pf_from_fw(total_phyports)) { @@ -1797,6 +1787,20 @@ nfp_app_fw_nic_total_phyports_check(struct nfp_pf_dev *pf_dev) return true; } +static void +nfp_port_name_generate(char *port_name, + size_t length, + int port_id, + struct nfp_pf_dev *pf_dev) +{ + const char *name = pf_dev->pci_dev->device.name; + + if (pf_dev->multi_pf.enabled) + snprintf(port_name, length, "%s", name); + else + snprintf(port_name, length, "%s_port%u", name, port_id); +} + static int nfp_init_app_fw_nic(struct nfp_net_hw_priv *hw_priv) { @@ -1849,12 +1853,7 @@ nfp_init_app_fw_nic(struct nfp_net_hw_priv *hw_priv) /* Loop through all physical ports on PF */ for (i = 0; i < pf_dev->total_phyports; i++) { - if (pf_dev->multi_pf.enabled) - snprintf(port_name, sizeof(port_name), "%s", - pf_dev->pci_dev->device.name); - else - snprintf(port_name, sizeof(port_name), "%s_port%u", - pf_dev->pci_dev->device.name, i); + nfp_port_name_generate(port_name, sizeof(port_name), i, pf_dev); id = nfp_function_id_get(pf_dev, i); hw_init.idx = id; @@ -1870,15 +1869,10 @@ nfp_init_app_fw_nic(struct nfp_net_hw_priv *hw_priv) return 0; port_cleanup: - for (i = 0; i < pf_dev->total_phyports; i++) { + for (uint32_t j = 0; j < i; j++) { struct rte_eth_dev *eth_dev; - if (pf_dev->multi_pf.enabled) - snprintf(port_name, sizeof(port_name), "%s", - pf_dev->pci_dev->device.name); - else - snprintf(port_name, sizeof(port_name), "%s_port%u", - pf_dev->pci_dev->device.name, i); + nfp_port_name_generate(port_name, sizeof(port_name), j, pf_dev); eth_dev = rte_eth_dev_get_by_name(port_name); if (eth_dev != NULL) rte_eth_dev_destroy(eth_dev, nfp_net_uninit); @@ -2369,7 +2363,7 @@ nfp_pf_init(struct rte_pci_device *pci_dev) pf_dev->nfp_eth_table = nfp_eth_table; pf_dev->multi_pf.enabled = nfp_check_multi_pf_from_nsp(pci_dev, cpp); pf_dev->multi_pf.function_id = function_id; - pf_dev->total_phyports = nfp_net_get_port_num(pf_dev); + pf_dev->total_phyports = nfp_net_get_phyports_from_nsp(pf_dev); ret = nfp_net_force_port_down(pf_dev); if (ret != 0) { @@ -2547,42 +2541,37 @@ static int nfp_secondary_init_app_fw_nic(struct nfp_net_hw_priv *hw_priv) { uint32_t i; - int err = 0; int ret = 0; - uint8_t function_id; uint32_t total_vnics; - char pf_name[RTE_ETH_NAME_MAX_LEN]; + char port_name[RTE_ETH_NAME_MAX_LEN]; struct nfp_pf_dev *pf_dev = hw_priv->pf_dev; - /* Read the number of vNIC's created for the PF */ - function_id = (pf_dev->pci_dev->addr.function) & 0x07; - snprintf(pf_name, sizeof(pf_name), "nfd_cfg_pf%u_num_ports", function_id); - total_vnics = nfp_rtsym_read_le(pf_dev->sym_tbl, pf_name, &err); - if (err != 0 || total_vnics == 0 || total_vnics > 8) { - PMD_INIT_LOG(ERR, "%s symbol with wrong value", pf_name); - return -ENODEV; - } + total_vnics = nfp_net_get_phyports_from_fw(pf_dev); for (i = 0; i < total_vnics; i++) { - char port_name[RTE_ETH_NAME_MAX_LEN]; - - if (nfp_check_multi_pf_from_fw(total_vnics)) - snprintf(port_name, sizeof(port_name), "%s", - pf_dev->pci_dev->device.name); - else - snprintf(port_name, sizeof(port_name), "%s_port%u", - pf_dev->pci_dev->device.name, i); + nfp_port_name_generate(port_name, sizeof(port_name), i, pf_dev); PMD_INIT_LOG(DEBUG, "Secondary attaching to port %s", port_name); ret = rte_eth_dev_create(&pf_dev->pci_dev->device, port_name, 0, NULL, NULL, nfp_secondary_net_init, hw_priv); if (ret != 0) { PMD_INIT_LOG(ERR, "Secondary process attach to port %s failed", port_name); - ret = -ENODEV; - break; + goto port_cleanup; } } + return 0; + +port_cleanup: + for (uint32_t j = 0; j < i; j++) { + struct rte_eth_dev *eth_dev; + + nfp_port_name_generate(port_name, sizeof(port_name), j, pf_dev); + eth_dev = rte_eth_dev_get_by_name(port_name); + if (eth_dev != NULL) + rte_eth_dev_destroy(eth_dev, NULL); + } + return ret; } @@ -2714,6 +2703,11 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) pf_dev->sym_tbl = sym_tbl; + /* Read the number of physical ports from firmware */ + pf_dev->multi_pf.function_id = function_id; + pf_dev->total_phyports = nfp_net_get_phyports_from_fw(pf_dev); + pf_dev->multi_pf.enabled = nfp_check_multi_pf_from_fw(pf_dev->total_phyports); + /* Read the app ID of the firmware loaded */ snprintf(app_name, sizeof(app_name), "_pf%u_net_app_id", function_id); app_fw_id = nfp_rtsym_read_le(sym_tbl, app_name, &ret); diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index 99f6b61947..86a1fbfaf2 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -14,6 +14,7 @@ #include "nfdk/nfp_nfdk.h" #include "nfpcore/nfp_mip.h" #include "nfpcore/nfp_nsp.h" +#include "nfpcore/nfp_rtsym.h" #include "nfp_logs.h" #include "nfp_net_meta.h" @@ -2724,7 +2725,7 @@ nfp_net_fec_set(struct rte_eth_dev *dev, } uint32_t -nfp_net_get_port_num(struct nfp_pf_dev *pf_dev) +nfp_net_get_phyports_from_nsp(struct nfp_pf_dev *pf_dev) { if (pf_dev->multi_pf.enabled) return 1; @@ -2732,6 +2733,25 @@ nfp_net_get_port_num(struct nfp_pf_dev *pf_dev) return pf_dev->nfp_eth_table->count; } +uint32_t +nfp_net_get_phyports_from_fw(struct nfp_pf_dev *pf_dev) +{ + int ret = 0; + uint8_t total_phyports; + char pf_name[RTE_ETH_NAME_MAX_LEN]; + + /* Read the number of vNIC's created for the PF */ + snprintf(pf_name, sizeof(pf_name), "nfd_cfg_pf%u_num_ports", + pf_dev->multi_pf.function_id); + total_phyports = nfp_rtsym_read_le(pf_dev->sym_tbl, pf_name, &ret); + if (ret != 0 || total_phyports == 0 || total_phyports > 8) { + PMD_INIT_LOG(ERR, "%s symbol with wrong value", pf_name); + return 0; + } + + return total_phyports; +} + uint8_t nfp_function_id_get(const struct nfp_pf_dev *pf_dev, uint8_t port_id) diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h index fb244383b7..8429db68f0 100644 --- a/drivers/net/nfp/nfp_net_common.h +++ b/drivers/net/nfp/nfp_net_common.h @@ -374,7 +374,8 @@ void nfp_net_get_fw_version(struct nfp_cpp *cpp, uint32_t *fw_version); int nfp_net_txrwb_alloc(struct rte_eth_dev *eth_dev); void nfp_net_txrwb_free(struct rte_eth_dev *eth_dev); -uint32_t nfp_net_get_port_num(struct nfp_pf_dev *pf_dev); +uint32_t nfp_net_get_phyports_from_nsp(struct nfp_pf_dev *pf_dev); +uint32_t nfp_net_get_phyports_from_fw(struct nfp_pf_dev *pf_dev); uint8_t nfp_function_id_get(const struct nfp_pf_dev *pf_dev, uint8_t port_id); int nfp_net_vf_config_app_init(struct nfp_net_hw *net_hw, From patchwork Thu Oct 10 09:17:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 145584 X-Patchwork-Delegate: ferruh.yigit@amd.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 53F0D45B00; Thu, 10 Oct 2024 11:18:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96C314066D; Thu, 10 Oct 2024 11:17:53 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2092.outbound.protection.outlook.com [40.107.223.92]) by mails.dpdk.org (Postfix) with ESMTP id BDECE40614; Thu, 10 Oct 2024 11:17:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XiMW7ng5iWEGbGwB8s5pJSTB8HssdMJIN6ksrMlWhCsvv2ZaVDv/ItH+VwVWE0mAxpszpJNm3BsHXVRIM+FwxEpnljEv8XEVFfAQ0pxbG0PIi+kfsjnabmOqOkWmavFyCzcoZeUuRaRMg5uGfWnQyRsss+xAia3LYjtjjhyGf14zs/8wH3NlToAFO+16QtaYtVKE9GkXUDAWnim35ZV+EndEvFzfiieDweEPP6Wxg7H/sBr4fsB+022NwP4/5w1MiqejZQgvKpU/Yhwzguyz7GSUUHiAoMlGMd+BtDPF0mD9KjeUNCB39aiLN+1kiKicNUayrA4jcqn99TKkZsTISw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=xKpIMuyiJa63K4pHNvPDdQpbPqW5u5ESGwAtf4tu/wA=; b=VPf9FY3SUPIVAHHhWZox4kw0LAKi5QzBdfLVgzupG5qQSO5BwzoJZkl4fT5IR4TxfvGu4QljqEqrajaZzZT+kKL6lGGILP2XEFFESHLc11PdxKJ4urMplh9A6oLNq1CfxxJ8EFyponRrDGdDXzZ6h29phj4F94YurHxfjXr9Vyh7i7rg1gHm+VShh1CRw4JCPS25d/8tt7iHSL9K/SgqbAGHNeddkjZfbcd8sX5Fewp6tx8nuIUwAQY60MOC62Yn5A/44BtS2PMiTOixxgSd3cWQcBYdxiflTd1thzFgL3nQkfOetFELjXoJAaXgss5dXN3d+u91fgopKgCgntEVaQ== 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=xKpIMuyiJa63K4pHNvPDdQpbPqW5u5ESGwAtf4tu/wA=; b=Qyd4EmWS+P1gAWRvZpPxWI8TW3o+haE/frmjjy6NnDhtToyL9h2dRuA7s8EwDjua0U1KtN/ia9PcjguPFAnr5/IKQDZrNPEcEdU1KXUqznbGfEYQJlcHERFIjRsaM/8iEmJkDxHUO6LTeI9Kln66hiGh/pKoR4RgjBoYt/KxhNY= 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 MW3PR13MB3980.namprd13.prod.outlook.com (2603:10b6:303:5c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Thu, 10 Oct 2024 09:17:47 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Thu, 10 Oct 2024 09:17:47 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , stable@dpdk.org, Long Wu , Peng Zhang Subject: [PATCH 05/10] net/nfp: fix problem caused by configure function Date: Thu, 10 Oct 2024 17:17:11 +0800 Message-Id: <20241010091716.3631747-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010091716.3631747-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> X-ClientProxiedBy: TP0P295CA0060.TWNP295.PROD.OUTLOOK.COM (2603:1096:910:3::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW3PR13MB3980:EE_ X-MS-Office365-Filtering-Correlation-Id: 2851465e-d394-46a0-f393-08dce90c67cb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: 4i6FaOGcMyD/htNry//6PB0SOMYQS9WwXBURPVOBBnO8eEYGbMgVsM5jueCFyFx0YOhbsJWEyYPBUuB4MDeBcxmafmNcgOMS3G2u2z/AD/sKhstrZfRkexlV5++cfGalXNzToW71C7FDV5V5UJ+rzFGBBqaYHRzg/lNsXnxPq13bzUHH/o73tcuzU/hI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0tBtUaMwp7+DMTARZWVr4jqmyKOnNYRWKJJl0yZuK0SPON7HYAAHzqwWf53NxcXkFrsMA4nbZElLY0afdStlDtbmQ1cTU2o6pTU4OKE+g== 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:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ntTvlBskcPUJXBiLRYTtqfQCXxtXNuY65TWznAIRtQpupgz5CoL/QGRb3C++tt70GT4lQIdHSJhXMkF+LcPWiVxxTn74eykiyK7p5h9uuHnvOI8EoYsRA4GAO428Q1ZMcH8Q1lBAL7Y3AoGU2M7EgXWlkKA965DOsu2iYlZvgMtjdyCvyogSTQBcUefJFPweLHc/4SRvqF0LVakAb46sRjb8vGxt8KM0XTaP8BHS55DEfBB1GJTXNzHismR8fHn3shSXDcfs1AAu9GYgfzxGZlf85jXB3ixTXBhEXmlqPTWyxV0ZSvsgozo0i9/K8bCXAgIBjeQ1UmtioXhBg+uK4PUuxEkdP9Rf/JKh0Vw/czLDEWt24hA9Ew3eNDZesWg4oQwPIFOp+dWhexmeeSJ6oT/ko7hN1DQlHp3i919XoIeFffsAxHdfH1Np8udhoiIl1tjeJ2Vhb06yYBOkz8BqcFSu6mkg0zKyyWGy3SBERJ2+rX9g+owbzW9+N+lKcOVIT9hZVzyooo1rGP/frB9TKHXDb8yBZo+JZgGvtqiOJz63ak+J0/xn+ZKkP6QRqgKlQzSlhU3De69yIz3J098HCrFEzjP/8kKDOYWDeOupin2M8d/gSSVkpBjcf7zuLUlaTKe0mOXFoeGiSlS+bDiQ2+iU59ni4NP3iVbOiOuYFcIgJ53r/34o7I83JRZwn+uxx0Wtx3XgoY38xQHuoR0EVy3aU5nIX9GEkSe3dF7DCWFYXvzboZJ6gutx/QaPj23XqAEPSbbLBOEcWDkxmgRlH0kV1Mr4YIm8VMtdOV3iX7bAkoVT5got8TJYAw6d7l64kLPZnSyZxh7GUc+40MkFHSSYXCiNJBqu9n6I6lxPMFDQh55KqJEEpX65rSpJO7W2rQoFfHBJQ9ll9UADyhXeoMwhTsYveAI74KCSjGnmHF935TloblC8D+vxiOAxEajXtKCsNwkLHZ0GIWf9Gfc/Y2aR2V2PsTDBc5mvtFR0N3Ah53J7In0stk5QDSSf9VbUVDJ48QVmYSRsnRLaSqcIDTSE6G9hj179nd/56FXCnpzGwJ5/wKSz8noip3njoU4oN8xTH8PBw4DeSP271ObCIQMkHoDPZY8UaaiQ6sNoPwSHIF4vtgMCDCGdP88wlxMtDxEnqPPLIm1BE01pLyslCBVg1lkZ7rFFbW6hTl8buW3v58+gUheVRc0mhOW3aFKj8j1sENu+/KIpkkp0GC/TsTC3iYTZOGMcFXjtgGchaYXVu4+8PLbndrLT9Jat0FUDGD5XtWsF6+balgTX+P1wXbXi64k4f0HubK7IdClTAZd7jWKRvnBEEOJpgp+4vCfr1ZOdoxyH4fb2P+J1+qBywssU3g+POfqFZHEHaJvCiFFRZoCUzOSbJTOJQYE6LHMSyW0RrGZ5td1UH5j2DYVCF2+Cdhgcb0Lu5q6VaKpUdvML6xnlx+xW0SUpsDiXB7P2pd5tzoylg/109AK2Ow/BXAuC2eGuXh0oGqsgIwbFWDxi+szJ8AK1sIRZhD7GoNIXTFcdcBqcZReOF+NCfX32h7zFXlFPgGnVtxHJOxZXtrJiLJzoivVTR9LQO1ChQwIN9IqfFf04S3CqI1kNAFItPw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2851465e-d394-46a0-f393-08dce90c67cb X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:17:47.1794 (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: AlFf2olq/7L1yahnRCeKUezrtdG8drpYQD3SvXYpV+l8FeICnxzrUrLeyiMaOTEd9WBMDLlRG9dX1UwWM0xToWY5KqLDfDpQRzW6RXSWXYM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB3980 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 The return value of 'nfp_eth_set_configured()' is three ways, the original logic considered it as two ways wrongly. Fixes: 61d4008fe6bb ("net/nfp: support setting link up/down") Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang Acked-by: Stephen Hemminger --- drivers/net/nfp/nfp_ethdev.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 405386e882..2fe6b1a292 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -527,26 +527,36 @@ nfp_net_start(struct rte_eth_dev *dev) static int nfp_net_set_link_up(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; struct nfp_net_hw_priv *hw_priv; hw = dev->data->dev_private; hw_priv = dev->process_private; - return nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 1); + ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 1); + if (ret < 0) + return ret; + + return 0; } /* Set the link down. */ static int nfp_net_set_link_down(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; struct nfp_net_hw_priv *hw_priv; hw = dev->data->dev_private; hw_priv = dev->process_private; - return nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 0); + ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 0); + if (ret < 0) + return ret; + + return 0; } static void From patchwork Thu Oct 10 09:17:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 145585 X-Patchwork-Delegate: ferruh.yigit@amd.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 A680A45B00; Thu, 10 Oct 2024 11:18:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4EE1040674; Thu, 10 Oct 2024 11:17:55 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2095.outbound.protection.outlook.com [40.107.223.95]) by mails.dpdk.org (Postfix) with ESMTP id E59C040664 for ; Thu, 10 Oct 2024 11:17:50 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aymA/Ehv1YkmiH7Wrx4dDm6LPmKkmtrjlWUTA4EyDu6kyN0v/bJkwGvxzT0lETJAH996xyV4oa9lZE1PrzRwukV3546NqZY/DkJ4WILw8hReM257Pk7HLJI1GlWLfnIoT3oNFaYNW8ciOD5NRGDLXesvE3YXzYWIGAcLsRnmWdMxRZzPMbTQYJsAhskAgj1tZ/izIuebR6FgGNsQEYuZZ58Otze49Bb2Zk/Oo8zrVVjrF18HACg8ZYAWTs0N52TEw8PfV8t4DeHcawNFG4BaAq1Ts/LC5mnEaP43rpwrmab3Yd77FoCqLHYKIq8/J66JSxXE15IT9AlrtujgfYTbjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5pufABaLS9KSPEdO3iEiMhjrWUn64zF3/4XBcyJX35A=; b=AAUt6nhT/H/WraF1Z1vh742F2hPEJpRALOIMqe55oFx52vFwhkyPN3dydX0CbtjJGvFAI9FHbBQ3xZqJibkZHtK9kGMPhG/ZycDz8ZjVv3WGPSdhCMFmSZTmYkNZHIiTyqR49IoTwQUb3UFWdeV3EAQoTEaEGiN3ez99izzqIyvgMaUBWBPy14DeCp/4e/vXQ/U8gs1D0xMMR65NL48YiN9l6UiPLWsoyy7Qz7AJ88p7LNNJCrxbl082eM9Z4DtvskaXMTWGOS8PlWFVlcWs7aVBprst4HWYq4KkwD7gszsZ2dRjIjEtHB0zaw+Z2Ln+MRuQVDN8kY9o4sivuhoQsQ== 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=5pufABaLS9KSPEdO3iEiMhjrWUn64zF3/4XBcyJX35A=; b=sWn43ATYIZ696wtM9Qw6zihLYaaAaCtlsLQGLuPzmyGQH6bSusGD7xywUfURoHat+kzrDy6bTXT5Vp50JryH+MY7BU3kxi0HikWbWbux1qPyEJanhDpo8izxD8s3L+ut/tOPz/2PVh30Mr2kFUKgJF4DeejMHogLa459+8cOV64= 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 MW3PR13MB3980.namprd13.prod.outlook.com (2603:10b6:303:5c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Thu, 10 Oct 2024 09:17:49 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Thu, 10 Oct 2024 09:17:49 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 06/10] net/nfp: add check logic for port up/down function Date: Thu, 10 Oct 2024 17:17:12 +0800 Message-Id: <20241010091716.3631747-7-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010091716.3631747-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> X-ClientProxiedBy: TP0P295CA0060.TWNP295.PROD.OUTLOOK.COM (2603:1096:910:3::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW3PR13MB3980:EE_ X-MS-Office365-Filtering-Correlation-Id: 7da4b0e2-78bc-4f93-3e7f-08dce90c690e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: +dEWEcpVIEE47EUCKJhdlJ4EhJ/BFb/nr5d+To1Jr26cW7kad61ynCspwNGWTEdFRJOWxcBg5nMdRovYacCvEKBbgcbRucKkPrPSxVEGOoaj/gQHOtiXA7InEgPXhDGXCAVzLtihWvV1vSytQc2tDsX16UPqTa14CjQagqilyFfzgNgZ7XjN5Md4Zree0b70nyTPgR50q54t1PIjQj1q6yuU7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kiaEBW0X9NxrSy/7D3+ih9/HGUg3EsjhohMe2Spi71LgjK3r4S4MkHM9XiBUBnFQx7lM22Q== 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:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: m+bBddA+RGH2Z7gFssvBd7xBt0ePLWhvmIz/vp7yuNBOSQ4VZskF4gRtEzgV886N1tkpZYHUsAvgMDKySUq70PaxstbetS6NiEhIvFjWO3ShVgQMtpNkcPOHACw+3dY2A0AvRWJZUuXPbUXEDUePpT7BE2JRPV8UDfPy+hWvM8R/cnP7rwINaUIteQml8N/SAgP2beEOsw4VYypmjmAq0v1mnziwFHKZc69Iu8bCMntZymbFP0MDDCvuKn3+d4XMOrLVo6YiHR2ZbQJcmAJjOrLeZM8DGtJxfmPV7RHGNlIiSOG7gDsHRuS5ZAyQxC0EJLY0xt1pgbneSX2FKu9eZPVB6EdQrhFjYvD4/4++DqbDkvKL62WbwRvDf5v56ui9klCsm8tJJt4941EicS6BvyA3hdMK0mSz6qavEJSwO5P4kTLd8/T9E3FVzpYJXMz5Kka4mcQb6KIjdE4QPG4JI3v0zft1FSJuje4w73PRVoF7hymml3SbO5xW4CSWcUhaeoKihwR+Nusj7UKQG1e+U5owKWGh+8RK9pm74lHN1fz47ABb6sG8Y/VxUQwJn18rlvii30OPu2dgI7s+gUdC3/ViHihVWNrzAbEny+M0OAC1I9mKzi/5keib1F3O3/MOMRdt6/Bbjls8HexQxWa1JkBvyJxlyycGGBUgTBaQEh8y5S8jBNuIalZ+pX7W+WDObEZpxiw0aEi9up2co++eg3ApG2G2zhjz5Efg8x7hl1PVPWZDF71PDLfbHEGfMJUmMSL47CxAaDt85yoE+E6bhnO8t0GymxUtNue7kwMdN5cD/AwOBi7mGUnP24BSxIC2i3gyweUH0XvAtYedS4JP/ZpP/W+Z+gA5FldEcgidLhyoHUq0dMNxNqWUtM3nnwgHJ9nPZ8HvlsStpm7znVAm7mfxoAysQGs4qnWZwJf9vJ0HiyKyYdhEY889DFLFj2RRzQyFKmSwgc2MzCt/w7uZxkQTnbAMU9bRg7zPrtjz4gF7fjx3KgFTE3ebMOW/bvPOMvcEiM2qtY0404n1sUw0MIWcyHrLFe+6cNrqKX8x6u3JazL+3+kZAqBXMX6PVx+uJpOalSW/5+KduucbpQpoPPQ5VWSl2hgKHcl6V0/Wy4d5YcoiLR1HvSHe4VmWg1RsJkNdhX2vgDFcE15lFc/O5wwnUuK2JaXK0F+CB0AJLD92GWJEknpElh2drkJZgenOVwC9uuyaTea6VZffP8GImIS1wgJaet/Y/I44zd3KGOVE2nOStX/qqPyyICLXX0dmFhQxOpWmx96r59Uo+h3CPWQQKd0ZtL+XNNH2rPbsNpTOR880jBwRfoEvVf6bJ5PSB8J4txur8N8umXJm1v/uLncgGkBOF0BLZGZ2exdmj+stPXy4osWbq1tC+AK7NTHVtk96HxVT/ZJqKQyyUfSHMr6oF2Vlf5D4IWBTDWuwU7IGXpM+xuHlo3HRextbIH1+Vp46pFqRV3Q1vgd78irhKnpPvY8W0D+FDMTfOR7kV4oj0PLUNOZYzQrUn+u6+b2VIuRHFaLpJbx18fthYyM4bB+4oa0FTSe5Us/itDug9Znn7RSIxpwcND7uLR0GG9bzKOBaxcXOqcpZtulKWd5cnA== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7da4b0e2-78bc-4f93-3e7f-08dce90c690e X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:17:49.2971 (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: QGGBrXj9GLlN4fRJnKjoWolKd/54IAnsRrotbRUywZmBBGCosnxFt2hfjydgmwJ0vrJ6j6JLgKpyglLftatmzxTykRdAoLdgU6y7sK9QSRg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB3980 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 The 'nfp_eth_set_configured()' function is not always success, so need to check the return value of it. Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang Acked-by: Stephen Hemminger --- .../net/nfp/flower/nfp_flower_representor.c | 18 +++++++++++++----- drivers/net/nfp/nfp_ethdev.c | 4 +++- drivers/net/nfp/nfp_net_common.c | 5 ++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index d1558b905c..eb0a02874b 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -83,6 +83,7 @@ nfp_flower_repr_dev_infos_get(__rte_unused struct rte_eth_dev *dev, static int nfp_flower_repr_dev_start(struct rte_eth_dev *dev) { + int ret; uint16_t i; struct nfp_net_hw_priv *hw_priv; struct nfp_flower_representor *repr; @@ -92,8 +93,11 @@ nfp_flower_repr_dev_start(struct rte_eth_dev *dev) hw_priv = dev->process_private; app_fw_flower = repr->app_fw_flower; - if (repr->repr_type == NFP_REPR_TYPE_PHYS_PORT) - nfp_eth_set_configured(hw_priv->pf_dev->cpp, repr->nfp_idx, 1); + if (repr->repr_type == NFP_REPR_TYPE_PHYS_PORT) { + ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, repr->nfp_idx, 1); + if (ret < 0) + return ret; + } nfp_flower_cmsg_port_mod(app_fw_flower, repr->port_id, true); @@ -109,6 +113,7 @@ static int nfp_flower_repr_dev_stop(struct rte_eth_dev *dev) { uint16_t i; + int ret = 0; struct nfp_net_hw_priv *hw_priv; struct nfp_flower_representor *repr; struct nfp_app_fw_flower *app_fw_flower; @@ -119,15 +124,18 @@ nfp_flower_repr_dev_stop(struct rte_eth_dev *dev) nfp_flower_cmsg_port_mod(app_fw_flower, repr->port_id, false); - if (repr->repr_type == NFP_REPR_TYPE_PHYS_PORT) - nfp_eth_set_configured(hw_priv->pf_dev->cpp, repr->nfp_idx, 0); + if (repr->repr_type == NFP_REPR_TYPE_PHYS_PORT) { + ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, repr->nfp_idx, 0); + if (ret == 1) + ret = 0; + } for (i = 0; i < dev->data->nb_rx_queues; i++) dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; for (i = 0; i < dev->data->nb_tx_queues; i++) dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; - return 0; + return ret; } static int diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 2fe6b1a292..302149e9dc 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -495,7 +495,9 @@ nfp_net_start(struct rte_eth_dev *dev) } /* Configure the physical port up */ - nfp_eth_set_configured(pf_dev->cpp, net_hw->nfp_idx, 1); + ret = nfp_eth_set_configured(pf_dev->cpp, net_hw->nfp_idx, 1); + if (ret < 0) + goto error; for (i = 0; i < dev->data->nb_rx_queues; i++) dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index 86a1fbfaf2..80d60515d8 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -2427,6 +2427,7 @@ nfp_net_ctrl_bar_size_set(struct nfp_pf_dev *pf_dev) int nfp_net_stop(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; struct nfp_net_hw_priv *hw_priv; @@ -2439,7 +2440,9 @@ nfp_net_stop(struct rte_eth_dev *dev) nfp_net_stop_tx_queue(dev); nfp_net_stop_rx_queue(dev); - nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 0); + ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 0); + if (ret < 0) + return ret; return 0; } From patchwork Thu Oct 10 09:17:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 145586 X-Patchwork-Delegate: ferruh.yigit@amd.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 67A5645B00; Thu, 10 Oct 2024 11:18:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D870F4067B; Thu, 10 Oct 2024 11:17:59 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2091.outbound.protection.outlook.com [40.107.93.91]) by mails.dpdk.org (Postfix) with ESMTP id 9F78740654; Thu, 10 Oct 2024 11:17:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=umPve7gB18DA0RHyMUAhaMFev6kVsvZRbOLPFRKxKejdWZWvJSGnj3T1nK94Q24fk7zWmQdZZp/ZdT20mAjXkY1Rnpm7cUVXRJH8dA5t5B27m56y4HCeKatVrpRW5xPOvLFxJrm22Ys8HQoduR6gHEaE853hE268x31XqyIrhnazL9xwJCwnrzCwOc/XmSShgD081JIY7bGoawrZEiVPbQdXT58s6UGhRT+vT+45p0lqH8coEx7cvG+IxYxNOvk3vS70gavu2B/84M+LKiRCNxBJMMfQAHip9W9MS5g7wK2STwt4moNH6hEz8BOoGXU2x3JPVzPgNNZQPjlwIBB1Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=O9816qU3+Mj+k1xntbwtyxoXhFkHp0KO80N8u8OKV6Q=; b=Go4iAM06QC5gmv6+/UFROXTvSvVW/CeGiufoF/6ms56Fxj2erdr58RmyhqyR7jAS7vJPX8j2G/s5fCFn23JuFFHWS27IoNw4ZAAZ7rKMp4slMs0GSseNj2XqptazGKW76HmbNoI4Za5SaGKL/tqdveLx2a23igwM/V6SrCRUz5XeA5eb8/BlDrmKG9v/phNVAbjTSVXN58u9XT756Ib0cea47Ggu6xJwZzIFEpgY1V/Q1X8DjmvgCrXQrslG+gWXAFQnKoFYzsohcl5v8MYAjhqY+lXw6fDAiL0VTMlwnTNKG1u63+DP7rPhnizH6TPFlpYjdlo0DbAStyoZILzcRQ== 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=O9816qU3+Mj+k1xntbwtyxoXhFkHp0KO80N8u8OKV6Q=; b=pnIAtkua3SbFNrzZK5vf5SS/uOefpIx0WFlMtINmO3x3SJ0O6Ne7U6NmLNBqKyr83Z0wTVA44JGZ5YnYLziFadmCTjqAHCleHUEEiZQdnyq/Yko4qbL0/OmMQAfv/aWWH9SklI2j2GUlTkard3TjbAnnuebQdHyy1ar9Zf6C1XU= 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 CH0PR13MB5155.namprd13.prod.outlook.com (2603:10b6:610:f1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Thu, 10 Oct 2024 09:17:52 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Thu, 10 Oct 2024 09:17:51 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , zerun.fu@corigine.com, stable@dpdk.org, Long Wu , Peng Zhang Subject: [PATCH 07/10] net/nfp: fix problem caused by commit end function Date: Thu, 10 Oct 2024 17:17:13 +0800 Message-Id: <20241010091716.3631747-8-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010091716.3631747-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> X-ClientProxiedBy: TP0P295CA0060.TWNP295.PROD.OUTLOOK.COM (2603:1096:910:3::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CH0PR13MB5155:EE_ X-MS-Office365-Filtering-Correlation-Id: ee6d3404-7c07-4153-e6ea-08dce90c6a8a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: nISgTTT+ywUA+xc8U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F+2zOf6wKSubvfe7moMIox1MODckUcFVl6PnszLFumBNniRp3u5KgEFXnNGmVL2cVjcDRxhd/rKMUFwYly4EkK1AKg1mUR6xdSSIanGrSm4UIt+RsJrARUIIM7eNznjWmyTfHejFyz8CSl+b0rYFLfn8xfgplF/TK8/PcwMOOdlXE/Ph5HkzimRm6f9UCavlGwjsjrl0fcQ1ljnpwa+LqvqYTGCpo69YDMinvT0NR72DqyWs8yw== 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:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bmnnTZKvFRvPPwyvov1wFhummZzGnngptbGQlxylEqQGCrzX0gkNEU6zLb72oimdAweeSZmBXggY6sSlGi+kV6gkvf7SxhrBF0Dmghz+n5wqLmIzaR4w940O0lw+NUshyGOeR3Pz4s9TVzP3APVwPGGJ32nyeao9KbKOJqSkEiIA85toy2ggGNOx1D+tFyvA5ySRSvcM/Kk3nuSzEi+1RSaCfnZxpuYpNeb7WFrtWMgPbkf4kwvAKJeFLhkak/34ysC4HszAWsh6XHTHY7Aro7SeM6pGfWgUtgs5dDyvCSX1QvkNHNl8vFzMjwltksNAaalbQ0HioBxauDVYlv3tnRNgrGW94YDK2y4MDaRPd2Evr3Ted4ZCcpUEP+KplwpzkR06PAnXOJJuSYEacDzEhtX0ttEEEV9TlG7lYdjGCzd7Q7ljLSWWZsLOBlkXnZNaV7SzHPKZT8wX68NnoCbnixede4CX+JYMPHChiTSTXXBAmfPXoUZJb/mYeyA0LOzgwfoy2HbOli3WUQVtItw+s5pvYabtwf1iHdsi708/OljjZxX6MB3H9uMtz4x+/X+XgdVZXyOOqimmKE+YxxBcQ6L/hlmuM4TzzOX4UV6D7Z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ea-08dce90c6a8a X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:17:51.8756 (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: Yq+hCuxu+X9/WPUkGu1x4uHEn42hEf/Q+58xf0vUqPnKxkCAkblLcRO9my18YOMsQooXOlBEb8lqjOumMgUcQ149h4XWgW0wBEG1/f66/Ck= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB5155 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 The return value of 'nfp_eth_config_commit_end()' is three ways, the original logic considered it as two ways wrongly. Fixes: 68aa35373a94 ("net/nfp: support setting pause frame switch mode") Cc: zerun.fu@corigine.com Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang Acked-by: Stephen Hemminger --- drivers/net/nfp/nfp_net_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index 80d60515d8..5c3a9a7ae7 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -2520,7 +2520,7 @@ nfp_net_pause_frame_set(struct nfp_net_hw_priv *hw_priv, } err = nfp_eth_config_commit_end(nsp); - if (err != 0) { + if (err < 0) { PMD_DRV_LOG(ERR, "Failed to configure pause frame."); return err; } From patchwork Thu Oct 10 09:17:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 145587 X-Patchwork-Delegate: ferruh.yigit@amd.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 1362D45B00; Thu, 10 Oct 2024 11:18:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A762F40662; Thu, 10 Oct 2024 11:18:02 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2103.outbound.protection.outlook.com [40.107.94.103]) by mails.dpdk.org (Postfix) with ESMTP id 18E8A40678; Thu, 10 Oct 2024 11:17:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DgPK3r8c7DFZjhsR2x6CwW7UnNnPSzmY5iN5C4qXvqeQxbID2Mib6tvkEBUwB/y+VpP3rkN4nTK6JaG+B4oiTwTvDjODO5zKf2YdnzcIFR4h/UHBR1G+DBKsRiYEVi8R7/2osIHJe12gTCqbjpZ6xAu/VQmZHB4Vc8OMyELmZbSLgEVANSJY6E+FMGetYGTN6mYv1r3G/0F3TeTMkSty6HcuGoEFhwRofhOofI1A7H++MWT2lajuGLJEZwrCNszYbckoRHVi1V8Mfdty3xZr8gk7hIxFmpp9fPCH9D+rrPSeEGRnuPcbdDujJeUynjz3D92cpqWxGKk2BDmd4GM1bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=IboY87g8cir5Gpi0fEGbBLb1QBa5V/YeJ/VZWvMxDkE=; b=yjAhLNzlRphANsOHrHqvleiv4rJOjbqCfPrk++NYsivSYiQudgHZlOdfYiuTQ3jFfuRK1SdjstPwuINKeVjl7MQzQ5VhM2GLcm1y6ZzsMes//2LCF7yOw5ky51jjtB7O9wCise7U1pTxcfh3XIYlsgyuL1tZtie3bXh8GKobvR7h9F5T7cV8G/Sj4/m+oQ1XIdOqXb6MhjxQyXHhZcaSqoNyctFPBSfgBhh3V9k+yst+Ch3vBUxuHS9BEULACVtdSKQswt1nYdv52nNsvLhtXtTQLFpxK9GbrF4tfMGTLSH1DIhPqT9Ni8/+AKdgUkqbyp1MLwHwb4dX/5Mq3WVlZA== 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=IboY87g8cir5Gpi0fEGbBLb1QBa5V/YeJ/VZWvMxDkE=; b=cfjfhRrXuXwwGN231aglDfN5yVDpsnO6rzCRjOiR2BmbsloovN+mbjOWYQIpnPr8Gr18y0Xqj22VIkcokzMgFDlCLh3rRKJWJJoLV+P2mGxOFga2SKNgHTKRKdDY6TPmLZiZXbSI0fxCoWIG/3X7cGO/9SdHVAd2Bly57J32m4U= 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 SJ2PR13MB6117.namprd13.prod.outlook.com (2603:10b6:a03:4f8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Thu, 10 Oct 2024 09:17:54 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Thu, 10 Oct 2024 09:17:54 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , zerun.fu@corigine.com, stable@dpdk.org, Long Wu , Peng Zhang Subject: [PATCH 08/10] net/nfp: fix problem caused by FEC set Date: Thu, 10 Oct 2024 17:17:14 +0800 Message-Id: <20241010091716.3631747-9-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010091716.3631747-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> X-ClientProxiedBy: TP0P295CA0060.TWNP295.PROD.OUTLOOK.COM (2603:1096:910:3::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SJ2PR13MB6117:EE_ X-MS-Office365-Filtering-Correlation-Id: e207b2b9-c902-4359-a30a-08dce90c6c13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 99phX5RcLfIQQNOcEv2UiiW2iN8P0hcygeag1XYyy7pagHm0BzPLPPor+obYayasnDiLHVHBRpGjIy0NCecA/duTHQbrO6k0BRDL8HYUormi4vpY+9e7NowdMtqK4R4iUJJoxMRlQ3951vE35Sij3W5IHwoA3y8xouznm4rTCxkDwD0cka+QQ5rb9tWMW4phsBFTBUtGI9+ZVfF2hUSlYeigE/uYDcikkWoGTzUcQWfYPPnhz8PNgCoyyLc9eYB4aH4cE9+oIYGWPjvnTWrIDrv/0eZvlmEkDJ4rmm8Ejerv48rML9hoPvuON6c4NlSqJjNXHXJxLmabYUQhX7mUi63s6vKLLnghfwIERSnveUnPt8ZOWqyKTMqmWHNOop0XKbDtCaTu32oEq4Czxz9MiEvK0gYqo2U/VHuJRq5cLB0k6fZ1iIhcGYjYAi1mstCQ/CHs0aK7uv2rHPXqkhHfThA0n0dENxcRlXoww/qemfqWRiQjr544idFWLZZsuvNqBEK2kjRwB81qX37lMzGotqIpqWv3ZrKPpDyxzfEc7tqXThdcawSWBnUkfIQHD8o4SKMV82NpeTbZUEU7DhTYeijtaZarrg0LEs4vzU0B9v8liQY41VCqbrOUnLQUfNHvbznjNmhtXOdl0juHqlZ0LuSZjylihufPSsdNb8FhnZKPVboPF+Od1/g9b6ch8Bu9Yx3BiZ2/lGNQsMQ/127OFwQ9+ArWn2UQK35wP7+N3MC1SAur0h9Y/KOxvIcbCKRgsbcF0/bIzbA12YunX9zG6VF1pSHEiSVXFke84S046402CvuRy8+A82tSBWykC5emyWM2m+l23+sV/gvjoHknSj4/aaAxh/TJptCRipM8zKXZBCUwGbSCn4+oeptFucsPG9cVAfy9k7J+9oFdJuBxUJdJXoujp58vvv9pnKnjpQTJqer+yzS+4b2b6NRqnSZM+A5Xgw6qZtUjoXrPLBksQE4Ot7QjSKgx4MfbjI4gMgDeYgAgc873evYN9uI4Um1ZNE4SLHQJTayYdVP1yaBlW530Bmrkm0++0ETew8VZu4eGLFwdjf0Xu4gkuWgqHsYsGU/BSIjN/IjZ4U5w9e0XCMaDClXTsj3IzXX+Gukfl6Xj2gA8KgMsI0MlNmV+0DBYtufqSSBNnHLBnw4zJkqizmUP4CDnmpM4N1PeelaQHvnwWsTj3aEal2tEhmVY0JrW6EVIfzrWs3ZlCL+RGlk25OJ1madZ0AJNRnnQta2el812txDKRxjod7x7dODJoHymXU/oskCmnW9pUH8PJCn/p/pBEHqG5indqm1AJhaxFCkeQeZRebWzsqnIgDgGPdV6F+8B6MfFVerHnZTPNzXBcA== 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: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MCTYlfxwg3p9yKH/1QM9biCoyOq2Dpwby7KhBgvxi+iOJpdc2tgtk0LEAUJydiOCgcSrVLHwf1U0hCp+O8OMX+gN10l6j4xCpdNiSacCWaj+PJT+Ott7AvSQBHdd9Gna4y6q5wY5YpS0RnnMjEdXou8HfzHx3cYqZVYzPsgQMlIqLyH7xWffB62KS3UaoU96BgsZ1tWjk+2Mt7GioCTkf8Dc7CucMoFACDCw+IUTxOw2hSk92NSzBXsWu8cCA6BPSF91ChPRqxq2LDaQbbbaMW/oL7I475vkWloxUeYQ/41A74z7VkcMxCuxIf3RzpZ+KY84vhhZbn+4ucRz8WcMJCRHuxMvoyB13v+X07RHFtxJvCQcMI/OBeqhg3VJYratOPIhvXNdwEIQfT5aECy+wCAZp4vQP60VuGV5jDhdqqm0+ICREGEXwvd0TwJ6YSb09MZkBUUrPwa9ua8q1c1j0fZBnnEtwW77nWcfKFQVi9INy1udd8RzZmNgtpXpkgOsghw06tVh1avr1fpxdpaP7DfQpFj86PzYh9btn/x9lvkpzobYaUh6PF9B52YFlc3BNWwUTlEaoLH3Ny0eVwMIqqIWrkbnIBqNfz+WpygQQzumVZrhSfGYKdzqyt2sxnBPL5n6Zblb8J8BzsEm++f6Ok52si1ymxojbFSAFK1b6q9CVSg== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: e207b2b9-c902-4359-a30a-08dce90c6c13 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:17:54.4487 (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: +pYjX7YjewB0HVshdHAbuRLNKDIqzMohZGLSFEUel6n+kw4zHlX2nKpyw+UEh8vJUsdeg+XnrEURPAEKdm2+yJhY3ScrN2c5g1TH1is0y1k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR13MB6117 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 The return value of 'nfp_eth_set_fec()' is three ways, the original logic considered it as two ways wrongly. Fixes: 37bd1b843a20 ("net/nfp: support setting FEC mode") Cc: zerun.fu@corigine.com Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang Acked-by: Stephen Hemminger --- drivers/net/nfp/nfp_net_common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index 5c3a9a7ae7..b986ed4622 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -2692,6 +2692,7 @@ int nfp_net_fec_set(struct rte_eth_dev *dev, uint32_t fec_capa) { + int ret; uint8_t idx; enum nfp_eth_fec fec; uint32_t supported_fec; @@ -2724,7 +2725,13 @@ nfp_net_fec_set(struct rte_eth_dev *dev, return -EIO; } - return nfp_eth_set_fec(hw_priv->pf_dev->cpp, eth_port->index, fec); + ret = nfp_eth_set_fec(hw_priv->pf_dev->cpp, eth_port->index, fec); + if (ret < 0) { + PMD_DRV_LOG(ERR, "NFP set FEC mode failed."); + return ret; + } + + return 0; } uint32_t From patchwork Thu Oct 10 09:17:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 145588 X-Patchwork-Delegate: ferruh.yigit@amd.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 41D7E45B00; Thu, 10 Oct 2024 11:18:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA6ED40697; Thu, 10 Oct 2024 11:18:04 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2103.outbound.protection.outlook.com [40.107.94.103]) by mails.dpdk.org (Postfix) with ESMTP id 73D994067B for ; Thu, 10 Oct 2024 11:17:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AtHTNHjT3PwDFF5yrzPm3KJkiOV54oYTxtHpH3JvnY40lXNMG4NAU4v67Gq/Tz2nmTkDLmqRI2aAixPqi0A4bLhAMDblmr3E5J2f/cE7XPisRuM8VrHTFBJ/A28QjZaZxhGjLm6MUniIK33RmF1jTSzJ53bmTqbMj6EV+HQeHPJaUAC3jush2yDaGx564XILdPEvo1sE5xYY0IwllTAuJsprgoSEUgRpa+G2ZZyl/L9CKRx8u9WW+dL0QH2x2z039dfG1rbR7wXJJQmBvFaNpXO9MOS3tga5+RN/oPtm1HPWGAggSux6+EUx7j5OBoSC2lFNjj3JtWPFfdnr0DFyZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=bgcsNEb/mrTo9nYd7/OPfrNyzSv9RixbhpmzVdPlQ7Y=; b=hJDx5UI54vG4+0e8fyy2ZyXT/SWfmTD/JG7jE8ymJBIq8FXLF9o88z0f0a67A/T470VNWgrBQPyCxgZFHd8uvoe8SdEgxY4JGxHyIDGAIpLJxe00K9phbw9MUphHv/3IZgd8W5kGqrMrf/rfwgF6jAEl1fz1l70S6oPzezVAu/qKos9BqlJP9r3vzLJEgTz1bvg+shpEhyfJsEkrzuzTrwKpbLKRW3VZ2+Rx+GjVrPnh+z5S5MBw+IGZqk6HoCLU8XLXcdrkp0hIyrRjk0oms1elO19jGOlkacAqgJ7VfxeWEHDcyvkq6nHc86Fq9h3VKQ6hwPJebXZJnxdXgeOXbQ== 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=bgcsNEb/mrTo9nYd7/OPfrNyzSv9RixbhpmzVdPlQ7Y=; b=DtEbDXnoRlI3ZOciLo6Ge9CZJSMA48aZctrr7b8Bwb0HSCDBEow03NlUkqmYyUzxvieKv7yfepY8sLXZM4YMOgl9e05d0+Kk8Ftdp9Zyg08t6x5oV/nsveZFxA5kpUtbO2D7Gu1xJ0BY2oC0URKwOCqOZHh82JyIEc9W36V6n0g= 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 SJ2PR13MB6117.namprd13.prod.outlook.com (2603:10b6:a03:4f8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Thu, 10 Oct 2024 09:17:56 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Thu, 10 Oct 2024 09:17:56 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu Subject: [PATCH 09/10] net/nfp: modify the comment of some control messages Date: Thu, 10 Oct 2024 17:17:15 +0800 Message-Id: <20241010091716.3631747-10-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010091716.3631747-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> X-ClientProxiedBy: TP0P295CA0060.TWNP295.PROD.OUTLOOK.COM (2603:1096:910:3::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SJ2PR13MB6117:EE_ X-MS-Office365-Filtering-Correlation-Id: 659e4b48-3d8d-412a-f13d-08dce90c6d34 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: oQAn7KimHDuY9qcSCLwnhbAMomrAARmCR97yVDGfb4+uejpg7btKH+30yywjY0ZJC2IcQqiyR2SKysfFW1r3k+7tXbbr2DlOQqpLMlqIQmt+hmWebZnZCNFkdAsx+8ggXi0Rs9siyNOiVPmT2vsGjfSpjhVGJ9naMgn+CBM9/ZABx2nCRFRylfze2MklCtot+FGA0vPhCvK5mwxh4PrZYegbV6Ete3QZx2XVotFtx+KSPQj0NE7vfiHpe4sWyrOY+gjX7JW9bTjjF2DotRrB9cuY8QxDcOCx1N5LIn3o2BhpESlpdt07FPmOV2h6d2wMA3PSxc1D2l4HG6B8ZX7PfnURou1PQA81KQ11mgojzZKGh7e1sP8y9EhYN9OFaVod9Q+KZsrm+vBWvyxA/a7l9hYXaGEBQ2UU8TNmkbdMKokblTgT4wx19ANU9i7mNDjkAsb/LFA2mabD0IOIqdEZrkQ09fq2YEXEYwLcmIUl30LRiZSElpHjBgsD5fklOmQ6b0bMrX+M4n2ofTkUrWTdIlLYhZ83FaA8IrLTw3Ast/wAodkY8+eocp/E/CSfKy4uM3tVq0j0hivaEsGPq8N307TJE6zqNkrhWLD810OgCn8HApcowNudHf+LYmSR8sDmCDxOSvnDpJuKvdozm1rV1Ifn2Jq3h/CtFrtC5Pyj2+OyMqy7Vl3rohRP141oG6WA/ivbFR0aFxShSV9m42P5xID55nkPJDhsfhWkYkUrN2PNXAec2cIrir0mZVGkqA2YM6YrpiD/5kOby/j1ThWPzPNAyapj090PRyLA9R5eGu0sbX/NTpKpyiR8FcoMqb/ol9dtZtnAg/7s84ZErVl3+Uoq+drhszt89n4s5Eg+0jMxMnr3kuhSf1koo31HIps2VZdopRQ56nvzINAk2sB1JxuHuG0ONaJ9gVDEFLJ5qSOSnC0fVFQKJiCmAaOaqSrRJiEUo2jAKCek7pmIvlySor1cIAafDY0HGSglLQA3rOajC4JLWTzUBIDfYa8jXj29qOGicvx9im8cRAGfocDURp1KulNHlfqfb4q2xilALWR7JBC10ZUQUfW5rEAsRXvsYJxqEPoxuN3e9imLkE0ww+1iXnWiHEN1QRRrMMWj+F3BzbhlxXBJ2KuvjBSR4Mc2IMIIWj4UOVloWBeBaE2flxUboTXvBAYT694cmz3eihElapjgceMfK6NmcNQ1sx6ccNK8ufuRwDXkGfQMWFtgiZ0L5c6oxOUoIT838tIcftIz/n/z+C1d390TDFBK2HRTbMejw4CUksLCchOSBpXGaSiwjZEo0XZdxvZ/Q1tHGripfqmpro2lf6lZIcW6xfBTCfQW0lW35DaSIKZ81adp1g== 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:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CwbTmYtsb8/jtxa1V09D7V94QHPpcj5fedfeZgMoEP05zAW7WAhmsnN9T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OQdRc8TYA55K1bonXeI/2vJbOeQvFR168lJO3vJWF/ZIW4vwsZKcGs7ItPNsSkJXjv+zzRhX8CnTmSzOQRErFi2vFec/AlErADnpbPSHX+C537l9UScTXQAOijRqV7wtciqHpIjKNsL/dGmlmL7E6yBzh/MYmi7zsXGw+Vyefx+HasQUH33YOs5uUHHbcnyC1D0n0Nvsy3KK8bEZmX16KMHNLOjVB01PUSeSzxTC7NPkHjWO/ka2VYvX33AMjKtzf1TmG/yi5wbexyyq6/5K+dU8TDtNWXI1pzyhgK4uM0FeUcTsTnmdZ931Id0/A/+5FlF0M53BxHs5fd0UWmwvAOdHl9TkVDOFYPQRWtq2louoQ1mNFGi9dyTmBiT2mtLmRtVeZpJdr45JvViY0kRxt4maPN2hDRa3kT52dWIE1S93j4W1TMoyIRV9kHTY/sPEwn5FUm1ofxnkJqvd/SnhLpCgzQSg== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 659e4b48-3d8d-412a-f13d-08dce90c6d34 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:17:56.2554 (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: lS6vfMwbiYO5JR/+jnN5TzdyoZLyCNy1uj17WKHjhyjj69hGqD3xuHpW8i08yO3vT9ZH1bAZut5ngvHPMsVkxtq6+DudAQJvAaRRfYbM0gA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR13MB6117 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 The comment of some control messages are not right, which conflict with the data structure and may confuse the other developers. Signed-off-by: Chaoyong He Reviewed-by: Long Wu Acked-by: Stephen Hemminger --- drivers/net/nfp/flower/nfp_flower_cmsg.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h index 5fc4210d8b..eda047a404 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.h +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h @@ -738,7 +738,7 @@ struct nfp_fl_act_output { * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | - |opcode | - |jump_id| - | + * | res | opcode | res | len_lw| - | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | eth_dst_47_16_mask | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -777,7 +777,7 @@ struct nfp_fl_act_push_vlan { * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | - |opcode | |jump_id| - | + * | res | opcode | res | len_lw| - | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | ipv4_saddr_mask | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -802,7 +802,7 @@ struct nfp_fl_act_set_ip4_addrs { * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | - |opcode | |jump_id| ttl_mask | tos_mask | + * | res | opcode | res | len_lw| ttl_mask | tos_mask | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | ttl | tos | 0 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -821,7 +821,7 @@ struct nfp_fl_act_set_ip4_ttl_tos { * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | - |opcode | |jump_id| - | + * | res | opcode | res | len_lw| - | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | ipv6_addr_127_96_mask | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -854,7 +854,7 @@ struct nfp_fl_act_set_ipv6_addr { * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | - |opcode | |jump_id| tclass_mask | hlimit_mask | + * | res | opcode | res | len_lw| tclass_mask | hlimit_mask | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | 0 | tclass | hlimit | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -879,7 +879,7 @@ struct nfp_fl_act_set_ipv6_tc_hl_fl { * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | - |opcode | |jump_id| - | + * | res | opcode | res | len_lw| - | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | src_mask | dst_mask | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -900,7 +900,7 @@ struct nfp_fl_act_set_tport { * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | - | opcode | |jump_id| - |M| - |V| + * | res | opcode | res | len_lw| - |M| - |V| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | ipv6_daddr_127_96 / ipv4_daddr | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ From patchwork Thu Oct 10 09:17:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 145589 X-Patchwork-Delegate: ferruh.yigit@amd.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 7487945B00; Thu, 10 Oct 2024 11:18:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14C8440669; Thu, 10 Oct 2024 11:18:06 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2119.outbound.protection.outlook.com [40.107.94.119]) by mails.dpdk.org (Postfix) with ESMTP id DF39D4067D; Thu, 10 Oct 2024 11:17:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rEFy8AoqZ4/4bJgTes/jdPZudvfkDsfrAsd7OSyzlETLuxziKbNhnA1wmckFKpfZOqB4CjQaOy4Np7F/5qjj0eWyjJvAriacvuVVtdyHVUjznkIzLfCVEIsWFO8d19L7KFeSWRHz8ApkZO2nl5vCbIVnolSBZTmnJM7Ll6B7sP34hqhX+1+OYziC53FPscRT4Y4dzi+1ETZ6O+gjcaFRO77iPu0OD/7kR3HPvucUbZjB4MONeVMkbiaHekokfaaCmvxswFJo4aJ0zZmNTC9Z7VUGcv3uZCQIdMAV/pS3bggGaQmlbAWCX+J2W2BFC4f5RHNrfC5TT++bcz7qvDPz6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=G0CWZi/hMPABcOIMUNgdjBF+bNFWPncPWovo0Fef0Pw=; b=aE8gEKkKKA+mKHbcRE96l0CRcPRLyS60EnoTGQ9xRlOLUme2G+P/ji6PBJJp27SaCeIGyMMMauGMEih1/0xUsRqdG4DE6PbEMW6ctoWK/kHYBmle7K/29XRsJ3irvdnfndHS9+J1zoXRLPUGwTfIumQy9roinsV0kLzR5IuZ3MMTKTj6h7MNcV+PRR3B15CJS/JIW63r+lgVbtJMKz0srXOweOa5qUsGCW63NByVUHR646WjHYH5ed8imO3y3vX2BvdTfyOHK3c3Q+aczNt1LQ5n35IPwT1Ih+OTaq7zIEJZMDJ5168SSWIG32mw8lfoW92lhLoj1wfI4B0aO6e6eg== 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=G0CWZi/hMPABcOIMUNgdjBF+bNFWPncPWovo0Fef0Pw=; b=ET8Qb/pdaxO22SYiEcYrncuEt6HzCwFofzHaQ88/vigxdqyWM/Ly4HmTU24GI1opTr6x7FXRoLDx68EknvZ32sRy7kLni63QkGJ7GYFjmtcP9aUqvPytm+w+SNmtiluGEhPYjSpiz449XixH7rwgGlG1Ch/gE1/hhntyPGrOWck= 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 SJ2PR13MB6117.namprd13.prod.outlook.com (2603:10b6:a03:4f8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Thu, 10 Oct 2024 09:17:58 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Thu, 10 Oct 2024 09:17:58 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , stable@dpdk.org, Long Wu , Peng Zhang Subject: [PATCH 10/10] net/nfp: fix memory leak in VF initialization logic Date: Thu, 10 Oct 2024 17:17:16 +0800 Message-Id: <20241010091716.3631747-11-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010091716.3631747-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> X-ClientProxiedBy: TP0P295CA0060.TWNP295.PROD.OUTLOOK.COM (2603:1096:910:3::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SJ2PR13MB6117:EE_ X-MS-Office365-Filtering-Correlation-Id: 230baaff-141f-43e0-08b2-08dce90c6e8d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 1PEKbiTWdmYVYZlRrjEwH6H6GQSASXiQKKkdVH0AhPiYZQUbLc9DLlSwwd+kkrwj6HpqRVIEnfPZ8JDDj0SwsqJIaMGeVIJuCpl3zDmqeHCJ/5ki5XtLagAz1+1l2CneWeMwDJ8a/MvbhvsLlwEx0bsu0KXhW+Vus5xQfcLOvGbJjsT2r3Q0Lo9U8o7w5SPevUfugjk7pfBaiG8npCGO7d/0I994bRWl/OVJga/Z+BP42gGaXL7yZrArg+CZLb4NObkC0U004yZRFms3POmiBLtw3WIQw/cO5qp0P8usSj+9nf0N1yqUlwOqlJgWCXqnItIClXKyC4BoU10pHIkfezynODaPBTMmbWspnra4++AQ2Tv8lGMb+OjC7ZU6R3LswUQGr6/t87TUVQL798PoV7x1Z0BPZwlvje6iSM+4viLTSM4pAc+zxA7Jm5QaOr+TbTUI2KG3VgzjGzo6IknT1mVKF53mA5dthU8jT75japgPNsEuyM7m4ygH97PaYzIfAm7HEBME1zooaKTuBYhkkaIZ6HEnTrpOdXOuuqGVGWkNmJ5by3Ltj9NKhepik98RN323qAdR2SnVVKXvqgcJ46vnnYaC71IXRJccCh21BGtXbXykeO5WXLgWf8ebQhFsNgYpAUuf/q9TsHXCrGuFJZWAcMn9TpUnCDc/mYWKSL053UwcHs3BXlI5BdasKO4ipeSo5jojfx5+CpCsfwhCsvJ8jTpb9DEaJ2VPHUpaNkiB79ZVecpTLHndo5Jtrib45Mi/B95iYy996WR83k7mItCAvo5B8MEsy+zv25QCmkOpxSDjIRCm1GNg1ywgpIbKd10kKS6FzAA1x7fPSN7X4YpCFaeSyWp4E+J8TfDgEgVQq3bCMXxQ41YQkt+Hu2qs31KHWk57nQf6LfB/U6u4NUwOe4d2BU1DI3NKyxDhhJuKir4/uKWkbuDzHE8McBO3SFb5eFKZQcNR9cBxtlg6tpBtYTmI6zA3cZa6FsKKcjYzslG/qzUGdReBBnCFZnzvJwZ/EOyHsn1ZEcPN2bRT8d0RT//39d9ecZqM3dFdFHUrgnO7i33IFFg7kfJndGyIqdCl7qD4rISYtc61+Jey5DrPBubbwBcnyXoE37Dt0jgPLFVXkV8anMwkhTp58drKJw0icRxNnj94vEmSrr7s8+EFQRQu8nZjtbSOThjW2uJenLd3PgfGBQuWQku//leXupIwZxjem7R4TClIg99qPtj8LjycqB+SiG3w7sir/fBt1x4Vl76gfZiJDtSXkhLbJHx4SbU5JB9VWaPTWKxGFbhqn0OggLosD0uH2k+nIQ8BGaltePEi77toSLbZvZRk2E25Oba8RfGF/Ea8SiryZA== 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:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UGXcERhPbWXVRNof5IffwQVEuQO96YYwtWFpQFkDMlC5rt/WVYY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U/cVaqMWq98Z1qBcb7k4B939sRR5hdF0JUyjOb9K7HhXROO2iZogJD07r6NiQiW7cRPNCTgF0U0a9HbE3ncxYd1HbcTPpCvWMFpi+LOYjNBZ4+ey+sDs0WYddv0kwCe8GVH/IFvaCrvWa/OvGkDWv4zcFJ70spcZr2HNJGv4h3UPEJLh852NwKy2OZeaC45JBlcF+71kYHAE+/7hLE/yamNsN9lUa8nLzGarlrjjlki6U0fJT1HPNJ6J2zUSwAKjcYhyIqR3yG/ywGLhphfP8+M2RL//vow/VDX2q6f167GBFqRqG2wXi/B5p/ppzGbaszjL75zCzepGtFuSqet1Y6Oje9Gd6DYLa+zf8TG+H9rGX6PWxUjux5W9lXRf0FXAzvgSLnIty16uLGJx8ITyKhDXNWdBh0hDwobRHORMPEXhPSvO6QUyqcGEUrVXAbMlMVfOj2qE3pzU0Qx33afmK4DtNBnzomymPXw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 230baaff-141f-43e0-08b2-08dce90c6e8d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:17:58.6245 (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: DFXPI75AnsWzDA5HGXmWSOuRVuhP5nVpCMYxfNIm5j5nzjtWotOWel+CkVANTZksLhBmv40EUWCkJ2g++zsRvlhQCnbpG8Q7HDGv648VB74= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR13MB6117 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 Fix one memory leak problem in the logic of VF initialization. Fixes: d81e2b514dc9 ("net/nfp: move device info into process private data") Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang Acked-by: Stephen Hemminger --- drivers/net/nfp/nfp_ethdev_vf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index ab413a2c5a..0a25730bf1 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -327,7 +327,8 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) if (net_hw->eth_xstats_base == NULL) { PMD_INIT_LOG(ERR, "No memory for xstats base values on device %s!", pci_dev->device.name); - return -ENOMEM; + err = -ENOMEM; + goto hw_priv_free; } /* Work out where in the BAR the queues start. */