* [PATCH net-next 0/8] bridge: netlink: complete port attribute support
@ 2015-10-06 12:11 Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 1/8] bridge: netlink: export port's root id Nikolay Aleksandrov
` (8 more replies)
0 siblings, 9 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2015-10-06 12:11 UTC (permalink / raw)
To: netdev; +Cc: bridge, Nikolay Aleksandrov, roopa, shm, davem
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Hi,
This is the second set that completes the bridge port's netlink support and
makes everything from sysfs available via netlink. I've used sysfs as a
guide of what and how to set again. I've tested setting/getting every
option and also this time tested enabling KASAN. Again there're a few long
line warnings about the ifla attribute names in br_port_info_size() but
as the previous set - it's good to know what's been accounted for.
Cheers,
Nik
Nikolay Aleksandrov (8):
bridge: netlink: export port's root id
bridge: netlink: export port's bridge id
bridge: netlink: export port's designated cost and port
bridge: netlink: export port's id and number
bridge: netlink: export port's topology_change_ack and config_pending
bridge: netlink: export port's timer values
bridge: netlink: allow to flush port's fdb
bridge: netlink: add support for port's multicast_router attribute
include/uapi/linux/if_link.h | 13 ++++++++++
net/bridge/br_netlink.c | 57 +++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 69 insertions(+), 1 deletion(-)
--
2.4.3
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH net-next 1/8] bridge: netlink: export port's root id
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
@ 2015-10-06 12:11 ` Nikolay Aleksandrov
2015-10-06 12:30 ` kbuild test robot
2015-10-06 12:30 ` kbuild test robot
2015-10-06 12:11 ` [PATCH net-next 2/8] bridge: netlink: export port's bridge id Nikolay Aleksandrov
` (7 subsequent siblings)
8 siblings, 2 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2015-10-06 12:11 UTC (permalink / raw)
To: netdev; +Cc: roopa, davem, stephen, bridge, shm, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Add IFLA_BRPORT_ROOT_ID to allow getting the designated root id via
netlink.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
include/uapi/linux/if_link.h | 1 +
net/bridge/br_netlink.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index c5b15bfeabe2..c45c1d7894e7 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -292,6 +292,7 @@ enum {
IFLA_BRPORT_PROXYARP, /* proxy ARP */
IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
+ IFLA_BRPORT_ROOT_ID, /* designated root */
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 330abf4b033a..cad4050310ee 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -127,6 +127,7 @@ static inline size_t br_port_info_size(void)
+ nla_total_size(1) /* IFLA_BRPORT_UNICAST_FLOOD */
+ nla_total_size(1) /* IFLA_BRPORT_PROXYARP */
+ nla_total_size(1) /* IFLA_BRPORT_PROXYARP_WIFI */
+ + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */
+ 0;
}
@@ -160,7 +161,9 @@ static int br_port_fill_attrs(struct sk_buff *skb,
nla_put_u8(skb, IFLA_BRPORT_UNICAST_FLOOD, !!(p->flags & BR_FLOOD)) ||
nla_put_u8(skb, IFLA_BRPORT_PROXYARP, !!(p->flags & BR_PROXYARP)) ||
nla_put_u8(skb, IFLA_BRPORT_PROXYARP_WIFI,
- !!(p->flags & BR_PROXYARP_WIFI)))
+ !!(p->flags & BR_PROXYARP_WIFI)) ||
+ nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
+ &p->designated_root))
return -EMSGSIZE;
return 0;
--
2.4.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 2/8] bridge: netlink: export port's bridge id
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 1/8] bridge: netlink: export port's root id Nikolay Aleksandrov
@ 2015-10-06 12:11 ` Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 3/8] bridge: netlink: export port's designated cost and port Nikolay Aleksandrov
` (6 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2015-10-06 12:11 UTC (permalink / raw)
To: netdev; +Cc: bridge, Nikolay Aleksandrov, roopa, shm, davem
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Add IFLA_BRPORT_BRIDGE_ID to allow getting the designated bridge id via
netlink.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
include/uapi/linux/if_link.h | 1 +
net/bridge/br_netlink.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index c45c1d7894e7..e891c32c9993 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -293,6 +293,7 @@ enum {
IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
IFLA_BRPORT_ROOT_ID, /* designated root */
+ IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index cad4050310ee..c3e0b73d660d 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -128,6 +128,7 @@ static inline size_t br_port_info_size(void)
+ nla_total_size(1) /* IFLA_BRPORT_PROXYARP */
+ nla_total_size(1) /* IFLA_BRPORT_PROXYARP_WIFI */
+ nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */
+ + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_BRIDGE_ID */
+ 0;
}
@@ -163,7 +164,9 @@ static int br_port_fill_attrs(struct sk_buff *skb,
nla_put_u8(skb, IFLA_BRPORT_PROXYARP_WIFI,
!!(p->flags & BR_PROXYARP_WIFI)) ||
nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
- &p->designated_root))
+ &p->designated_root) ||
+ nla_put(skb, IFLA_BRPORT_BRIDGE_ID, sizeof(struct ifla_bridge_id),
+ &p->designated_bridge))
return -EMSGSIZE;
return 0;
--
2.4.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 3/8] bridge: netlink: export port's designated cost and port
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 1/8] bridge: netlink: export port's root id Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 2/8] bridge: netlink: export port's bridge id Nikolay Aleksandrov
@ 2015-10-06 12:11 ` Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 4/8] bridge: netlink: export port's id and number Nikolay Aleksandrov
` (5 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2015-10-06 12:11 UTC (permalink / raw)
To: netdev; +Cc: roopa, davem, stephen, bridge, shm, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Add IFLA_BRPORT_DESIGNATED_(COST|PORT) to allow getting the port's
designated cost and port respectively via netlink.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
include/uapi/linux/if_link.h | 2 ++
net/bridge/br_netlink.c | 6 +++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index e891c32c9993..837caf940135 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -294,6 +294,8 @@ enum {
IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
IFLA_BRPORT_ROOT_ID, /* designated root */
IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
+ IFLA_BRPORT_DESIGNATED_PORT,
+ IFLA_BRPORT_DESIGNATED_COST,
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index c3e0b73d660d..678d22747044 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -129,6 +129,8 @@ static inline size_t br_port_info_size(void)
+ nla_total_size(1) /* IFLA_BRPORT_PROXYARP_WIFI */
+ nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */
+ nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_BRIDGE_ID */
+ + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_PORT */
+ + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_COST */
+ 0;
}
@@ -166,7 +168,9 @@ static int br_port_fill_attrs(struct sk_buff *skb,
nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
&p->designated_root) ||
nla_put(skb, IFLA_BRPORT_BRIDGE_ID, sizeof(struct ifla_bridge_id),
- &p->designated_bridge))
+ &p->designated_bridge) ||
+ nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_PORT, p->designated_port) ||
+ nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_COST, p->designated_cost))
return -EMSGSIZE;
return 0;
--
2.4.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 4/8] bridge: netlink: export port's id and number
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
` (2 preceding siblings ...)
2015-10-06 12:11 ` [PATCH net-next 3/8] bridge: netlink: export port's designated cost and port Nikolay Aleksandrov
@ 2015-10-06 12:11 ` Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 5/8] bridge: netlink: export port's topology_change_ack and config_pending Nikolay Aleksandrov
` (4 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2015-10-06 12:11 UTC (permalink / raw)
To: netdev; +Cc: roopa, davem, stephen, bridge, shm, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Add IFLA_BRPORT_(ID|NO) to allow getting port's port_id and port_no
respectively via netlink.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
include/uapi/linux/if_link.h | 2 ++
net/bridge/br_netlink.c | 6 +++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 837caf940135..6857563eb27c 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -296,6 +296,8 @@ enum {
IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
IFLA_BRPORT_DESIGNATED_PORT,
IFLA_BRPORT_DESIGNATED_COST,
+ IFLA_BRPORT_ID,
+ IFLA_BRPORT_NO,
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 678d22747044..e51332792c3c 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -131,6 +131,8 @@ static inline size_t br_port_info_size(void)
+ nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_BRIDGE_ID */
+ nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_PORT */
+ nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_COST */
+ + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_ID */
+ + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_NO */
+ 0;
}
@@ -170,7 +172,9 @@ static int br_port_fill_attrs(struct sk_buff *skb,
nla_put(skb, IFLA_BRPORT_BRIDGE_ID, sizeof(struct ifla_bridge_id),
&p->designated_bridge) ||
nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_PORT, p->designated_port) ||
- nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_COST, p->designated_cost))
+ nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_COST, p->designated_cost) ||
+ nla_put_u16(skb, IFLA_BRPORT_ID, p->port_id) ||
+ nla_put_u16(skb, IFLA_BRPORT_NO, p->port_no))
return -EMSGSIZE;
return 0;
--
2.4.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 5/8] bridge: netlink: export port's topology_change_ack and config_pending
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
` (3 preceding siblings ...)
2015-10-06 12:11 ` [PATCH net-next 4/8] bridge: netlink: export port's id and number Nikolay Aleksandrov
@ 2015-10-06 12:11 ` Nikolay Aleksandrov
2015-10-06 12:12 ` [PATCH net-next 6/8] bridge: netlink: export port's timer values Nikolay Aleksandrov
` (3 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2015-10-06 12:11 UTC (permalink / raw)
To: netdev; +Cc: roopa, davem, stephen, bridge, shm, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Add IFLA_BRPORT_TOPOLOGY_CHANGE_ACK and IFLA_BRPORT_CONFIG_PENDING to
allow getting port's topology_change_ack and config_pending respectively
via netlink.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
include/uapi/linux/if_link.h | 2 ++
net/bridge/br_netlink.c | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 6857563eb27c..1d6aeb1bbe95 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -298,6 +298,8 @@ enum {
IFLA_BRPORT_DESIGNATED_COST,
IFLA_BRPORT_ID,
IFLA_BRPORT_NO,
+ IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
+ IFLA_BRPORT_CONFIG_PENDING,
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index e51332792c3c..433d632ad7d0 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -133,6 +133,8 @@ static inline size_t br_port_info_size(void)
+ nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_COST */
+ nla_total_size(sizeof(u16)) /* IFLA_BRPORT_ID */
+ nla_total_size(sizeof(u16)) /* IFLA_BRPORT_NO */
+ + nla_total_size(sizeof(u8)) /* IFLA_BRPORT_TOPOLOGY_CHANGE_ACK */
+ + nla_total_size(sizeof(u8)) /* IFLA_BRPORT_CONFIG_PENDING */
+ 0;
}
@@ -174,7 +176,10 @@ static int br_port_fill_attrs(struct sk_buff *skb,
nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_PORT, p->designated_port) ||
nla_put_u16(skb, IFLA_BRPORT_DESIGNATED_COST, p->designated_cost) ||
nla_put_u16(skb, IFLA_BRPORT_ID, p->port_id) ||
- nla_put_u16(skb, IFLA_BRPORT_NO, p->port_no))
+ nla_put_u16(skb, IFLA_BRPORT_NO, p->port_no) ||
+ nla_put_u8(skb, IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
+ p->topology_change_ack) ||
+ nla_put_u8(skb, IFLA_BRPORT_CONFIG_PENDING, p->config_pending))
return -EMSGSIZE;
return 0;
--
2.4.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 6/8] bridge: netlink: export port's timer values
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
` (4 preceding siblings ...)
2015-10-06 12:11 ` [PATCH net-next 5/8] bridge: netlink: export port's topology_change_ack and config_pending Nikolay Aleksandrov
@ 2015-10-06 12:12 ` Nikolay Aleksandrov
2015-10-06 12:12 ` [PATCH net-next 7/8] bridge: netlink: allow to flush port's fdb Nikolay Aleksandrov
` (2 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2015-10-06 12:12 UTC (permalink / raw)
To: netdev; +Cc: roopa, davem, stephen, bridge, shm, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Add the following attributes in order to export port's timer values:
IFLA_BRPORT_MESSAGE_AGE_TIMER, IFLA_BRPORT_FORWARD_DELAY_TIMER and
IFLA_BRPORT_HOLD_TIMER.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
include/uapi/linux/if_link.h | 3 +++
net/bridge/br_netlink.c | 14 ++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 1d6aeb1bbe95..9c17f605e013 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -300,6 +300,9 @@ enum {
IFLA_BRPORT_NO,
IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
IFLA_BRPORT_CONFIG_PENDING,
+ IFLA_BRPORT_MESSAGE_AGE_TIMER,
+ IFLA_BRPORT_FORWARD_DELAY_TIMER,
+ IFLA_BRPORT_HOLD_TIMER,
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 433d632ad7d0..04b0e5072686 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -135,6 +135,9 @@ static inline size_t br_port_info_size(void)
+ nla_total_size(sizeof(u16)) /* IFLA_BRPORT_NO */
+ nla_total_size(sizeof(u8)) /* IFLA_BRPORT_TOPOLOGY_CHANGE_ACK */
+ nla_total_size(sizeof(u8)) /* IFLA_BRPORT_CONFIG_PENDING */
+ + nla_total_size(sizeof(u64)) /* IFLA_BRPORT_MESSAGE_AGE_TIMER */
+ + nla_total_size(sizeof(u64)) /* IFLA_BRPORT_FORWARD_DELAY_TIMER */
+ + nla_total_size(sizeof(u64)) /* IFLA_BRPORT_HOLD_TIMER */
+ 0;
}
@@ -156,6 +159,7 @@ static int br_port_fill_attrs(struct sk_buff *skb,
const struct net_bridge_port *p)
{
u8 mode = !!(p->flags & BR_HAIRPIN_MODE);
+ u64 timerval;
if (nla_put_u8(skb, IFLA_BRPORT_STATE, p->state) ||
nla_put_u16(skb, IFLA_BRPORT_PRIORITY, p->priority) ||
@@ -182,6 +186,16 @@ static int br_port_fill_attrs(struct sk_buff *skb,
nla_put_u8(skb, IFLA_BRPORT_CONFIG_PENDING, p->config_pending))
return -EMSGSIZE;
+ timerval = br_timer_value(&p->message_age_timer);
+ if (nla_put_u64(skb, IFLA_BRPORT_MESSAGE_AGE_TIMER, timerval))
+ return -EMSGSIZE;
+ timerval = br_timer_value(&p->forward_delay_timer);
+ if (nla_put_u64(skb, IFLA_BRPORT_FORWARD_DELAY_TIMER, timerval))
+ return -EMSGSIZE;
+ timerval = br_timer_value(&p->hold_timer);
+ if (nla_put_u64(skb, IFLA_BRPORT_HOLD_TIMER, timerval))
+ return -EMSGSIZE;
+
return 0;
}
--
2.4.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 7/8] bridge: netlink: allow to flush port's fdb
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
` (5 preceding siblings ...)
2015-10-06 12:12 ` [PATCH net-next 6/8] bridge: netlink: export port's timer values Nikolay Aleksandrov
@ 2015-10-06 12:12 ` Nikolay Aleksandrov
2015-10-06 12:12 ` [PATCH net-next 8/8] bridge: netlink: add support for port's multicast_router attribute Nikolay Aleksandrov
2015-10-07 11:50 ` [PATCH net-next 0/8] bridge: netlink: complete port attribute support David Miller
8 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2015-10-06 12:12 UTC (permalink / raw)
To: netdev; +Cc: roopa, davem, stephen, bridge, shm, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Add IFLA_BRPORT_FLUSH to allow flushing port's fdb similar to sysfs's
flush.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
include/uapi/linux/if_link.h | 1 +
net/bridge/br_netlink.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 9c17f605e013..fcea39a56095 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -303,6 +303,7 @@ enum {
IFLA_BRPORT_MESSAGE_AGE_TIMER,
IFLA_BRPORT_FORWARD_DELAY_TIMER,
IFLA_BRPORT_HOLD_TIMER,
+ IFLA_BRPORT_FLUSH,
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 04b0e5072686..6468166d6bdc 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -631,6 +631,9 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[])
return err;
}
+ if (tb[IFLA_BRPORT_FLUSH])
+ br_fdb_delete_by_port(p->br, p, 0, 0);
+
br_port_flags_change(p, old_flags ^ p->flags);
return 0;
}
--
2.4.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 8/8] bridge: netlink: add support for port's multicast_router attribute
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
` (6 preceding siblings ...)
2015-10-06 12:12 ` [PATCH net-next 7/8] bridge: netlink: allow to flush port's fdb Nikolay Aleksandrov
@ 2015-10-06 12:12 ` Nikolay Aleksandrov
2015-10-07 11:50 ` [PATCH net-next 0/8] bridge: netlink: complete port attribute support David Miller
8 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2015-10-06 12:12 UTC (permalink / raw)
To: netdev; +Cc: roopa, davem, stephen, bridge, shm, Nikolay Aleksandrov
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Add IFLA_BRPORT_MULTICAST_ROUTER to allow setting/getting port's
multicast_router via netlink.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
include/uapi/linux/if_link.h | 1 +
net/bridge/br_netlink.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index fcea39a56095..e3b6217f34f1 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -304,6 +304,7 @@ enum {
IFLA_BRPORT_FORWARD_DELAY_TIMER,
IFLA_BRPORT_HOLD_TIMER,
IFLA_BRPORT_FLUSH,
+ IFLA_BRPORT_MULTICAST_ROUTER,
__IFLA_BRPORT_MAX
};
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 6468166d6bdc..d78b4429505a 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -138,6 +138,9 @@ static inline size_t br_port_info_size(void)
+ nla_total_size(sizeof(u64)) /* IFLA_BRPORT_MESSAGE_AGE_TIMER */
+ nla_total_size(sizeof(u64)) /* IFLA_BRPORT_FORWARD_DELAY_TIMER */
+ nla_total_size(sizeof(u64)) /* IFLA_BRPORT_HOLD_TIMER */
+#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
+ + nla_total_size(sizeof(u8)) /* IFLA_BRPORT_MULTICAST_ROUTER */
+#endif
+ 0;
}
@@ -196,6 +199,12 @@ static int br_port_fill_attrs(struct sk_buff *skb,
if (nla_put_u64(skb, IFLA_BRPORT_HOLD_TIMER, timerval))
return -EMSGSIZE;
+#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
+ if (nla_put_u8(skb, IFLA_BRPORT_MULTICAST_ROUTER,
+ p->multicast_router))
+ return -EMSGSIZE;
+#endif
+
return 0;
}
@@ -560,6 +569,7 @@ static const struct nla_policy br_port_policy[IFLA_BRPORT_MAX + 1] = {
[IFLA_BRPORT_UNICAST_FLOOD] = { .type = NLA_U8 },
[IFLA_BRPORT_PROXYARP] = { .type = NLA_U8 },
[IFLA_BRPORT_PROXYARP_WIFI] = { .type = NLA_U8 },
+ [IFLA_BRPORT_MULTICAST_ROUTER] = { .type = NLA_U8 },
};
/* Change the state of the port and notify spanning tree */
@@ -634,6 +644,15 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[])
if (tb[IFLA_BRPORT_FLUSH])
br_fdb_delete_by_port(p->br, p, 0, 0);
+#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
+ if (tb[IFLA_BRPORT_MULTICAST_ROUTER]) {
+ u8 mcast_router = nla_get_u8(tb[IFLA_BRPORT_MULTICAST_ROUTER]);
+
+ err = br_multicast_set_port_router(p, mcast_router);
+ if (err)
+ return err;
+ }
+#endif
br_port_flags_change(p, old_flags ^ p->flags);
return 0;
}
--
2.4.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 1/8] bridge: netlink: export port's root id
2015-10-06 12:11 ` [PATCH net-next 1/8] bridge: netlink: export port's root id Nikolay Aleksandrov
@ 2015-10-06 12:30 ` kbuild test robot
2015-10-06 12:43 ` Nikolay Aleksandrov
2015-10-06 12:30 ` kbuild test robot
1 sibling, 1 reply; 13+ messages in thread
From: kbuild test robot @ 2015-10-06 12:30 UTC (permalink / raw)
To: Nikolay Aleksandrov
Cc: kbuild-all, netdev, roopa, davem, stephen, bridge, shm,
Nikolay Aleksandrov
[-- Attachment #1: Type: text/plain, Size: 1813 bytes --]
Hi Nikolay,
[auto build test ERROR on v4.3-rc4 -- if it's inappropriate base, please ignore]
config: x86_64-randconfig-x016-201540 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
net/bridge/br_netlink.c: In function 'br_port_info_size':
>> net/bridge/br_netlink.c:116:27: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
+ nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */
^
net/bridge/br_netlink.c: In function 'br_port_fill_attrs':
net/bridge/br_netlink.c:151:47: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
^
net/bridge/br_netlink.c: In function 'br_port_info_size':
>> net/bridge/br_netlink.c:118:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
vim +116 net/bridge/br_netlink.c
110 + nla_total_size(1) /* IFLA_BRPORT_PROTECT */
111 + nla_total_size(1) /* IFLA_BRPORT_FAST_LEAVE */
112 + nla_total_size(1) /* IFLA_BRPORT_LEARNING */
113 + nla_total_size(1) /* IFLA_BRPORT_UNICAST_FLOOD */
114 + nla_total_size(1) /* IFLA_BRPORT_PROXYARP */
115 + nla_total_size(1) /* IFLA_BRPORT_PROXYARP_WIFI */
> 116 + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */
117 + 0;
> 118 }
119
120 static inline size_t br_nlmsg_size(struct net_device *dev, u32 filter_mask)
121 {
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 25228 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 1/8] bridge: netlink: export port's root id
2015-10-06 12:11 ` [PATCH net-next 1/8] bridge: netlink: export port's root id Nikolay Aleksandrov
2015-10-06 12:30 ` kbuild test robot
@ 2015-10-06 12:30 ` kbuild test robot
1 sibling, 0 replies; 13+ messages in thread
From: kbuild test robot @ 2015-10-06 12:30 UTC (permalink / raw)
To: Nikolay Aleksandrov
Cc: kbuild-all, netdev, roopa, davem, stephen, bridge, shm,
Nikolay Aleksandrov
[-- Attachment #1: Type: text/plain, Size: 13119 bytes --]
Hi Nikolay,
[auto build test WARNING on v4.3-rc4 -- if it's inappropriate base, please ignore]
config: i386-randconfig-x006-201540 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
net/bridge/br_netlink.c: In function 'br_port_info_size':
net/bridge/br_netlink.c:116:27: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
+ nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */
^
In file included from include/linux/linkage.h:4:0,
from include/linux/kernel.h:6,
from net/bridge/br_netlink.c:13:
net/bridge/br_netlink.c: In function 'br_port_fill_attrs':
net/bridge/br_netlink.c:151:47: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
^
include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
if (__builtin_constant_p((cond)) ? !!(cond) : \
^
>> net/bridge/br_netlink.c:139:2: note: in expansion of macro 'if'
if (nla_put_u8(skb, IFLA_BRPORT_STATE, p->state) ||
^
net/bridge/br_netlink.c:151:47: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
^
include/linux/compiler.h:147:40: note: in definition of macro '__trace_if'
if (__builtin_constant_p((cond)) ? !!(cond) : \
^
>> net/bridge/br_netlink.c:139:2: note: in expansion of macro 'if'
if (nla_put_u8(skb, IFLA_BRPORT_STATE, p->state) ||
^
net/bridge/br_netlink.c:151:47: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
^
include/linux/compiler.h:158:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^
>> net/bridge/br_netlink.c:139:2: note: in expansion of macro 'if'
if (nla_put_u8(skb, IFLA_BRPORT_STATE, p->state) ||
^
net/bridge/br_netlink.c: In function 'br_port_info_size':
net/bridge/br_netlink.c:118:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
vim +/if +139 net/bridge/br_netlink.c
11dc1f36 Stephen Hemminger 2006-05-25 7 * This program is free software; you can redistribute it and/or
11dc1f36 Stephen Hemminger 2006-05-25 8 * modify it under the terms of the GNU General Public License
11dc1f36 Stephen Hemminger 2006-05-25 9 * as published by the Free Software Foundation; either version
11dc1f36 Stephen Hemminger 2006-05-25 10 * 2 of the License, or (at your option) any later version.
11dc1f36 Stephen Hemminger 2006-05-25 11 */
11dc1f36 Stephen Hemminger 2006-05-25 12
11dc1f36 Stephen Hemminger 2006-05-25 @13 #include <linux/kernel.h>
5a0e3ad6 Tejun Heo 2010-03-24 14 #include <linux/slab.h>
bb900b27 stephen hemminger 2011-04-04 15 #include <linux/etherdevice.h>
32fe21c0 Thomas Graf 2007-03-22 16 #include <net/rtnetlink.h>
881d966b Eric W. Biederman 2007-09-17 17 #include <net/net_namespace.h>
b854272b Denis V. Lunev 2007-12-01 18 #include <net/sock.h>
407af329 Vlad Yasevich 2013-02-13 19 #include <uapi/linux/if_bridge.h>
bb900b27 stephen hemminger 2011-04-04 20
11dc1f36 Stephen Hemminger 2006-05-25 21 #include "br_private.h"
b03b6dd5 Vitalii Demianets 2011-11-25 22 #include "br_private_stp.h"
11dc1f36 Stephen Hemminger 2006-05-25 23
fed0a159 Roopa Prabhu 2015-02-25 24 static int br_get_num_vlan_infos(const struct net_port_vlans *pv,
fed0a159 Roopa Prabhu 2015-02-25 25 u32 filter_mask)
fed0a159 Roopa Prabhu 2015-02-25 26 {
fed0a159 Roopa Prabhu 2015-02-25 27 u16 vid_range_start = 0, vid_range_end = 0;
fed0a159 Roopa Prabhu 2015-02-25 28 u16 vid_range_flags = 0;
fed0a159 Roopa Prabhu 2015-02-25 29 u16 pvid, vid, flags;
fed0a159 Roopa Prabhu 2015-02-25 30 int num_vlans = 0;
fed0a159 Roopa Prabhu 2015-02-25 31
fed0a159 Roopa Prabhu 2015-02-25 32 if (filter_mask & RTEXT_FILTER_BRVLAN)
fed0a159 Roopa Prabhu 2015-02-25 33 return pv->num_vlans;
fed0a159 Roopa Prabhu 2015-02-25 34
fed0a159 Roopa Prabhu 2015-02-25 35 if (!(filter_mask & RTEXT_FILTER_BRVLAN_COMPRESSED))
fed0a159 Roopa Prabhu 2015-02-25 36 return 0;
fed0a159 Roopa Prabhu 2015-02-25 37
fed0a159 Roopa Prabhu 2015-02-25 38 /* Count number of vlan info's
fed0a159 Roopa Prabhu 2015-02-25 39 */
fed0a159 Roopa Prabhu 2015-02-25 40 pvid = br_get_pvid(pv);
fed0a159 Roopa Prabhu 2015-02-25 41 for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) {
fed0a159 Roopa Prabhu 2015-02-25 42 flags = 0;
fed0a159 Roopa Prabhu 2015-02-25 43 if (vid == pvid)
fed0a159 Roopa Prabhu 2015-02-25 44 flags |= BRIDGE_VLAN_INFO_PVID;
fed0a159 Roopa Prabhu 2015-02-25 45
fed0a159 Roopa Prabhu 2015-02-25 46 if (test_bit(vid, pv->untagged_bitmap))
fed0a159 Roopa Prabhu 2015-02-25 47 flags |= BRIDGE_VLAN_INFO_UNTAGGED;
fed0a159 Roopa Prabhu 2015-02-25 48
fed0a159 Roopa Prabhu 2015-02-25 49 if (vid_range_start == 0) {
fed0a159 Roopa Prabhu 2015-02-25 50 goto initvars;
fed0a159 Roopa Prabhu 2015-02-25 51 } else if ((vid - vid_range_end) == 1 &&
fed0a159 Roopa Prabhu 2015-02-25 52 flags == vid_range_flags) {
fed0a159 Roopa Prabhu 2015-02-25 53 vid_range_end = vid;
fed0a159 Roopa Prabhu 2015-02-25 54 continue;
fed0a159 Roopa Prabhu 2015-02-25 55 } else {
fed0a159 Roopa Prabhu 2015-02-25 56 if ((vid_range_end - vid_range_start) > 0)
fed0a159 Roopa Prabhu 2015-02-25 57 num_vlans += 2;
fed0a159 Roopa Prabhu 2015-02-25 58 else
fed0a159 Roopa Prabhu 2015-02-25 59 num_vlans += 1;
fed0a159 Roopa Prabhu 2015-02-25 60 }
fed0a159 Roopa Prabhu 2015-02-25 61 initvars:
fed0a159 Roopa Prabhu 2015-02-25 62 vid_range_start = vid;
fed0a159 Roopa Prabhu 2015-02-25 63 vid_range_end = vid;
fed0a159 Roopa Prabhu 2015-02-25 64 vid_range_flags = flags;
fed0a159 Roopa Prabhu 2015-02-25 65 }
fed0a159 Roopa Prabhu 2015-02-25 66
fed0a159 Roopa Prabhu 2015-02-25 67 if (vid_range_start != 0) {
fed0a159 Roopa Prabhu 2015-02-25 68 if ((vid_range_end - vid_range_start) > 0)
fed0a159 Roopa Prabhu 2015-02-25 69 num_vlans += 2;
fed0a159 Roopa Prabhu 2015-02-25 70 else
fed0a159 Roopa Prabhu 2015-02-25 71 num_vlans += 1;
fed0a159 Roopa Prabhu 2015-02-25 72 }
fed0a159 Roopa Prabhu 2015-02-25 73
fed0a159 Roopa Prabhu 2015-02-25 74 return num_vlans;
fed0a159 Roopa Prabhu 2015-02-25 75 }
fed0a159 Roopa Prabhu 2015-02-25 76
fed0a159 Roopa Prabhu 2015-02-25 77 static size_t br_get_link_af_size_filtered(const struct net_device *dev,
fed0a159 Roopa Prabhu 2015-02-25 78 u32 filter_mask)
b7853d73 Roopa Prabhu 2015-02-21 79 {
b7853d73 Roopa Prabhu 2015-02-21 80 struct net_port_vlans *pv;
fed0a159 Roopa Prabhu 2015-02-25 81 int num_vlan_infos;
b7853d73 Roopa Prabhu 2015-02-21 82
2f56f6be Johannes Berg 2015-03-03 83 rcu_read_lock();
b7853d73 Roopa Prabhu 2015-02-21 84 if (br_port_exists(dev))
2f56f6be Johannes Berg 2015-03-03 85 pv = nbp_get_vlan_info(br_port_get_rcu(dev));
b7853d73 Roopa Prabhu 2015-02-21 86 else if (dev->priv_flags & IFF_EBRIDGE)
b7853d73 Roopa Prabhu 2015-02-21 87 pv = br_get_vlan_info((struct net_bridge *)netdev_priv(dev));
b7853d73 Roopa Prabhu 2015-02-21 88 else
2f56f6be Johannes Berg 2015-03-03 89 pv = NULL;
2f56f6be Johannes Berg 2015-03-03 90 if (pv)
fed0a159 Roopa Prabhu 2015-02-25 91 num_vlan_infos = br_get_num_vlan_infos(pv, filter_mask);
2f56f6be Johannes Berg 2015-03-03 92 else
2f56f6be Johannes Berg 2015-03-03 93 num_vlan_infos = 0;
2f56f6be Johannes Berg 2015-03-03 94 rcu_read_unlock();
2f56f6be Johannes Berg 2015-03-03 95
fed0a159 Roopa Prabhu 2015-02-25 96 if (!num_vlan_infos)
fed0a159 Roopa Prabhu 2015-02-25 97 return 0;
fed0a159 Roopa Prabhu 2015-02-25 98
b7853d73 Roopa Prabhu 2015-02-21 99 /* Each VLAN is returned in bridge_vlan_info along with flags */
fed0a159 Roopa Prabhu 2015-02-25 100 return num_vlan_infos * nla_total_size(sizeof(struct bridge_vlan_info));
b7853d73 Roopa Prabhu 2015-02-21 101 }
b7853d73 Roopa Prabhu 2015-02-21 102
25c71c75 stephen hemminger 2012-11-13 103 static inline size_t br_port_info_size(void)
25c71c75 stephen hemminger 2012-11-13 104 {
25c71c75 stephen hemminger 2012-11-13 105 return nla_total_size(1) /* IFLA_BRPORT_STATE */
25c71c75 stephen hemminger 2012-11-13 106 + nla_total_size(2) /* IFLA_BRPORT_PRIORITY */
25c71c75 stephen hemminger 2012-11-13 107 + nla_total_size(4) /* IFLA_BRPORT_COST */
25c71c75 stephen hemminger 2012-11-13 108 + nla_total_size(1) /* IFLA_BRPORT_MODE */
a2e01a65 stephen hemminger 2012-11-13 109 + nla_total_size(1) /* IFLA_BRPORT_GUARD */
1007dd1a stephen hemminger 2012-11-13 110 + nla_total_size(1) /* IFLA_BRPORT_PROTECT */
3da889b6 stephen hemminger 2013-03-11 111 + nla_total_size(1) /* IFLA_BRPORT_FAST_LEAVE */
9ba18891 Vlad Yasevich 2013-06-05 112 + nla_total_size(1) /* IFLA_BRPORT_LEARNING */
867a5943 Vlad Yasevich 2013-06-05 113 + nla_total_size(1) /* IFLA_BRPORT_UNICAST_FLOOD */
355b9f9d Nikolay Aleksandrov 2015-08-04 114 + nla_total_size(1) /* IFLA_BRPORT_PROXYARP */
786c2077 Nikolay Aleksandrov 2015-08-04 115 + nla_total_size(1) /* IFLA_BRPORT_PROXYARP_WIFI */
1706db4b Nikolay Aleksandrov 2015-10-06 116 + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */
25c71c75 stephen hemminger 2012-11-13 117 + 0;
25c71c75 stephen hemminger 2012-11-13 118 }
25c71c75 stephen hemminger 2012-11-13 119
fed0a159 Roopa Prabhu 2015-02-25 120 static inline size_t br_nlmsg_size(struct net_device *dev, u32 filter_mask)
339bf98f Thomas Graf 2006-11-10 121 {
339bf98f Thomas Graf 2006-11-10 122 return NLMSG_ALIGN(sizeof(struct ifinfomsg))
339bf98f Thomas Graf 2006-11-10 123 + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */
339bf98f Thomas Graf 2006-11-10 124 + nla_total_size(MAX_ADDR_LEN) /* IFLA_ADDRESS */
339bf98f Thomas Graf 2006-11-10 125 + nla_total_size(4) /* IFLA_MASTER */
339bf98f Thomas Graf 2006-11-10 126 + nla_total_size(4) /* IFLA_MTU */
339bf98f Thomas Graf 2006-11-10 127 + nla_total_size(4) /* IFLA_LINK */
339bf98f Thomas Graf 2006-11-10 128 + nla_total_size(1) /* IFLA_OPERSTATE */
b7853d73 Roopa Prabhu 2015-02-21 129 + nla_total_size(br_port_info_size()) /* IFLA_PROTINFO */
fed0a159 Roopa Prabhu 2015-02-25 130 + nla_total_size(br_get_link_af_size_filtered(dev,
fed0a159 Roopa Prabhu 2015-02-25 131 filter_mask)); /* IFLA_AF_SPEC */
25c71c75 stephen hemminger 2012-11-13 132 }
25c71c75 stephen hemminger 2012-11-13 133
25c71c75 stephen hemminger 2012-11-13 134 static int br_port_fill_attrs(struct sk_buff *skb,
25c71c75 stephen hemminger 2012-11-13 135 const struct net_bridge_port *p)
25c71c75 stephen hemminger 2012-11-13 136 {
25c71c75 stephen hemminger 2012-11-13 137 u8 mode = !!(p->flags & BR_HAIRPIN_MODE);
25c71c75 stephen hemminger 2012-11-13 138
25c71c75 stephen hemminger 2012-11-13 @139 if (nla_put_u8(skb, IFLA_BRPORT_STATE, p->state) ||
25c71c75 stephen hemminger 2012-11-13 140 nla_put_u16(skb, IFLA_BRPORT_PRIORITY, p->priority) ||
25c71c75 stephen hemminger 2012-11-13 141 nla_put_u32(skb, IFLA_BRPORT_COST, p->path_cost) ||
a2e01a65 stephen hemminger 2012-11-13 142 nla_put_u8(skb, IFLA_BRPORT_MODE, mode) ||
:::::: The code at line 139 was first introduced by commit
:::::: 25c71c75ac87508528db053b818944f3650dd7a6 bridge: bridge port parameters over netlink
:::::: TO: stephen hemminger <shemminger@vyatta.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 30865 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 1/8] bridge: netlink: export port's root id
2015-10-06 12:30 ` kbuild test robot
@ 2015-10-06 12:43 ` Nikolay Aleksandrov
0 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2015-10-06 12:43 UTC (permalink / raw)
To: kbuild test robot, Nikolay Aleksandrov
Cc: shm, netdev, roopa, bridge, kbuild-all, davem
On 10/06/2015 02:30 PM, kbuild test robot wrote:
> Hi Nikolay,
>
> [auto build test ERROR on v4.3-rc4 -- if it's inappropriate base, please ignore]
>
> config: x86_64-randconfig-x016-201540 (attached as .config)
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> All error/warnings (new ones prefixed by >>):
>
> net/bridge/br_netlink.c: In function 'br_port_info_size':
>>> net/bridge/br_netlink.c:116:27: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
> + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */
> ^
> net/bridge/br_netlink.c: In function 'br_port_fill_attrs':
> net/bridge/br_netlink.c:151:47: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
> nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
> ^
> net/bridge/br_netlink.c: In function 'br_port_info_size':
>>> net/bridge/br_netlink.c:118:1: warning: control reaches end of non-void function [-Wreturn-type]
> }
> ^
This is incorrect, the structure is in net-next. My previous set introduced it:
commit 5127c81f84de ("bridge: netlink: export root id")
Cheers,
Nik
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 0/8] bridge: netlink: complete port attribute support
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
` (7 preceding siblings ...)
2015-10-06 12:12 ` [PATCH net-next 8/8] bridge: netlink: add support for port's multicast_router attribute Nikolay Aleksandrov
@ 2015-10-07 11:50 ` David Miller
8 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2015-10-07 11:50 UTC (permalink / raw)
To: razor; +Cc: netdev, roopa, stephen, bridge, shm, nikolay
From: Nikolay Aleksandrov <razor@blackwall.org>
Date: Tue, 6 Oct 2015 14:11:54 +0200
> This is the second set that completes the bridge port's netlink support and
> makes everything from sysfs available via netlink. I've used sysfs as a
> guide of what and how to set again. I've tested setting/getting every
> option and also this time tested enabling KASAN. Again there're a few long
> line warnings about the ifla attribute names in br_port_info_size() but
> as the previous set - it's good to know what's been accounted for.
Series applied, thanks Nik.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2015-10-07 11:34 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 12:11 [PATCH net-next 0/8] bridge: netlink: complete port attribute support Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 1/8] bridge: netlink: export port's root id Nikolay Aleksandrov
2015-10-06 12:30 ` kbuild test robot
2015-10-06 12:43 ` Nikolay Aleksandrov
2015-10-06 12:30 ` kbuild test robot
2015-10-06 12:11 ` [PATCH net-next 2/8] bridge: netlink: export port's bridge id Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 3/8] bridge: netlink: export port's designated cost and port Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 4/8] bridge: netlink: export port's id and number Nikolay Aleksandrov
2015-10-06 12:11 ` [PATCH net-next 5/8] bridge: netlink: export port's topology_change_ack and config_pending Nikolay Aleksandrov
2015-10-06 12:12 ` [PATCH net-next 6/8] bridge: netlink: export port's timer values Nikolay Aleksandrov
2015-10-06 12:12 ` [PATCH net-next 7/8] bridge: netlink: allow to flush port's fdb Nikolay Aleksandrov
2015-10-06 12:12 ` [PATCH net-next 8/8] bridge: netlink: add support for port's multicast_router attribute Nikolay Aleksandrov
2015-10-07 11:50 ` [PATCH net-next 0/8] bridge: netlink: complete port attribute support David Miller
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).