aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/mlx4_ib.h
diff options
context:
space:
mode:
authorEran Ben Elisha <eranbe@mellanox.com>2015-10-15 14:44:40 +0300
committerDoug Ledford <dledford@redhat.com>2015-10-21 23:16:47 -0400
commit3ba8e31d5a4343fa042c976a9ce9c3c16946c92d (patch)
tree7dda8d7b6ad7e20701a4f49aa2d9cd25daacde1c /drivers/infiniband/hw/mlx4/mlx4_ib.h
parentnet/mlx4_en: Implement mcast loopback prevention for ETH qps (diff)
downloadlinux-dev-3ba8e31d5a4343fa042c976a9ce9c3c16946c92d.tar.xz
linux-dev-3ba8e31d5a4343fa042c976a9ce9c3c16946c92d.zip
IB/mlx4: Add IB counters table
This is an infrastructure step for allocating and attaching more than one counter to QPs on the same port. Allocate a counters table and manage the insertion and removals of the counters in load and unload of mlx4 IB. Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/mlx4_ib.h')
-rw-r--r--drivers/infiniband/hw/mlx4/mlx4_ib.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
index 1e7b23bb2eb0..4056dc1c57cd 100644
--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
+++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
@@ -528,10 +528,17 @@ struct mlx4_ib_iov_port {
};
struct counter_index {
+ struct list_head list;
u32 index;
u8 allocated;
};
+struct mlx4_ib_counters {
+ struct list_head counters_list;
+ struct mutex mutex; /* mutex for accessing counters list */
+ u32 default_counter;
+};
+
struct mlx4_ib_dev {
struct ib_device ib_dev;
struct mlx4_dev *dev;
@@ -550,7 +557,7 @@ struct mlx4_ib_dev {
struct mutex cap_mask_mutex;
bool ib_active;
struct mlx4_ib_iboe iboe;
- struct counter_index counters[MLX4_MAX_PORTS];
+ struct mlx4_ib_counters counters_table[MLX4_MAX_PORTS];
int *eq_table;
struct kobject *iov_parent;
struct kobject *ports_parent;