Re: [PATCH net-next 3/3] r8169: support IPv6

From: David Woodhouse
Date: Fri Oct 02 2015 - 05:04:16 EST



> Support the IPv6 hw checksum for RTL8111C and later chips. Note
> that the hw has the limitation for the transport offset. The
> checksum must be calculated by sw, when the transport offset is
> out of the range which the hw accepts.


It would be better to implement this check in a .ndo_features_check
method, just clearing the appropriate CSUM/TSO features for the skbs for
which the hardware cannot cope. That way the stack fixes them up for you.


> + if (skb_shinfo(skb)->gso_size) {
> + netdev_features_t features = tp->dev->features;
> + struct sk_buff *segs, *nskb;
> +
> + features &= ~(NETIF_F_SG | NETIF_F_IPV6_CSUM | NETIF_F_TSO6);
> + segs = skb_gso_segment(skb, features);
> + if (IS_ERR(segs) || !segs)
> + goto drop;
> +
> + do {
> + nskb = segs;
> + segs = segs->next;
> + nskb->next = NULL;
> + rtl8169_start_xmit(nskb, tp->dev);
> + } while (segs);
> +
> + dev_kfree_skb(skb);

This loop in particular makes no attempt to avoid exceeding the available
space in your descriptor ring, and can drop packets and trigger the
warning at the start of your hard_start_xmit function.

--
dwmw2

--
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/