[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170605100705.3909-1-jiri@resnulli.us>
Date: Mon, 5 Jun 2017 12:07:05 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, idosch@...lanox.com, arkadis@...lanox.com,
mlxsw@...lanox.com, roopa@...ulusnetworks.com,
stephen@...workplumber.org, ivecera@...hat.com
Subject: [patch iproute2] bridge: Distinguish between externally learned vs offloaded FDBs
From: Arkadi Sharshevsky <arkadis@...lanox.com>
Distinguish between externally learned vs offloaded FDBs. This is done
in order to indicate that FDBs added by software was successfully
offloaded.
Signed-off-by: Arkadi Sharshevsky <arkadis@...lanox.com>
Signed-off-by: Jiri Pirko <jiri@...lanox.com>
---
bridge/fdb.c | 6 ++++++
include/linux/neighbour.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/bridge/fdb.c b/bridge/fdb.c
index a71a78f..e5cebf9 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -262,6 +262,10 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
}
if (r->ndm_flags & NTF_EXT_LEARNED) {
start_json_fdb_flags_array(&fdb_flags);
+ jsonw_string(jw_global, "extern_learn");
+ }
+ if (r->ndm_flags & NTF_OFFLOADED) {
+ start_json_fdb_flags_array(&fdb_flags);
jsonw_string(jw_global, "offload");
}
if (r->ndm_flags & NTF_MASTER)
@@ -280,6 +284,8 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if (r->ndm_flags & NTF_ROUTER)
fprintf(fp, "router ");
if (r->ndm_flags & NTF_EXT_LEARNED)
+ fprintf(fp, "extern_learn ");
+ if (r->ndm_flags & NTF_OFFLOADED)
fprintf(fp, "offload ");
if (tb[NDA_MASTER]) {
fprintf(fp, "master %s ",
diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h
index f3d16db..3199d28 100644
--- a/include/linux/neighbour.h
+++ b/include/linux/neighbour.h
@@ -41,6 +41,7 @@ enum {
#define NTF_MASTER 0x04
#define NTF_PROXY 0x08 /* == ATF_PUBL */
#define NTF_EXT_LEARNED 0x10
+#define NTF_OFFLOADED 0x20
#define NTF_ROUTER 0x80
/*
--
2.9.3
Powered by blists - more mailing lists