Skip to contentSkip to conversation

skge: bad checksums on big-endian platforms

PATCH New Stephen Hemminger 1 participant 2 messages May 15, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 skge: bad checksums on big-endian platforms

Skge driver always causes bad checksums on big-endian. The checksum in the receive control block was being swapped when it doesn't need to be.

drivers/net/skge.c +1 -2
@@ -2717,8 +2717,7 @@ static int skge_poll(struct net_device *
 		if (control & BMU_OWN)
 			break;
 
-		skb = skge_rx_get(skge, e, control, rd->status,
-				  le16_to_cpu(rd->csum2));
+		skb = skge_rx_get(skge, e, control, rd->status, rd->csum2);
 		if (likely(skb)) {
 			dev->last_rx = jiffies;
 			netif_receive_skb(skb);
#1 lore raw

PATCH 2/2 skge: don't allow transmit ring to be too small

The driver will get stuck (permanent transmit timeout), if the transmit ring size is set too small. It needs to have enough ring elements to hold one maximum size transmit.

drivers/net/skge.c +1 -1
@@ -402,7 +402,7 @@ static int skge_set_ring_param(struct ne
 	int err;
 
 	if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE ||
-	    p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE)
+	    p->tx_pending < MAX_SKB_FRAGS+1 || p->tx_pending > MAX_TX_RING_SIZE)
 		return -EINVAL;
 
 	skge->rx_ring.count = p->rx_pending;