[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <09187038-06b1-82d2-1fda-1fea1c119a0a@gmail.com>
Date: Fri, 7 Apr 2017 06:05:00 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
netdev@...r.kernel.org
Subject: Re: [PATCH 05/12] ftgmac100: Pad small frames properly
On 04/06/2017 08:30 PM, Benjamin Herrenschmidt wrote:
> Rather than just transmitting garbage past the end of the small
> packet.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@...nel.crashing.org>
> ---
> drivers/net/ethernet/faraday/ftgmac100.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
> index 6c71726..3f2172f 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.c
> +++ b/drivers/net/ethernet/faraday/ftgmac100.c
> @@ -636,6 +636,13 @@ static int ftgmac100_hard_start_xmit(struct sk_buff *skb,
> struct ftgmac100_txdes *txdes;
> dma_addr_t map;
>
> + /* The HW doesn't pad small frames */
> + if (skb_padto(skb, ETH_ZLEN) < 0) {
> + netdev->stats.tx_dropped++;
> + return NETDEV_TX_OK;
> + }
You may want to use skb_put_padto() which also takes care of bumping
skb->len accordingly, in case that makes a difference for the ftgmac100
hardware.
--
Florian
Powered by blists - more mailing lists