From: <rongqing.li@windriver.com>
To: <linux-mips@linux-mips.org>, <netdev@vger.kernel.org>
Cc: <ralf@linux-mips.org>, <david.daney@cavium.com>
Subject: [PATCH] staging/octeon: Software should check the checksum of no tcp/udp packets
Date: Mon, 26 Sep 2011 09:08:00 +0800 [thread overview]
Message-ID: <1316999280-11999-1-git-send-email-rongqing.li@windriver.com> (raw)
From: Roy.Li <rongqing.li@windriver.com>
Icmp packets with wrong checksum are never dropped since
skb->ip_summed is set to CHECKSUM_UNNECESSARY.
When icmp packets with wrong checksum pass through the octeon
net driver, the not_IP, IP_exc, L4_error hardware indicators
show no error. so the driver sets CHECKSUM_UNNECESSARY on
skb->ip_summed.
L4_error only works for TCP/UDP, not for ICMP.
Signed-off-by: Roy.Li <rongqing.li@windriver.com>
---
drivers/staging/octeon/ethernet-rx.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 1a7c19a..1747024 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -411,7 +411,8 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
skb->protocol = eth_type_trans(skb, dev);
skb->dev = dev;
- if (unlikely(work->word2.s.not_IP || work->word2.s.IP_exc || work->word2.s.L4_error))
+ if (unlikely(work->word2.s.not_IP || work->word2.s.IP_exc ||
+ work->word2.s.L4_error || !work->word2.s.tcp_or_udp))
skb->ip_summed = CHECKSUM_NONE;
else
skb->ip_summed = CHECKSUM_UNNECESSARY;
--
1.7.1
next reply other threads:[~2011-09-26 1:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-26 1:08 rongqing.li [this message]
2011-09-26 19:50 ` [PATCH] staging/octeon: Software should check the checksum of no tcp/udp packets David Daney
2011-09-27 0:51 ` Greg KH
2011-09-27 2:01 ` Ralf Baechle
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=1316999280-11999-1-git-send-email-rongqing.li@windriver.com \
--to=rongqing.li@windriver.com \
--cc=david.daney@cavium.com \
--cc=linux-mips@linux-mips.org \
--cc=netdev@vger.kernel.org \
--cc=ralf@linux-mips.org \
/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).