From: Varka Bhadram <varkabhadram@gmail.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>,
davem@davemloft.net, stephen@networkplumber.org
Cc: netdev@vger.kernel.org, vyasevic@redhat.com,
sfeldma@cumulusnetworks.com, john.r.fastabend@intel.com,
roopa@cumulusnetworks.com, eric.dumazet@gmail.com
Subject: Re: [net-next-2.6 PATCH v5 2/2] bridge: netlink dump interface at par with brctl
Date: Thu, 03 Jul 2014 17:54:56 +0530 [thread overview]
Message-ID: <53B54B98.603@gmail.com> (raw)
In-Reply-To: <1404380290-17040-3-git-send-email-jhs@emojatatu.com>
On 07/03/2014 03:08 PM, Jamal Hadi Salim wrote:
> From: Jamal Hadi Salim <jhs@mojatatu.com>
>
> Actually better than brctl showmacs because we can filter by bridge
> port in the kernel.
> The current bridge netlink interface doesnt scale when you have many
> bridges each with large fdbs or even bridges with many bridge ports
>
> And now for the science non-fiction novel you have all been
> waiting for..
>
> //lets see what bridge ports we have
> root@moja-1:/configs/may30-iprt/bridge# ./bridge link show
> 8: eth1 state DOWN : <BROADCAST,MULTICAST> mtu 1500 master br0 state
> disabled priority 32 cost 19
> 17: sw1-p1 state DOWN : <BROADCAST,NOARP> mtu 1500 master br0 state
> disabled priority 32 cost 100
>
> // show all..
> root@moja-1:/configs/may30-iprt/bridge# ./bridge fdb show
> 33:33:00:00:00:01 dev bond0 self permanent
> 33:33:00:00:00:01 dev dummy0 self permanent
> 33:33:00:00:00:01 dev ifb0 self permanent
> 33:33:00:00:00:01 dev ifb1 self permanent
> 33:33:00:00:00:01 dev eth0 self permanent
> 01:00:5e:00:00:01 dev eth0 self permanent
> 33:33:ff:22:01:01 dev eth0 self permanent
> 02:00:00:12:01:02 dev eth1 vlan 0 master br0 permanent
> 00:17:42:8a:b4:05 dev eth1 vlan 0 master br0 permanent
> 00:17:42:8a:b4:07 dev eth1 self permanent
> 33:33:00:00:00:01 dev eth1 self permanent
> 33:33:00:00:00:01 dev gretap0 self permanent
> da:ac:46:27:d9:53 dev sw1-p1 vlan 0 master br0 permanent
> 33:33:00:00:00:01 dev sw1-p1 self permanent
>
> //filter by bridge
> root@moja-1:/configs/may30-iprt/bridge# ./bridge fdb show br br0
> 02:00:00:12:01:02 dev eth1 vlan 0 master br0 permanent
> 00:17:42:8a:b4:05 dev eth1 vlan 0 master br0 permanent
> 00:17:42:8a:b4:07 dev eth1 self permanent
> 33:33:00:00:00:01 dev eth1 self permanent
> da:ac:46:27:d9:53 dev sw1-p1 vlan 0 master br0 permanent
> 33:33:00:00:00:01 dev sw1-p1 self permanent
>
> // bridge sw1 has no ports attached..
> root@moja-1:/configs/may30-iprt/bridge# ./bridge fdb show br sw1
>
> //filter by port
> root@moja-1:/configs/may30-iprt/bridge# ./bridge fdb show brport eth1
> 02:00:00:12:01:02 vlan 0 master br0 permanent
> 00:17:42:8a:b4:05 vlan 0 master br0 permanent
> 00:17:42:8a:b4:07 self permanent
> 33:33:00:00:00:01 self permanent
>
> // filter by port + bridge
> root@moja-1:/configs/may30-iprt/bridge# ./bridge fdb show br br0 brport
> sw1-p1
> da:ac:46:27:d9:53 vlan 0 master br0 permanent
> 33:33:00:00:00:01 self permanent
>
> // for shits and giggles (as they say in New Brunswick), lets
> // change the mac that br0 uses
> // Note: a magical fdb entry with no brport is added ...
> root@moja-1:/configs/may30-iprt/bridge# ip link set dev br0 address
> 02:00:00:12:01:04
>
> // lets see if we can see the unicorn ..
> root@moja-1:/configs/may30-iprt/bridge# ./bridge fdb show
> 33:33:00:00:00:01 dev bond0 self permanent
> 33:33:00:00:00:01 dev dummy0 self permanent
> 33:33:00:00:00:01 dev ifb0 self permanent
> 33:33:00:00:00:01 dev ifb1 self permanent
> 33:33:00:00:00:01 dev eth0 self permanent
> 01:00:5e:00:00:01 dev eth0 self permanent
> 33:33:ff:22:01:01 dev eth0 self permanent
> 02:00:00:12:01:02 dev eth1 vlan 0 master br0 permanent
> 00:17:42:8a:b4:05 dev eth1 vlan 0 master br0 permanent
> 00:17:42:8a:b4:07 dev eth1 self permanent
> 33:33:00:00:00:01 dev eth1 self permanent
> 33:33:00:00:00:01 dev gretap0 self permanent
> 02:00:00:12:01:04 dev br0 vlan 0 master br0 permanent <=== there it is
> da:ac:46:27:d9:53 dev sw1-p1 vlan 0 master br0 permanent
> 33:33:00:00:00:01 dev sw1-p1 self permanent
>
> //can we see it if we filter by bridge?
> root@moja-1:/configs/may30-iprt/bridge# ./bridge fdb show br br0
> 02:00:00:12:01:02 dev eth1 vlan 0 master br0 permanent
> 00:17:42:8a:b4:05 dev eth1 vlan 0 master br0 permanent
> 00:17:42:8a:b4:07 dev eth1 self permanent
> 33:33:00:00:00:01 dev eth1 self permanent
> 02:00:00:12:01:04 dev br0 vlan 0 master br0 permanent <=== there it is
> da:ac:46:27:d9:53 dev sw1-p1 vlan 0 master br0 permanent
> 33:33:00:00:00:01 dev sw1-p1 self permanent
>
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
> ---
> net/bridge/br_fdb.c | 14 +++++++---
> net/core/rtnetlink.c | 73 +++++++++++++++++++++++++++++++++++++++-----------
> 2 files changed, 69 insertions(+), 18 deletions(-)
>
>
[...]
WARNING: line over 80 characters
#12: FILE: net/bridge/br_fdb.c:695:
+ if (filter_dev && (!f->dst || f->dst->dev != filter_dev)) {
WARNING: braces {} are not necessary for single statement blocks
#63: FILE: net/core/rtnetlink.c:2560:
+ if (!br_dev) {
+ return -ENODEV;
+ }
WARNING: line over 80 characters
#100: FILE: net/core/rtnetlink.c:2593:
+ idx = cops->ndo_fdb_dump(skb, cb, br_dev, dev, idx);
total: 0 errors, 3 warnings, 0 checks, 106 lines checked
--
Varka Bhadram
next prev parent reply other threads:[~2014-07-03 12:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 9:38 [net-next-2.6 PATCH v5 0/2] bridge: fdb dumping takes a filter device Jamal Hadi Salim
2014-07-03 9:38 ` [net-next-2.6 PATCH v5 1/2] " Jamal Hadi Salim
2014-07-03 12:23 ` Varka Bhadram
2014-07-03 9:38 ` [net-next-2.6 PATCH v5 2/2] bridge: netlink dump interface at par with brctl Jamal Hadi Salim
2014-07-03 12:24 ` Varka Bhadram [this message]
2014-07-08 21:10 ` [net-next-2.6 PATCH v5 0/2] bridge: fdb dumping takes a filter device David Miller
2014-07-08 21:21 ` David Miller
2014-07-10 10:23 ` Jamal Hadi Salim
2014-07-10 19:20 ` 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=53B54B98.603@gmail.com \
--to=varkabhadram@gmail.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jhs@mojatatu.com \
--cc=john.r.fastabend@intel.com \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=sfeldma@cumulusnetworks.com \
--cc=stephen@networkplumber.org \
--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).