[ovs-dev] [PATCH 1/2] odp-util: handle ipv4_tunnel key in odp_flow_key_to_flow()
Pravin Shelar
pshelar at nicira.com
Tue Nov 20 19:22:16 UTC 2012
On Tue, Nov 20, 2012 at 11:17 AM, Jesse Gross <jesse at nicira.com> wrote:
> On Tue, Nov 20, 2012 at 10:15 AM, Pravin B Shelar <pshelar at nicira.com>
> wrote:
> > Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
> > ---
> > lib/odp-util.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/lib/odp-util.c b/lib/odp-util.c
> > index 9b0876c..3884b4d 100644
> > --- a/lib/odp-util.c
> > +++ b/lib/odp-util.c
> > @@ -1874,6 +1874,20 @@ odp_flow_key_to_flow(const struct nlattr *key,
> size_t key_len,
>
> Don't we need the corresponding code in odp_flow_key_from_flow()?
> Otherwise, this will now return ODP_FIT_PERFECT but we won't actually
> be able to regenerate the kernel's original flow. Is there any reason
> not to add support for not just these two but as an action as well?
>
> ok, I will fix odp_flow_key_from_flow().
> > + if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_IPV4_TUNNEL)) {
> > + struct ovs_key_ipv4_tunnel *ipv4_tun_key;
> > +
> > + ipv4_tun_key = nl_attr_get(attrs[OVS_KEY_ATTR_IPV4_TUNNEL]);
> > +
> > + flow->tunnel.tun_id = ipv4_tun_key->tun_id;
> > + flow->tunnel.flags = ipv4_tun_key->tun_flags;
>
> This implicitly assumes that the flags are the same between userspace
> and kernel. This is the case now but I'm not sure that we want to
> make that assumption in the future. It can also cause us to pull in
> additional information from the kernel that we don't actually
> understand.
>
We have used that assumption at other places, I will post separate patch to
fix that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20121120/9357e4be/attachment-0003.html>
More information about the dev
mailing list