[PATCH] eepro100.c alignment

From: Yves Rutschle
Date: Tue Mar 16 2004 - 06:42:50 EST


Hi,

Two small changes to the eepro100 driver; the first one uses
the proper rx_align function instead of aligning by hand, so
one can change the alignment of packets consistently
throughout the driver in one place only.

The second is more questionable: rx_align in 2.6.4 seems to
deliberately align everything on half-words, at least on
ARM. Ideally I gues we'd want to detect the best alignment
value to use.

Cheers,
Y.
PS. CC me to answers, I'm not subscribed to lkml.


--- linux-2.6.2.orig/drivers/net/eepro100.c Wed Feb 4 03:44:04 2004
+++ linux-2.6.4/drivers/net/eepro100.c Mon Mar 15 15:46:37 2004
@@ -1828,7 +1857,7 @@ speedo_rx(struct net_device *dev)
if (pkt_len < rx_copybreak
&& (skb = dev_alloc_skb(pkt_len + 2)) != 0) {
skb->dev = dev;
- skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
+ rx_align(skb); /* Align IP on 16 byte boundaries */
/* 'skb_put()' points to the start of sk_buff data area. */
pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[entry],
sizeof(struct RxFD) + pkt_len, PCI_DMA_FROMDEVICE);


--- linux-2.6.2.orig/drivers/net/eepro100.c Wed Feb 4 03:44:04 2004
+++ linux-2.6.4/drivers/net/eepro100.c Mon Mar 15 15:46:37 2004
@@ -44,7 +44,7 @@ static int rxdmacount /* = 0 */;
#if defined(__ia64__) || defined(__alpha__) || defined(__sparc__) || defined(__mips__) || \
defined(__arm__)
/* align rx buffers to 2 bytes so that IP header is aligned */
-# define rx_align(skb) skb_reserve((skb), 2)
+# define rx_align(skb) skb_reserve((skb), 0)
# define RxFD_ALIGNMENT __attribute__ ((aligned (2), packed))
#else
# define rx_align(skb)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/