diff options
author | Pavan Chebbi <pavan.chebbi@broadcom.com> | 2023-12-22 20:22:02 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-01-02 13:52:27 +0000 |
commit | d3c982851c15ff1c5187a6188710daa7d0db7fe4 (patch) | |
tree | 3e57e4200015dbea2143130d2816f4da462cd633 /drivers/net/ethernet/broadcom/bnxt/bnxt.h | |
parent | 96c9bedc755ed1fa6e35d37328ddbcb439c93c4c (diff) |
bnxt_en: Add function to calculate Toeplitz hash
For ntuple filters added by aRFS, the Toeplitz hash calculated by our
NIC is available and is used to store the ntuple filter for quick
retrieval. In the next patches, user defined ntuple filter support
will be added and we need to calculate the same hash for these
filters. The same hash function needs to be used so we can detect
duplicates.
Add the function bnxt_toeplitz() to calculate the Toeplitz hash for
user defined ntuple filters. bnxt_toeplitz() uses the same Toeplitz
key and the same key length as the NIC.
bnxt_get_ntp_filter_idx() is added to return the hash index. For
aRFS, the hash comes from the NIC. For user defined ntuple, we call
bnxt_toeplitz() to calculate the hash index.
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt.h')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index 5d67b8299328..3f4e4708f7d8 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -1370,6 +1370,16 @@ struct bnxt_l2_key { }; }; +struct bnxt_ipv4_tuple { + struct flow_dissector_key_ipv4_addrs v4addrs; + struct flow_dissector_key_ports ports; +}; + +struct bnxt_ipv6_tuple { + struct flow_dissector_key_ipv6_addrs v6addrs; + struct flow_dissector_key_ports ports; +}; + #define BNXT_L2_KEY_SIZE (sizeof(struct bnxt_l2_key) / 4) struct bnxt_l2_filter { @@ -2413,6 +2423,7 @@ struct bnxt { struct hlist_head l2_fltr_hash_tbl[BNXT_L2_FLTR_HASH_SIZE]; u32 hash_seed; + u64 toeplitz_prefix; /* To protect link related settings during link changes and * ethtool settings changes. |