• Paul Blakey's avatar
    net/sched: act_ct: Support restoring conntrack info on skbs · 30b0cf90
    Paul Blakey authored
    Provide an API to restore the ct state pointer.
    
    This may be used by drivers to restore the ct state if they
    miss in tc chain after they already did the hardware connection
    tracking action (ct_metadata action).
    
    For example, consider the following rule on chain 0 that is in_hw,
    however chain 1 is not_in_hw:
    
    $ tc filter add dev ... chain 0 ... \
      flower ... action ct pipe action goto chain 1
    
    Packets of a flow offloaded (via nf flow table offload) by the driver
    hit this rule in hardware, will be marked with the ct metadata action
    (mark, label, zone) that does the equivalent of the software ct action,
    and when the packet jumps to hardware chain 1, there would be a miss.
    
    CT was already processed in hardware. Therefore, the driver's miss
    handling should restore the ct state on the skb, using the provided API,
    and continue the packet processing in chain 1.
    Signed-off-by: default avatarPaul Blakey <paulb@mellanox.com>
    Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    30b0cf90
act_ct.c 37.6 KB