All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Lamparter <equinox@diac24.net>
To: netdev@vger.kernel.org
Cc: amine.kherbouche@6wind.com, roopa@cumulusnetworks.com,
	David Lamparter <equinox@diac24.net>
Subject: [PATCH 5/6] bridge: add VPLS pseudowire info in fdb dump
Date: Wed, 16 Aug 2017 19:02:01 +0200	[thread overview]
Message-ID: <20170816170202.456851-6-equinox@diac24.net> (raw)
In-Reply-To: <20170816170202.456851-1-equinox@diac24.net>

Add a NDA_VPLS_WIRE attribute to the FDB dump if we have dst metadata
that is indicative of a VPLS pseudowire.  This is really helpful for
debugging.

Signed-off-by: David Lamparter <equinox@diac24.net>
---
 include/uapi/linux/neighbour.h |  1 +
 net/bridge/br_fdb.c            | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h
index 3199d28980b3..703089c91b04 100644
--- a/include/uapi/linux/neighbour.h
+++ b/include/uapi/linux/neighbour.h
@@ -27,6 +27,7 @@ enum {
 	NDA_MASTER,
 	NDA_LINK_NETNSID,
 	NDA_SRC_VNI,
+	NDA_VPLS_WIRE,
 	__NDA_MAX
 };
 
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 0751fcb89699..ffbaff914d55 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -670,6 +670,18 @@ static int fdb_fill_info(struct sk_buff *skb, const struct net_bridge *br,
 
 	if (fdb->vlan_id && nla_put(skb, NDA_VLAN, sizeof(u16), &fdb->vlan_id))
 		goto nla_put_failure;
+	if (fdb->md_dst) {
+		struct metadata_dst *md_dst;
+		md_dst = (struct metadata_dst *)fdb->md_dst;
+		/* ensured in br_fdb_update */
+		BUG_ON(!(md_dst->dst.flags & DST_METADATA));
+
+		if (md_dst->type == METADATA_VPLS) {
+			unsigned wire = md_dst->u.vpls_info.pw_label;
+			if (nla_put_u32(skb, NDA_VPLS_WIRE, wire))
+				goto nla_put_failure;
+		}
+	}
 
 	nlmsg_end(skb, nlh);
 	return 0;
-- 
2.13.0

  parent reply	other threads:[~2017-08-16 17:02 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16 17:01 [RFC net-next] VPLS support David Lamparter
2017-08-16 17:01 ` [PATCH 1/6] bridge: learn dst metadata in FDB David Lamparter
2017-08-16 20:38   ` Nikolay Aleksandrov
2017-08-16 20:38     ` [Bridge] " Nikolay Aleksandrov
2017-08-17 11:03     ` David Lamparter
2017-08-17 11:03       ` [Bridge] " David Lamparter
2017-08-17 11:39       ` Nikolay Aleksandrov
2017-08-17 11:39         ` [Bridge] " Nikolay Aleksandrov
2017-08-17 11:51         ` Nikolay Aleksandrov
2017-08-17 11:51           ` [Bridge] " Nikolay Aleksandrov
2017-08-17 12:10           ` David Lamparter
2017-08-17 12:10             ` [Bridge] " David Lamparter
2017-08-17 12:19             ` Nikolay Aleksandrov
2017-08-17 12:19               ` [Bridge] " Nikolay Aleksandrov
2017-08-17 12:20             ` David Lamparter
2017-08-17 12:20               ` [Bridge] " David Lamparter
2017-08-17 12:45         ` David Lamparter
2017-08-17 12:45           ` [Bridge] " David Lamparter
2017-08-17 13:04           ` Nikolay Aleksandrov
2017-08-17 13:04             ` [Bridge] " Nikolay Aleksandrov
2017-08-17 16:16     ` David Lamparter
2017-08-17 16:16       ` [Bridge] " David Lamparter
2017-08-16 17:01 ` [PATCH 2/6] mpls: split forwarding path on rx/tx boundary David Lamparter
2017-08-19 17:10   ` kbuild test robot
2017-08-19 17:42   ` kbuild test robot
2017-08-16 17:01 ` [PATCH 3/6] mpls: add VPLS entry points David Lamparter
2017-08-19 18:27   ` kbuild test robot
2017-08-21 14:01   ` Amine Kherbouche
2017-08-21 15:55     ` David Lamparter
2017-08-21 16:13       ` Amine Kherbouche
2017-08-16 17:02 ` [PATCH 4/6] mpls: VPLS support David Lamparter
2017-08-21 15:14   ` Amine Kherbouche
2017-08-21 16:18     ` David Lamparter
2017-08-21 16:11   ` Amine Kherbouche
2017-08-16 17:02 ` David Lamparter [this message]
2017-08-16 17:02 ` [PATCH 6/6] mpls: pseudowire control word support David Lamparter

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=20170816170202.456851-6-equinox@diac24.net \
    --to=equinox@diac24.net \
    --cc=amine.kherbouche@6wind.com \
    --cc=netdev@vger.kernel.org \
    --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 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.