• Ido Schimmel's avatar
    mlxsw: spectrum_trap: Factor out common Rx listener function · 45b1c873
    Ido Schimmel authored
    We currently have an Rx listener function for exception traps that marks
    received skbs with 'offload_fwd_mark' and injects them to the kernel's
    Rx path. The marking is done because all these exceptions occur during
    L3 forwarding, after the packets were potentially flooded at L2.
    
    A subsequent patch will add support for control traps. Packets received
    via some of these control traps need different handling:
    
    1. Packets might not need to be marked with 'offload_fwd_mark'. For
       example, if packet was trapped before L2 forwarding
    
    2. Packets might not need to be injected to the kernel's Rx path. For
       example, sampled packets are reported to user space via the psample
       module
    
    Factor out a common Rx listener function that only reports trapped
    packets to devlink. Call it from mlxsw_sp_rx_no_mark_listener() and
    mlxsw_sp_rx_mark_listener() that will inject the packets to the kernel's
    Rx path, without and with the marking, respectively.
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    45b1c873
spectrum_trap.c 27.9 KB