summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
diff options
context:
space:
mode:
authorYan Burman <yanb@mellanox.com>2013-02-07 02:25:25 +0000
committerDavid S. Miller <davem@davemloft.net>2013-02-07 23:26:13 -0500
commitc07cb4b0ab78f279ea94c3b4661cad86eb02a5d9 (patch)
tree7c2eda4433a461a036410586a3ca31d27d46fb6a /drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
parent90bbb74af68b3255bc298731f8b60d5668877306 (diff)
downloadlinux-c07cb4b0ab78f279ea94c3b4661cad86eb02a5d9.tar.gz
linux-c07cb4b0ab78f279ea94c3b4661cad86eb02a5d9.tar.bz2
linux-c07cb4b0ab78f279ea94c3b4661cad86eb02a5d9.zip
net/mlx4_en: Manage hash of MAC addresses per port
As a preparation step for supporting multiple unicast addresses, store MAC addresses in hash table. Remove the radix tree for MAC addresses per QP, as it's not in use. Signed-off-by: Yan Burman <yanb@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/mlx4_en.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 47c9876a2449..0ff99e0b2ea3 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -442,6 +442,9 @@ enum {
MLX4_EN_FLAG_RX_FILTER_NEEDED = (1 << 3)
};
+#define MLX4_EN_MAC_HASH_SIZE (1 << BITS_PER_BYTE)
+#define MLX4_EN_MAC_HASH_IDX 5
+
struct mlx4_en_priv {
struct mlx4_en_dev *mdev;
struct mlx4_en_port_profile *prof;
@@ -521,7 +524,7 @@ struct mlx4_en_priv {
bool wol;
struct device *ddev;
int base_tx_qpn;
- struct radix_tree_root mac_tree;
+ struct hlist_head mac_hash[MLX4_EN_MAC_HASH_SIZE];
#ifdef CONFIG_MLX4_EN_DCB
struct ieee_ets ets;
@@ -542,8 +545,10 @@ enum mlx4_en_wol {
};
struct mlx4_mac_entry {
+ struct hlist_node hlist;
unsigned char mac[ETH_ALEN + 2];
u64 reg_id;
+ struct rcu_head rcu;
};
#define MLX4_EN_WOL_DO_MODIFY (1ULL << 63)