From 9d802d1cb902931cd8236177a1aaf3053143d75e Mon Sep 17 00:00:00 2001 From: Nelson Escobar Date: Thu, 23 Jun 2016 16:10:02 -0700 Subject: [PATCH] net/enic: fix name of classifiers hash table 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 7d2bb781e9..3365176aa4 100644 --- a/drivers/net/enic/enic_clsf.c +++ b/drivers/net/enic/enic_clsf.c @@ -248,15 +248,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.20.1