From: Long Wu <long...@corigine.com>

The flow rules limitation is 2056 and driver needs
to store it in hash table. Considering hash conflicts,
driver use a new macro to enlarge hash table size.

Signed-off-by: Long Wu <long...@corigine.com>
Reviewed-by: Chaoyong He <chaoyong...@corigine.com>
Reviewed-by: Peng Zhang <peng.zh...@corigine.com>
---
 drivers/net/nfp/nfp_net_common.h | 3 +++
 drivers/net/nfp/nfp_net_flow.c   | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h
index 6db849eb07..6c739891be 100644
--- a/drivers/net/nfp/nfp_net_common.h
+++ b/drivers/net/nfp/nfp_net_common.h
@@ -179,6 +179,9 @@ struct nfp_net_flow_count {
        uint16_t ipv6_count;
 };
 
+#define NFP_NET_HASH_REDUNDANCE (1.2)
+#define NFP_NET_FLOW_HASH_TBALE_SIZE ((NFP_NET_FLOW_LIMIT) * 
(NFP_NET_HASH_REDUNDANCE))
+
 struct nfp_net_priv {
        uint32_t hash_seed; /**< Hash seed for hash tables in this structure. */
        struct rte_hash *flow_table; /**< Hash table to store flow rules. */
diff --git a/drivers/net/nfp/nfp_net_flow.c b/drivers/net/nfp/nfp_net_flow.c
index 74dd67abd4..2dab317a5f 100644
--- a/drivers/net/nfp/nfp_net_flow.c
+++ b/drivers/net/nfp/nfp_net_flow.c
@@ -1063,7 +1063,7 @@ nfp_net_flow_priv_init(struct nfp_pf_dev *pf_dev,
 
        struct rte_hash_parameters flow_hash_params = {
                .name       = flow_name,
-               .entries    = NFP_NET_FLOW_LIMIT,
+               .entries    = NFP_NET_FLOW_HASH_TBALE_SIZE,
                .hash_func  = rte_jhash,
                .socket_id  = rte_socket_id(),
                .key_len    = sizeof(uint32_t),
-- 
2.39.1

Reply via email to