Re: [PATCH net] r8152: drop the tx packet with invalid length

From: Eric Dumazet
Date: Fri Dec 19 2014 - 12:36:51 EST


On Fri, 2014-12-19 at 06:42 +0000, Hayes Wang wrote:

> Excuse me. I try to implement ndo_gso_check() with kernel 3.18.
> However, I still get packets with gso and their skb lengths are more
> than the acceptable one. Do I miss something?
>
> +static bool rtl8152_gso_check(struct sk_buff *skb, struct net_device *dev)
> +{
> + if ((skb->len + sizeof(struct tx_desc)) > agg_buf_sz)
> + return false;
> +
> + return true;
> +}
>
> @@ -5861,6 +5876,9 @@ static const struct net_device_ops rtl8152_netdev_ops = {
> .ndo_set_mac_address = rtl8152_set_mac_address,
> .ndo_change_mtu = rtl8152_change_mtu,
> .ndo_validate_addr = eth_validate_addr,
> + .ndo_gso_check = rtl8152_gso_check,
> };

You are right, it seems ndo_gso_check() is buggy at this moment.

Presumably this method should alter %features so that we really segment
the packets in software.

features &= ~NETIF_F_GSO_MASK;



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/