From: Yves Rutschle <y.rutschle@indigovision.com>
To: "Andrey V. Savochkin" <saw@saw.sw.com.sg>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] eepro100.c alignment
Date: Tue, 16 Mar 2004 11:41:10 +0000 [thread overview]
Message-ID: <20040316114110.GA32157@localhost> (raw)
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)
reply other threads:[~2004-03-16 11:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040316114110.GA32157@localhost \
--to=y.rutschle@indigovision.com \
--cc=linux-kernel@vger.kernel.org \
--cc=saw@saw.sw.com.sg \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox