netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	colin.king@canonical.com, tklauser@distanz.ch,
	thierry.reding@gmail.com
Subject: Re: [PATCH net v2 2/2] net: ethoc: Correctly pad short packets
Date: Tue, 12 Jul 2016 15:24:40 +0300	[thread overview]
Message-ID: <20160712122440.GA19495@octofox.metropolis> (raw)
In-Reply-To: <1468280155-13152-3-git-send-email-f.fainelli@gmail.com>

Hi Florian,

On Mon, Jul 11, 2016 at 04:35:55PM -0700, Florian Fainelli wrote:
> Even though the hardware can be doing zero padding, we want the SKB to
> be going out on the wire with the appropriate size. This fixes packet
> truncations observed with e.g: ARP packets.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/net/ethernet/ethoc.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
> index 06ae14a8e946..ca678d46c322 100644
> --- a/drivers/net/ethernet/ethoc.c
> +++ b/drivers/net/ethernet/ethoc.c
> @@ -860,6 +860,11 @@ static netdev_tx_t ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  	unsigned int entry;
>  	void *dest;
>  
> +	if (skb_put_padto(skb, ETHOC_ZLEN)) {
> +		dev->stats.tx_errors++;
> +		goto out;
> +	}

skb_put_padto says that skb is freed on error, so this shoudn't go to
label 'out' on error where skb is freed again?

-- 
Thanks.
-- Max

  reply	other threads:[~2016-07-12 12:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 23:35 [PATCH net v2 0/2] net: ethoc: Error path and transmit fixes Florian Fainelli
2016-07-11 23:35 ` [PATCH net v2 1/2] net: ethoc: Fix early error paths Florian Fainelli
2016-07-11 23:35 ` [PATCH net v2 2/2] net: ethoc: Correctly pad short packets Florian Fainelli
2016-07-12 12:24   ` Max Filippov [this message]
2016-07-12  2:47 ` [PATCH net v2 0/2] net: ethoc: Error path and transmit fixes David Miller
2016-07-12 13:51 ` Max Filippov
2016-07-12 17:35   ` 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=20160712122440.GA19495@octofox.metropolis \
    --to=jcmvbkbc@gmail.com \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=tklauser@distanz.ch \
    /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).