From: John Fastabend <john.r.fastabend@intel.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: shemminger@vyatta.com, buytenh@wantstofly.org,
davem@davemloft.net, vyasevic@redhat.com, jhs@mojatatu.com,
chrisw@redhat.com, krkumar2@in.ibm.com, samudrala@us.ibm.com,
peter.p.waskiewicz.jr@intel.com, jeffrey.t.kirsher@intel.com,
netdev@vger.kernel.org, gregory.v.rose@intel.com,
eilong@broadcom.com
Subject: Re: [net-next PATCH v2 2/3] net: set and query VEB/VEPA bridge mode via PF_BRIDGE
Date: Fri, 02 Nov 2012 16:03:01 -0700 [thread overview]
Message-ID: <50945125.1040103@intel.com> (raw)
In-Reply-To: <1351897261.2703.21.camel@bwh-desktop.uk.solarflarecom.com>
On 11/2/2012 4:01 PM, Ben Hutchings wrote:
> On Fri, 2012-11-02 at 15:48 -0700, John Fastabend wrote:
>> On 11/2/2012 3:38 PM, Ben Hutchings wrote:
>>> On Wed, 2012-10-24 at 11:13 -0700, John Fastabend wrote:
>>>> Hardware switches may support enabling and disabling the
>>>> loopback switch which puts the device in a VEPA mode defined
>>>> in the IEEE 802.1Qbg specification. In this mode frames are
>>>> not switched in the hardware but sent directly to the switch.
>>>> SR-IOV capable NICs will likely support this mode I am
>>>> aware of at least two such devices. Also I am told (but don't
>>>> have any of this hardware available) that there are devices
>>>> that only support VEPA modes. In these cases it is important
>>>> at a minimum to be able to query these attributes.
>>>>
>>>> This patch adds an additional IFLA_BRIDGE_MODE attribute that can be
>>>> set and dumped via the PF_BRIDGE:{SET|GET}LINK operations. Also
>>>> anticipating bridge attributes that may be common for both embedded
>>>> bridges and software bridges this adds a flags attribute
>>>> IFLA_BRIDGE_FLAGS currently used to determine if the command or event
>>>> is being generated to/from an embedded bridge or software bridge.
>>>> Finally, the event generation is pulled out of the bridge module and
>>>> into rtnetlink proper.
> [...]
>>>> + if (attr && nla_type(attr) == IFLA_BRIDGE_FLAGS)
>>>
>>> This condition is wrong; attr will *not* be NULL if the
>>> nla_for_each_nested() loop terminates without finding an
>>> IFLA_BRIDGE_FLAGS attribute.
>>
>> It might be NULL if the nlmsg has no IFLA_AF_SPEC attr. In this case
>> we still need to send the PROTINFO attribute to the master which
>> could be the linux bridge.
> [...]
>
> I think nla_for_each_nested() can leave attr non-null but also not valid
> for use with nla_type(). And that's a problem. I think it would be
> better to use an explicit flag for whether we found that attribute,
> rather than trying to re-test here.
>
> Ben.
>
OK. I'll add an explicit flag for this. Thanks.
next prev parent reply other threads:[~2012-11-02 23:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-24 18:12 [net-next PATCH v2 0/3] extend set/get netlink for embedded John Fastabend
2012-10-24 18:12 ` [net-next PATCH v2 1/3] net: create generic bridge ops John Fastabend
2012-11-02 22:32 ` Ben Hutchings
2012-11-02 23:46 ` John Fastabend
2012-10-24 18:13 ` [net-next PATCH v2 2/3] net: set and query VEB/VEPA bridge mode via PF_BRIDGE John Fastabend
2012-11-02 22:38 ` Ben Hutchings
2012-11-02 22:48 ` John Fastabend
2012-11-02 23:01 ` Ben Hutchings
2012-11-02 23:03 ` John Fastabend [this message]
2012-10-24 18:13 ` [net-next PATCH v2 3/3] ixgbe: add setlink, getlink support to ixgbe and ixgbevf John Fastabend
2012-10-25 21:09 ` [net-next PATCH v2 0/3] extend set/get netlink for embedded Ariel Elior
2012-11-13 17:16 ` John Fastabend
2012-10-31 17:21 ` 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=50945125.1040103@intel.com \
--to=john.r.fastabend@intel.com \
--cc=bhutchings@solarflare.com \
--cc=buytenh@wantstofly.org \
--cc=chrisw@redhat.com \
--cc=davem@davemloft.net \
--cc=eilong@broadcom.com \
--cc=gregory.v.rose@intel.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jhs@mojatatu.com \
--cc=krkumar2@in.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.com \
--cc=samudrala@us.ibm.com \
--cc=shemminger@vyatta.com \
--cc=vyasevic@redhat.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).