netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roopa Prabhu <roopa@cumulusnetworks.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	wkok@cumulusnetworks.com,
	Shrijeet Mukherjee <shm@cumulusnetworks.com>
Subject: Re: [RFC PATCH] Add bridge ifindex to bridge fdb notify msgs
Date: Tue, 27 May 2014 10:05:10 -0700	[thread overview]
Message-ID: <5384C5C6.2090606@cumulusnetworks.com> (raw)
In-Reply-To: <20140527093713.512824b0@nehalam.linuxnetplumber.net>

On 5/27/14, 9:37 AM, Stephen Hemminger wrote:
> On Mon, 26 May 2014 21:39:46 -0700
> roopa@cumulusnetworks.com wrote:
>
>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>
>> This patch adds NDA_MASTER attribute to neighbour attributes enum for
>> bridge/master ifindex. And adds NDA_MASTER to bridge fdb notify msgs.
>>
>> Today bridge fdb notifications dont contain bridge information.
>> Userspace can derive it from the port information in the fdb
>> notification. However this is tricky in some scenarious.
>>
>> Example, bridge port delete notification comes before bridge fdb
>> delete notifications. And we have seen problems in userspace
>> when using libnl where, the bridge fdb delete notification handling code
>> does not understand which bridge this fdb entry is part of because
>> the bridge and port association has already been deleted.
>> And these notifications (port membership and fdb) are generated on
>> separate rtnl groups.
>>
>> Fixing the order of notifications could possibly solve the problem
>> for some cases (I can submit a separate patch for that).
>>
>> This patch chooses to add NDA_MASTER to bridge fdb notify msgs
>> because it not only solves the problem described above, but also helps
>> userspace avoid another lookup into link msgs to derive the master index.
>>
>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>> ---
>>   include/uapi/linux/neighbour.h |    1 +
>>   net/bridge/br_fdb.c            |    3 +++
>>   2 files changed, 4 insertions(+)
>>
>> diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h
>> index d3ef583..4a1d7e9 100644
>> --- a/include/uapi/linux/neighbour.h
>> +++ b/include/uapi/linux/neighbour.h
>> @@ -24,6 +24,7 @@ enum {
>>   	NDA_PORT,
>>   	NDA_VNI,
>>   	NDA_IFINDEX,
>> +	NDA_MASTER,
>>   	__NDA_MAX
>>   };
>>   
>> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
>> index 9203d5a..019bb93 100644
>> --- a/net/bridge/br_fdb.c
>> +++ b/net/bridge/br_fdb.c
>> @@ -565,6 +565,8 @@ static int fdb_fill_info(struct sk_buff *skb, const struct net_bridge *br,
>>   
>>   	if (nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->addr))
>>   		goto nla_put_failure;
>> +	if (nla_put_u32(skb, NDA_MASTER, br->dev->ifindex))
>> +		goto nla_put_failure;
>>   	ci.ndm_used	 = jiffies_to_clock_t(now - fdb->used);
>>   	ci.ndm_confirmed = 0;
>>   	ci.ndm_updated	 = jiffies_to_clock_t(now - fdb->updated);
>> @@ -586,6 +588,7 @@ static inline size_t fdb_nlmsg_size(void)
>>   {
>>   	return NLMSG_ALIGN(sizeof(struct ndmsg))
>>   		+ nla_total_size(ETH_ALEN) /* NDA_LLADDR */
>> +		+ nla_total_size(sizeof(u32)) /* NDA_MASTER */
>>   		+ nla_total_size(sizeof(u16)) /* NDA_VLAN */
>>   		+ nla_total_size(sizeof(struct nda_cacheinfo));
>>   }
> I like the idea of this, but the new attribute needs to be part of the set
> as well as notify and display infrastructure.
>
ok thanks, i will resubmit with set and other changes.

  reply	other threads:[~2014-05-27 17:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27  4:39 [RFC PATCH] Add bridge ifindex to bridge fdb notify msgs roopa
2014-05-27 16:37 ` Stephen Hemminger
2014-05-27 17:05   ` Roopa Prabhu [this message]
2014-05-27 21:51     ` Jamal Hadi Salim
2014-05-27 21:57       ` Jamal Hadi Salim
2014-05-28  0:05         ` Roopa Prabhu
2014-05-28  0:39           ` Jamal Hadi Salim

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=5384C5C6.2090606@cumulusnetworks.com \
    --to=roopa@cumulusnetworks.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shm@cumulusnetworks.com \
    --cc=stephen@networkplumber.org \
    --cc=wkok@cumulusnetworks.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).