All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Murali Karicheri <m-karicheri2@ti.com>, <davem@davemloft.net>,
	<kuba@kernel.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <nsekhar@ti.com>,
	<vinicius.gomes@intel.com>
Subject: Re: [PATCH 1/2 v2] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames
Date: Fri, 17 Jul 2020 20:39:53 +0300	[thread overview]
Message-ID: <0e064d93-546d-e999-e36a-499d37137ba4@ti.com> (raw)
In-Reply-To: <20200717145510.30433-1-m-karicheri2@ti.com>



On 17/07/2020 17:55, Murali Karicheri wrote:
> 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>
> ---
>   no change from original version
>   Sending this bug fix ahead of PRP patch series as per comment
>   net/hsr/hsr_forward.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
>   Sending this bug fix ahead of PRP patch series as per comment
> 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);

It may fail.
And i worry that it might be not the right place to do that
(if packet is small it will be called for every copy of the packet).
May be it has to be done once when packet enters LRE device?

> +
>   	if (port->type == HSR_PT_SLAVE_A)
>   		lane_id = 0;
>   	else
> 

-- 
Best regards,
grygorii

  parent reply	other threads:[~2020-07-17 17:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 14:55 [PATCH 1/2 v2] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames Murali Karicheri
2020-07-17 14:55 ` [PATCH 2/2 v2] net: hsr: validate address B before copying to skb Murali Karicheri
2020-07-18  1:54   ` David Miller
2020-07-17 17:39 ` Grygorii Strashko [this message]
2020-07-20 14:08   ` [PATCH 1/2 v2] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames Murali Karicheri
2020-07-20 15:25     ` Murali Karicheri
2020-07-18  1:54 ` David Miller

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=0e064d93-546d-e999-e36a-499d37137ba4@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-karicheri2@ti.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.