linux-api.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>, <vinicius.gomes@intel.com>
Subject: [net-next PATCH v2 1/9] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames
Date: Wed, 15 Jul 2020 12:40:02 -0400	[thread overview]
Message-ID: <20200715164012.1222-2-m-karicheri2@ti.com> (raw)
In-Reply-To: <20200715164012.1222-1-m-karicheri2@ti.com>

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 <m-karicheri2@ti.com>
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


  reply	other threads:[~2020-07-15 16:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 16:40 [net-next PATCH v2 0/9] Add PRP driver and bug fixes Murali Karicheri
2020-07-15 16:40 ` Murali Karicheri [this message]
2020-07-15 16:40 ` [net-next PATCH v2 2/9] net: hsr/prp: validate address B before copying to skb Murali Karicheri
2020-07-15 16:40 ` [net-next PATCH v2 3/9] hsr: enhance netlink socket interface to support PRP Murali Karicheri
2020-07-15 16:40 ` [net-next PATCH v2 4/9] net: hsr: introduce common code for skb initialization Murali Karicheri
2020-07-15 16:40 ` [net-next PATCH v2 5/9] net: hsr: introduce protocol specific function pointers Murali Karicheri
2020-07-15 16:40 ` [net-next PATCH v2 6/9] net: prp: add supervision frame generation utility function Murali Karicheri
2020-07-15 16:40 ` [net-next PATCH v2 7/9] net: hsr: define and use proto_ops ptrs to handle hsr specific frames Murali Karicheri
2020-07-15 16:40 ` [net-next PATCH v2 8/9] net: prp: add packet handling support Murali Karicheri
2020-07-15 16:40 ` [net-next PATCH v2 9/9] net: prp: enhance debugfs to display PRP info Murali Karicheri
2020-07-15 16:40 ` [net-next iproute2 PATCH v2 1/2] iplink: hsr: add support for creating PRP device similar to HSR Murali Karicheri
2020-07-15 16:40 ` [net-next iproute2 PATCH v2 2/2] ip: iplink: prp: update man page for new parameter Murali Karicheri
2020-07-16 23:56 ` [net-next PATCH v2 0/9] Add PRP driver and bug fixes Jakub Kicinski
2020-07-17 14:19   ` Murali Karicheri

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=20200715164012.1222-2-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 \
    --cc=vinicius.gomes@intel.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).