netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
To: Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
Cc: "dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org"
	<dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org>,
	netdev <netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Ravi K <rkerur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Isaku Yamahata <yamahata-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
Subject: Re: [PATCH 2/4] Move execute_set_action to lib/odp-util.c
Date: Mon, 8 Apr 2013 13:29:52 -0700	[thread overview]
Message-ID: <CAEP_g=_JYu0m4G01osWCaMhu6ESdiryMQYvikfpuNNYj6dNn_A@mail.gmail.com> (raw)
In-Reply-To: <1365403431-18102-3-git-send-email-horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>

On Sun, Apr 7, 2013 at 11:43 PM, Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org> wrote:
> Move execute_set_action from lib/dpif-netedev.c to lib/odp-util.c
>
> This is in preparation for using execute_set_action()
> in lib/odp-util.c to handle recirculation/
>
> Signed-off-by: Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
>
> ---
>
> packet.c might be a better place for execute_set_action()
> but I'm unsure if accessing struct ovs_key_ethernet would
> lead to a layering violation.

I'd be tempted to just put this in it's own file.  As you say, it
doesn't really fit in either of the two existing ones.

> diff --git a/lib/odp-util.c b/lib/odp-util.c
> index e18e109..ad5873c 100644
> --- a/lib/odp-util.c
> +++ b/lib/odp-util.c
> @@ -2420,3 +2420,79 @@ commit_odp_actions(const struct flow *flow, struct flow *base,
>      commit_set_priority_action(flow, base, odp_actions);
>      commit_set_skb_mark_action(flow, base, odp_actions);
>  }
> +
> +static void
> +dp_netdev_set_dl(struct ofpbuf *packet, const struct ovs_key_ethernet *eth_key)

I think this function should be given a more generic name and possibly
moved to packet.c.

> +void
> +execute_set_action(struct ofpbuf *packet, const struct nlattr *a,
> +                   uint32_t *skb_mark)
> +{
> +    enum ovs_key_attr type = nl_attr_type(a);
> +    const struct ovs_key_ipv4 *ipv4_key;
> +    const struct ovs_key_ipv6 *ipv6_key;
> +    const struct ovs_key_tcp *tcp_key;
> +    const struct ovs_key_udp *udp_key;
> +
> +    switch (type) {
> +    case OVS_KEY_ATTR_PRIORITY:
> +    case OVS_KEY_ATTR_TUNNEL:
> +        /* not implemented */
> +        break;

Don't we need to carry this information along as well similar to skb->mark?

Also, is there a reason to not have the code for push/pop actions here as well?

  parent reply	other threads:[~2013-04-08 20:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08  6:43 [PATCH v5 0/4] Add packet recirculation Simon Horman
     [not found] ` <1365403431-18102-1-git-send-email-horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-04-08  6:43   ` [PATCH 1/4] " Simon Horman
2013-04-09  1:46     ` Jesse Gross
2013-04-09  7:50       ` Simon Horman
2013-04-09 15:44         ` Jesse Gross
     [not found]           ` <CAEP_g=-baZGttBowXKGdgKafxp9fkUrQ=44y562ZzfnOL-XaQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-10  9:16             ` Simon Horman
2013-04-10 16:21               ` Jesse Gross
     [not found]                 ` <CAEP_g=8vE9Ykdnro+Puw34ORRnPEMn1LMBxv+f7w_Dp-uty_iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-11  0:14                   ` Simon Horman
2013-04-08  6:43   ` [PATCH 2/4] Move execute_set_action to lib/odp-util.c Simon Horman
     [not found]     ` <1365403431-18102-3-git-send-email-horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-04-08 20:29       ` Jesse Gross [this message]
2013-04-09  3:11         ` Simon Horman
2013-04-09 15:17           ` Jesse Gross
2013-04-08  6:43   ` [PATCH 4/4] Avoid recirculation id collision Simon Horman
2013-04-08  6:43 ` [PATCH 3/4] Allow recirculation without facets Simon Horman

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='CAEP_g=_JYu0m4G01osWCaMhu6ESdiryMQYvikfpuNNYj6dNn_A@mail.gmail.com' \
    --to=jesse-l0m0p4e3n4lqt0dzr+alfa@public.gmane.org \
    --cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
    --cc=horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rkerur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=yamahata-jCdQPDEk3idL9jVzuh4AOg@public.gmane.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).