All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roopa Prabhu <roopa@cumulusnetworks.com>
To: Petr Machata <petrm@mellanox.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"dsa@cumulusnetworks.com" <dsa@cumulusnetworks.com>,
	"sd@queasysnail.net" <sd@queasysnail.net>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>
Subject: Re: [PATCH net-next 1/2] vxlan: add extack support for create and changelink
Date: Tue, 26 Feb 2019 06:06:20 -0800	[thread overview]
Message-ID: <CAJieiUhKFrhoMcy-Bz1JmWEQ=8OooeZpb_sbD6zcKwotfJooBQ@mail.gmail.com> (raw)
In-Reply-To: <87imx6fyk1.fsf@mellanox.com>

On Tue, Feb 26, 2019 at 5:51 AM Petr Machata <petrm@mellanox.com> wrote:
>
>
> Roopa Prabhu <roopa@cumulusnetworks.com> writes:
>
> > From: Roopa Prabhu <roopa@cumulusnetworks.com>
> >
> > This patch adds extack coverage in vxlan link
> > create and changelink paths. Introduces a new helper
> > vxlan_nl2flags to consolidate flag attribute validation.
> >
> > thanks to Johannes Berg for some tips to construct the
> > generic vxlan flag extack strings.
> >
> > Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
> > ---
> >  drivers/net/vxlan.c | 208 +++++++++++++++++++++++++++++++++++-----------------
> >  include/net/vxlan.h |  31 ++++++++
> >  2 files changed, 172 insertions(+), 67 deletions(-)
> >
> > diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> > index 577201c..a3c46d7 100644
> > --- a/drivers/net/vxlan.c
> > +++ b/drivers/net/vxlan.c
> > @@ -3583,11 +3583,40 @@ static int __vxlan_dev_create(struct net *net, struct net_device *dev,
> >       return err;
> >  }
> >
> > +/* Set/clear flags based on attribute */
> > +static int vxlan_nl2flag(struct vxlan_config *conf, struct nlattr *tb[],
> > +                       int attrtype, unsigned long mask, bool changelink,
> > +                       bool changelink_supported,
> > +                       struct netlink_ext_ack *extack)
> > +{
> > +     unsigned long flags;
> > +
> > +     if (!tb[attrtype])
> > +             return 0;
> > +
> > +     if (changelink && !changelink_supported) {
> > +             vxlan_flag_attr_error(attrtype, extack);
> > +             return -EOPNOTSUPP;
> > +     }
> > +
> > +     if (vxlan_policy[attrtype].type == NLA_FLAG)
> > +             flags = conf->flags | mask;
> > +     else if (nla_get_u8(tb[attrtype]))
> > +             flags = conf->flags | mask;
> > +     else
> > +             flags = conf->flags & ~mask;
>
> Many of the flags for which you call this don't actually have the else
> branch. However I suspect there are no good reasons not to allow
> resetting a flag.
>
> Reviewed-by: Petr Machata <petrm@mellanox.com>

yes, correct, that was intentional.
also, I am not sure what is the best way to support reseting of a NLA_FLAG.
Absence of the flag attribute in the request cannot be the reason for
resetting or clearing the flag.

None of the NLA_FLAG attributes support changing the flag today. This
patch does not change that.

  reply	other threads:[~2019-02-26 14:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-26  6:03 [PATCH net-next 0/2] vxlan: create and changelink extack support Roopa Prabhu
2019-02-26  6:03 ` [PATCH net-next 1/2] vxlan: add extack support for create and changelink Roopa Prabhu
2019-02-26 13:51   ` Petr Machata
2019-02-26 14:06     ` Roopa Prabhu [this message]
2019-02-26 17:45       ` Petr Machata
2019-02-27  1:05         ` Roopa Prabhu
2019-02-26  6:03 ` [PATCH net-next 2/2] tools: selftests: rtnetlink: add testcases for vxlan flag sets Roopa Prabhu
2019-02-26 17:01 ` [PATCH net-next 0/2] vxlan: create and changelink extack support David Miller

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='CAJieiUhKFrhoMcy-Bz1JmWEQ=8OooeZpb_sbD6zcKwotfJooBQ@mail.gmail.com' \
    --to=roopa@cumulusnetworks.com \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=johannes@sipsolutions.net \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@mellanox.com \
    --cc=sd@queasysnail.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.