netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Murali Karicheri <m-karicheri2@ti.com>
To: <davem@davemloft.net>, <kuba@kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-api@vger.kernel.org>, <nsekhar@ti.com>,
	<grygorii.strashko@ti.com>
Subject: [net-next RFC PATCH 07/13] net: hsr: introduce common uapi include/definitions for HSR and PRP
Date: Wed, 6 May 2020 12:30:27 -0400	[thread overview]
Message-ID: <20200506163033.3843-8-m-karicheri2@ti.com> (raw)
In-Reply-To: <20200506163033.3843-1-m-karicheri2@ti.com>

There are many commonalities between HSR and PRP protocols except for
the fact that HSR uses Tag as a prefix vs RCT (Redundancy Control Trail)
as a trailer for PRP. Few of the commonalities to name are:- both uses
a pair of Ethernet interfaces, can be set up the same way from user
space using ip link command, Same Multicast MAC address for Supervision
frames, similar mechanism for redundancy, duplicate and discard using
tag/rct etc. So this patch introduces a common user space API in
if_link.h with a HSR_PRP prefix and common hsr_prp_netlink.h for
protocol specific interface configuration.  It is assumed that the old
definitions and include file for HSR may be obsoleted at some time
future (TBD) once all applications migrate to the new API.
IFLA_HSR_PRP_SUPERVISION_ADDR is the MC address for Supervision Frames
(SF), so use the name IFLA_HSR_PRP_SF_MC_ADDR instead to make it shorter
and also change IFLA_HSR_PRP_MULTICAST_SPEC to
IFLA_HSR_PRP_SF_MC_ADDR_LSB as it is the last byte of the MC address
used by Supervision frames.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
 include/uapi/linux/hsr_netlink.h     |  3 ++
 include/uapi/linux/hsr_prp_netlink.h | 50 ++++++++++++++++++++++++++++
 include/uapi/linux/if_link.h         | 19 +++++++++++
 3 files changed, 72 insertions(+)
 create mode 100644 include/uapi/linux/hsr_prp_netlink.h

diff --git a/include/uapi/linux/hsr_netlink.h b/include/uapi/linux/hsr_netlink.h
index c218ef9c35dd..54650ffca2be 100644
--- a/include/uapi/linux/hsr_netlink.h
+++ b/include/uapi/linux/hsr_netlink.h
@@ -14,6 +14,9 @@
 #ifndef __UAPI_HSR_NETLINK_H
 #define __UAPI_HSR_NETLINK_H
 
+/* This file will become obsolete soon!!! Start using hsr_prp_netlink.h
+ * instead
+ */
 /* Generic Netlink HSR family definition
  */
 
diff --git a/include/uapi/linux/hsr_prp_netlink.h b/include/uapi/linux/hsr_prp_netlink.h
new file mode 100644
index 000000000000..17865cf14432
--- /dev/null
+++ b/include/uapi/linux/hsr_prp_netlink.h
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* prp_prp_netlink.h: This is based on hsr_netlink.h from Arvid Brodin,
+ * arvid.brodin@alten.se
+ *
+ * Copyright 2011-2014 Autronica Fire and Security AS
+ * Copyright (C) 2020 Texas Instruments Incorporated
+ *
+ * Author(s):
+ *	2011-2014 Arvid Brodin, arvid.brodin@alten.se
+ *	2020 Murali Karicheri <m-karicheri2@ti.com>
+ */
+
+#ifndef __UAPI_HSR_PRP_NETLINK_H
+#define __UAPI_HSR_PRP_NETLINK_H
+
+/* Generic Netlink HSR/PRP family definition
+ */
+
+/* attributes */
+enum {
+	HSR_PRP_A_UNSPEC,
+	HSR_PRP_A_NODE_ADDR,
+	HSR_PRP_A_IFINDEX,
+	HSR_PRP_A_IF1_AGE,
+	HSR_PRP_A_IF2_AGE,
+	HSR_PRP_A_NODE_ADDR_B,
+	HSR_PRP_A_IF1_SEQ,
+	HSR_PRP_A_IF2_SEQ,
+	HSR_PRP_A_IF1_IFINDEX,
+	HSR_PRP_A_IF2_IFINDEX,
+	HSR_PRP_A_ADDR_B_IFINDEX,
+	__HSR_PRP_A_MAX,
+};
+#define HSR_PRP_A_MAX (__HSR_PRP_A_MAX - 1)
+
+
+/* commands */
+enum {
+	HSR_PRP_C_UNSPEC,
+	HSR_PRP_C_RING_ERROR, /* only for HSR for now */
+	HSR_PRP_C_NODE_DOWN,
+	HSR_PRP_C_GET_NODE_STATUS,
+	HSR_PRP_C_SET_NODE_STATUS,
+	HSR_PRP_C_GET_NODE_LIST,
+	HSR_PRP_C_SET_NODE_LIST,
+	__HSR_PRP_C_MAX,
+};
+#define HSR_PRP_C_MAX (__HSR_PRP_C_MAX - 1)
+
+#endif /* __UAPI_HSR_PRP_NETLINK_H */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index a009365ad67b..520537f35dcb 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -906,6 +906,8 @@ enum {
 #define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
 
 
+/* Will become obsolete soon!!!  Replaced with IFLA_HSR_PRP* prefix below */
+
 /* HSR section */
 
 enum {
@@ -1055,4 +1057,21 @@ struct ifla_rmnet_flags {
 	__u32	mask;
 };
 
+/* New definitions below to replace the HSR_ prefixed ones for HSR and PRP.
+ * It is expected to migrate all applications to this and obsolete the
+ * HSR specific definitions used currently.
+ */
+enum {
+	IFLA_HSR_PRP_UNSPEC,
+	IFLA_HSR_PRP_SLAVE1,
+	IFLA_HSR_PRP_SLAVE2,
+	IFLA_HSR_PRP_SF_MC_ADDR_LSB,  /* Last byte of supervision addr */
+	IFLA_HSR_PRP_SF_MC_ADDR,      /* Supervision frame multicast addr */
+	IFLA_HSR_PRP_SEQ_NR,
+	IFLA_HSR_PRP_VERSION,		/* HSR version */
+	__IFLA_HSR_PRP_MAX,
+};
+
+#define IFLA_HSR_PRP_MAX (__IFLA_HSR_PRP_MAX - 1)
+
 #endif /* _UAPI_LINUX_IF_LINK_H */
-- 
2.17.1


  parent reply	other threads:[~2020-05-06 16:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 16:30 [net-next RFC PATCH 00/13] net: hsr: Add PRP driver Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 01/13] net: hsr: Re-use Kconfig option to support PRP Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 02/13] net: hsr: rename hsr directory to hsr-prp to introduce PRP Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 03/13] net: hsr: rename files to introduce PRP support Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 04/13] net: hsr: rename hsr variable inside struct hsr_port to priv Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 05/13] net: hsr: rename hsr_port_get_hsr() to hsr_prp_get_port() Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 06/13] net: hsr: some renaming to introduce PRP driver support Murali Karicheri
2020-05-06 16:30 ` Murali Karicheri [this message]
2020-05-06 16:30 ` [net-next RFC PATCH 08/13] net: hsr: migrate HSR netlink socket code to use new common API Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 09/13] net: hsr: move re-usable code for PRP to hsr_prp_netlink.c Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 10/13] net: hsr: add netlink socket interface for PRP Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 11/13] net: prp: add supervision frame generation and handling support Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 12/13] net: prp: add packet " Murali Karicheri
2020-05-06 16:30 ` [net-next RFC PATCH 13/13] net: prp: enhance debugfs to display PRP specific info in node table Murali Karicheri
2020-05-13 12:27 ` [net-next RFC PATCH 00/13] net: hsr: Add PRP driver Murali Karicheri
2020-05-21 12:34   ` Murali Karicheri
2020-05-21 17:31 ` Vinicius Costa Gomes
2020-05-25 16:49   ` Murali Karicheri
2020-05-26 18:56     ` Vinicius Costa Gomes
2020-05-26 21:51       ` Murali Karicheri
2020-05-25 21:37   ` Vladimir Oltean
2020-05-26 14:12     ` Murali Karicheri
2020-05-26 18:25       ` Vladimir Oltean
2020-05-26 21:33         ` Murali Karicheri
2020-05-26 18:09     ` Vinicius Costa Gomes

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=20200506163033.3843-8-m-karicheri2@ti.com \
    --to=m-karicheri2@ti.com \
    --cc=davem@davemloft.net \
    --cc=grygorii.strashko@ti.com \
    --cc=kuba@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.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 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).