From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-4.cisco.com (rcdn-iport-4.cisco.com [173.37.86.75]) by dpdk.org (Postfix) with ESMTP id 1F5AAC63C for ; Fri, 24 Jun 2016 01:11:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1699; q=dns/txt; s=iport; t=1466723487; x=1467933087; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Nx8r3OGOSMxfyxCgcx+WAcdifQblD4cjn8x5zDrNSiQ=; b=RQu2LaeXStY+Ara2f9BHuGs7afET+gqdwNSHjox/8wdtna3TNMOTvC+X LJUcMr3sZSZ0yBIw9Sybs98Ucc2HSI04JGmg0yj/qic0LJwU14lTdPbuY FqZC9mXTi1VlG+qxrrucgBeK6IgnyqrlKJjmFrZGxy1anphKuqX1M5VgM g=; X-IronPort-AV: E=Sophos;i="5.26,518,1459814400"; d="scan'208";a="118388390" Received: from alln-core-9.cisco.com ([173.36.13.129]) by rcdn-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Jun 2016 23:11:26 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-9.cisco.com (8.14.5/8.14.5) with ESMTP id u5NNBQxa017636; Thu, 23 Jun 2016 23:11:26 GMT Received: by cisco.com (Postfix, from userid 412739) id 240C13FAAE17; Thu, 23 Jun 2016 16:11:26 -0700 (PDT) From: Nelson Escobar To: dev@dpdk.org Cc: bruce.richardson@intel.com, Nelson Escobar Date: Thu, 23 Jun 2016 16:10:02 -0700 Message-Id: <1466723402-29261-1-git-send-email-neescoba@cisco.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <20160623112404.GF5024@bricha3-MOBL3> References: <20160623112404.GF5024@bricha3-MOBL3> Subject: [dpdk-dev] [PATCH v2] enic: fix name of hash table used for enic classifiers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 23:11:27 -0000 The enic_clsf_init() function is called once per enic instance, but it used a static name to create the hash table. Consequently when using more than one enic instance, there was a name collision which caused errors: EAL: memzone_reserve_aligned_thread_unsafe(): memzone already exists RING: Cannot reserve memory HASH: memory allocation failed PMD: rte_enic_pmd: Init of hash table for clsf failed. Flow director feature will not work This patch changes the name to be unique per enic instance. Fixes: fefed3d1e62c ("enic: new driver") Signed-off-by: Nelson Escobar Reviewed-by: John Daley --- v2: - use snprintf instead of sprintf drivers/net/enic/enic_clsf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c index edb56e1..2050818 100644 --- a/drivers/net/enic/enic_clsf.c +++ b/drivers/net/enic/enic_clsf.c @@ -239,15 +239,16 @@ void enic_clsf_destroy(struct enic *enic) int enic_clsf_init(struct enic *enic) { + char clsf_name[RTE_HASH_NAMESIZE]; struct rte_hash_parameters hash_params = { - .name = "enicpmd_clsf_hash", + .name = clsf_name, .entries = ENICPMD_CLSF_HASH_ENTRIES, .key_len = sizeof(struct rte_eth_fdir_filter), .hash_func = DEFAULT_HASH_FUNC, .hash_func_init_val = 0, .socket_id = SOCKET_ID_ANY, }; - + snprintf(clsf_name, RTE_HASH_NAMESIZE, "enic_clsf_%s", enic->bdf_name); enic->fdir.hash = rte_hash_create(&hash_params); memset(&enic->fdir.stats, 0, sizeof(enic->fdir.stats)); enic->fdir.stats.free = ENICPMD_FDIR_MAX; -- 2.7.0