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 D1D3042C69; Fri, 9 Jun 2023 08:01:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8656542D38; Fri, 9 Jun 2023 08:01:38 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by mails.dpdk.org (Postfix) with ESMTP id 93B9D40A84; Fri, 9 Jun 2023 08:01:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mHdjpEhh4+dc1RMEgvzRBxd8SMXmgyv8fSk+24LKcd+eg3TU4IflKdunfszBIPKEMlT8FJSjAZfHgRNF+BVFkMw912vpN2mv+sF3uY+q9m5tjSsecXrMx+5o11e49nKcqiL5b2+vxI6AGqdfjoesSnxCJNxpYtR7VoA3+ISiTy/BefbIfRN09xV0xWbhLWR0B9PzFRwTYOuNztMIJEPvwmshCL0hNYAW+EPExsfdvfWQgfyIz+LDGosK3fgsvA7000yfL+AgY6k63/XivD9hioedUxH0CuH58CAOBS+g+k3HF4XIBthUbzO1xZJMgM/U44slKsArND/mwCaAakGyiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cYMHJtrF/r6qD0GfIDmmzqZZNpoIfY3WxDF7fybqL70=; b=CzdNdgAZTbDlVydfYjen3iOnkdrhkMyoTlKDOtoaNKP3qju7fqLlcKDD9lU0Js3Oy6vF0SjDk4j9r0QvsB7syhPqxKcOA2y6U1TeJUMliHsP/HsqC5ZO7R4B/Buwt7Tk9J/Dpp2UWe2mlpxKao8oR8pcaPI/Rarfanuf9weO2dBfWXrnFhJIuyzpghiLO0CnRnQ0rOpJPDOwquJJu4Z4p5tNbvQfRp/ACNCZmYT1Ak9E9m5LlBwl9moT8rvtbgX1LpM2EBJJMBwkJ6IKhFwskapkrigDW+CsjvqycRApuvaROwgiN6isRPMFjCcK67CvQsnieghA0Eu1QYlrQPav/A== 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=cYMHJtrF/r6qD0GfIDmmzqZZNpoIfY3WxDF7fybqL70=; b=Zr0291PXGxgT/ZXkuNHpmaBWNOroXyzL/f6nHT59kUa049H6ReEb04kLmipmQ2Zr69h2/1n1dKbyRvT8R2Kr5QmsbCP1llrKRcvZHvdOsOzbjslYPzB5nUnJI8FsOA7Y7X/R2b01MBufHmVTrx7PxTyVT6ZeVhVrwBfCvOkW2IA= 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 CO1PR13MB5046.namprd13.prod.outlook.com (2603:10b6:303:f4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Fri, 9 Jun 2023 06:01:32 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::d2cb:a650:e1ce:2174]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::d2cb:a650:e1ce:2174%3]) with mapi id 15.20.6455.030; Fri, 9 Jun 2023 06:01:32 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Long Wu , chaoyong.he@corigine.com, stable@dpdk.org Subject: [PATCH 3/3] net/nfp: fix flow hash table creation failed Date: Fri, 9 Jun 2023 14:01:00 +0800 Message-Id: <20230609060100.1306648-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230609060100.1306648-1-chaoyong.he@corigine.com> References: <20230609060100.1306648-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2P153CA0035.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::22) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CO1PR13MB5046:EE_ X-MS-Office365-Filtering-Correlation-Id: 3394cd2c-d2a8-4718-4370-08db68aef944 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JFnILvS5tv/i2+FmlV92RDWW4YHqOdjddkFa3UFLjPPzMp7wRo+Jp+LLle7rasvtfqpSz72zQDtwuU7xgbi5vCJI4czp21zUhqSEDIz/Sn1HAdaeKj5TIdAm+hyCtgArkZWSS68h/nJ7+CrSDGGi2qpKwaX5L5+W0borTB57vJRgdz8qY3aPgwJ3WICcec58Uf7vZCVpkn7jfogcKzyfOTZYad6sgtF2amTNBnIJsjMW/edyvrF13ZP4hQ6TyNnKPBw0M+ZnNaCpXpZH/HGhO0hzBGq9pshvebJekxd95sPGLmUfSvo0de9SUaD6atdUAawYCZOUyLXqoojmUqB1rlwa8CnfQq2IiPDXH4oQ4JJJOi/qpphYLJjtzvO861h7TM9XoQ+9OBRhWDq0Gsc+kJ2Df1Bx/Gw+L4uM1K2lzHd3+cph+feAAZSrkl3/lIHiI+lOut7WEjMGndyaGQ7eaGQBWfE/XHx/SXsapuA2l6kjCGuMu93gIk86j8kYtvRQmLeOP2D5Oo/vCG/nWDwXUZf+2DglZglK/RLzAPhCRftine16YN7qC3zhjjeYY3nIfPDTTjTPmSqntlh6I/kyX/Ad6v+hwfW4IW16MEhfuz/QMVqn80iGM5V6Z1YNj5d3 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:(13230028)(4636009)(396003)(39840400004)(136003)(346002)(376002)(366004)(451199021)(41300700001)(4326008)(66946007)(450100002)(66556008)(8676002)(478600001)(8936002)(6916009)(66476007)(2906002)(316002)(6666004)(44832011)(5660300002)(6486002)(52116002)(6506007)(6512007)(1076003)(26005)(186003)(2616005)(83380400001)(36756003)(38100700002)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TjBWTXRtNVFyVzI2RmNCSy9UY0ZoT0o4dVpHZTZNRmJZdmFMb1RwVXBMMDdt?= =?utf-8?B?V1B6WmxLYlNocWlqb0JPdThRNmFDY2hlOVkyTUZtdlFjbWtUTXpyL0l3OElX?= =?utf-8?B?aVg3S3NFWDY2emtmR3lCRUdPY0ljdk9hK2NVT1dpWHRHNW9EUHcwZGdBMGtQ?= =?utf-8?B?UzE2ZmdZVnpwOFFuNUNOeWFUY283bTEzNVF6TktRTnNIREZpRGpjOGhYL1NJ?= =?utf-8?B?K2p3NE9LRlR0cXFpVFJvMkZnR0VkdlAyL3dIRjB0S3k0cDJ4SnpUbVBvVzRN?= =?utf-8?B?clp3Nk5POEFuWUpZNzBoLzdpSVpaMUQ5Ym0ybnR2Vlc3dyt3MlUvaGhDemUr?= =?utf-8?B?cnc4RTk4alpVWm1ZZ3Nyci9kdmEvd09VTnZXOTFvdHQvQXltcGpJNW9wZVZE?= =?utf-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network-Message-Id: 3394cd2c-d2a8-4718-4370-08db68aef944 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2023 06:01:32.0757 (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: mWAk5Kd8yQKMwvhLUWkkp1uOlX63QzrRJ+zzaUZ0TRehdeyocCzj4pEcag9JIye3WpBoznOYqe5ceFnDsV1rWRwvhOYBKxfnHWOh8gsL01s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR13MB5046 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Wu The former logic does not consider the simultaneous initialization of several NICs using flower firmware. The reason the initialization failed was because several NICs use the same name parameter when we call rte_hash_create(). We use the PCI address to give each NIC a unique name parameter and let the initializtion succeed. Fixes: ac09376096d8 ("net/nfp: add structures and functions for flow offload") Cc: chaoyong.he@corigine.com Cc: stable@dpdk.org Signed-off-by: Long Wu Reviewed-by: Niklas Söderlund Reviewed-by: Chaoyong He --- drivers/net/nfp/nfp_flow.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index cb7073f361..d392f9c77b 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -4105,11 +4105,21 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev) size_t stats_size; uint64_t ctx_count; uint64_t ctx_split; + char mask_name[RTE_HASH_NAMESIZE]; + char flow_name[RTE_HASH_NAMESIZE]; + char pretun_name[RTE_HASH_NAMESIZE]; struct nfp_flow_priv *priv; struct nfp_app_fw_flower *app_fw_flower; + snprintf(mask_name, sizeof(mask_name), "%s_mask", + pf_dev->pci_dev->device.name); + snprintf(flow_name, sizeof(flow_name), "%s_flow", + pf_dev->pci_dev->device.name); + snprintf(pretun_name, sizeof(pretun_name), "%s_pretun", + pf_dev->pci_dev->device.name); + struct rte_hash_parameters mask_hash_params = { - .name = "mask_hash_table", + .name = mask_name, .entries = NFP_MASK_TABLE_ENTRIES, .hash_func = rte_jhash, .socket_id = rte_socket_id(), @@ -4118,7 +4128,7 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev) }; struct rte_hash_parameters flow_hash_params = { - .name = "flow_hash_table", + .name = flow_name, .hash_func = rte_jhash, .socket_id = rte_socket_id(), .key_len = sizeof(uint32_t), @@ -4126,7 +4136,7 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev) }; struct rte_hash_parameters pre_tun_hash_params = { - .name = "pre_tunnel_table", + .name = pretun_name, .entries = 32, .hash_func = rte_jhash, .socket_id = rte_socket_id(), -- 2.39.1