]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: refactor reinsert action
authorJohn Hurley <john.hurley@netronome.com>
Mon, 24 Jun 2019 22:13:35 +0000 (23:13 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Jun 2019 21:36:25 +0000 (14:36 -0700)
commit6543b0381497af3752a28bc0dd33f33e165e24d7
tree7e800de40ddee832bf6dde5738c1994824b93c0b
parent6edc9500e8750ecb8eb12bbb56191503f18ba1d2
net: sched: refactor reinsert action

The TC_ACT_REINSERT return type was added as an in-kernel only option to
allow a packet ingress or egress redirect. This is used to avoid
unnecessary skb clones in situations where they are not required. If a TC
hook returns this code then the packet is 'reinserted' and no skb consume
is carried out as no clone took place.

This return type is only used in act_mirred. Rather than have the reinsert
called from the main datapath, call it directly in act_mirred. Instead of
returning TC_ACT_REINSERT, change the type to the new TC_ACT_CONSUMED
which tells the caller that the packet has been stolen by another process
and that no consume call is required.

Moving all redirect calls to the act_mirred code is in preparation for
tracking recursion created by act_mirred.

Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_cls.h
include/net/sch_generic.h
net/core/dev.c
net/sched/act_mirred.c