From: Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
To: Pravin Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@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 v2.39 7/7] datapath: Add basic MPLS support to kernel
Date: Thu, 19 Sep 2013 13:45:37 -0700 [thread overview]
Message-ID: <20130919204214.GA2734@verge.net.au> (raw)
In-Reply-To: <20130918220756.GA24919-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
On Wed, Sep 18, 2013 at 05:07:59PM -0500, Simon Horman wrote:
> On Tue, Sep 17, 2013 at 11:38:18AM -0700, Pravin Shelar wrote:
> > On Mon, Sep 9, 2013 at 12:20 AM, Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org> wrote:
> > > Allow datapath to recognize and extract MPLS labels into flow keys
> > > and execute actions which push, pop, and set labels on packets.
> > >
> > > Based heavily on work by Leo Alterman, Ravi K, Isaku Yamahata and Joe Stringer.
> > >
> > > Cc: Ravi K <rkerur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > > Cc: Leo Alterman <lalterman-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
> > > Cc: Isaku Yamahata <yamahata-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
> > > Cc: Joe Stringer <joe-Q1GJJQv1iO6lP80pJB477g@public.gmane.org>
> > > Signed-off-by: Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
> > >
> > > ---
> > ....
> > > diff --git a/datapath/datapath.h b/datapath/datapath.h
> > > index 5d50dd4..babae3b 100644
> > > --- a/datapath/datapath.h
> > > +++ b/datapath/datapath.h
> > > @@ -36,6 +36,10 @@
> > >
> > > #define SAMPLE_ACTION_DEPTH 3
> > >
> > > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
> > > +#define HAVE_INNER_PROTOCOL
> > > +#endif
> > > +
> > > /**
> > > * struct dp_stats_percpu - per-cpu packet processing statistics for a given
> > > * datapath.
> > > @@ -93,11 +97,16 @@ struct datapath {
> > > * @pkt_key: The flow information extracted from the packet. Must be nonnull.
> > > * @tun_key: Key for the tunnel that encapsulated this packet. NULL if the
> > > * packet is not being tunneled.
> > > + * @inner_protocol: Provides a substitute for the skb->inner_protocol field on
> > > + * kernels before 3.11.
> > > */
> > > struct ovs_skb_cb {
> > > struct sw_flow *flow;
> > > struct sw_flow_key *pkt_key;
> > > struct ovs_key_ipv4_tunnel *tun_key;
> > > +#ifndef HAVE_INNER_PROTOCOL
> > > + __be16 inner_protocol;
> > > +#endif
> > > };
> > > #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb)
> > >
> > Can you move this to compat struct ovs_gso_cb {}
>
> I think that you are correct and inner_protocol needs
> to be in struct ovs_gso_cb so that it can
> be accessed via skb_network_protocol() from
> rpl___skb_gso_segment().
>
> However I think it may also need to be present in struct ovs_cb
> so that it can be set correctly.
>
> Currently it is set unconditionally
> in ovs_execute_actions() and Jesse has suggested setting
> it conditionally in pop_mpls() (which is called by do_execute_actions()).
> But regardless it seems to me that the field would need to be available
> in struct ovs_cb.
Having reviewed the code once more I now notice that struct ovs_gso_cb
contains struct ovs_skb_cb dp_cb. Whereas my previous assumption was
that they were mutually exclusive.
With this in mind I think it should be safe to use ovs_gso_cb from
ovs_execute_actions() or do_execute_actions() but I would value
your opinion on that.
Conversely, if inner_protocol was left in struct ovs_skb_cb there should
be no problem with accessing it from GSO code as the code currently does.
So I am not sure that I see the value of moving it but I am happy to do
so if you think it is safe and it is your preferred option.
next prev parent reply other threads:[~2013-09-19 20:45 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-09 7:20 [PATCH v2.39 0/7] MPLS actions and matches Simon Horman
2013-09-09 7:20 ` [PATCH v2.39 2/7] odp: Allow VLAN actions after MPLS actions Simon Horman
[not found] ` <1378711207-29890-1-git-send-email-horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-09-09 7:20 ` [PATCH v2.39 1/7] odp: Only pass vlan_tci to commit_vlan_action() Simon Horman
2013-09-09 7:20 ` [PATCH v2.39 3/7] ofp-actions: Add OFPUTIL_OFPAT13_PUSH_MPLS Simon Horman
2013-09-09 7:20 ` [PATCH v2.39 4/7] ofp-actions: Add separate OpenFlow 1.3 action parser Simon Horman
2013-09-09 7:20 ` [PATCH v2.39 5/7] lib: Push MPLS tags in the OpenFlow 1.3 ordering Simon Horman
2013-09-09 7:20 ` [PATCH v2.39 6/7] datapath: Break out deacceleration portion of vlan_push Simon Horman
2013-09-13 22:07 ` Jesse Gross
[not found] ` <CAEP_g=_ZQ6hNpxoHm6t3N=PxA+3WTrvNegL514j0R3GDM5C92A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-15 16:32 ` Simon Horman
2013-09-19 14:56 ` Simon Horman
2013-09-09 7:20 ` [PATCH v2.39 7/7] datapath: Add basic MPLS support to kernel Simon Horman
[not found] ` <1378711207-29890-8-git-send-email-horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-09-16 20:38 ` Jesse Gross
[not found] ` <CAEP_g=8FBQPZ=C6G39YdHRzG57m5MqfXSZFAX2S_KLHRwfzc2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-16 20:46 ` Ben Pfaff
2013-09-17 23:47 ` Simon Horman
2013-09-18 0:05 ` Ben Pfaff
2013-09-19 15:57 ` Simon Horman
2013-09-19 17:21 ` Jesse Gross
2013-09-22 5:34 ` Simon Horman
[not found] ` <20130922053156.GA4849-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-09-23 21:17 ` Jesse Gross
2013-09-24 1:32 ` Simon Horman
2013-09-24 1:38 ` Jesse Gross
2013-09-24 2:49 ` Simon Horman
2013-09-17 18:38 ` Pravin Shelar
2013-09-18 22:07 ` Simon Horman
2013-09-19 17:31 ` Jesse Gross
2013-09-22 5:38 ` Simon Horman
2013-09-23 19:47 ` Pravin Shelar
[not found] ` <CALnjE+o_bcNbU6kv2eUBaNS4tincV+BmrFyJtZZRTaMPMVv8gw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-23 21:24 ` Jesse Gross
2013-09-24 1:33 ` Simon Horman
[not found] ` <20130918220756.GA24919-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-09-19 20:45 ` Simon Horman [this message]
2013-09-20 1:31 ` [ovs-dev] " Pravin Shelar
2013-09-22 3:54 ` Simon Horman
2013-09-09 7:25 ` [PATCH v2.39 0/7] MPLS actions and matches Simon Horman
2013-09-12 19:06 ` [ovs-dev] " Ben Pfaff
[not found] ` <20130912190636.GL16044-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2013-09-12 22:56 ` Simon Horman
[not found] ` <20130912225614.GB30229-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-09-12 22:54 ` Ben Pfaff
2013-09-13 22:15 ` [ovs-dev] " Jesse Gross
2013-09-15 16:39 ` 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=20130919204214.GA2734@verge.net.au \
--to=horms-/r6kz+ddxgppr4jqbcensq@public.gmane.org \
--cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pshelar-l0M0P4e3n4LQT0dZR+AlfA@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).