diff options
author | Nogah Frankel | 2016-11-25 10:33:39 +0100 |
---|---|---|
committer | David S. Miller | 2016-11-26 03:22:14 +0100 |
commit | 0fb78a4e9c8563e1f95358794bd168c5c1e72009 (patch) | |
tree | 751577feae526796ac7e472cb7e2d196caac27dd /drivers/net/ethernet/mellanox/mlxsw/core.h | |
parent | mlxsw: Change trap set function (diff) | |
download | kernel-qcow2-linux-0fb78a4e9c8563e1f95358794bd168c5c1e72009.tar.gz kernel-qcow2-linux-0fb78a4e9c8563e1f95358794bd168c5c1e72009.tar.xz kernel-qcow2-linux-0fb78a4e9c8563e1f95358794bd168c5c1e72009.zip |
mlxsw: Add option to choose trap group
Currently, we set the trap group to pre-determined option, based on whether
it is an rx or event trap.
This commit adds a possibility to chose the trap group, so it can be set
to different values in the following patches.
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.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h index b5b5b367d25c..d663b8e98c91 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.h +++ b/drivers/net/ethernet/mellanox/mlxsw/core.h @@ -103,7 +103,8 @@ struct mlxsw_listener { bool is_event; }; -#define MLXSW_RXL(_func, _trap_id, _action, _is_ctrl, _unreg_action) \ +#define MLXSW_RXL(_func, _trap_id, _action, _is_ctrl, _trap_group, \ + _unreg_action) \ { \ .trap_id = MLXSW_TRAP_ID_##_trap_id, \ .u.rx_listener = \ @@ -114,23 +115,23 @@ 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, \ + .trap_group = MLXSW_REG_HTGT_TRAP_GROUP_##_trap_group, \ .is_ctrl = _is_ctrl, \ .is_event = false, \ } -#define MLXSW_EVENTL(_func, _trap_id) \ - { \ - .trap_id = MLXSW_TRAP_ID_##_trap_id, \ - .u.event_listener = \ - { \ - .func = _func, \ - .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, \ +#define MLXSW_EVENTL(_func, _trap_id, _trap_group) \ + { \ + .trap_id = MLXSW_TRAP_ID_##_trap_id, \ + .u.event_listener = \ + { \ + .func = _func, \ + .trap_id = MLXSW_TRAP_ID_##_trap_id, \ + }, \ + .action = MLXSW_REG_HPKT_ACTION_TRAP_TO_CPU, \ + .trap_group = MLXSW_REG_HTGT_TRAP_GROUP_##_trap_group, \ + .is_ctrl = false, \ + .is_event = true, \ } int mlxsw_core_rx_listener_register(struct mlxsw_core *mlxsw_core, |