* [PATCH] forcedeth: fix checksum flag
@ 2008-08-14 22:49 Ayaz Abdulla
2008-08-18 21:54 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Ayaz Abdulla @ 2008-08-14 22:49 UTC (permalink / raw)
To: Jeff Garzik, Manfred Spraul, Andrew Morton, nedev
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
This patch fixes the checksum feature advertised in device flags. The
hardware support TCP/UDP over IPv4 and TCP/UDP over IPv6 (without IPv6
extension headers). However, the kernel feature flags do not distinguish
IPv6 with/without extension headers.
Therefore, the driver needs to use NETIF_F_IP_CSUM instead of
NETIF_F_HW_CSUM since the latter includes all IPv6 packets.
A future patch can created to check for extension headers and perform
software checksum calculation.
Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
[-- Attachment #2: patch-forcedeth-ipv4csum --]
[-- Type: text/plain, Size: 779 bytes --]
--- old/drivers/net/forcedeth.c 2008-08-14 18:37:11.000000000 -0400
+++ new/drivers/net/forcedeth.c 2008-08-14 18:37:05.000000000 -0400
@@ -5522,7 +5522,7 @@
if (id->driver_data & DEV_HAS_CHECKSUM) {
np->rx_csum = 1;
np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK;
- dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;
+ dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
dev->features |= NETIF_F_TSO;
}
@@ -5835,7 +5835,7 @@
dev_printk(KERN_INFO, &pci_dev->dev, "%s%s%s%s%s%s%s%s%s%sdesc-v%u\n",
dev->features & NETIF_F_HIGHDMA ? "highdma " : "",
- dev->features & (NETIF_F_HW_CSUM | NETIF_F_SG) ?
+ dev->features & (NETIF_F_IP_CSUM | NETIF_F_SG) ?
"csum " : "",
dev->features & (NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX) ?
"vlan " : "",
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] forcedeth: fix checksum flag
2008-08-14 22:49 [PATCH] forcedeth: fix checksum flag Ayaz Abdulla
@ 2008-08-18 21:54 ` Andrew Morton
2008-08-19 12:58 ` Herbert Xu
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2008-08-18 21:54 UTC (permalink / raw)
To: Ayaz Abdulla; +Cc: jgarzik, manfred, netdev
On Thu, 14 Aug 2008 18:49:09 -0400
Ayaz Abdulla <aabdulla@nvidia.com> wrote:
> This patch fixes the checksum feature advertised in device flags. The
> hardware support TCP/UDP over IPv4 and TCP/UDP over IPv6 (without IPv6
> extension headers). However, the kernel feature flags do not distinguish
> IPv6 with/without extension headers.
>
> Therefore, the driver needs to use NETIF_F_IP_CSUM instead of
> NETIF_F_HW_CSUM since the latter includes all IPv6 packets.
>
> A future patch can created to check for extension headers and perform
> software checksum calculation.
>
> Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
>
>
> [patch-forcedeth-ipv4csum text/plain (780B)]
> --- old/drivers/net/forcedeth.c 2008-08-14 18:37:11.000000000 -0400
> +++ new/drivers/net/forcedeth.c 2008-08-14 18:37:05.000000000 -0400
> @@ -5522,7 +5522,7 @@
> if (id->driver_data & DEV_HAS_CHECKSUM) {
> np->rx_csum = 1;
> np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK;
> - dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;
> + dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
> dev->features |= NETIF_F_TSO;
> }
>
> @@ -5835,7 +5835,7 @@
>
> dev_printk(KERN_INFO, &pci_dev->dev, "%s%s%s%s%s%s%s%s%s%sdesc-v%u\n",
> dev->features & NETIF_F_HIGHDMA ? "highdma " : "",
> - dev->features & (NETIF_F_HW_CSUM | NETIF_F_SG) ?
> + dev->features & (NETIF_F_IP_CSUM | NETIF_F_SG) ?
> "csum " : "",
> dev->features & (NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX) ?
> "vlan " : "",
>
Is this fix needed in 2.6.25.x and 2.6.26.x?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] forcedeth: fix checksum flag
2008-08-18 21:54 ` Andrew Morton
@ 2008-08-19 12:58 ` Herbert Xu
0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2008-08-19 12:58 UTC (permalink / raw)
To: Andrew Morton; +Cc: aabdulla, jgarzik, manfred, netdev
Andrew Morton <akpm@linux-foundation.org> wrote:
>
>> --- old/drivers/net/forcedeth.c 2008-08-14 18:37:11.000000000 -0400
>> +++ new/drivers/net/forcedeth.c 2008-08-14 18:37:05.000000000 -0400
>> @@ -5522,7 +5522,7 @@
>> if (id->driver_data & DEV_HAS_CHECKSUM) {
>> np->rx_csum = 1;
>> np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK;
>> - dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;
>> + dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
>> dev->features |= NETIF_F_TSO;
>> }
>>
>> @@ -5835,7 +5835,7 @@
>>
>> dev_printk(KERN_INFO, &pci_dev->dev, "%s%s%s%s%s%s%s%s%s%sdesc-v%u\n",
>> dev->features & NETIF_F_HIGHDMA ? "highdma " : "",
>> - dev->features & (NETIF_F_HW_CSUM | NETIF_F_SG) ?
>> + dev->features & (NETIF_F_IP_CSUM | NETIF_F_SG) ?
>> "csum " : "",
>> dev->features & (NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX) ?
>> "vlan " : "",
>
> Is this fix needed in 2.6.25.x and 2.6.26.x?
Yep it's needed for all kernels.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-19 12:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-14 22:49 [PATCH] forcedeth: fix checksum flag Ayaz Abdulla
2008-08-18 21:54 ` Andrew Morton
2008-08-19 12:58 ` Herbert Xu
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).