Skip to contentSkip to conversation

: e1000 endianness bugs

PATCH Applied David S. Miller 4 participants 5 messages Mar 15, 2006 – Mar 17, 2006

Subsystems (2)
lore
Share & tools
lore

David S. Miller

author maintainer
#0 lore raw

PATCH 1/1 : e1000 endianness bugs

	return -E_NO_BIG_ENDIAN_TESTING;

[E1000]: Fix 4 missed endianness conversions on RX descriptor fields.

drivers/net/e1000/e1000_main.c +4 -4
index 5b7d0f4..1d91117 100644
@@ -3710,7 +3710,7 @@ e1000_clean_rx_irq(struct e1000_adapter 
 		e1000_rx_checksum(adapter,
 				  (uint32_t)(status) |
 				  ((uint32_t)(rx_desc->errors) << 24),
-				  rx_desc->csum, skb);
+				  le16_to_cpu(rx_desc->csum), skb);
 
 		skb->protocol = eth_type_trans(skb, netdev);
 #ifdef CONFIG_E1000_NAPI
@@ -3854,11 +3854,11 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
 		}
 
 		e1000_rx_checksum(adapter, staterr,
-				  rx_desc->wb.lower.hi_dword.csum_ip.csum, skb);
+				  le16_to_cpu(rx_desc->wb.lower.hi_dword.csum_ip.csum), skb);
 		skb->protocol = eth_type_trans(skb, netdev);
 
 		if (likely(rx_desc->wb.upper.header_status &
-			  E1000_RXDPS_HDRSTAT_HDRSP))
+			   cpu_to_le16(E1000_RXDPS_HDRSTAT_HDRSP)))
 			adapter->rx_hdr_split++;
 #ifdef CONFIG_E1000_NAPI
 		if (unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) {
@@ -3884,7 +3884,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
 #endif
 
 next_desc:
-		rx_desc->wb.middle.status_error &= ~0xFF;
+		rx_desc->wb.middle.status_error &= cpu_to_le32(~0xFF);
 		buffer_info->skb = NULL;
 
 		/* return some buffers to hardware, one at a time is too slow */
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · David S. Miller
        return -E_NO_BIG_ENDIAN_TESTING;

[E1000]: Fix 4 missed endianness conversions on RX descriptor fields.

Yep, those look like bugs to me, thanks and congratulations, you're the first person to test our PCI Express adapters in a big endian system (they haven't been available before, and we don't have one, yet)

author maintainer
#2 lore raw

From: "Jesse Brandeburg" <[email protected]>
Date: Wed, 15 Mar 2006 15:33:43 -0800

Quoted 4 lines

Yep, those look like bugs to me, thanks and congratulations, you're the first person to test our PCI Express adapters in a big endian system (they haven't been available before, and we don't have one, yet)

It was onboard a Niagara T2000 system.

#3 lore raw
In reply to David S. Miller
Quoted 4 lines · David S. Miller
	return -E_NO_BIG_ENDIAN_TESTING;

[E1000]: Fix 4 missed endianness conversions on RX descriptor fields.

Could the e1000 maintainers please add endianess annotations so that sparse will catch such things in the future?