* [PATCH iproute2 net-next 0/2] iplink: bridge: add vlan filtering support and show more attributes
@ 2015-08-11 12:56 Nikolay Aleksandrov
2015-08-11 12:56 ` [PATCH iproute2 net-next 1/2] iplink: bridge: add ageing_time, stp_state and priority when showing attributes Nikolay Aleksandrov
2015-08-11 12:56 ` [PATCH iproute2 net-next 2/2] iplink: bridge: add support for IFLA_BR_VLAN_FILTERING attribute Nikolay Aleksandrov
0 siblings, 2 replies; 6+ messages in thread
From: Nikolay Aleksandrov @ 2015-08-11 12:56 UTC (permalink / raw)
To: netdev; +Cc: davem, stephen, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Hi,
Patch 01 adds support to show some additional attributes and patch 02
adds support for the recently added IFLA_BR_VLAN_FILTERING attribute.
Cheers,
Nik
Nikolay Aleksandrov (2):
iplink: bridge: add ageing_time, stp_state and priority when showing
attributes
iplink: bridge: add support for IFLA_BR_VLAN_FILTERING attribute
include/linux/if_link.h | 1 +
ip/iplink_bridge.c | 26 ++++++++++++++++++++++++++
2 files changed, 27 insertions(+)
--
2.4.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH iproute2 net-next 1/2] iplink: bridge: add ageing_time, stp_state and priority when showing attributes
2015-08-11 12:56 [PATCH iproute2 net-next 0/2] iplink: bridge: add vlan filtering support and show more attributes Nikolay Aleksandrov
@ 2015-08-11 12:56 ` Nikolay Aleksandrov
2015-08-12 16:14 ` Stephen Hemminger
2015-08-11 12:56 ` [PATCH iproute2 net-next 2/2] iplink: bridge: add support for IFLA_BR_VLAN_FILTERING attribute Nikolay Aleksandrov
1 sibling, 1 reply; 6+ messages in thread
From: Nikolay Aleksandrov @ 2015-08-11 12:56 UTC (permalink / raw)
To: netdev; +Cc: davem, stephen, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
When showing bridge attributes, show also ageing_time, stp_state and
priority if available.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
ip/iplink_bridge.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 297160c490fd..2a0bf6e147d0 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -109,6 +109,18 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_BR_MAX_AGE])
fprintf(f, "max_age %u ",
rta_getattr_u32(tb[IFLA_BR_MAX_AGE]));
+
+ if (tb[IFLA_BR_AGEING_TIME])
+ fprintf(f, "ageing_time %u ",
+ rta_getattr_u32(tb[IFLA_BR_AGEING_TIME]));
+
+ if (tb[IFLA_BR_STP_STATE])
+ fprintf(f, "stp_state %u ",
+ rta_getattr_u32(tb[IFLA_BR_STP_STATE]));
+
+ if (tb[IFLA_BR_PRIORITY])
+ fprintf(f, "priority %u ",
+ rta_getattr_u16(tb[IFLA_BR_PRIORITY]));
}
struct link_util bridge_link_util = {
--
2.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH iproute2 net-next 2/2] iplink: bridge: add support for IFLA_BR_VLAN_FILTERING attribute
2015-08-11 12:56 [PATCH iproute2 net-next 0/2] iplink: bridge: add vlan filtering support and show more attributes Nikolay Aleksandrov
2015-08-11 12:56 ` [PATCH iproute2 net-next 1/2] iplink: bridge: add ageing_time, stp_state and priority when showing attributes Nikolay Aleksandrov
@ 2015-08-11 12:56 ` Nikolay Aleksandrov
2015-08-12 16:21 ` Stephen Hemminger
1 sibling, 1 reply; 6+ messages in thread
From: Nikolay Aleksandrov @ 2015-08-11 12:56 UTC (permalink / raw)
To: netdev; +Cc: davem, stephen, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
This patch implements support for the IFLA_BR_VLAN_FILTERING attribute
in iproute2 so it can enable/disable vlan_filtering.
Example:
$ ip link set br0 type bridge vlan_filtering 1
$ ip -d link show br0
6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UP mode DEFAULT group default
link/ether 08:00:27:ea:07:38 brd ff:ff:ff:ff:ff:ff promiscuity 0
bridge forward_delay 1500 hello_time 200 max_age 2000 vlan_filtering 1
addrgenmode eui64
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
include/linux/if_link.h | 1 +
ip/iplink_bridge.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index fa66d2bb3388..4f0a558e8fcf 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -228,6 +228,7 @@ enum {
IFLA_BR_AGEING_TIME,
IFLA_BR_STP_STATE,
IFLA_BR_PRIORITY,
+ IFLA_BR_VLAN_FILTERING,
__IFLA_BR_MAX,
};
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 2a0bf6e147d0..eeee71c98a93 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -26,6 +26,7 @@ static void explain(void)
" [ ageing_time AGEING_TIME ]\n"
" [ stp_state STP_STATE ]\n"
" [ priority PRIORITY ]\n"
+ " [ vlan_filtering VLAN_FILTERING ]\n"
);
}
@@ -79,6 +80,15 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
return -1;
}
addattr16(n, 1024, IFLA_BR_PRIORITY, prio);
+ } else if (matches(*argv, "vlan_filtering") == 0) {
+ __u8 vlan_filter;
+
+ NEXT_ARG();
+ if (get_u8(&vlan_filter, *argv, 0)) {
+ invarg("invalid vlan_filtering", *argv);
+ return -1;
+ }
+ addattr8(n, 1024, IFLA_BR_VLAN_FILTERING, vlan_filter);
} else if (matches(*argv, "help") == 0) {
explain();
return -1;
@@ -121,6 +131,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_BR_PRIORITY])
fprintf(f, "priority %u ",
rta_getattr_u16(tb[IFLA_BR_PRIORITY]));
+
+ if (tb[IFLA_BR_VLAN_FILTERING])
+ fprintf(f, "vlan_filtering %u ",
+ rta_getattr_u8(tb[IFLA_BR_VLAN_FILTERING]));
}
struct link_util bridge_link_util = {
--
2.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH iproute2 net-next 1/2] iplink: bridge: add ageing_time, stp_state and priority when showing attributes
2015-08-11 12:56 ` [PATCH iproute2 net-next 1/2] iplink: bridge: add ageing_time, stp_state and priority when showing attributes Nikolay Aleksandrov
@ 2015-08-12 16:14 ` Stephen Hemminger
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2015-08-12 16:14 UTC (permalink / raw)
To: Nikolay Aleksandrov; +Cc: netdev, davem, Nikolay Aleksandrov
On Tue, 11 Aug 2015 15:56:23 +0300
Nikolay Aleksandrov <razor@blackwall.org> wrote:
> From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
>
> When showing bridge attributes, show also ageing_time, stp_state and
> priority if available.
>
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
This doesn't need anything that is not already in 4.2-rc
therefore applied to master.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH iproute2 net-next 2/2] iplink: bridge: add support for IFLA_BR_VLAN_FILTERING attribute
2015-08-11 12:56 ` [PATCH iproute2 net-next 2/2] iplink: bridge: add support for IFLA_BR_VLAN_FILTERING attribute Nikolay Aleksandrov
@ 2015-08-12 16:21 ` Stephen Hemminger
2015-08-12 18:42 ` Nikolay Aleksandrov
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2015-08-12 16:21 UTC (permalink / raw)
To: Nikolay Aleksandrov; +Cc: netdev, davem, Nikolay Aleksandrov
On Tue, 11 Aug 2015 15:56:24 +0300
Nikolay Aleksandrov <razor@blackwall.org> wrote:
> From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
>
> This patch implements support for the IFLA_BR_VLAN_FILTERING attribute
> in iproute2 so it can enable/disable vlan_filtering.
>
> Example:
> $ ip link set br0 type bridge vlan_filtering 1
> $ ip -d link show br0
> 6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
> UP mode DEFAULT group default
> link/ether 08:00:27:ea:07:38 brd ff:ff:ff:ff:ff:ff promiscuity 0
> bridge forward_delay 1500 hello_time 200 max_age 2000 vlan_filtering 1
> addrgenmode eui64
>
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Applied.
Please update man page as well.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH iproute2 net-next 2/2] iplink: bridge: add support for IFLA_BR_VLAN_FILTERING attribute
2015-08-12 16:21 ` Stephen Hemminger
@ 2015-08-12 18:42 ` Nikolay Aleksandrov
0 siblings, 0 replies; 6+ messages in thread
From: Nikolay Aleksandrov @ 2015-08-12 18:42 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, davem
> On Aug 12, 2015, at 7:21 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
>
> On Tue, 11 Aug 2015 15:56:24 +0300
> Nikolay Aleksandrov <razor@blackwall.org> wrote:
>
>> From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
>>
>> This patch implements support for the IFLA_BR_VLAN_FILTERING attribute
>> in iproute2 so it can enable/disable vlan_filtering.
>>
>> Example:
>> $ ip link set br0 type bridge vlan_filtering 1
>> $ ip -d link show br0
>> 6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
>> UP mode DEFAULT group default
>> link/ether 08:00:27:ea:07:38 brd ff:ff:ff:ff:ff:ff promiscuity 0
>> bridge forward_delay 1500 hello_time 200 max_age 2000 vlan_filtering 1
>> addrgenmode eui64
>>
>> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
>
> Applied.
> Please update man page as well.
Hi Stephen,
I looked into the man page update while making the patch but I didn’t find bridge specific attributes anywhere and
so I thought that section hasn’t been added yet. Anyway, I have plans to add it and describe all of the currently
supported attributes plus the ones I plan to post patches for soon.
Cheers,
Nik
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-08-12 18:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-11 12:56 [PATCH iproute2 net-next 0/2] iplink: bridge: add vlan filtering support and show more attributes Nikolay Aleksandrov
2015-08-11 12:56 ` [PATCH iproute2 net-next 1/2] iplink: bridge: add ageing_time, stp_state and priority when showing attributes Nikolay Aleksandrov
2015-08-12 16:14 ` Stephen Hemminger
2015-08-11 12:56 ` [PATCH iproute2 net-next 2/2] iplink: bridge: add support for IFLA_BR_VLAN_FILTERING attribute Nikolay Aleksandrov
2015-08-12 16:21 ` Stephen Hemminger
2015-08-12 18:42 ` Nikolay Aleksandrov
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).