diff mbox series

[net-next,v3,4/7] net: openvswitch: add meter drop reason

Message ID 20230807164551.553365-5-amorenoz@redhat.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series openvswitch: add drop reasons | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 1336 this patch: 1337
netdev/cc_maintainers warning 5 maintainers not CCed: kuba@kernel.org pshelar@ovn.org davem@davemloft.net pabeni@redhat.com edumazet@google.com
netdev/build_clang fail Errors and warnings before: 1359 this patch: 1360
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 1359 this patch: 1360
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Adrian Moreno Aug. 7, 2023, 4:45 p.m. UTC
By using an independent drop reason it makes it easy to ditinguish
between QoS-triggered or flow-triggered drop.

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:53 p.m. UTC | #1
Adrian Moreno <amorenoz@redhat.com> writes:

> By using an independent drop reason it makes it easy to ditinguish

nit: distinguish

> between QoS-triggered or flow-triggered drop.
>
> Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
> ---

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

>  net/openvswitch/actions.c | 2 +-
>  net/openvswitch/drop.h    | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
> index 285b1243b94f..e204c7eee8ef 100644
> --- a/net/openvswitch/actions.c
> +++ b/net/openvswitch/actions.c
> @@ -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);
> +				kfree_skb_reason(skb, OVS_DROP_METER);
>  				return 0;
>  			}
>  			break;
> diff --git a/net/openvswitch/drop.h b/net/openvswitch/drop.h
> index be51ff5039fb..1ba866c408e5 100644
> --- a/net/openvswitch/drop.h
> +++ b/net/openvswitch/drop.h
> @@ -12,6 +12,7 @@
>  	R(OVS_DROP_ACTION_ERROR)		\
>  	R(OVS_DROP_EXPLICIT_ACTION)		\
>  	R(OVS_DROP_EXPLICIT_ACTION_ERROR)	\
> +	R(OVS_DROP_METER)			\
>  	/* deliberate comment for trailing \ */
>  
>  enum ovs_drop_reason {
diff mbox series

Patch

diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 285b1243b94f..e204c7eee8ef 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -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);
+				kfree_skb_reason(skb, OVS_DROP_METER);
 				return 0;
 			}
 			break;
diff --git a/net/openvswitch/drop.h b/net/openvswitch/drop.h
index be51ff5039fb..1ba866c408e5 100644
--- a/net/openvswitch/drop.h
+++ b/net/openvswitch/drop.h
@@ -12,6 +12,7 @@ 
 	R(OVS_DROP_ACTION_ERROR)		\
 	R(OVS_DROP_EXPLICIT_ACTION)		\
 	R(OVS_DROP_EXPLICIT_ACTION_ERROR)	\
+	R(OVS_DROP_METER)			\
 	/* deliberate comment for trailing \ */
 
 enum ovs_drop_reason {