aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/en_rep.h
diff options
context:
space:
mode:
authorHadar Hen Zion <hadarh@mellanox.com>2017-02-02 16:43:35 +0200
committerSaeed Mahameed <saeedm@mellanox.com>2017-04-30 16:03:12 +0300
commit37b498ff238549b30c9e70d4e45f522fd53b8994 (patch)
treef0003d2d9e090f943bd9ffd25903153abccd70da /drivers/net/ethernet/mellanox/mlx5/core/en_rep.h
parentnet/mlx5e: Read neigh parameters with proper locking (diff)
downloadlinux-dev-37b498ff238549b30c9e70d4e45f522fd53b8994.tar.xz
linux-dev-37b498ff238549b30c9e70d4e45f522fd53b8994.zip
net/mlx5e: Add neighbour hash table to the representors
Add hash table to the representors which is to be used by the next patch to save neighbours information in the driver. In order to offload IP tunnel encapsulation rules, the driver must find the tunnel dst neighbour according to the output device and the destination address given by the user. The next patch will cache the neighbors information in the driver to allow support in neigh update flow for tunnel encap rules. The neighbour entries are also saved in a list so we easily iterate over them when querying statistics in order to provide 'used' feedback to the kernel neighbour NUD core. Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_rep.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_rep.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.h b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.h
index 425cb1b0bf02..99f6b5f41070 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.h
@@ -34,11 +34,41 @@
#define __MLX5E_REP_H__
#include <net/ip_tunnels.h>
+#include <linux/rhashtable.h>
#include "eswitch.h"
#include "en.h"
+struct mlx5e_neigh_update_table {
+ struct rhashtable neigh_ht;
+ /* Save the neigh hash entries in a list in addition to the hash table
+ * (neigh_ht). In order to iterate easily over the neigh entries.
+ * Used for stats query.
+ */
+ struct list_head neigh_list;
+};
+
struct mlx5e_rep_priv {
struct mlx5_eswitch_rep *rep;
+ struct mlx5e_neigh_update_table neigh_update;
+};
+
+struct mlx5e_neigh {
+ struct net_device *dev;
+ union {
+ __be32 v4;
+ struct in6_addr v6;
+ } dst_ip;
+};
+
+struct mlx5e_neigh_hash_entry {
+ struct rhash_head rhash_node;
+ struct mlx5e_neigh m_neigh;
+
+ /* Save the neigh hash entry in a list on the representor in
+ * addition to the hash table. In order to iterate easily over the
+ * neighbour entries. Used for stats query.
+ */
+ struct list_head neigh_list;
};
struct mlx5e_encap_entry {