netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Woodhouse" <dwmw2@infradead.org>
To: "Hayes Wang" <hayeswang@realtek.com>
Cc: romieu@fr.zoreil.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, nic_swsd@realtek.com
Subject: Re: [PATCH net-next 3/3] r8169: support IPv6
Date: Fri, 2 Oct 2015 08:41:49 -0000	[thread overview]
Message-ID: <68ac55cb202df8b295c27d251ab8e6fe.squirrel@twosheds.infradead.org> (raw)
In-Reply-To: <1394712342-15778-13-Taiwan-albertk@realtek.com>


> 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

  reply	other threads:[~2015-10-02  8:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11  8:25 [PATCH net-next 0/3] r8169: support IPv6 Hayes Wang
2014-07-11  8:25 ` [PATCH net-next 1/3] r8169: split rtl8169_tso_csum Hayes Wang
2014-07-11  8:25 ` [PATCH net-next 2/3] r8169: use Giant Send Hayes Wang
2014-07-11  8:25 ` [PATCH net-next 3/3] r8169: support IPv6 Hayes Wang
2015-10-02  8:41   ` David Woodhouse [this message]
2014-07-11 21:33 ` [PATCH net-next 0/3] " 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=68ac55cb202df8b295c27d251ab8e6fe.squirrel@twosheds.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=romieu@fr.zoreil.com \
    /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).