Skip to contentSkip to conversation

net/hsr Patch - Help

DISCUSSION Arvid Brodin 1 participant 2 messages Oct 15, 2013 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 16 lines · Elías Molina Muñoz
Quoted 15 lines · Arvid Brodin
Quoted 5 lines · Elías Molina Muñoz

Dear Mr. Brodin,

I would like to introduce myself. My name is Elías Molina, PhD. Student at University of Basque Country (Spain). I am writing to enquire about your HSR patch.

Hi!

Quoted 7 lines

I have read "This is a patch against net-next (2013-08-21)" in its last version (v3) so I have tried with several kernel versions but I do not know which is the repo's correct version of
http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/
.

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

Could you tell me which is the kernel version to apply your patch?

I made an error when I sent that patch, so it won't apply to any kernel version.

The below patch should work (cd to the net-next directory and apply with patch -Np1):

[removed]

Quoted 5 lines

Dear Mr. Brodin,

Thanks for getting back to me and I apologize for being so late replying.

Quoted 8 lines

I am writing to enquire if, once compiled the kernel with your patch, there is a sample application for verifying the correct operation of HSR, as you did in http://patchwork.ozlabs.org/patch/191165/ with Documentation/networking/hsr/hsr_genl.c

Thank you very much. Best regards,

Elías Molina

Hi again,

I'm CC:ing the netdev list and others who've shown interest in HSR, since they might be interested as well.

Yes, I have patches for iproute2 (to make it possible to add HSR devices) and also a "hsrinfo" program which can be used to query an HSR interface for statistics, and to listen for any HSR errors detected. The hsrinfo program is based on the hsr_genl program that you mention. It requires the libnl3 library.

The iproute patch is below (I'll send a separate message with the hsrinfo code).

(I don't think the patch below will get accepted into iproute2 before the HSR patch itself is accepted into the kernel - which I'm beginning to doubt it ever will be, unfortunately.)

This patch adds support to iproute2 for adding High-Availability Seamless Redundancy (HSR) network devices.

---
 include/linux/if_link.h | 12 +++++++
 ip/Makefile             |  2 +-
 ip/iplink_hsr.c         | 86 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 99 insertions(+), 1 deletion(-)
 create mode 100644 ip/iplink_hsr.c
include/linux/if_link.h +12 -0
index d07aeca..bab39e8 100644
@@ -465,4 +465,16 @@ enum {
 
 #define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
 
+/* HSR section */
+
+enum {
+	IFLA_HSR_UNSPEC,
+	IFLA_HSR_SLAVE1,
+	IFLA_HSR_SLAVE2,
+	IFLA_HSR_MULTICAST_SPEC,
+	__IFLA_HSR_MAX,
+};
+
+#define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
+
 #endif /* _LINUX_IF_LINK_H */
ip/Makefile +1 -1
index 48bd4a1..5ef1562 100644
@@ -5,7 +5,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
     iplink_vlan.o link_veth.o link_gre.o iplink_can.o \
     iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o \
     iplink_vxlan.o tcp_metrics.o iplink_ipoib.o ipnetconf.o link_ip6tnl.o \
-    link_iptnl.o
+    link_iptnl.o iplink_hsr.o
 
 RTMONOBJ=rtmon.o
 
ip/iplink_hsr.c new file +86 -0

86 lines not on this page · raw message

Signature · 7 lines
1.8.1.5



-- 
Arvid Brodin | Consultant (Linux)
XDIN AB | Knarrarnäsgatan 7 | SE-164 40 Kista | Sweden | xdin.com
#4 lore raw
In reply to a message not in the archive
Quoted 16 lines · Elías Molina Muñoz
Quoted 15 lines · Arvid Brodin
Quoted 5 lines · Elías Molina Muñoz

Dear Mr. Brodin,

I would like to introduce myself. My name is Elías Molina, PhD. Student at University of Basque Country (Spain). I am writing to enquire about your HSR patch.

Hi!

Quoted 7 lines

I have read "This is a patch against net-next (2013-08-21)" in its last version (v3) so I have tried with several kernel versions but I do not know which is the repo's correct version of
http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/
.

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

Could you tell me which is the kernel version to apply your patch?

I made an error when I sent that patch, so it won't apply to any kernel version.

The below patch should work (cd to the net-next directory and apply with patch -Np1):

[removed]

Quoted 5 lines

Dear Mr. Brodin,

Thanks for getting back to me and I apologize for being so late replying.

Quoted 8 lines

I am writing to enquire if, once compiled the kernel with your patch, there is a sample application for verifying the correct operation of HSR, as you did in http://patchwork.ozlabs.org/patch/191165/ with Documentation/networking/hsr/hsr_genl.c

Thank you very much. Best regards,

Elías Molina

Hi again,

I'm CC:ing the netdev list and others who've shown interest in HSR, since they might be interested as well.

Yes, I have patches for iproute2 (to make it possible to add HSR devices) and also a "hsrinfo" program which can be used to query an HSR interface for statistics, and to listen for any HSR errors detected. The hsrinfo program is based on the hsr_genl program that you mention. It requires the libnl3 library.

The hsrinfo program is below (the iproute2 patch was sent in a previous message). This code is not of the same quality standards as you would expect of a kernel/iproute2 patch. The idea is to re-write it so that it becomes part of iproute2, but I won't spend time on that unless there is some progress with the HSR kernel patch.

---

hsr_netlink.h +72 -0
diff -Nurp hsrinfo-a/hsr_netlink.h hsrinfo-b/hsr_netlink.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2011-2013 Autronica Fire and Security AS
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * Author(s):
+ *	2011-2013 Arvid Brodin, [email protected]
+ */
+
+#ifndef __HSR_NETLINK_H
+#define __HSR_NETLINK_H
+
+/* attributes */
+enum {
+	HSR_A_UNSPEC,
+	HSR_A_NODE_ADDR,
+	HSR_A_IFINDEX,
+	HSR_A_IF1_AGE,
+	HSR_A_IF2_AGE,
+	HSR_A_NODE_ADDR_B,
+	HSR_A_IF1_SEQ,
+	HSR_A_IF2_SEQ,
+	HSR_A_IF1_IFINDEX,
+	HSR_A_IF2_IFINDEX,
+	HSR_A_ADDR_B_IFINDEX,
+	__HSR_A_MAX,
+};
+#define HSR_A_MAX (__HSR_A_MAX - 1)
+
+
+#ifdef __KERNEL__
+
+#include <linux/if_ether.h>
+#include <linux/module.h>
+
+int __init hsr_netlink_init(void);
+void __exit hsr_netlink_exit(void);
+
+void hsr_nl_ringerror(unsigned char addr[ETH_ALEN], int dev_idx);
+void hsr_nl_nodedown(unsigned char addr[ETH_ALEN]);
+void hsr_nl_framedrop(int dropcount, int dev_idx);
+void hsr_nl_linkdown(int dev_idx);
+
+
+/*
+ * Generic Netlink HSR family definition
+ */
+
+
+#endif /* __KERNEL__ */
+
+
+
+/* commands */
+enum {
+	HSR_C_UNSPEC,
+	HSR_C_RING_ERROR,
+	HSR_C_NODE_DOWN,
+	HSR_C_GET_NODE_STATUS,
+	HSR_C_SET_NODE_STATUS,
+	HSR_C_GET_NODE_LIST,
+	HSR_C_SET_NODE_LIST,
+	__HSR_C_MAX,
+};
+#define HSR_C_MAX (__HSR_C_MAX - 1)
+
+
+
+#endif /* __HSR_NETLINK_H */
hsrinfo.c +504 -0

504 lines not on this page · raw message

Signature · 2 lines
Arvid Brodin | Consultant (Linux)
XDIN AB | Knarrarnäsgatan 7 | SE-164 40 Kista | Sweden | xdin.com