linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: <nikolay@cumulusnetworks.com>, <roopa@cumulusnetworks.com>,
	<davem@davemloft.net>, <kuba@kernel.org>, <jiri@resnulli.us>,
	<ivecera@redhat.com>, <andrew@lunn.ch>,
	<UNGLinuxDriver@microchip.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<bridge@lists.linux-foundation.org>
Cc: Horatiu Vultur <horatiu.vultur@microchip.com>
Subject: [PATCH net-next 11/12] bridge: mrp: Extend br_mrp_fill_info
Date: Mon, 6 Jul 2020 11:18:41 +0200	[thread overview]
Message-ID: <20200706091842.3324565-12-horatiu.vultur@microchip.com> (raw)
In-Reply-To: <20200706091842.3324565-1-horatiu.vultur@microchip.com>

This patch extends the function br_mrp_fill_info to return also the
status for the interconnect ring.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 net/bridge/br_mrp_netlink.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/net/bridge/br_mrp_netlink.c b/net/bridge/br_mrp_netlink.c
index a006e0771e8d3..2a2fdf3500c5b 100644
--- a/net/bridge/br_mrp_netlink.c
+++ b/net/bridge/br_mrp_netlink.c
@@ -474,6 +474,11 @@ int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br)
 				     p->dev->ifindex))
 			goto nla_put_failure;
 
+		p = rcu_dereference(mrp->i_port);
+		if (p && nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_I_IFINDEX,
+				     p->dev->ifindex))
+			goto nla_put_failure;
+
 		if (nla_put_u16(skb, IFLA_BRIDGE_MRP_INFO_PRIO,
 				mrp->prio))
 			goto nla_put_failure;
@@ -493,6 +498,19 @@ int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br)
 				mrp->test_monitor))
 			goto nla_put_failure;
 
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_IN_STATE,
+				mrp->in_state))
+			goto nla_put_failure;
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_IN_ROLE,
+				mrp->in_role))
+			goto nla_put_failure;
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_IN_TEST_INTERVAL,
+				mrp->in_test_interval))
+			goto nla_put_failure;
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_IN_TEST_MAX_MISS,
+				mrp->in_test_max_miss))
+			goto nla_put_failure;
+
 		nla_nest_end(skb, tb);
 	}
 	nla_nest_end(skb, mrp_tb);
-- 
2.27.0


  parent reply	other threads:[~2020-07-06  9:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06  9:18 [PATCH net-next 00/12] bridge: mrp: Add support for interconnect ring Horatiu Vultur
2020-07-06  9:18 ` [PATCH net-next 01/12] switchdev: mrp: Extend switchdev API for MRP Interconnect Horatiu Vultur
2020-07-06 19:26   ` David Miller
2020-07-07 10:38     ` Horatiu Vultur
2020-07-06  9:18 ` [PATCH net-next 02/12] bridge: uapi: mrp: Extend MRP attributes for MRP interconnect Horatiu Vultur
2020-07-06 19:27   ` David Miller
2020-07-07 10:39     ` Horatiu Vultur
2020-07-06  9:18 ` [PATCH net-next 03/12] bridge: mrp: Extend bridge interface Horatiu Vultur
2020-07-06  9:18 ` [PATCH net-next 04/12] bridge: mrp: Extend br_mrp for MRP interconnect Horatiu Vultur
2020-07-06  9:18 ` [PATCH net-next 05/12] bridge: mrp: Rename br_mrp_port_open to br_mrp_ring_port_open Horatiu Vultur
2020-07-06  9:18 ` [PATCH net-next 06/12] bridge: mrp: Add br_mrp_in_port_open function Horatiu Vultur
2020-07-06  9:18 ` [PATCH net-next 07/12] bridge: switchdev: mrp: Extend MRP API for switchdev for MRP Interconnect Horatiu Vultur
2020-07-06  9:18 ` [PATCH net-next 08/12] bridge: mrp: Implement the MRP Interconnect API Horatiu Vultur
2020-07-07 13:27   ` Nikolay Aleksandrov
2020-07-07 14:11     ` Horatiu Vultur
2020-07-06  9:18 ` [PATCH net-next 09/12] bridge: mrp: Extend MRP netlink interface for configuring MRP interconnect Horatiu Vultur
2020-07-06  9:18 ` [PATCH net-next 10/12] bridge: uapi: mrp: Extend MRP_INFO attributes for interconnect status Horatiu Vultur
2020-07-06  9:18 ` Horatiu Vultur [this message]
2020-07-06  9:18 ` [PATCH net-next 12/12] net: bridge: Add port attribute IFLA_BRPORT_MRP_IN_OPEN Horatiu Vultur

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=20200706091842.3324565-12-horatiu.vultur@microchip.com \
    --to=horatiu.vultur@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=roopa@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).