[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <525D46F1.6060502@cogentembedded.com>
Date: Tue, 15 Oct 2013 17:45:21 +0400
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Sathya Perla <sathya.perla@...lex.com>
CC: netdev@...r.kernel.org
Subject: Re: [PATCH 2/2] be2net: drop non-tso frames longer than mtu
Hello.
On 15-10-2013 15:56, Sathya Perla wrote:
> From: Vasundhara Volam <vasundhara.volam@...lex.com>
> Pktgen can generate non-TSO frames of arbitrary length disregarding
> the MTU value of the physical interface. Drop such frames in the driver
> instead of sending them to HW as it cannot handle such frames.
> Signed-off-by: Vasundhara Volam <vasundhara.volam@...lex.com>
> Signed-off-by: Sathya Perla <sathya.perla@...lex.com>
> ---
> drivers/net/ethernet/emulex/benet/be_main.c | 9 +++++++--
> 1 files changed, 7 insertions(+), 2 deletions(-)
> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
> index 2c38cc4..76057b8 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -855,6 +855,13 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
> unsigned int eth_hdr_len;
> struct iphdr *ip;
>
> + /* Don't allow non-TSO packets longer than MTU */
> + eth_hdr_len = (ntohs(skb->protocol) == ETH_P_8021Q) ?
> + VLAN_ETH_HLEN : ETH_HLEN;
> + if (!skb_is_gso(skb) &&
> + (skb->len - eth_hdr_len) > adapter->netdev->mtu)
> + goto tx_drop;
This *goto* is indented one tab too much.
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists