net: openvswitch: add last-action drop reason
authorAdrian Moreno <amorenoz@redhat.com>
Fri, 11 Aug 2023 14:12:48 +0000 (16:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Aug 2023 07:01:06 +0000 (08:01 +0100)
commit9d802da40b7c820deb9c60fc394457ea565cafc8
treeff60cda621b7504ac5ce43fde491c630584173c0
parentafb0c19242a0c9a19fc2013dd1389b553acc0ede
net: openvswitch: add last-action drop reason

Create a new drop reason subsystem for openvswitch and add the first
drop reason to represent last-action drops.

Last-action drops happen when a flow has an empty action list or there
is no action that consumes the packet (output, userspace, recirc, etc).
It is the most common way in which OVS drops packets.

Implementation-wise, most of these skb-consuming actions already call
"consume_skb" internally and return directly from within the
do_execute_actions() loop so with minimal changes we can assume that
any skb that exits the loop normally is a packet drop.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dropreason.h
net/openvswitch/actions.c
net/openvswitch/datapath.c
net/openvswitch/drop.h [new file with mode: 0644]