netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Jesse Gross <jesse@nicira.com>
Cc: David Miller <davem@davemloft.net>,
	"dev@openvswitch.org" <dev@openvswitch.org>,
	netdev <netdev@vger.kernel.org>,
	Daniel Borkmann <dborkman@redhat.com>,
	ffusco@redhat.com, fleitner@redhat.com,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Ben Hutchings <bhutchings@solarflare.com>
Subject: Re: [PATCH net-next 6/8] openvswitch: Allow update of dp with OVS_DP_CMD_NEW if NLM_F_REPLACE is set
Date: Wed, 27 Nov 2013 22:32:20 +0000	[thread overview]
Message-ID: <20131127223220.GA26084@casper.infradead.org> (raw)
In-Reply-To: <CAEP_g=8=dzm7NS5zx4-+wY+AXZLpym7JGQO9YTAgdTPm9v1mpQ@mail.gmail.com>

On 11/25/13 at 01:23pm, Jesse Gross wrote:
> On Fri, Nov 22, 2013 at 8:56 AM, Thomas Graf <tgraf@suug.ch> wrote:
> > diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
> > index 95d4424..3f1fb87 100644
> > --- a/net/openvswitch/datapath.c
> > +++ b/net/openvswitch/datapath.c
> 
> I'm a little worried that this introduces some quirks to the interface. Such as:
> 
> > @@ -1190,6 +1185,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
> >         struct vport *vport;
> >         struct ovs_net *ovs_net;
> >         int err, i;
> > +       bool allocated = false;
> >
> >         err = -EINVAL;
> >         if (!a[OVS_DP_ATTR_NAME] || !a[OVS_DP_ATTR_UPCALL_PID])
> 
> This requires that DP_CMD_SET supply an OVS_DP_ATTR_UPCALL_PID
> although I don't think that it's really necessary. In fact, we used to
> completely ignore that field on SET since it's really only useful on
> datapath creation and can otherwise be done more naturally through the
> vport interface.

It's a theoretical exercise since nobody is using OVS_DP_CMD_SET
but I agree, it should be optional in the update path. I'll update
the patch.

> > @@ -1197,11 +1193,26 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
> >
> >         ovs_lock();
> >
> > +       dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs);
> > +       if (!IS_ERR(dp)) {
> > +               if (info->nlhdr->nlmsg_flags & NLM_F_REPLACE)
> > +                       goto update;
> 
> Conversely, this won't respect the UPCALL_PID field, which I would
> expect it to since I think NLM_F_REPLACE should be roughly equivalent
> to a delete and create. I believe that's the only field that is
> missing although it seems easy to have the same problem as others are
> added in the future.

It's up to us to define that.

What the patch proposes is what OVS has been doing already: Try to
find a datapath with matching name and reuse it. Otherwise create
a new data path. Disregard UPCALL_PID.

As you state above, the upcall pid can be modified through the vport
interface which in my opinion is the correct way to modify it if
needed.

I have no problem with adding upcall pid overwrite logic to the
NLM_F_REPLACE path but it _changes_ the existing semantics in
terms of "opening" a datapath.

  reply	other threads:[~2013-11-27 22:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22 16:56 [PATCH net-next 0/8 v7] Open vSwitch upcall optimiziations Thomas Graf
2013-11-22 16:56 ` [PATCH net-next 1/8] genl: Add genlmsg_new_unicast() for unicast message allocation Thomas Graf
     [not found] ` <cover.1385137618.git.tgraf-G/eBtMaohhA@public.gmane.org>
2013-11-22 16:56   ` [PATCH net-next 2/8] netlink: Avoid netlink mmap alloc if msg size exceeds frame size Thomas Graf
2013-11-22 16:56 ` [PATCH net-next 3/8] openvswitch: Enable memory mapped Netlink i/o Thomas Graf
2013-11-22 16:56 ` [PATCH net-next 4/8] net: Export skb_zerocopy() to zerocopy from one skb to another Thomas Graf
2013-11-22 16:56 ` [PATCH net-next 5/8] openvswitch: Allow user space to announce ability to accept unaligned Netlink messages Thomas Graf
2013-11-22 16:56 ` [PATCH net-next 6/8] openvswitch: Allow update of dp with OVS_DP_CMD_NEW if NLM_F_REPLACE is set Thomas Graf
     [not found]   ` <2b77b94f043dbed36a08dcc0a876830d6ad1a97a.1385137618.git.tgraf-G/eBtMaohhA@public.gmane.org>
2013-11-25 21:23     ` Jesse Gross
2013-11-27 22:32       ` Thomas Graf [this message]
2013-11-22 16:56 ` [PATCH net-next 7/8] openvswitch: Drop user features if old user space attempted to create datapath Thomas Graf
2013-11-25 23:40   ` Jesse Gross
2013-11-27 22:35     ` Thomas Graf
2013-11-22 16:56 ` [PATCH net-next 8/8] openvswitch: Use skb_zerocopy() for upcall Thomas Graf
  -- strict thread matches above, loose matches on Subject: below --
2013-11-21 18:13 [PATCH net-next 0/8 v6] Open vSwitch upcall optimiziations Thomas Graf
2013-11-21 18:13 ` [PATCH net-next 6/8] openvswitch: Allow update of dp with OVS_DP_CMD_NEW if NLM_F_REPLACE is set Thomas Graf

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=20131127223220.GA26084@casper.infradead.org \
    --to=tgraf@suug.ch \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=dev@openvswitch.org \
    --cc=eric.dumazet@gmail.com \
    --cc=ffusco@redhat.com \
    --cc=fleitner@redhat.com \
    --cc=jesse@nicira.com \
    --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).