* [PATCH] eepro100.c alignment
@ 2004-03-16 11:41 Yves Rutschle
0 siblings, 0 replies; only message in thread
From: Yves Rutschle @ 2004-03-16 11:41 UTC (permalink / raw)
To: Andrey V. Savochkin; +Cc: linux-kernel
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-03-16 11:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-16 11:41 [PATCH] eepro100.c alignment Yves Rutschle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox