Rename common hash and flow functions to have consistent naming convention.
Signed-off-by: Serhii Iliushyk <[email protected]> --- drivers/net/ntnic/include/flow_api.h | 8 ++++---- drivers/net/ntnic/nthw/flow_api/flow_api.c | 12 ++++++------ drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c | 8 ++++---- drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.h | 2 +- .../flow_api/profile_inline/flow_api_hw_db_inline.c | 4 ++-- .../profile_inline/flow_api_profile_inline.c | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/net/ntnic/include/flow_api.h b/drivers/net/ntnic/include/flow_api.h index 582de3b281..869158258e 100644 --- a/drivers/net/ntnic/include/flow_api.h +++ b/drivers/net/ntnic/include/flow_api.h @@ -56,7 +56,7 @@ struct nt_eth_rss_conf { enum rte_eth_hash_function algorithm; }; -int sprint_nt_rss_mask(char *str, uint16_t str_len, const char *prefix, uint64_t hash_mask); +int nthw_sprint_rss_mask(char *str, uint16_t str_len, const char *prefix, uint64_t hash_mask); struct flow_eth_dev { /* NIC that owns this port device */ @@ -171,7 +171,7 @@ void nthw_flow_nic_set_error(enum flow_nic_err_msg_e msg, struct rte_flow_error * Resources */ -extern const char *dbg_res_descr[]; +extern const char *nthw_dbg_res_descr[]; #define flow_nic_set_bit(arr, x) \ do { \ @@ -199,7 +199,7 @@ extern const char *dbg_res_descr[]; typeof(res_type) _temp_res_type = (res_type); \ size_t _temp_index = (index); \ NT_LOG(DBG, FILTER, "mark resource used: %s idx %zu", \ - dbg_res_descr[_temp_res_type], _temp_index); \ + nthw_dbg_res_descr[_temp_res_type], _temp_index); \ RTE_ASSERT(flow_nic_is_bit_set(_temp_ndev->res[_temp_res_type].alloc_bm, \ _temp_index) == 0); \ flow_nic_set_bit(_temp_ndev->res[_temp_res_type].alloc_bm, _temp_index); \ @@ -210,7 +210,7 @@ extern const char *dbg_res_descr[]; typeof(res_type) _temp_res_type = (res_type); \ size_t _temp_index = (index); \ NT_LOG(DBG, FILTER, "mark resource unused: %s idx %zu", \ - dbg_res_descr[_temp_res_type], _temp_index); \ + nthw_dbg_res_descr[_temp_res_type], _temp_index); \ flow_nic_unset_bit((_ndev)->res[_temp_res_type].alloc_bm, _temp_index); \ } while (0) diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c index 4d1c9c8d7c..dee2ee137a 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_api.c +++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c @@ -18,7 +18,7 @@ name, #name \ } -const char *dbg_res_descr[] = { +const char *nthw_dbg_res_descr[] = { [RES_QUEUE] = "RES_QUEUE", [RES_CAT_CFN] = "RES_CAT_CFN", [RES_CAT_COT] = "RES_CAT_COT", @@ -41,7 +41,7 @@ const char *dbg_res_descr[] = { [RES_INVALID] = "RES_INVALID", }; -static_assert(RTE_DIM(dbg_res_descr) == RES_END, +static_assert(RTE_DIM(nthw_dbg_res_descr) == RES_END, "The list of debug descriptions is not fully completed"); static struct flow_nic_dev *dev_base; @@ -212,7 +212,7 @@ void nthw_flow_nic_free_resource(struct flow_nic_dev *ndev, enum res_type_e res_ int nthw_flow_nic_ref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index) { NT_LOG(DBG, FILTER, "Reference resource %s idx %i (before ref cnt %" PRIu32 ")", - dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]); + nthw_dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]); RTE_ASSERT(flow_nic_is_resource_used(ndev, res_type, index)); if (ndev->res[res_type].ref[index] == (uint32_t)-1) @@ -225,7 +225,7 @@ int nthw_flow_nic_ref_resource(struct flow_nic_dev *ndev, enum res_type_e res_ty int nthw_flow_nic_deref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index) { NT_LOG(DBG, FILTER, "De-reference resource %s idx %i (before ref cnt %" PRIu32 ")", - dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]); + nthw_dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]); RTE_ASSERT(flow_nic_is_resource_used(ndev, res_type, index)); RTE_ASSERT(ndev->res[res_type].ref[index]); /* deref */ @@ -494,7 +494,7 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev) for (unsigned int i = 0; i < RES_COUNT; i++) { int err = 0; - NT_LOG(DBG, FILTER, "RES state for: %s", dbg_res_descr[i]); + NT_LOG(DBG, FILTER, "RES state for: %s", nthw_dbg_res_descr[i]); for (unsigned int ii = 0; ii < ndev->res[i].resource_count; ii++) { int ref = ndev->res[i].ref[ii]; @@ -983,7 +983,7 @@ static struct rss_type_info rss_to_string[] = { RSS_TO_STRING(RTE_ETH_RSS_L3_SRC_ONLY), }; -int sprint_nt_rss_mask(char *str, uint16_t str_len, const char *prefix, uint64_t hash_mask) +int nthw_sprint_rss_mask(char *str, uint16_t str_len, const char *prefix, uint64_t hash_mask) { if (str == NULL || str_len == 0) return -1; diff --git a/drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c b/drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c index 76ff79cbe1..9a7069194b 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c +++ b/drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c @@ -130,7 +130,7 @@ static __rte_always_inline void unset_bits_and_log(uint64_t *hash_mask, uint64_t char rss_buffer[4096]; uint16_t rss_buffer_len = sizeof(rss_buffer); - if (sprint_nt_rss_mask(rss_buffer, rss_buffer_len, " ", *hash_mask & hash_bits) == 0) + if (nthw_sprint_rss_mask(rss_buffer, rss_buffer_len, " ", *hash_mask & hash_bits) == 0) NT_LOG(DBG, FILTER, "Configured RSS types:%s", rss_buffer); unset_bits(hash_mask, hash_bits); } @@ -141,14 +141,14 @@ static __rte_always_inline void unset_bits_if_all_enabled(uint64_t *hash_mask, u unset_bits(hash_mask, hash_bits); } -int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_conf) +int nthw_hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_conf) { uint64_t fields = rss_conf.rss_hf; char rss_buffer[4096]; uint16_t rss_buffer_len = sizeof(rss_buffer); - if (sprint_nt_rss_mask(rss_buffer, rss_buffer_len, " ", fields) == 0) + if (nthw_sprint_rss_mask(rss_buffer, rss_buffer_len, " ", fields) == 0) NT_LOG(DBG, FILTER, "Requested RSS types:%s", rss_buffer); /* @@ -645,7 +645,7 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c if (fields || res != 0) { nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_PRESET_ALL, hsh_idx, 0, 0); - if (sprint_nt_rss_mask(rss_buffer, rss_buffer_len, " ", rss_conf.rss_hf) == 0) { + if (nthw_sprint_rss_mask(rss_buffer, rss_buffer_len, " ", rss_conf.rss_hf) == 0) { NT_LOG(ERR, FILTER, "RSS configuration%s is not supported for hash func %s.", rss_buffer, (enum rte_eth_hash_function)toeplitz ? "Toeplitz" : "NTH10"); diff --git a/drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.h b/drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.h index 38901b3e8a..124225c455 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.h +++ b/drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.h @@ -11,7 +11,7 @@ #include "hw_mod_backend.h" #include "flow_api.h" -int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, +int nthw_hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_conf); #endif /* _FLOW_HSH_CFG_H_ */ diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c index b1a2d9dfa3..5de4f6bae7 100644 --- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c +++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c @@ -598,7 +598,7 @@ void nthw_db_inline_dump(struct flow_nic_dev *ndev, void *db_handle, const struc fprintf(file, " %016lx\n", data->hash_mask); /* convert hash mask to human readable RTE_ETH_RSS_* form if possible */ - if (sprint_nt_rss_mask(str_buffer, rss_buffer_len, "\n ", + if (nthw_sprint_rss_mask(str_buffer, rss_buffer_len, "\n ", data->hash_mask) == 0) { fprintf(file, " Hash mask flags:%s\n", str_buffer); } @@ -2830,7 +2830,7 @@ struct hw_db_hsh_idx nthw_db_inline_hsh_add(struct flow_nic_dev *ndev, void *db_ tmp_rss_conf.rss_hf = data->hash_mask; memcpy(tmp_rss_conf.rss_key, data->key, MAX_RSS_KEY_LEN); tmp_rss_conf.algorithm = data->func; - int res = hsh_set(ndev, idx.ids, tmp_rss_conf); + int res = nthw_hsh_set(ndev, idx.ids, tmp_rss_conf); if (res != 0) { idx.error = 1; diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c index e0cdd12626..a1f9e3addf 100644 --- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c @@ -3977,7 +3977,7 @@ int nthw_init_flow_mgmnt_of_ndev_profile_inline(struct flow_nic_dev *ndev) .rss_hf = RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_PORT, .algorithm = 0, }; - hsh_set(ndev, 0, hsh_5_tuple); + nthw_hsh_set(ndev, 0, hsh_5_tuple); nthw_mod_hsh_rcp_flush(&ndev->be, 0, 1); flow_nic_mark_resource_used(ndev, RES_HSH_RCP, 0); diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c index 1c26411da8..906e55de7c 100644 --- a/drivers/net/ntnic/ntnic_ethdev.c +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -1770,7 +1770,7 @@ static int eth_dev_rss_hash_update(struct rte_eth_dev *eth_dev, struct rte_eth_r tmp_rss_conf.algorithm = rss_conf->algorithm; tmp_rss_conf.rss_hf = rss_conf->rss_hf; - int res = hsh_set(ndev, hsh_idx, tmp_rss_conf); + int res = nthw_hsh_set(ndev, hsh_idx, tmp_rss_conf); if (res == 0) { flow_filter_ops->nthw_mod_hsh_rcp_flush(&ndev->be, hsh_idx, 1); -- 2.45.0

