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 3691241C58; Fri, 10 Feb 2023 02:09:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 060F642D61; Fri, 10 Feb 2023 02:08:21 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 7A13642D20 for ; Fri, 10 Feb 2023 02:08:15 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id pj3so3756004pjb.1 for ; Thu, 09 Feb 2023 17:08:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AQAJJTqjTskC+oEt/E/VEGrTfvC38UgFYNoSiBgmG8Y=; b=EFBay0K8hOh2iTpj+9+6pDWf/C8poua1hQ8iqgJIvCuFn3zl+qY6G86CZB5M6Y1pYA xsrHrptq2MZ336tFOQkPDgAhtvG4MtJsz/lsypZWE250iKEGDmGus9CCysfRvOiDb+bQ y3D49pewC89+V/izOScMmfcqZXVT5PE1zSV0FkZVtY71901qwSrJeY6PFGacTd+wdcFY 4BcMVbfNcCuY/EotIDsRN7DU7nOdGRSZELoRBD/wexIZbz3KXzKV7s5WyVlCQoIPSgS8 yRwtMU33E39buBd2l4ir8OEzuH3GFO+3MnCGQujAwMmPKzEKeX9Fpu1qORhdkfQDG9Sw eE7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AQAJJTqjTskC+oEt/E/VEGrTfvC38UgFYNoSiBgmG8Y=; b=ne6kgEAOuS1hqiQAcT8qqjx63gm53tgZurLBjB4EOvCf1hUACpQfg5PteA3IS+Dk8o zn3QKCQPMMVuCNR8XShW1mDJYnjgDVj7+oERqbfA6F0tjqbFgUseatzITGPUvVp3nVzW cSEVibdsl0XbUSmV3nTG9KfcWNCDp6DU21FIHb/xq/wk6rR22xeODAzXu555sc7YqNLp R8dAlvwpviLPVaKo469aadShK4p4ud0Ac7jTyzebAMFgEull3SFcV8ES9cJ2ay1C3rgC xqYOcMS5IZyM7ipOsN8qgvETcyDTsvkMGVNJX3gsoKwI9T6ABIe497UazmDaAucf54Ix iAlw== X-Gm-Message-State: AO0yUKU3ZtNFFxTTcxfMQ2sRhISvhBT5JAhRLslGaNXDYdDs/hklNjAY FSxw/qnxfiHCp82AgcO4RkJP5MHa6guhGv4JBOs= X-Google-Smtp-Source: AK7set9DLjYs1FDQvUe9c2hBksmwlmFqOse8nseaRg+MCSrF/MwqIT2AyZreg0gyhl6wB1DjcjTNuw== X-Received: by 2002:a17:903:110e:b0:19a:7217:32a9 with SMTP id n14-20020a170903110e00b0019a721732a9mr369177plh.26.1675991294214; Thu, 09 Feb 2023 17:08:14 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id jd9-20020a170903260900b0019625428cefsm2103023plb.281.2023.02.09.17.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 17:08:13 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v3 11/16] hash: replace RTE_LOGTYPE_HASH with dynamic type Date: Thu, 9 Feb 2023 17:07:19 -0800 Message-Id: <20230210010724.890413-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210010724.890413-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230210010724.890413-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 A little more complex here since the one hash library actually has multiple routines in it. Split up the logtypes for hash and toeplitz. The hash crc file has another issue around logging. It is calling RTE_LOG during a constructor which is maybe problematic because this will all run before the DPDK library has finished initializing logging. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/hash/rte_cuckoo_hash.c | 60 ++++++++++++++++++--------------- lib/hash/rte_fbk_hash.c | 10 ++++-- lib/hash/rte_hash_crc.h | 6 ++-- lib/hash/rte_thash.c | 53 ++++++++++++++++++++++------- lib/hash/rte_thash_gfni.h | 24 ++++--------- lib/hash/version.map | 4 +++ 8 files changed, 95 insertions(+), 65 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index b0c625a02cdf..97120543d808 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -350,7 +350,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, - {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 69d3d07252ec..afbd67d55b45 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -32,7 +32,7 @@ extern "C" { /* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ -#define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ + /* was RTE_LOGTYPE_HASH */ /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c index 829b79c89a27..a5ca21b74e2a 100644 --- a/lib/hash/rte_cuckoo_hash.c +++ b/lib/hash/rte_cuckoo_hash.c @@ -26,6 +26,12 @@ #include "rte_hash.h" #include "rte_cuckoo_hash.h" +RTE_LOG_REGISTER_SUFFIX(hash_logtype, cuckoo, INFO); + +#define HASH_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, hash_logtype, \ + "%s(): " fmt "\n", __func__, ##args) + /* Mask of all flags supported by this version */ #define RTE_HASH_EXTRA_FLAGS_MASK (RTE_HASH_EXTRA_FLAGS_TRANS_MEM_SUPPORT | \ RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD | \ @@ -159,7 +165,7 @@ rte_hash_create(const struct rte_hash_parameters *params) hash_list = RTE_TAILQ_CAST(rte_hash_tailq.head, rte_hash_list); if (params == NULL) { - RTE_LOG(ERR, HASH, "rte_hash_create has no parameters\n"); + HASH_LOG(ERR, "null parameters"); return NULL; } @@ -168,13 +174,13 @@ rte_hash_create(const struct rte_hash_parameters *params) (params->entries < RTE_HASH_BUCKET_ENTRIES) || (params->key_len == 0)) { rte_errno = EINVAL; - RTE_LOG(ERR, HASH, "rte_hash_create has invalid parameters\n"); + HASH_LOG(ERR, "invalid parameters"); return NULL; } if (params->extra_flag & ~RTE_HASH_EXTRA_FLAGS_MASK) { rte_errno = EINVAL; - RTE_LOG(ERR, HASH, "rte_hash_create: unsupported extra flags\n"); + HASH_LOG(ERR, "unsupported extra flags"); return NULL; } @@ -182,8 +188,8 @@ rte_hash_create(const struct rte_hash_parameters *params) if ((params->extra_flag & RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY) && (params->extra_flag & RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF)) { rte_errno = EINVAL; - RTE_LOG(ERR, HASH, "rte_hash_create: choose rw concurrency or " - "rw concurrency lock free\n"); + HASH_LOG(ERR, + "choose rw concurrency or rw concurrency lock free"); return NULL; } @@ -233,7 +239,7 @@ rte_hash_create(const struct rte_hash_parameters *params) r = rte_ring_create_elem(ring_name, sizeof(uint32_t), rte_align32pow2(num_key_slots), params->socket_id, 0); if (r == NULL) { - RTE_LOG(ERR, HASH, "memory allocation failed\n"); + HASH_LOG(ERR, "memory allocation failed"); goto err; } @@ -249,8 +255,8 @@ rte_hash_create(const struct rte_hash_parameters *params) params->socket_id, 0); if (r_ext == NULL) { - RTE_LOG(ERR, HASH, "ext buckets memory allocation " - "failed\n"); + HASH_LOG(ERR, + "ext buckets memory allocation failed"); goto err; } } @@ -275,7 +281,7 @@ rte_hash_create(const struct rte_hash_parameters *params) te = rte_zmalloc("HASH_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { - RTE_LOG(ERR, HASH, "tailq entry allocation failed\n"); + HASH_LOG(ERR, "tailq entry allocation failed"); goto err_unlock; } @@ -283,7 +289,7 @@ rte_hash_create(const struct rte_hash_parameters *params) RTE_CACHE_LINE_SIZE, params->socket_id); if (h == NULL) { - RTE_LOG(ERR, HASH, "memory allocation failed\n"); + HASH_LOG(ERR, "memory allocation failed"); goto err_unlock; } @@ -292,7 +298,7 @@ rte_hash_create(const struct rte_hash_parameters *params) RTE_CACHE_LINE_SIZE, params->socket_id); if (buckets == NULL) { - RTE_LOG(ERR, HASH, "buckets memory allocation failed\n"); + HASH_LOG(ERR, "buckets memory allocation failed"); goto err_unlock; } @@ -302,8 +308,8 @@ rte_hash_create(const struct rte_hash_parameters *params) num_buckets * sizeof(struct rte_hash_bucket), RTE_CACHE_LINE_SIZE, params->socket_id); if (buckets_ext == NULL) { - RTE_LOG(ERR, HASH, "ext buckets memory allocation " - "failed\n"); + HASH_LOG(ERR, + "ext buckets memory allocation failed"); goto err_unlock; } /* Populate ext bkt ring. We reserve 0 similar to the @@ -318,8 +324,8 @@ rte_hash_create(const struct rte_hash_parameters *params) ext_bkt_to_free = rte_zmalloc(NULL, sizeof(uint32_t) * num_key_slots, 0); if (ext_bkt_to_free == NULL) { - RTE_LOG(ERR, HASH, "ext bkt to free memory allocation " - "failed\n"); + HASH_LOG(ERR, + "ext bkt to free memory allocation failed"); goto err_unlock; } } @@ -334,7 +340,7 @@ rte_hash_create(const struct rte_hash_parameters *params) RTE_CACHE_LINE_SIZE, params->socket_id); if (k == NULL) { - RTE_LOG(ERR, HASH, "memory allocation failed\n"); + HASH_LOG(ERR, "memory allocation failed"); goto err_unlock; } @@ -342,7 +348,7 @@ rte_hash_create(const struct rte_hash_parameters *params) RTE_CACHE_LINE_SIZE, params->socket_id); if (tbl_chng_cnt == NULL) { - RTE_LOG(ERR, HASH, "memory allocation failed\n"); + HASH_LOG(ERR, "memory allocation failed"); goto err_unlock; } @@ -390,7 +396,7 @@ rte_hash_create(const struct rte_hash_parameters *params) sizeof(struct lcore_cache) * RTE_MAX_LCORE, RTE_CACHE_LINE_SIZE, params->socket_id); if (local_free_slots == NULL) { - RTE_LOG(ERR, HASH, "local free slots memory allocation failed\n"); + HASH_LOG(ERR, "local free slots memory allocation failed"); goto err_unlock; } } @@ -624,7 +630,7 @@ rte_hash_reset(struct rte_hash *h) /* Reclaim all the resources */ rte_rcu_qsbr_dq_reclaim(h->dq, ~0, NULL, &pending, NULL); if (pending != 0) - RTE_LOG(ERR, HASH, "RCU reclaim all resources failed\n"); + HASH_LOG(ERR, "RCU reclaim all resources failed"); } memset(h->buckets, 0, h->num_buckets * sizeof(struct rte_hash_bucket)); @@ -1498,9 +1504,8 @@ __hash_rcu_qsbr_free_resource(void *p, void *e, unsigned int n) /* Return key indexes to free slot ring */ ret = free_slot(h, rcu_dq_entry.key_idx); if (ret < 0) { - RTE_LOG(ERR, HASH, - "%s: could not enqueue free slots in global ring\n", - __func__); + HASH_LOG(ERR, + "could not enqueue free slots in global ring"); } } @@ -1527,7 +1532,7 @@ rte_hash_rcu_qsbr_add(struct rte_hash *h, struct rte_hash_rcu_config *cfg) hash_rcu_cfg = rte_zmalloc(NULL, sizeof(struct rte_hash_rcu_config), 0); if (hash_rcu_cfg == NULL) { - RTE_LOG(ERR, HASH, "memory allocation failed\n"); + HASH_LOG(ERR, "memory allocation failed"); return 1; } @@ -1551,7 +1556,7 @@ rte_hash_rcu_qsbr_add(struct rte_hash *h, struct rte_hash_rcu_config *cfg) h->dq = rte_rcu_qsbr_dq_create(¶ms); if (h->dq == NULL) { rte_free(hash_rcu_cfg); - RTE_LOG(ERR, HASH, "HASH defer queue creation failed\n"); + HASH_LOG(ERR, "HASH defer queue creation failed"); return 1; } } else { @@ -1580,9 +1585,8 @@ remove_entry(const struct rte_hash *h, struct rte_hash_bucket *bkt, int ret = free_slot(h, bkt->key_idx[i]); if (ret < 0) { - RTE_LOG(ERR, HASH, - "%s: could not enqueue free slots in global ring\n", - __func__); + HASH_LOG(ERR, + "could not enqueue free slots in global ring"); } } @@ -1770,7 +1774,7 @@ __rte_hash_del_key_with_hash(const struct rte_hash *h, const void *key, } else if (h->dq) /* Push into QSBR FIFO if using RTE_HASH_QSBR_MODE_DQ */ if (rte_rcu_qsbr_dq_enqueue(h->dq, &rcu_dq_entry) != 0) - RTE_LOG(ERR, HASH, "Failed to push QSBR FIFO\n"); + HASH_LOG(ERR, "Failed to push QSBR FIFO"); } __hash_rw_writer_unlock(h); return ret; diff --git a/lib/hash/rte_fbk_hash.c b/lib/hash/rte_fbk_hash.c index 538b23a4030a..37edb5e2c7fe 100644 --- a/lib/hash/rte_fbk_hash.c +++ b/lib/hash/rte_fbk_hash.c @@ -18,6 +18,12 @@ #include "rte_fbk_hash.h" +RTE_LOG_REGISTER_SUFFIX(fbk_hash_logtype, fbk, INFO); + +#define HASH_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, fbk_hash_logtype, \ + "%s(): " fmt "\n", __func__, ##args) + TAILQ_HEAD(rte_fbk_hash_list, rte_tailq_entry); static struct rte_tailq_elem rte_fbk_hash_tailq = { @@ -114,7 +120,7 @@ rte_fbk_hash_create(const struct rte_fbk_hash_params *params) te = rte_zmalloc("FBK_HASH_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { - RTE_LOG(ERR, HASH, "Failed to allocate tailq entry\n"); + HASH_LOG(ERR, "Failed to allocate tailq entry"); goto exit; } @@ -122,7 +128,7 @@ rte_fbk_hash_create(const struct rte_fbk_hash_params *params) ht = rte_zmalloc_socket(hash_name, mem_size, 0, params->socket_id); if (ht == NULL) { - RTE_LOG(ERR, HASH, "Failed to allocate fbk hash table\n"); + HASH_LOG(ERR, "Failed to allocate fbk hash table"); rte_free(te); goto exit; } diff --git a/lib/hash/rte_hash_crc.h b/lib/hash/rte_hash_crc.h index 0249ad16c5b6..3bb38880c4ea 100644 --- a/lib/hash/rte_hash_crc.h +++ b/lib/hash/rte_hash_crc.h @@ -63,7 +63,7 @@ rte_hash_crc_set_alg(uint8_t alg) #if defined RTE_ARCH_X86 if (!(alg & CRC32_SSE42_x64)) - RTE_LOG(WARNING, HASH, + fprintf(stderr, "Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\n"); if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42) crc32_alg = CRC32_SSE42; @@ -73,14 +73,14 @@ rte_hash_crc_set_alg(uint8_t alg) #if defined RTE_ARCH_ARM64 if (!(alg & CRC32_ARM64)) - RTE_LOG(WARNING, HASH, + fprintf(stderr, "Unsupported CRC32 algorithm requested using CRC32_ARM64\n"); if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) crc32_alg = CRC32_ARM64; #endif if (crc32_alg == CRC32_SW) - RTE_LOG(WARNING, HASH, + fprintf(stderr, "Unsupported CRC32 algorithm requested using CRC32_SW\n"); } diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c index 0249883b8d07..fddc14e57588 100644 --- a/lib/hash/rte_thash.c +++ b/lib/hash/rte_thash.c @@ -13,6 +13,12 @@ #include #include +RTE_LOG_REGISTER_SUFFIX(rte_thash_logtype, thash, INFO); + +#define HASH_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, rte_thash_logtype, \ + "%s(): " fmt "\n", __func__, ##args) + #define THASH_NAME_LEN 64 #define TOEPLITZ_HASH_LEN 32 @@ -104,6 +110,28 @@ rte_thash_gfni_supported(void) return 0; }; +#ifndef RTE_THASH_GFNI_DEFINED +uint32_t +rte_thash_gfni(const uint64_t *mtrx __rte_unused, + const uint8_t *key __rte_unused, int len __rte_unused) +{ + HASH_LOG(ERR, "is undefined under given arch"); + return 0; +} + +void +rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, + int len __rte_unused, uint8_t *tuple[] __rte_unused, + uint32_t val[], uint32_t num) +{ + unsigned int i; + + HASH_LOG(ERR, "is undefined under given arch"); + for (i = 0; i < num; i++) + val[i] = 0; +} +#endif + void rte_thash_complete_matrix(uint64_t *matrixes, const uint8_t *rss_key, int size) { @@ -240,8 +268,8 @@ rte_thash_init_ctx(const char *name, uint32_t key_len, uint32_t reta_sz, /* allocate tailq entry */ te = rte_zmalloc("THASH_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { - RTE_LOG(ERR, HASH, - "Can not allocate tailq entry for thash context %s\n", + HASH_LOG(ERR, + "Can not allocate tailq entry for thash context %s", name); rte_errno = ENOMEM; goto exit; @@ -249,7 +277,8 @@ rte_thash_init_ctx(const char *name, uint32_t key_len, uint32_t reta_sz, ctx = rte_zmalloc(NULL, sizeof(struct rte_thash_ctx) + key_len, 0); if (ctx == NULL) { - RTE_LOG(ERR, HASH, "thash ctx %s memory allocation failed\n", + HASH_LOG(ERR, + "thash ctx %s memory allocation failed", name); rte_errno = ENOMEM; goto free_te; @@ -272,7 +301,7 @@ rte_thash_init_ctx(const char *name, uint32_t key_len, uint32_t reta_sz, ctx->matrices = rte_zmalloc(NULL, key_len * sizeof(uint64_t), RTE_CACHE_LINE_SIZE); if (ctx->matrices == NULL) { - RTE_LOG(ERR, HASH, "Cannot allocate matrices\n"); + HASH_LOG(ERR, "Cannot allocate matrices"); rte_errno = ENOMEM; goto free_ctx; } @@ -387,8 +416,8 @@ generate_subkey(struct rte_thash_ctx *ctx, struct thash_lfsr *lfsr, if (((lfsr->bits_cnt + req_bits) > (1ULL << lfsr->deg) - 1) && ((ctx->flags & RTE_THASH_IGNORE_PERIOD_OVERFLOW) != RTE_THASH_IGNORE_PERIOD_OVERFLOW)) { - RTE_LOG(ERR, HASH, - "Can't generate m-sequence due to period overflow\n"); + HASH_LOG(ERR, + "Can't generate m-sequence due to period overflow"); return -ENOSPC; } @@ -467,9 +496,9 @@ insert_before(struct rte_thash_ctx *ctx, return ret; } } else if ((next_ent != NULL) && (end > next_ent->offset)) { - RTE_LOG(ERR, HASH, - "Can't add helper %s due to conflict with existing" - " helper %s\n", ent->name, next_ent->name); + HASH_LOG(ERR, + "Can't add helper %s due to conflict with existing helper %s", + ent->name, next_ent->name); rte_free(ent); return -ENOSPC; } @@ -516,9 +545,9 @@ insert_after(struct rte_thash_ctx *ctx, int ret; if ((next_ent != NULL) && (end > next_ent->offset)) { - RTE_LOG(ERR, HASH, - "Can't add helper %s due to conflict with existing" - " helper %s\n", ent->name, next_ent->name); + HASH_LOG(ERR, + "Can't add helper %s due to conflict with existing helper %s", + ent->name, next_ent->name); rte_free(ent); return -EEXIST; } diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h index ef90faa302d1..c3a5cf7e7b2d 100644 --- a/lib/hash/rte_thash_gfni.h +++ b/lib/hash/rte_thash_gfni.h @@ -38,13 +38,8 @@ extern "C" { * Calculated Toeplitz hash value. */ __rte_experimental -static inline uint32_t -rte_thash_gfni(const uint64_t *mtrx __rte_unused, - const uint8_t *key __rte_unused, int len __rte_unused) -{ - RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__); - return 0; -} +uint32_t +rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len); /** * Bulk implementation for Toeplitz hash. @@ -67,17 +62,10 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused, * Number of tuples to hash. */ __rte_experimental -static inline void -rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, - int len __rte_unused, uint8_t *tuple[] __rte_unused, - uint32_t val[], uint32_t num) -{ - unsigned int i; - - RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__); - for (i = 0; i < num; i++) - val[i] = 0; -} +void +rte_thash_gfni_bulk(const uint64_t *mtrx, + int len, uint8_t *tuple[], + uint32_t val[], uint32_t num); #endif /* RTE_THASH_GFNI_DEFINED */ diff --git a/lib/hash/version.map b/lib/hash/version.map index bdcebd19c29b..c30ac81307a7 100644 --- a/lib/hash/version.map +++ b/lib/hash/version.map @@ -51,4 +51,8 @@ EXPERIMENTAL { rte_thash_complete_matrix; rte_thash_get_gfni_matrices; rte_thash_gfni_supported; + + # added in 23.07 + rte_thash_gfni; + rte_thash_gfni_bulk; }; -- 2.39.1