summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/core.h
diff options
context:
space:
mode:
authorNogah Frankel2016-11-25 10:33:38 +0100
committerDavid S. Miller2016-11-26 03:22:14 +0100
commitd570b7ee4e47721099fc6309fd3ff9b637261357 (patch)
tree6cc027835a266425d4721de250402892a7b85505 /drivers/net/ethernet/mellanox/mlxsw/core.h
parentmlxsw: switchib: Use generic listener struct for events (diff)
downloadkernel-qcow2-linux-d570b7ee4e47721099fc6309fd3ff9b637261357.tar.gz
kernel-qcow2-linux-d570b7ee4e47721099fc6309fd3ff9b637261357.tar.xz
kernel-qcow2-linux-d570b7ee4e47721099fc6309fd3ff9b637261357.zip
mlxsw: Change trap set function
Change trap setting function so instead of determining the trap group by trap id, it gets it as a parameter (so later we can have different trap groups for Spectrum and Switchx2). Add "is_ctrl" parameter to the trap setting function. It control whether the trapped packets wait in a designated control buffer or in their default one. This parameter is ignored by Switchx2 and Switchib. Add these parameters to the traps array in Spectrum, Switchx2 and Switchib. Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/core.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/core.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h
index 852218e44b23..b5b5b367d25c 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.h
@@ -98,10 +98,12 @@ struct mlxsw_listener {
} u;
enum mlxsw_reg_hpkt_action action;
enum mlxsw_reg_hpkt_action unreg_action;
+ u8 trap_group;
+ bool is_ctrl; /* should go via control buffer or not */
bool is_event;
};
-#define MLXSW_RXL(_func, _trap_id, _action, _unreg_action) \
+#define MLXSW_RXL(_func, _trap_id, _action, _is_ctrl, _unreg_action) \
{ \
.trap_id = MLXSW_TRAP_ID_##_trap_id, \
.u.rx_listener = \
@@ -112,6 +114,8 @@ struct mlxsw_listener {
}, \
.action = MLXSW_REG_HPKT_ACTION_##_action, \
.unreg_action = MLXSW_REG_HPKT_ACTION_##_unreg_action, \
+ .trap_group = MLXSW_REG_HTGT_TRAP_GROUP_RX, \
+ .is_ctrl = _is_ctrl, \
.is_event = false, \
}
@@ -124,6 +128,8 @@ struct mlxsw_listener {
.trap_id = MLXSW_TRAP_ID_##_trap_id, \
}, \
.action = MLXSW_REG_HPKT_ACTION_TRAP_TO_CPU, \
+ .trap_group = MLXSW_REG_HTGT_TRAP_GROUP_EMAD, \
+ .is_ctrl = false, \
.is_event = true, \
}