All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: netdev@vger.kernel.org
Cc: David Ahern <dsahern@gmail.com>, Jiri Pirko <jiri@resnulli.us>,
	Scott Feldman <sfeldma@gmail.com>
Subject: [PATCH 3/3] iproute2: Add support for phys_port_name
Date: Mon, 16 Mar 2015 21:27:17 -0600	[thread overview]
Message-ID: <1426562837-13126-3-git-send-email-dsahern@gmail.com> (raw)
In-Reply-To: <1426562837-13126-1-git-send-email-dsahern@gmail.com>

Display phys_port_name attribute if returned:

./ip link show sw1p1
4: sw1p1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop port name sw1p1 state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:12:35:01 brd ff:ff:ff:ff:ff:ff

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: Scott Feldman <sfeldma@gmail.com>

---
 include/linux/if_link.h | 1 +
 ip/ipaddress.c          | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 3450c3fbdc65..c5ee8c91b1c6 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -147,6 +147,7 @@ enum {
 	IFLA_CARRIER_CHANGES,
 	IFLA_PHYS_SWITCH_ID,
 	IFLA_LINK_NETNSID,
+	IFLA_PHYS_PORT_NAME,
 	__IFLA_MAX
 };
 
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 99a6ab5977e3..9e65015b7a48 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -645,6 +645,9 @@ int print_linkinfo(const struct sockaddr_nl *who,
 				      b1, sizeof(b1)));
 	}
 
+	if (tb[IFLA_PHYS_PORT_NAME])
+		fprintf(fp, "port name %s ", rta_getattr_str(tb[IFLA_PHYS_PORT_NAME]));
+
 	if (tb[IFLA_OPERSTATE])
 		print_operstate(fp, rta_getattr_u8(tb[IFLA_OPERSTATE]));
 
-- 
2.2.1

  parent reply	other threads:[~2015-03-17  3:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17  3:27 [PATCH v2 1/3] net: add support for phys_port_name David Ahern
2015-03-17  3:27 ` [PATCH v2 2/3] rocker: " David Ahern
2015-03-17  4:27   ` Philip Prindeville
2015-03-17  7:08     ` Jiri Pirko
2015-03-17 16:11       ` Philip Prindeville
2015-03-17  5:52   ` Scott Feldman
2015-03-17  3:27 ` David Ahern [this message]
2015-03-17  7:20   ` [PATCH 3/3] iproute2: Add " Jiri Pirko
2015-03-17  5:59 ` [PATCH v2 1/3] net: add " Scott Feldman
2015-03-17  7:23 ` Jiri Pirko
  -- strict thread matches above, loose matches on Subject: below --
2015-03-18  2:23 [PATCH v4 " David Ahern
2015-03-18  2:23 ` [PATCH 3/3] iproute2: Add " David Ahern
2015-03-17 15:30 [PATCH v3 1/3] net: add " David Ahern
2015-03-17 15:30 ` [PATCH 3/3] iproute2: Add " David Ahern
2015-03-16 15:46 [PATCH 1/3] net: add " David Ahern
2015-03-16 15:46 ` [PATCH 3/3] iproute2: Add " David Ahern
2015-03-24 22:50   ` Stephen Hemminger
2015-03-27  3:41     ` David Ahern

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=1426562837-13126-3-git-send-email-dsahern@gmail.com \
    --to=dsahern@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=sfeldma@gmail.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 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.