net: hsr: add support for EntryForgetTime
Subsystems (3)
Quoted 110 lines · On Fri, Feb 19, 2021 at 2:14 PM : George McCollister…
Quoted 2 lines · Marco
On Thu, Feb 18, 2021 at 6:06 PM : George McCollister
Quoted 90 lines · <[email protected]> wrote:
Quoted 35 lines
net/hsr/hsr_framereg.c static struct hsr_node *hsr_add_node(struct
Quoted 20 lines · Marco Wenzel
In IEC 62439-3 EntryForgetTime is defined with a value of 400 ms. When a node does not send any frame within this time, the sequence number check for can be ignored. This solves communication issues with Cisco IE 2000 in Redbox mode.
Fixes f421436a591d ("net/hsr: Add support for theHigh-availability Seamless Redundancy protocol (HSRv0)")
Signed-off-by Marco Wenzel <[email protected]>--- net/hsr/hsr_framereg.c | 9 +++++++-- net/hsr/hsr_framereg.h | 1(quoted diff) +1
-0+ net/hsr/hsr_main.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-)net/hsr/hsr_framereg.c index renamed from net/hsr/hsr_framereg.c +0
-0
5c97de459905..805f974923b9100644net/hsr/hsr_framereg.c +0
-0@@ -164,8 +164,10 @@ static struct hsr_node *hsr_add_node(struct
hsr_priv*hsr,Quoted 11 lines
net/hsr/hsr_framereg.c +3
-1* as initialization. (0 could trigger an spurious ring error warning). */ now = jiffies; -for (i =0 ; i <HSR_PT_PORTS ; i++) +for (i =0 ; i <HSR_PT_PORTS ; i++) { new_node->time_in[i] = now; + new_node->time_out[i] = now; + }for (i =0 ; i <HSR_PT_PORTS ; i++) new_node->seq_out[i] = seq_out;Quoted 7 lines
net/hsr/hsr_framereg.c void hsr_register_frame_in(struct hsr_node
Quoted 1 line
net/hsr/hsr_framereg.c +0
-0@@ -411,9 +413,12 @@ void hsr_register_frame_in(struct hsr_node*node,
Quoted 2 lines
struct
hsr_port*port, int hsr_register_frame_out(structhsr_port*port,struct
hsr_node*node,Quoted 2 lines
u16 sequence_nr) {- if (seq_nr_before_or_eq(sequence_nr, node->seq_out[port-
type]))
Quoted 47 lines
Quoted 2 lines
+ if (seq_nr_before_or_eq(sequence_nr,
+ node->seq_out[port->type])&&
Quoted 31 lines
net/hsr/hsr_framereg.c +3
-0+ time_is_after_jiffies(node->time_out[port->type] + + msecs_to_jiffies(HSR_ENTRY_FORGET_TIME)))return 1 ; + node->time_out[port->type] = jiffies; node->seq_out[port->type] = sequence_nr;return 0 ; }net/hsr/hsr_framereg.h index renamed from net/hsr/hsr_framereg.h +0
-0
86b43f539f2c..d9628e7a5f05100644net/hsr/hsr_framereg.h +1
-0@@ -75,6 +75,7 @@ struct hsr_node {enum hsr_port_type addr_B_port;unsigned long time_in[HSR_PT_PORTS ];bool time_in_stale[HSR_PT_PORTS ]; +unsigned long time_out[HSR_PT_PORTS ];/* if the node is a SAN */ bool san_a;bool san_b;net/hsr/hsr_main.h index renamed from net/hsr/hsr_main.h +0
-0
7dc92ce5a134..f79ca55d6986100644net/hsr/hsr_main.h +1
-0@@ -21,6 +21,7 @@#define HSR_LIFE_CHECK_INTERVAL 2000/* ms */ #define HSR_NODE_FORGET_TIME 60000/* ms */ #define HSR_ANNOUNCE_INTERVAL 100/* ms */ +#define HSR_ENTRY_FORGET_TIME 400/* ms */ /* By how much may slave1 and slave2 timestamps of latest Quoted 1 line
received
frame from
Quoted 4 lines
* each node differ before we notify of communication problem?
--
2.30.0
scripts/checkpatch.plgives errors about DOS line endings but once that is resolved this looks good. I tested it on an HSR network with the software implementation and the xrs700x which uses offloading and everything still works. I don't have a way to force anything on the HSR network to reuse sequence numbers after 400ms.Quoted 6 lines
Quoted 2 lines
Reviewed-by George McCollister <[email protected]Tested-by George McCollister <[email protected]Thank you very much for reviewing, testing and supporting!
Where do you see the incorrect line endings? I just ran
scripts/checkpath.plas git commit hook and it did not report any errors. When I run it again manually, it also does not report any errors:
Quoted 6 lines
# ./scripts/checkpatch.pl --strict /tmp/0001-net-hsr-add-support-for-EntryForgetTime.patch total: 0 errors, 0 warnings, 0 checks, 38 lines checked
/tmp/0001-net-hsr-add-support-for-EntryForgetTime.patchhas no obvious
Quoted 9 lines
style problems and is ready for submission.
Sorry about this. It seems when I downloaded the patch with Chromium from gmail in Linux it added DOS new lines (this is unexpected). When I downloaded it from lore.kernel.org it's fine.
Reviewed-by George McCollister <[email protected]>Tested-by George McCollister <[email protected]>
Thank you for reviewing again! Is there any operation needed from my side in order to officially apply this patch?
Quoted 3 lines
Quoted 3 lines
Regards,
Marco Wenzel
Quoted 118 lines · Marco
Quoted 116 lines · On Fri, Feb 19, 2021 at 2:14 PM : George McCollister…
Quoted 2 lines · Marco
On Thu, Feb 18, 2021 at 6:06 PM : George McCollister
Quoted 90 lines · <[email protected]> wrote:
Quoted 35 lines
net/hsr/hsr_framereg.c static struct hsr_node *hsr_add_node(struct
Quoted 20 lines · Marco Wenzel
In IEC 62439-3 EntryForgetTime is defined with a value of 400 ms. When a node does not send any frame within this time, the sequence number check for can be ignored. This solves communication issues with Cisco IE 2000 in Redbox mode.
Fixes f421436a591d ("net/hsr: Add support for theHigh-availability Seamless Redundancy protocol (HSRv0)")
Signed-off-by Marco Wenzel <[email protected]>--- net/hsr/hsr_framereg.c | 9 +++++++-- net/hsr/hsr_framereg.h | 1(quoted diff) +1
-0+ net/hsr/hsr_main.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-)net/hsr/hsr_framereg.c index renamed from net/hsr/hsr_framereg.c +0
-0
5c97de459905..805f974923b9100644net/hsr/hsr_framereg.c +0
-0@@ -164,8 +164,10 @@ static struct hsr_node *hsr_add_node(struct
hsr_priv*hsr,Quoted 11 lines
net/hsr/hsr_framereg.c +3
-1* as initialization. (0 could trigger an spurious ring error warning). */ now = jiffies; -for (i =0 ; i <HSR_PT_PORTS ; i++) +for (i =0 ; i <HSR_PT_PORTS ; i++) { new_node->time_in[i] = now; + new_node->time_out[i] = now; + }for (i =0 ; i <HSR_PT_PORTS ; i++) new_node->seq_out[i] = seq_out;Quoted 7 lines
net/hsr/hsr_framereg.c void hsr_register_frame_in(struct hsr_node
Quoted 1 line
net/hsr/hsr_framereg.c +0
-0@@ -411,9 +413,12 @@ void hsr_register_frame_in(struct hsr_node*node,
Quoted 2 lines
struct
hsr_port*port, int hsr_register_frame_out(structhsr_port*port,struct
hsr_node*node,Quoted 2 lines
u16 sequence_nr) {- if (seq_nr_before_or_eq(sequence_nr, node->seq_out[port-
type]))
Quoted 47 lines
Quoted 2 lines
+ if (seq_nr_before_or_eq(sequence_nr,
+ node->seq_out[port->type])&&
Quoted 31 lines
net/hsr/hsr_framereg.c +3
-0+ time_is_after_jiffies(node->time_out[port->type] + + msecs_to_jiffies(HSR_ENTRY_FORGET_TIME)))return 1 ; + node->time_out[port->type] = jiffies; node->seq_out[port->type] = sequence_nr;return 0 ; }net/hsr/hsr_framereg.h index renamed from net/hsr/hsr_framereg.h +0
-0
86b43f539f2c..d9628e7a5f05100644net/hsr/hsr_framereg.h +1
-0@@ -75,6 +75,7 @@ struct hsr_node {enum hsr_port_type addr_B_port;unsigned long time_in[HSR_PT_PORTS ];bool time_in_stale[HSR_PT_PORTS ]; +unsigned long time_out[HSR_PT_PORTS ];/* if the node is a SAN */ bool san_a;bool san_b;net/hsr/hsr_main.h index renamed from net/hsr/hsr_main.h +0
-0
7dc92ce5a134..f79ca55d6986100644net/hsr/hsr_main.h +1
-0@@ -21,6 +21,7 @@#define HSR_LIFE_CHECK_INTERVAL 2000/* ms */ #define HSR_NODE_FORGET_TIME 60000/* ms */ #define HSR_ANNOUNCE_INTERVAL 100/* ms */ +#define HSR_ENTRY_FORGET_TIME 400/* ms */ /* By how much may slave1 and slave2 timestamps of latest Quoted 1 line
received
frame from
Quoted 4 lines
* each node differ before we notify of communication problem?
--
2.30.0
scripts/checkpatch.plgives errors about DOS line endings but once that is resolved this looks good. I tested it on an HSR network with the software implementation and the xrs700x which uses offloading and everything still works. I don't have a way to force anything on the HSR network to reuse sequence numbers after 400ms.Quoted 6 lines
Quoted 2 lines
Reviewed-by George McCollister <[email protected]Tested-by George McCollister <[email protected]Thank you very much for reviewing, testing and supporting!
Where do you see the incorrect line endings? I just ran
scripts/checkpath.plas git commit hook and it did not report any errors. When I run it again manually, it also does not report any errors:
Quoted 6 lines
# ./scripts/checkpatch.pl --strict /tmp/0001-net-hsr-add-support-for-EntryForgetTime.patch total: 0 errors, 0 warnings, 0 checks, 38 lines checked
/tmp/0001-net-hsr-add-support-for-EntryForgetTime.patchhas no obviousstyle problems and is ready for submission.
Sorry about this. It seems when I downloaded the patch with Chromium from gmail in Linux it added DOS new lines (this is unexpected). When I downloaded it from lore.kernel.org it's fine.
Quoted 5 lines
Quoted 3 lines
Reviewed-by George McCollister <[email protected]>Tested-by George McCollister <[email protected]>Thank you for reviewing again! Is there any operation needed from my side in order to officially apply this patch?
Looks like the patch is showing as deferred in patchwork because it's not targeting either net or net-next.
From https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt
There are always two trees (git repositories) in play. Both are driven
by David Miller, the main network maintainer. There is the "net" tree, and the "net-next" tree. As you can probably guess from the names, the net tree is for fixes to existing code already in the mainline tree from Linus, and net-next is where the new code goes for the future release. You can find the trees here:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
You must decide if you want to send it for net or net-next. If you want to send it for net-next you must wait Linus has closed the merge window and this shows open:
http://vger.kernel.org/~davem/net-next.html
To send for net use the subject prefix "[PATCH net]". To send for net-next use the subject prefix "[PATCH net-next]".
If you're using git format-patch you can use the following:
git format-patch --subject-prefix='PATCH net-next'
If you're just using git send-email you can use the --annotate option to edit the patch subject manually.
Thanks and sorry for not mentioning this before,
George McCollister
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Regards,
Marco Wenzel
Quoted 161 lines · On Mon, Feb 22, 2021 at 5:49 PM : George McCollister…
Quoted 2 lines · Marco
On Fri, Feb 19, 2021 at 2:14 PM : George McCollister
Quoted 33 lines · <[email protected]> wrote:
Quoted 33 lines
Quoted 2 lines · Marco
On Thu, Feb 18, 2021 at 6:06 PM : George McCollister
Quoted 27 lines · <[email protected]> wrote:
Quoted 27 lines
Quoted 22 lines · Marco Wenzel
In IEC 62439-3 EntryForgetTime is defined with a value of 400 ms. When a node does not send any frame within this time, the sequence number check for can be ignored. This solves communication issues with Cisco IE 2000 in Redbox mode.
Fixes f421436a591d ("net/hsr: Add support for theHigh-availability Seamless Redundancy protocol (HSRv0)")
Signed-off-by Marco Wenzel <[email protected]>---
net/hsr/hsr_framereg.c| 9 +++++++--net/hsr/hsr_framereg.h
| 1(quoted diff) +1
-0+ net/hsr/hsr_main.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-)net/hsr/hsr_framereg.c +0
-0index
5c97de459905..805f974923b9100644net/hsr/hsr_framereg.c static struct hsr_node · line 164
Quoted 1 line
net/hsr/hsr_framereg.c +0
-0@@ -164,8 +164,10 @@ static struct hsr_node *hsr_add_node(struct
hsr_priv*hsr,Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
net/hsr/hsr_framereg.c static struct hsr_node · line 165
Quoted 1 line
net/hsr/hsr_framereg.c +0
-0* as initialization. (0 could trigger an spurious ring error warning).
Quoted 61 lines
Quoted 61 lines
Quoted 61 lines
Quoted 10 lines
Quoted 10 lines
net/hsr/hsr_framereg.c +3
-1*/ now = jiffies; -for (i =0 ; i <HSR_PT_PORTS ; i++) +for (i =0 ; i <HSR_PT_PORTS ; i++) { new_node->time_in[i] = now; + new_node->time_out[i] = now; + }for (i =0 ; i <HSR_PT_PORTS ; i++) new_node->seq_out[i] = seq_out;Quoted 8 lines
Quoted 2 lines
net/hsr/hsr_framereg.c +0
-0@@ -411,9 +413,12 @@ void hsr_register_frame_in(struct
hsr_node*node,
Quoted 2 lines
struct
hsr_port*port, int hsr_register_frame_out(structhsr_port*port,struct
hsr_node*node,Quoted 2 lines
u16 sequence_nr) {- if (seq_nr_before_or_eq(sequence_nr, node->seq_out[port-
type]))
Quoted 42 lines
Quoted 2 lines
+ if (seq_nr_before_or_eq(sequence_nr,
+ node->seq_out[port->type])&&
Quoted 32 lines
net/hsr/hsr_framereg.c +3
-0+ time_is_after_jiffies(node->time_out[port->type] + + msecs_to_jiffies(HSR_ENTRY_FORGET_TIME)))return 1 ; + node->time_out[port->type] = jiffies; node->seq_out[port->type] = sequence_nr;return 0 ; }net/hsr/hsr_framereg.h +0
-0index
86b43f539f2c..d9628e7a5f05100644net/hsr/hsr_framereg.h +1
-0@@ -75,6 +75,7 @@ struct hsr_node {enum hsr_port_type addr_B_port;unsigned long time_in[HSR_PT_PORTS ];bool time_in_stale[HSR_PT_PORTS ]; +unsigned long time_out[HSR_PT_PORTS ];/* if the node is a SAN */ bool san_a;bool san_b;net/hsr/hsr_main.h index renamed from net/hsr/hsr_main.h +0
-0
7dc92ce5a134..f79ca55d6986100644net/hsr/hsr_main.h +1
-0@@ -21,6 +21,7 @@#define HSR_LIFE_CHECK_INTERVAL 2000/* ms */ #define HSR_NODE_FORGET_TIME 60000/* ms */ #define HSR_ANNOUNCE_INTERVAL 100/* ms */ +#define HSR_ENTRY_FORGET_TIME 400/* ms */ /* By how much may slave1 and slave2 timestamps of latest Quoted 1 line
received
frame from
Quoted 4 lines
* each node differ before we notify of communication problem?
--
2.30.0Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
scripts/checkpatch.plgives errors about DOS line endings but once that is resolved this looks good. I tested it on an HSR network with the software implementation and the xrs700x which uses offloading and everything still works. I don't have a way to force anything on the HSR network to reuse sequence numbersafter 400ms.
Quoted 23 lines
Quoted 23 lines
Quoted 8 lines
Quoted 3 lines
Reviewed-by George McCollister <[email protected]Tested-by George McCollister <[email protected]Thank you very much for reviewing, testing and supporting!
Where do you see the incorrect line endings? I just ran
scripts/checkpath.plas git commit hook and it did not report any errors. When I run it again manually, it also does not report any errors:
Quoted 7 lines
# ./scripts/checkpatch.pl --strict /tmp/0001-net-hsr-add-support-for-EntryForgetTime.patch total: 0 errors, 0 warnings, 0 checks, 38 lines checked
/tmp/0001-net-hsr-add-support-for-EntryForgetTime.patchhas no obviousstyle problems and is ready for submission.
Sorry about this. It seems when I downloaded the patch with Chromium from gmail in Linux it added DOS new lines (this is unexpected). When I downloaded it from lore.kernel.org it's fine.
Quoted 5 lines
Quoted 3 lines
Reviewed-by George McCollister <[email protected]>Tested-by George McCollister <[email protected]>Thank you for reviewing again! Is there any operation needed from my side
in order to officially apply this patch?
Looks like the patch is showing as deferred in patchwork because it's not targeting either net or net-next.
From https://www.kernel.org/doc/Documentation/networking/netdev-
FAQ.txt
There are always two trees (git repositories) in play. Both are driven
by David Miller, the main network maintainer. There is the "net" tree, and the "net-next" tree. As you can probably guess from the names, the net tree is for fixes to existing code already in the mainline tree from Linus, and net-next is where the new code goes for the future release. You can find the trees here:https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.gitYou must decide if you want to send it for net or net-next. If you want to send it for net-next you must wait Linus has closed the merge window and this shows open:
http://vger.kernel.org/~davem/net-next.htmlTo send for net use the subject prefix "[PATCH net]". To send for net-next use the subject prefix "[PATCH net-next]".
Quoted 7 lines
If you're using git format-patch you can use the following:
git format-patch --subject-prefix='PATCH net-next'If you're just using git send-email you can use the --annotate option to edit the patch subject manually.
Thanks and sorry for not mentioning this before, George McCollister
Thanks again for the very helpful hints. I hope the patch will be correct now.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Regards,
Marco Wenzel
Quoted 11 lines
Quoted 11 lines
You must decide if you want to send it for net or net-next. If you want to send it for net-next you must wait Linus has closed the merge window and this shows open:
http://vger.kernel.org/~davem/net-next.htmlTo send for net use the subject prefix "[PATCH net]". To send for net-next use the subject prefix "[PATCH net-next]".
If you're using git format-patch you can use the following:
git format-patch --subject-prefix='PATCH net-next'
Quoted 6 lines
Quoted 4 lines
If you're just using git send-email you can use the --annotate option to edit the patch subject manually.
Thanks and sorry for not mentioning this before, George McCollister
Thanks again for the very helpful hints. I hope the patch will be correct now.
Hi Marco
I know there is a lot of learn, doing the submission correct can be harder than writing the code, at least for the first few patches.
One thing you missed is the patch version number in the Subject:
line. When there are multiple versions of a patch flying around, it makes it easier to keep track of, if there is a version number. Please try to remember this for you next patch. No need to resend just because of this.
Andrew
PATCH 1/1 net: hsr: add support for EntryForgetTime
In reply to George McCollisterIn IEC 62439-3 EntryForgetTime is defined with a value of 400 ms. When a node does not send any frame within this time, the sequence number check for can be ignored. This solves communication issues with Cisco IE 2000 in Redbox mode.
--- net/hsr/hsr_framereg.c | 9 +++++++-- net/hsr/hsr_framereg.h | 1 + net/hsr/hsr_main.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-)
net/hsr/hsr_framereg.c +7 -2
@@ -164,8 +164,10 @@ static struct hsr_node *hsr_add_node(struct hsr_priv *hsr,* as initialization. (0 could trigger an spurious ring error warning). */ now = jiffies; -for (i =0 ; i <HSR_PT_PORTS ; i++) +for (i =0 ; i <HSR_PT_PORTS ; i++) { new_node->time_in[i] = now; + new_node->time_out[i] = now; + }for (i =0 ; i <HSR_PT_PORTS ; i++) new_node->seq_out[i] = seq_out;
@@ -413,9 +415,12 @@ void hsr_register_frame_in(struct hsr_node *node, struct hsr_port *port,int hsr_register_frame_out (struct hsr_port *port,struct hsr_node *node,u16 sequence_nr) { -if (seq_nr_before_or_eq (sequence_nr, node->seq_out[port->type])) +if (seq_nr_before_or_eq (sequence_nr, node->seq_out[port->type]) && +time_is_after_jiffies (node->time_out[port->type] + +msecs_to_jiffies (HSR_ENTRY_FORGET_TIME )))return 1 ; + node->time_out[port->type] = jiffies; node->seq_out[port->type] = sequence_nr;return 0 ; }
net/hsr/hsr_framereg.h +1 -0
@@ -75,6 +75,7 @@ struct hsr_node {enum hsr_port_type addr_B_port;unsigned long time_in[HSR_PT_PORTS ];bool time_in_stale[HSR_PT_PORTS ]; +unsigned long time_out[HSR_PT_PORTS ];/* if the node is a SAN */ bool san_a;bool san_b;
net/hsr/hsr_main.h +1 -0
@@ -22,6 +22,7 @@#define HSR_LIFE_CHECK_INTERVAL 2000/* ms */ #define HSR_NODE_FORGET_TIME 60000/* ms */ #define HSR_ANNOUNCE_INTERVAL 100/* ms */ +#define HSR_ENTRY_FORGET_TIME 400/* ms */ /* By how much may slave1 and slave2 timestamps of latest received frame from * each node differ before we notify of communication problem?
Signature · 1 line
2.30.0
Quoted 9 lines · Marco Wenzel
In IEC 62439-3 EntryForgetTime is defined with a value of 400 ms. When a node does not send any frame within this time, the sequence number check for can be ignored. This solves communication issues with Cisco IE 2000 in Redbox mode.
Fixes f421436a591d ("net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)")Signed-off-by Marco Wenzel <[email protected]>Reviewed-by George McCollister <[email protected]>Tested-by George McCollister <[email protected]>
Andrew
Quoted 6 lines · On Wed, 24 Feb 2021 14:55:17 +0100 Andrew Lunn wrote:
Quoted 5 lines · Marco Wenzel
In IEC 62439-3 EntryForgetTime is defined with a value of 400 ms. When a node does not send any frame within this time, the sequence number check for can be ignored. This solves communication issues with Cisco IE 2000 in Redbox mode.
Quoted 6 lines
Quoted 4 lines
Fixes f421436a591d ("net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)")Signed-off-by Marco Wenzel <[email protected]>Reviewed-by George McCollister <[email protected]>Tested-by George McCollister <[email protected]>Reviewed-by Andrew Lunn <[email protected]>
Applied, thanks!
Quoted 14 lines · Jakub Kicinski
Quoted 12 lines · On Wed, 24 Feb 2021 14:55:17 +0100 Andrew Lunn wrote:
Quoted 10 lines · Marco Wenzel
In IEC 62439-3 EntryForgetTime is defined with a value of 400 ms. When a node does not send any frame within this time, the sequence number check for can be ignored. This solves communication issues with Cisco IE 2000 in Redbox mode.
Fixes f421436a591d ("net/hsr: Add support for the High-availabilitySeamless Redundancy protocol (HSRv0)")
Signed-off-by Marco Wenzel <[email protected]>Reviewed-by George McCollister <[email protected]>Tested-by George McCollister <[email protected]>
Quoted 3 lines
Quoted 1 line
Reviewed-by Andrew Lunn <[email protected]>Applied, thanks!
Thank you all for supporting me during the submission of my first kernel patch!
Best regards,
Marco