From: Simon Kagstrom <simon.kagstrom@netinsight.net>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, davej@redhat.com, shemminger@vyatta.com,
romieu@fr.zoreil.com
Subject: [PATCH v4 1/7] via-velocity: Correct 64-byte alignment for rx buffers
Date: Thu, 26 Nov 2009 09:09:53 +0100 [thread overview]
Message-ID: <20091126090953.2d783d06@marrow.netinsight.se> (raw)
In-Reply-To: <20091126090429.39cb37ac@marrow.netinsight.se>
(From the VIA driver). The current code does not guarantee 64-byte
alignment since it simply does
int add = skb->data & 63;
skb->data += add;
(via skb_reserve). So for example, if the skb->data address would be
0x10, this would result in 32-byte alignment (0x10 + 0x10).
Correct by adding
64 - (skb->data & 63)
instead.
Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
drivers/net/via-velocity.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index e04e5be..b6cf3b5 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -1483,7 +1483,8 @@ static int velocity_alloc_rx_buf(struct velocity_info *vptr, int idx)
* Do the gymnastics to get the buffer head for data at
* 64byte alignment.
*/
- skb_reserve(rd_info->skb, (unsigned long) rd_info->skb->data & 63);
+ skb_reserve(rd_info->skb,
+ 64 - ((unsigned long) rd_info->skb->data & 63));
rd_info->skb_dma = pci_map_single(vptr->pdev, rd_info->skb->data,
vptr->rx.buf_sz, PCI_DMA_FROMDEVICE);
--
1.6.0.4
next prev parent reply other threads:[~2009-11-26 8:09 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-20 15:06 [PATCH 0/7] via-velocity performance fixes Simon Kagstrom
2009-11-20 15:12 ` [PATCH 1/7] via-velocity: Correct setting of skipped checksums Simon Kagstrom
2009-11-20 17:36 ` David Miller
2009-11-20 15:12 ` [PATCH 2/7] via-velocity: Correct 64-byte alignment for rx buffers Simon Kagstrom
2009-11-20 15:12 ` [PATCH 3/7] via-velocity: Enable support for adaptive interrupt supression Simon Kagstrom
2009-11-20 17:05 ` Stephen Hemminger
2009-11-20 17:47 ` David Miller
2009-11-20 15:12 ` [PATCH 4/7] via-velocity: Implement NAPI support Simon Kagstrom
2009-11-20 17:35 ` David Miller
2009-11-20 15:12 ` [PATCH 5/7] via-velocity: Change DMA_LENGTH_DEF (from the VIA driver) Simon Kagstrom
2009-11-20 15:12 ` [PATCH 6/7] via-velocity: Re-enable the transmit scatter-gather support Simon Kagstrom
2009-11-20 15:12 ` [PATCH 7/7] via-velocity: Bump version Simon Kagstrom
2009-11-20 17:03 ` [PATCH 0/7] via-velocity performance fixes Stephen Hemminger
2009-11-23 13:39 ` Simon Kagstrom
2009-11-23 16:27 ` Stephen Hemminger
2009-11-23 14:27 ` [PATCH v2 " Simon Kagstrom
2009-11-23 14:30 ` [PATCH v2 1/7] via-velocity: Correct 64-byte alignment for rx buffers Simon Kagstrom
2009-11-23 14:31 ` [PATCH v2 2/7] via-velocity: Add ethtool interrupt coalescing support Simon Kagstrom
2009-11-23 14:31 ` [PATCH v2 3/7] via-velocity: Implement NAPI support Simon Kagstrom
2009-11-23 14:31 ` [PATCH v2 4/7] via-velocity: Change DMA_LENGTH_DEF (from the VIA driver) Simon Kagstrom
2009-11-23 14:31 ` [PATCH v2 5/7] via-velocity: Re-enable transmit scatter-gather support Simon Kagstrom
2009-11-23 18:52 ` David Miller
2009-11-25 8:22 ` [PATCH v3 " Simon Kagstrom
2009-11-25 23:37 ` David Miller
2009-11-26 7:36 ` Simon Kagstrom
2009-11-26 21:09 ` David Miller
2009-11-23 14:31 ` [PATCH v2 6/7] via-velocity: Set tx checksum from ethtool instead of module parameter Simon Kagstrom
2009-11-23 14:31 ` [PATCH v2 7/7] via-velocity: Bump version Simon Kagstrom
2009-11-24 20:13 ` [PATCH v2 0/7] via-velocity performance fixes David Miller
2009-11-25 7:39 ` Simon Kagstrom
2009-11-25 20:18 ` David Miller
2009-11-26 8:04 ` [PATCH v4 " Simon Kagstrom
2009-11-26 8:09 ` Simon Kagstrom [this message]
2009-11-26 8:10 ` [PATCH v4 2/7] via-velocity: Add ethtool interrupt coalescing support Simon Kagstrom
2009-11-26 8:10 ` [PATCH v4 3/7] via-velocity: Implement NAPI support Simon Kagstrom
2009-11-26 8:10 ` [PATCH v4 4/7] via-velocity: Change DMA_LENGTH_DEF (from the VIA driver) Simon Kagstrom
2009-11-26 8:10 ` [PATCH v4 5/7] via-velocity: Re-enable transmit scatter-gather support Simon Kagstrom
2009-11-26 8:10 ` [PATCH v4 6/7] via-velocity: Set tx checksum from ethtool instead of module parameter Simon Kagstrom
2009-11-26 8:10 ` [PATCH v4 7/7] via-velocity: Bump version Simon Kagstrom
2009-11-26 23:52 ` [PATCH v4 0/7] via-velocity performance fixes David Miller
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=20091126090953.2d783d06@marrow.netinsight.se \
--to=simon.kagstrom@netinsight.net \
--cc=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.com \
--cc=shemminger@vyatta.com \
/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;
as well as URLs for NNTP newsgroup(s).