From: Jeremy Fitzhardinge <jeremy@goop•org>
To: Ian Campbell <ian.campbell@citrix•com>
Cc: netdev@vger•kernel.org, xen-devel@lists•xensource.com
Subject: Re: [PATCH] xen: netfront: Drop GSO SKBs which do not have csum_blank.
Date: Fri, 21 Jan 2011 16:58:58 -0800 [thread overview]
Message-ID: <4D3A2BD2.5030802@goop.org> (raw)
In-Reply-To: <1294233811-28123-1-git-send-email-ian.campbell@citrix.com>
On 01/05/2011 05:23 AM, Ian Campbell wrote:
> The Linux network stack expects all GSO SKBs to have ip_summed ==
> CHECKSUM_PARTIAL (which implies that the frame contains a partial
> checksum) and the Xen network ring protocol similarly expects an SKB
> which has GSO set to also have NETRX_csum_blank (which also implies a
> partial checksum). Therefore drop such frames on receive otherwise
> they will trigger the warning in skb_gso_segment.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix•com>
> Cc: Jeremy Fitzhardinge <jeremy@goop•org>
> Cc: xen-devel@lists•xensource.com
> Cc: netdev@vger•kernel.org
> ---
> drivers/net/xen-netfront.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index cdbeec9..8b8c480 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -836,6 +836,11 @@ static int handle_incoming_queue(struct net_device *dev,
> dev->stats.rx_errors++;
> continue;
> }
> + } else if (skb_is_gso(skb)) {
> + kfree_skb(skb);
> + packets_dropped++;
> + dev->stats.rx_errors++;
> + continue;
This looks redundant; why not something like:
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 47e6a71..c1b8f64 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -852,13 +852,12 @@ static int handle_incoming_queue(struct net_device *dev,
/* Ethernet work: Delayed to here as it peeks the header. */
skb->protocol = eth_type_trans(skb, dev);
- if (skb->ip_summed == CHECKSUM_PARTIAL) {
- if (skb_checksum_setup(skb)) {
- kfree_skb(skb);
- packets_dropped++;
- dev->stats.rx_errors++;
- continue;
- }
+ if (skb->ip_summed != CHECKSUM_PARTIAL ||
+ skb_checksum_setup(skb)) {
+ kfree_skb(skb);
+ packets_dropped++;
+ dev->stats.rx_errors++;
+ continue;
}
dev->stats.rx_packets++;
Thanks,
J
next prev parent reply other threads:[~2011-01-22 0:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 13:23 [PATCH] xen: netfront: Drop GSO SKBs which do not have csum_blank Ian Campbell
2011-01-11 11:46 ` Ian Campbell
2011-01-22 0:58 ` Jeremy Fitzhardinge [this message]
2011-01-22 9:43 ` Ian Campbell
2011-01-24 17:55 ` Jeremy Fitzhardinge
2011-01-25 17:09 ` Ian Campbell
2011-01-25 17:09 ` [PATCH 1/2] xen: netfront: refactor code for checking validity of incoming skbs Ian Campbell
2011-01-25 17:10 ` [PATCH 2/2] xen: netfront: Drop GSO SKBs which do not have csum_blank Ian Campbell
2011-01-26 3:44 ` David Miller
2011-01-26 11:56 ` Ian Campbell
2011-01-27 14:14 ` [PATCH] xen: netfront: handle incoming GSO SKBs which are not CHECKSUM_PARTIAL Ian Campbell
2011-01-27 22:23 ` 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=4D3A2BD2.5030802@goop.org \
--to=jeremy@goop$(echo .)org \
--cc=ian.campbell@citrix$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=xen-devel@lists$(echo .)xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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