netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging/octeon: Software should check the checksum of no tcp/udp packets
@ 2011-09-26  1:08 rongqing.li
  2011-09-26 19:50 ` David Daney
  0 siblings, 1 reply; 4+ messages in thread
From: rongqing.li @ 2011-09-26  1:08 UTC (permalink / raw)
  To: linux-mips, netdev; +Cc: ralf, david.daney

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging/octeon: Software should check the checksum of no tcp/udp packets
  2011-09-26  1:08 [PATCH] staging/octeon: Software should check the checksum of no tcp/udp packets rongqing.li
@ 2011-09-26 19:50 ` David Daney
  2011-09-27  0:51   ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: David Daney @ 2011-09-26 19:50 UTC (permalink / raw)
  To: rongqing.li, netdev, ralf, David Miller; +Cc: linux-mips, Greg KH

On 09/25/2011 06:08 PM, rongqing.li@windriver.com wrote:
> 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>

We found the same problem, but have not yet sent the patch to fix it.

This looks fine to me,

Acked-by: David Daney <david.daney@cavium.com>

I would let davem, Ralf and Greg KH fight over who gets to merge it.

David Daney

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging/octeon: Software should check the checksum of no tcp/udp packets
  2011-09-26 19:50 ` David Daney
@ 2011-09-27  0:51   ` Greg KH
  2011-09-27  2:01     ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2011-09-27  0:51 UTC (permalink / raw)
  To: David Daney; +Cc: rongqing.li, netdev, ralf, David Miller, linux-mips

On Mon, Sep 26, 2011 at 12:50:44PM -0700, David Daney wrote:
> On 09/25/2011 06:08 PM, rongqing.li@windriver.com wrote:
> >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>
> 
> We found the same problem, but have not yet sent the patch to fix it.
> 
> This looks fine to me,
> 
> Acked-by: David Daney <david.daney@cavium.com>
> 
> I would let davem, Ralf and Greg KH fight over who gets to merge it.

I'll let Ralf take it, unless he wants me to.

Ralf?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging/octeon: Software should check the checksum of no tcp/udp packets
  2011-09-27  0:51   ` Greg KH
@ 2011-09-27  2:01     ` Ralf Baechle
  0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2011-09-27  2:01 UTC (permalink / raw)
  To: Greg KH; +Cc: David Daney, rongqing.li, netdev, David Miller, linux-mips

On Mon, Sep 26, 2011 at 05:51:27PM -0700, Greg KH wrote:

> > This looks fine to me,
> > 
> > Acked-by: David Daney <david.daney@cavium.com>
> > 
> > I would let davem, Ralf and Greg KH fight over who gets to merge it.
> 
> I'll let Ralf take it, unless he wants me to.
> 
> Ralf?

Ok.  Yes, that seems the best solution.

  Ralf

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-27  2:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-26  1:08 [PATCH] staging/octeon: Software should check the checksum of no tcp/udp packets rongqing.li
2011-09-26 19:50 ` David Daney
2011-09-27  0:51   ` Greg KH
2011-09-27  2:01     ` Ralf Baechle

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).