All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2 1/3] ip-link: display parentid for netdevs
@ 2014-12-05 18:02 Andy Gospodarek
  2014-12-05 18:02 ` [PATCH net-next 2/3] netlink: IFLA_PHYS_SWITCH_ID to IFLA_PHYS_PARENT_ID Andy Gospodarek
  2014-12-05 18:02 ` [PATCH net-next 3/3] net: rename *_switch_parent_id_get to *_parent_id_get Andy Gospodarek
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Gospodarek @ 2014-12-05 18:02 UTC (permalink / raw)
  To: netdev; +Cc: sfeldma, jpirko

Display parentid for netdev that may actually be associated with device
capable of offloading network forwarding.  Useful to identify which
netdevs are connected device when multiple forwarding elements are on a
system.

Based on patch from Jiri Pirko but with a different name for netlink
attribute.

Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
---

I did not include definition for IFLA_PHYS_PARENT_ID as Stephen
indicated that patching if_link.h isn't needed since it will get pulled
later.

 ip/ipaddress.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 4d99324..d155085 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -581,6 +581,14 @@ int print_linkinfo(const struct sockaddr_nl *who,
 		fprintf(fp, "master %s ", ll_idx_n2a(*(int*)RTA_DATA(tb[IFLA_MASTER]), b1));
 	}
 
+	if (tb[IFLA_PHYS_PARENT_ID]) {
+		SPRINT_BUF(b1);
+		fprintf(fp, "parentid %s ",
+			hexstring_n2a(RTA_DATA(tb[IFLA_PHYS_PARENT_ID]),
+				      RTA_PAYLOAD(tb[IFLA_PHYS_PARENT_ID]),
+				      b1, sizeof(b1)));
+	}
+
 	if (tb[IFLA_PHYS_PORT_ID]) {
 		SPRINT_BUF(b1);
 		fprintf(fp, "portid %s ",
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-12-08 17:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-05 18:02 [PATCH iproute2 1/3] ip-link: display parentid for netdevs Andy Gospodarek
2014-12-05 18:02 ` [PATCH net-next 2/3] netlink: IFLA_PHYS_SWITCH_ID to IFLA_PHYS_PARENT_ID Andy Gospodarek
2014-12-08 15:17   ` Jiri Pirko
2014-12-08 15:37     ` Andy Gospodarek
2014-12-08 16:41       ` Jiri Pirko
2014-12-08 17:49         ` Andy Gospodarek
2014-12-05 18:02 ` [PATCH net-next 3/3] net: rename *_switch_parent_id_get to *_parent_id_get Andy Gospodarek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.