* [PATCH 14/17] atl1 trivial endianness misannotations
@ 2007-03-14 9:20 Al Viro
2007-03-14 9:57 ` Jeff Garzik
2007-03-15 19:02 ` Chris Snook
0 siblings, 2 replies; 3+ messages in thread
From: Al Viro @ 2007-03-14 9:20 UTC (permalink / raw)
To: torvalds; +Cc: jgarzik, linux-kernel
NB: driver is choke-full of code that will break on big-endian; as long
as the hardware is onboard-only we can live with that, but sooner or
later that'll need fixing.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
drivers/net/atl1/atl1_main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 88d4f70..dee3638 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1328,7 +1328,7 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
cso = skb->h.raw - skb->data;
- css = (skb->h.raw + skb->csum) - skb->data;
+ css = (skb->h.raw + skb->csum_offset) - skb->data;
if (unlikely(cso & 0x1)) {
printk(KERN_DEBUG "%s: payload offset != even number\n",
atl1_driver_name);
@@ -1562,7 +1562,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
/* mss will be nonzero if we're doing segment offload (TSO/GSO) */
mss = skb_shinfo(skb)->gso_size;
if (mss) {
- if (skb->protocol == ntohs(ETH_P_IP)) {
+ if (skb->protocol == htons(ETH_P_IP)) {
proto_hdr_len = ((skb->h.raw - skb->data) +
(skb->h.th->doff << 2));
if (unlikely(proto_hdr_len > len)) {
--
1.5.0-rc2.GIT
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 14/17] atl1 trivial endianness misannotations
2007-03-14 9:20 [PATCH 14/17] atl1 trivial endianness misannotations Al Viro
@ 2007-03-14 9:57 ` Jeff Garzik
2007-03-15 19:02 ` Chris Snook
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2007-03-14 9:57 UTC (permalink / raw)
To: Al Viro; +Cc: torvalds, linux-kernel
Al Viro wrote:
> NB: driver is choke-full of code that will break on big-endian; as long
> as the hardware is onboard-only we can live with that, but sooner or
> later that'll need fixing.
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> drivers/net/atl1/atl1_main.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
ACK
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 14/17] atl1 trivial endianness misannotations
2007-03-14 9:20 [PATCH 14/17] atl1 trivial endianness misannotations Al Viro
2007-03-14 9:57 ` Jeff Garzik
@ 2007-03-15 19:02 ` Chris Snook
1 sibling, 0 replies; 3+ messages in thread
From: Chris Snook @ 2007-03-15 19:02 UTC (permalink / raw)
To: Al Viro; +Cc: torvalds, jgarzik, linux-kernel, Jay Cliburn
Al Viro wrote:
> NB: driver is choke-full of code that will break on big-endian; as long
> as the hardware is onboard-only we can live with that, but sooner or
> later that'll need fixing.
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> drivers/net/atl1/atl1_main.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
> index 88d4f70..dee3638 100644
> --- a/drivers/net/atl1/atl1_main.c
> +++ b/drivers/net/atl1/atl1_main.c
> @@ -1328,7 +1328,7 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
>
> if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
> cso = skb->h.raw - skb->data;
> - css = (skb->h.raw + skb->csum) - skb->data;
> + css = (skb->h.raw + skb->csum_offset) - skb->data;
> if (unlikely(cso & 0x1)) {
> printk(KERN_DEBUG "%s: payload offset != even number\n",
> atl1_driver_name);
This could certainly explain some checksumming problems we've seen.
> @@ -1562,7 +1562,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
> /* mss will be nonzero if we're doing segment offload (TSO/GSO) */
> mss = skb_shinfo(skb)->gso_size;
> if (mss) {
> - if (skb->protocol == ntohs(ETH_P_IP)) {
> + if (skb->protocol == htons(ETH_P_IP)) {
> proto_hdr_len = ((skb->h.raw - skb->data) +
> (skb->h.th->doff << 2));
> if (unlikely(proto_hdr_len > len)) {
ACK.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-03-15 19:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-14 9:20 [PATCH 14/17] atl1 trivial endianness misannotations Al Viro
2007-03-14 9:57 ` Jeff Garzik
2007-03-15 19:02 ` Chris Snook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox