net: openvswitch: add action error drop reason
authorAdrian Moreno <amorenoz@redhat.com>
Fri, 11 Aug 2023 14:12:49 +0000 (16:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Aug 2023 07:01:06 +0000 (08:01 +0100)
Add a drop reason for packets that are dropped because an action
returns a non-zero error code.

Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/actions.c
net/openvswitch/drop.h

index 8c8a7a82f76ffc4c8096387267eac106492dc224..bb7aa181da30702cf80248060a3554280f3dda20 100644 (file)
@@ -1488,7 +1488,7 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
                }
 
                if (unlikely(err)) {
-                       kfree_skb(skb);
+                       ovs_kfree_skb_reason(skb, OVS_DROP_ACTION_ERROR);
                        return err;
                }
        }
index a5b2b901249bccf19097d80af2f8892aef7e06d2..b87613ced7132c06f9be347ea05cc94e60c0ea72 100644 (file)
@@ -10,6 +10,7 @@
 
 #define OVS_DROP_REASONS(R)                    \
        R(OVS_DROP_LAST_ACTION)                 \
+       R(OVS_DROP_ACTION_ERROR)                \
        /* deliberate comment for trailing \ */
 
 enum ovs_drop_reason {