netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, arkadis@mellanox.com, idosch@mellanox.com,
	mlxsw@mellanox.com
Subject: [patch net-next 1/8] devlink: Add IPv6 header for dpipe
Date: Wed, 30 Aug 2017 14:02:59 +0200	[thread overview]
Message-ID: <20170830120306.6128-2-jiri@resnulli.us> (raw)
In-Reply-To: <20170830120306.6128-1-jiri@resnulli.us>

From: Arkadi Sharshevsky <arkadis@mellanox.com>

This will be used by the IPv6 host table which will be introduced in the
following patches. The fields in the header are added per-use. This header
is global and can be reused by many drivers.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 include/net/devlink.h        |  1 +
 include/uapi/linux/devlink.h |  5 +++++
 net/core/devlink.c           | 17 +++++++++++++++++
 3 files changed, 23 insertions(+)

diff --git a/include/net/devlink.h b/include/net/devlink.h
index aaf7178..b9654e1 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -330,6 +330,7 @@ int devlink_dpipe_match_put(struct sk_buff *skb,
 			    struct devlink_dpipe_match *match);
 extern struct devlink_dpipe_header devlink_dpipe_header_ethernet;
 extern struct devlink_dpipe_header devlink_dpipe_header_ipv4;
+extern struct devlink_dpipe_header devlink_dpipe_header_ipv6;
 
 #else
 
diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index 6c17254..0cbca96 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -234,9 +234,14 @@ enum devlink_dpipe_field_ipv4_id {
 	DEVLINK_DPIPE_FIELD_IPV4_DST_IP,
 };
 
+enum devlink_dpipe_field_ipv6_id {
+	DEVLINK_DPIPE_FIELD_IPV6_DST_IP,
+};
+
 enum devlink_dpipe_header_id {
 	DEVLINK_DPIPE_HEADER_ETHERNET,
 	DEVLINK_DPIPE_HEADER_IPV4,
+	DEVLINK_DPIPE_HEADER_IPV6,
 };
 
 #endif /* _UAPI_LINUX_DEVLINK_H_ */
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 194708a..47931a2 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -63,6 +63,23 @@ struct devlink_dpipe_header devlink_dpipe_header_ipv4 = {
 };
 EXPORT_SYMBOL(devlink_dpipe_header_ipv4);
 
+static struct devlink_dpipe_field devlink_dpipe_fields_ipv6[] = {
+	{
+		.name = "destination ip",
+		.id = DEVLINK_DPIPE_FIELD_IPV6_DST_IP,
+		.bitwidth = 128,
+	},
+};
+
+struct devlink_dpipe_header devlink_dpipe_header_ipv6 = {
+	.name = "ipv6",
+	.id = DEVLINK_DPIPE_HEADER_IPV6,
+	.fields = devlink_dpipe_fields_ipv6,
+	.fields_count = ARRAY_SIZE(devlink_dpipe_fields_ipv6),
+	.global = true,
+};
+EXPORT_SYMBOL(devlink_dpipe_header_ipv6);
+
 EXPORT_TRACEPOINT_SYMBOL_GPL(devlink_hwmsg);
 
 static LIST_HEAD(devlink_list);
-- 
2.9.3

  reply	other threads:[~2017-08-30 12:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 12:02 [patch net-next 0/8] mlxsw: Add IPv6 host dpipe table Jiri Pirko
2017-08-30 12:02 ` Jiri Pirko [this message]
2017-08-30 12:03 ` [patch net-next 2/8] mlxsw: spectrum_router: Export IPv6 link local address check helper Jiri Pirko
2017-08-30 12:03 ` [patch net-next 3/8] mlxsw: spectrum_dpipe: Add IPv6 host table initial support Jiri Pirko
2017-08-30 17:36   ` David Ahern
2017-08-31  7:17     ` Jiri Pirko
2017-08-30 12:03 ` [patch net-next 4/8] mlxsw: spectrum_router: Add IPv6 neighbor access helper Jiri Pirko
2017-08-30 12:03 ` [patch net-next 5/8] mlxsw: spectrum_dpipe: Make host entry fill handler more generic Jiri Pirko
2017-08-30 12:03 ` [patch net-next 6/8] mlxsw: spectrum_dpipe: Add support for IPv6 host table dump Jiri Pirko
2017-08-30 17:42   ` David Ahern
2017-08-31  7:18     ` Jiri Pirko
2017-08-30 12:03 ` [patch net-next 7/8] mlxsw: spectrum_router: Add support for setting counters on IPv6 neighbors Jiri Pirko
2017-08-30 17:43   ` David Ahern
2017-08-30 12:03 ` [patch net-next 8/8] mlxsw: spectrum_dpipe: Add support for controlling IPv6 neighbor counters Jiri Pirko
2017-08-30 17:26 ` [patch net-next 0/8] mlxsw: Add IPv6 host dpipe table Andrew Lunn
2017-08-30 17:33   ` David Ahern
2017-08-31 12:26   ` Arkadi Sharshevsky

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=20170830120306.6128-2-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=arkadis@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /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).