net: openvswitch: add meter drop reason
authorAdrian Moreno <amorenoz@redhat.com>
Fri, 11 Aug 2023 14:12:51 +0000 (16:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Aug 2023 07:01:06 +0000 (08:01 +0100)
By using an independent drop reason it makes it easy to distinguish
between QoS-triggered or flow-triggered drop.

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 e188f32..1222114 100644 (file)
@@ -1454,7 +1454,7 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
 
                case OVS_ACTION_ATTR_METER:
                        if (ovs_meter_execute(dp, skb, key, nla_get_u32(a))) {
-                               consume_skb(skb);
+                               ovs_kfree_skb_reason(skb, OVS_DROP_METER);
                                return 0;
                        }
                        break;
index 22e66d2..a35e63d 100644 (file)
@@ -13,6 +13,7 @@
        R(OVS_DROP_ACTION_ERROR)                \
        R(OVS_DROP_EXPLICIT)                    \
        R(OVS_DROP_EXPLICIT_WITH_ERROR)         \
+       R(OVS_DROP_METER)                       \
        /* deliberate comment for trailing \ */
 
 enum ovs_drop_reason {