From: John Fastabend <john.r.fastabend@intel.com>
To: Krishna Kumar2 <krkumar2@in.ibm.com>
Cc: bhutchings@solarflare.com, buytenh@wantstofly.org,
eilong@broadcom.com, eric.w.multanen@intel.com,
gregory.v.rose@intel.com, hadi@cyberus.ca,
jeffrey.t.kirsher@intel.com, mst@redhat.com,
netdev@vger.kernel.org, shemminger@vyatta.com, sri@us.ibm.com
Subject: Re: [RFC PATCH v1 2/3] net: add VEPA, VEB bridge mode
Date: Mon, 04 Jun 2012 09:38:04 -0700 [thread overview]
Message-ID: <4FCCE46C.7080809@intel.com> (raw)
In-Reply-To: <OF0D72A103.6F322B98-ON65257A13.00500E50-65257A13.005272D6@in.ibm.com>
On 6/4/2012 7:59 AM, Krishna Kumar2 wrote:
> John Fastabend <john.r.fastabend@intel.com> wrote on 05/30/2012 08:37:06
> AM:
>
> Some comments below:
>
>> +static int rtnl_bridge_notify(struct net_device *dev, u16 flags)
>> +{
>> ...
>> + if (!flags && master && master->netdev_ops->
> ndo_bridge_getlink)
>> + err = master->netdev_ops->ndo_bridge_getlink(skb,
> 0, 0, dev);
>> + else if (dev->netdev_ops->ndo_bridge_getlink)
>> + err = dev->netdev_ops->ndo_bridge_getlink(skb, 0,
> 0, dev);
>
> I think you should do something like:
>
> if ((flags == BRIDGE_FLAGS_MASTER) && ...)
> ...
>
> Also you could use BRIDGE_FLAGS_MASTER=1, SELF=2, and use
> "if (flags & BRIDGE_FLAGS_MASTER)" for consistency?
OK this is likely a good thing otherwise user space is a
bit tedious when managing FDB and bridge modes. We do still
need the !flags case to support existing applications though,
(we must maintain existing semantics)
if (!flags || (flags & BRIDGE_FLAGS_MASTER) && ...)
...
else (flags & BRIDGE_FLAGS_SELF)
...
>
>
> + if (!err)
> + err = rtnl_bridge_notify(dev, flags);
>
> It is possible to return a reporting error even though
> the operation succeeded. Maybe something that could be
> done here to indicate that the operation succeeded, or
> is that a TODO?
>
The problem is if rtnl_bridge_notify fails due to memory
constraints or otherwise. In this case the set has already
completed successfully as you note so we should not return
any error. This should fix it if I understand your concern
correctly.
if (!err)
rtnl_bridge_notify(dev, flags);
return err;
>> static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr
> *nlh,
>> void *arg)
>> {
> ..
>> + if (!flags && dev->master &&
>> + dev->master->netdev_ops->ndo_bridge_setlink)
>> + err = dev->master->netdev_ops->ndo_bridge_setlink(dev, nlh);
>> + else if ((flags & BRIDGE_FLAGS_SELF) &&
>> + dev->netdev_ops->ndo_bridge_setlink)
>
> Same usage of MASTER here.
Agreed. Thanks.
>
> Thanks,
> - KK
>
next prev parent reply other threads:[~2012-06-04 16:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-30 3:06 [RFC PATCH v1 0/3] Expose switching attributes via PF_BRIDGE John Fastabend
2012-05-30 3:07 ` [RFC PATCH v1 1/3] net: create generic bridge ops John Fastabend
2012-05-30 3:07 ` [RFC PATCH v1 2/3] net: add VEPA, VEB bridge mode John Fastabend
2012-06-04 14:59 ` Krishna Kumar2
2012-06-04 16:38 ` John Fastabend [this message]
2012-06-05 3:11 ` Krishna Kumar2
2012-05-30 3:07 ` [RFC PATCH v1 3/3] ixgbe: add setlink, getlink support to ixgbe and ixgbevf John Fastabend
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=4FCCE46C.7080809@intel.com \
--to=john.r.fastabend@intel.com \
--cc=bhutchings@solarflare.com \
--cc=buytenh@wantstofly.org \
--cc=eilong@broadcom.com \
--cc=eric.w.multanen@intel.com \
--cc=gregory.v.rose@intel.com \
--cc=hadi@cyberus.ca \
--cc=jeffrey.t.kirsher@intel.com \
--cc=krkumar2@in.ibm.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
--cc=sri@us.ibm.com \
/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).