From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6366445B17 for ; Sat, 12 Oct 2024 04:41:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C31F40653; Sat, 12 Oct 2024 04:41:44 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2127.outbound.protection.outlook.com [40.107.100.127]) by mails.dpdk.org (Postfix) with ESMTP id 44982402E4; Sat, 12 Oct 2024 04:41:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NgPhncGWoOi6SsWtdK3ldcRrQ5cpDqgF2JF6t8FYH6RpcuQ9C3ezFZSmzTHpbr+F7HTQlqIDD8JM+nb2409QdsuEQTdH27/aEsUulUvrtHjhZAgqDnmuiM1ga57bYdMEadhBCYqjnez67k5QgUaVolu10fb1mvEtiihGKC3sQUvj8jsVCg8tpizN/6/ZfzWQfQzxFp5Fs0lF9R+J9wrarj98ApcZILgqk6SnBbuvLfYqe3Oz3Z0874RbaEkM0czNQzB1+BWj6gU0nDgE2tOeyZXdPAtMokDefEmP3JXxVvtG1wTRFG+9/ML2fYV7C1iBddxWMPElUv1z1pHZJktoLw== 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=GZCnzQlPFXMtyjx+ud3cJa4ia3UEuLVtM0npPxdjO43pL6/RY6c8xHvWZEJ55dYK8DTxoUX5QInns/l3S5RfElUxUs41RkyZzvEceQxeH78xbD/jw+gaxgKnGZ3hlYOxuZlOIAEaDInjpcowLBnPxjN6vTUZAO1QuRNz5mygm5fXhyhqi4huAfu+E4cb6pdnnl0/FG/a2RRzO5amwsAJPdf9weaS5EuMU4tfWP6Oibl+Wsx3lqNBjYpW4RbdU+4OcRf48kAWcjqMGB6ny3lgIs2E7vRO/weTsbquAJ6ZWtcmdPRVVflin1Fx9DgYq/xF2/9qA6irnl/r83ygl1UjiA== 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=SmDteIp9hB6P4wTjzqQsdXF3/DrWPr8MIp9ZTCzewNb/zAZQB04q9c4BYhJu/3lsz3dkmbHBIEGw2BxTQ8DLP9XNqtCw6SBLobFAKInzuu9RjJHJnYr3Xn5ispcvqjZMi9PDr+FujyaH6xvaJSfw+F1Xyk26bEf4ljaJ6m0M3bo= 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 CO1PR13MB4902.namprd13.prod.outlook.com (2603:10b6:303:f0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.21; Sat, 12 Oct 2024 02:41:36 +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.8048.017; Sat, 12 Oct 2024 02:41:36 +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 v2 02/10] net/nfp: fix malloc name problem in secondary process Date: Sat, 12 Oct 2024 10:40:59 +0800 Message-Id: <20241012024107.3795935-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241012024107.3795935-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> <20241012024107.3795935-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR06CA0001.apcprd06.prod.outlook.com (2603:1096:4:186::21) To PH0PR13MB5568.namprd13.prod.outlook.com (2603:10b6:510:12b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CO1PR13MB4902:EE_ X-MS-Office365-Filtering-Correlation-Id: 00104d93-ea85-4e50-7d88-08dcea676431 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?N+aW5Hu/lFymbEUdNelXPodPmiVRVqyWo2Xl94PcYgetbGreEgm7KtAjihrd?= =?us-ascii?Q?o8b8/KfsLEa01OP7CdBYwfvmgaxybgEjCIvi6cKGogenhw6mnDAaOUklLsKJ?= =?us-ascii?Q?aBV1ajW/T3DbUK1CiAlBTLir+hI2Lco+oOxzEPaIlipw9Gid83nlPQp9pEPK?= =?us-ascii?Q?N7+No26hJ6U20r83VWzDF+nrRQnFomZeMaqqtUCm2AJ55C3dnwYSvqmgGDDy?= =?us-ascii?Q?MwsSKlVsZ4MSlmHppd+WdNtLQ74zVNNRdHCzCF1xyGOpRWp247yeh2cb2LOF?= =?us-ascii?Q?saH1iOCckUSWhNCR8gx/iCorbb0A5ETCnA59HhSLMlbDN56OZPwMFP4V2hRN?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Isv43I3n3WbsFLAbBQPJ7DnI?= =?us-ascii?Q?ume7xiGhCHIU6NnvrPe16HnRtHr9KwElBsHA57HlpLraozCXjEQUQxrm23s+?= =?us-ascii?Q?5y76DJfkzQVBV2ELo10jp/Xqfcmzm8kq/efhXh4DyhtDUQ=3D=3D?= 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)(376014)(366016)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1/gK0kTXFsdV0NV6I5vraN3Be/mT2FJ4lzGkxdMratNWwbwL4pAswWPL5M7f?= =?us-ascii?Q?xBTtQjh0erv+wZ43rd+uiUZ6J0GvVRvWUMVJRFxUjzQB2zI1BTGEc0Z4W97j?= =?us-ascii?Q?Qrg33KKdTCJJwP98y37ojLUoEQBK353tjy/bGEOGvPYcAzsydb64nqNpORPy?= =?us-ascii?Q?ztBzCW2fQeOov9r5kddKOz2dc3xT1CmdKYQuqLmZ9EcgJK9b9RidO3LXWJ2I?= =?us-ascii?Q?GMT/1CERG0sVb6I726z02y4RQpLvLkQw71jhWnwRVeS5c/SjjcW/VF+Y5etA?= =?us-ascii?Q?dAQSLEevPfhuE20Hyil5c4ws5ovFJm36qrEjJBLHua+plIzMWySP3k/do6mv?= =?us-ascii?Q?Z3wDXbY7Q9tH/h62RLE9iVCNBiy8RPJJvWwC1dqP40huw57cAjjmIxa7wzuc?= =?us-ascii?Q?EdnvmOKj522pSWyXXNdlrP3/2//nx58kiDKtWlmv9Ub08yF1zwJ7liJW+ZGK?= =?us-ascii?Q?xKt92PfjKZEtdd/ErnSOKUvQqL7FD+m4WB9XDHu9YB8eT7ZljGlNlZhvq9SX?= =?us-ascii?Q?iaZ+DMYk7jdqHevf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?= =?us-ascii?Q?qgtIM9u1O+lrqELMWw2pKeeEA/J8Zdg7tRMtfFaQG99967w9iqwICD9gft66?= =?us-ascii?Q?ln0sVQ9ZcHGlGcpwyWy5le0rOPr22973S7T0fi9/5fm2u/utpL/BpaurDU13?= =?us-ascii?Q?kGFY9IlOzmAQWU7407/rzSig/ZZ4iqkcf8PEeKTVv8AVDB8knzi/sQzBB515?= =?us-ascii?Q?tg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00104d93-ea85-4e50-7d88-08dcea676431 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB5568.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2024 02:41:36.6476 (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: O1R7lF14eDesRwrFCBlkt9U2o79BDSewg/LmsAC4kwOhT5lKjVWm/wj2ngr+OHnkP0Sj9H5OAANEun2/40uq/d78M8OffdZ7Xn/1cvfuyDo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR13MB4902 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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) { -- 2.39.1