From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from alln-iport-1.cisco.com (alln-iport-1.cisco.com [173.37.142.88]) by dpdk.org (Postfix) with ESMTP id CAB80AD90 for ; Wed, 15 Jun 2016 01:52:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1634; q=dns/txt; s=iport; t=1465948366; x=1467157966; h=from:to:cc:subject:date:message-id; bh=3XlAVcZ+JEr+ISHXzUVlxhSc/jXiHp4QhHekJILOC4w=; b=PXjqMfCGekeMylZKdrNxhquRW6CwQbJepeX1CDhCZKf047z3im66xpp4 mdVNwT2XKC52/uzQQjur0R9gRBi0/mFQtHg+bkj5cqVg1g6IKYv5OA+0W AlkbJlGd/rStPzlw7vFlJcJ7eFXR7Rl024nPIrLdi/HqWkpgv1s9mAClR M=; X-IronPort-AV: E=Sophos;i="5.26,473,1459814400"; d="scan'208";a="285758874" Received: from alln-core-7.cisco.com ([173.36.13.140]) by alln-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Jun 2016 23:52:46 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-7.cisco.com (8.14.5/8.14.5) with ESMTP id u5ENqjhJ006518; Tue, 14 Jun 2016 23:52:46 GMT Received: by cisco.com (Postfix, from userid 412739) id DC3563FAADFF; Tue, 14 Jun 2016 16:52:45 -0700 (PDT) From: Nelson Escobar To: dev@dpdk.org Cc: bruce.richardson@intel.com, johndale@cisco.com, Nelson Escobar Date: Tue, 14 Jun 2016 16:52:28 -0700 Message-Id: <1465948348-10333-1-git-send-email-neescoba@cisco.com> X-Mailer: git-send-email 2.7.0 Subject: [dpdk-dev] [PATCH] 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: Tue, 14 Jun 2016 23:52:47 -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 --- 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..2ec77f5 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, }; - + sprintf(clsf_name, "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