From: Pravin Shelar <pshelar@ovn.org>
To: Andy Zhou <azhou@ovn.org>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
Joe Stringer <joe@ovn.org>, Greg Rose <gvrose8192@gmail.com>
Subject: Re: [net-next RFC 4/4] openvswitch: Add meter action support
Date: Fri, 13 Oct 2017 17:13:00 -0700 [thread overview]
Message-ID: <CAOrHB_AaUYb_s4Mp9gOBsH26P1CHcnEcLjPW8ZDeJxPCESP3pw@mail.gmail.com> (raw)
In-Reply-To: <1507847923-13612-5-git-send-email-azhou@ovn.org>
On Thu, Oct 12, 2017 at 3:38 PM, Andy Zhou <azhou@ovn.org> wrote:
> Implements OVS kernel meter action support.
>
> Signed-off-by: Andy Zhou <azhou@ovn.org>
> ---
> include/uapi/linux/openvswitch.h | 1 +
> net/openvswitch/actions.c | 12 ++++++++++++
> net/openvswitch/datapath.h | 1 +
> net/openvswitch/flow_netlink.c | 6 ++++++
> 4 files changed, 20 insertions(+)
>
> diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
> index 325049a129e4..11fe1a06cdd6 100644
> --- a/include/uapi/linux/openvswitch.h
> +++ b/include/uapi/linux/openvswitch.h
> @@ -835,6 +835,7 @@ enum ovs_action_attr {
> OVS_ACTION_ATTR_TRUNC, /* u32 struct ovs_action_trunc. */
> OVS_ACTION_ATTR_PUSH_ETH, /* struct ovs_action_push_eth. */
> OVS_ACTION_ATTR_POP_ETH, /* No argument. */
> + OVS_ACTION_ATTR_METER, /* u32 meter ID. */
>
> __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted
> * from userspace. */
> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
> index a54a556fcdb5..4eb160ac5a27 100644
> --- a/net/openvswitch/actions.c
> +++ b/net/openvswitch/actions.c
> @@ -1210,6 +1210,12 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
> case OVS_ACTION_ATTR_POP_ETH:
> err = pop_eth(skb, key);
> break;
> +
> + case OVS_ACTION_ATTR_METER:
> + if (ovs_meter_execute(dp, skb, key, nla_get_u32(a))) {
> + consume_skb(skb);
> + return 0;
> + }
> }
>
> if (unlikely(err)) {
> @@ -1341,6 +1347,12 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
> err = do_execute_actions(dp, skb, key,
> acts->actions, acts->actions_len);
>
> + /* OVS action has dropped the packet, do not expose it
> + * to the user.
> + */
> + if (err == -ENODATA)
> + err = 0;
> +
I am not sure who is returning this error code?
next prev parent reply other threads:[~2017-10-14 0:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 22:38 [net-next RFC 0/4] Openvswitch meter action Andy Zhou
2017-10-12 22:38 ` [net-next RFC 1/4] openvswitch: Add meter netlink definitions Andy Zhou
2017-10-12 22:38 ` [net-next RFC 2/4] openvswitch: export get_dp() API Andy Zhou
2017-10-12 22:38 ` [net-next RFC 3/4] openvswitch: Add meter infrastructure Andy Zhou
2017-10-14 0:12 ` Pravin Shelar
2017-10-16 7:05 ` Andy Zhou
2017-10-16 17:49 ` Pravin Shelar
2017-10-17 7:40 ` Andy Zhou
2017-10-12 22:38 ` [net-next RFC 4/4] openvswitch: Add meter action support Andy Zhou
2017-10-14 0:13 ` Pravin Shelar [this message]
2017-10-16 7:06 ` Andy Zhou
2017-10-14 0:09 ` [net-next RFC 0/4] Openvswitch meter action Pravin Shelar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOrHB_AaUYb_s4Mp9gOBsH26P1CHcnEcLjPW8ZDeJxPCESP3pw@mail.gmail.com \
--to=pshelar@ovn.org \
--cc=azhou@ovn.org \
--cc=gvrose8192@gmail.com \
--cc=joe@ovn.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).