diff options
author | Simon Kagstrom <simon.kagstrom@netinsight.net> | 2009-11-25 17:09:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-26 18:51:06 -0500 |
commit | da95b2d422b6eb2b76789bbdbfafb7e07c493e7a (patch) | |
tree | 7ca2d1d0115d34364a7bc8c7ad558d3c5246f7be /drivers | |
parent | 350f75960c8ba317935b4274c56c16412e085b08 (diff) |
via-velocity: Correct 64-byte alignment for rx buffers
(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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 1e6b395c555f..04d3836bfa5d 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1470,7 +1470,8 @@ static int velocity_alloc_rx_buf(struct velocity_info *vptr, int idx) | |||
1470 | * Do the gymnastics to get the buffer head for data at | 1470 | * Do the gymnastics to get the buffer head for data at |
1471 | * 64byte alignment. | 1471 | * 64byte alignment. |
1472 | */ | 1472 | */ |
1473 | skb_reserve(rd_info->skb, (unsigned long) rd_info->skb->data & 63); | 1473 | skb_reserve(rd_info->skb, |
1474 | 64 - ((unsigned long) rd_info->skb->data & 63)); | ||
1474 | rd_info->skb_dma = pci_map_single(vptr->pdev, rd_info->skb->data, | 1475 | rd_info->skb_dma = pci_map_single(vptr->pdev, rd_info->skb->data, |
1475 | vptr->rx.buf_sz, PCI_DMA_FROMDEVICE); | 1476 | vptr->rx.buf_sz, PCI_DMA_FROMDEVICE); |
1476 | 1477 | ||