diff mbox series

[ovs-dev,net-next,v3,2/7] net: openvswitch: add action error drop reason

Message ID 20230807164551.553365-3-amorenoz@redhat.com
State Handled Elsewhere
Headers show
Series openvswitch: add drop reasons | expand

Commit Message

Adrián Moreno Aug. 7, 2023, 4:45 p.m. UTC
Add a drop reason for packets that are dropped because an action
returns a non-zero error code.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
---
 net/openvswitch/actions.c | 2 +-
 net/openvswitch/drop.h    | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Aaron Conole Aug. 8, 2023, 2:37 p.m. UTC | #1
Adrian Moreno <amorenoz@redhat.com> writes:

> Add a drop reason for packets that are dropped because an action
> returns a non-zero error code.
>
> Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
> ---

Acked-by: Aaron Conole <aconole@redhat.com>
diff mbox series

Patch

diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index af676dcac2b4..9b66a3334aaa 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -1488,7 +1488,7 @@  static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
 		}
 
 		if (unlikely(err)) {
-			kfree_skb(skb);
+			kfree_skb_reason(skb, OVS_DROP_ACTION_ERROR);
 			return err;
 		}
 	}
diff --git a/net/openvswitch/drop.h b/net/openvswitch/drop.h
index cdd10629c6be..3cd6489a5a2b 100644
--- a/net/openvswitch/drop.h
+++ b/net/openvswitch/drop.h
@@ -9,6 +9,7 @@ 
 
 #define OVS_DROP_REASONS(R)			\
 	R(OVS_DROP_FLOW)		        \
+	R(OVS_DROP_ACTION_ERROR)		\
 	/* deliberate comment for trailing \ */
 
 enum ovs_drop_reason {