Thread (14 messages) flat view 14 messages, 2 authors, 2020-07-17
STALE2228d REVIEWED: 1 (1M)

Revision v2 of 2 in this series; 1 review trailer.

Revisions (2)
  1. v2 current
  2. v2 [diff vs current]

[net-next PATCH v2 1/9] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames

From: Murali Karicheri <hidden>
Date: 2020-07-15 16:40:26
Also in: linux-api, lkml
Subsystem: hsr network protocol, networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

For small Ethernet frames with size less than minimum size 66 for HSR
vs 60 for regular Ethernet frames, hsr driver currently doesn't pad the
frame to make it minimum size. This results in incorrect LSDU size being
populated in the HSR tag for these frames. Fix this by padding the frame
to the minimum size applicable for HSR.

Signed-off-by: Murali Karicheri <redacted>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 net/hsr/hsr_forward.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index ed13760463de..e42fd356f073 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -127,6 +127,9 @@ static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame,
 	int lane_id;
 	int lsdu_size;
 
+	/* pad to minimum packet size which is 60 + 6 (HSR tag) */
+	skb_put_padto(skb, ETH_ZLEN + HSR_HLEN);
+
 	if (port->type == HSR_PT_SLAVE_A)
 		lane_id = 0;
 	else
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help