netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <razor@blackwall.org>
To: netdev@vger.kernel.org
Cc: roopa@cumulusnetworks.com, davem@davemloft.net,
	stephen@networkplumber.org, bridge@lists.linux-foundation.org,
	shm@cumulusnetworks.com,
	Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Subject: [PATCH net-next 6/8] bridge: netlink: export port's timer values
Date: Tue,  6 Oct 2015 14:12:00 +0200	[thread overview]
Message-ID: <1444133522-16907-7-git-send-email-razor@blackwall.org> (raw)
In-Reply-To: <1444133522-16907-1-git-send-email-razor@blackwall.org>

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

  parent reply	other threads:[~2015-10-06 12:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Nikolay Aleksandrov [this message]
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

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=1444133522-16907-7-git-send-email-razor@blackwall.org \
    --to=razor@blackwall.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=shm@cumulusnetworks.com \
    --cc=stephen@networkplumber.org \
    /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).