Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e9f63f30863fd778a5329e93c7e2208b9bcb5b79
Commit:     e9f63f30863fd778a5329e93c7e2208b9bcb5b79
Parent:     275391a482c436282dde57beeffc5d61b229fdd2
Author:     Francois Romieu <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 28 23:16:57 2007 +0100
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Sun Jul 8 22:16:44 2007 -0400

    r8169: align the IP header when there is no DMA constraint
    
    Align the IP header when the chipset can DMA at any location (plain 0x8169).
    Otherwise (0x8136/0x8168) obey the constraint imposed by the hardware.
    
    This patch complements the previous alignment rework done for copybreak.
    
    Original idea from Philip Craig <[EMAIL PROTECTED]>
    
    Signed-off-by: Francois Romieu <[EMAIL PROTECTED]>
    Cc: Philip Craig <[EMAIL PROTECTED]>
    Cc: Mike Isely <[EMAIL PROTECTED]>
    Cc: Edward Hsu <[EMAIL PROTECTED]>
---
 drivers/net/r8169.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index d8862cd..1942bf7 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1415,7 +1415,7 @@ static const struct rtl_cfg_info {
        [RTL_CFG_0] = {
                .hw_start       = rtl_hw_start_8169,
                .region         = 1,
-               .align          = 2,
+               .align          = 0,
                .intr_event     = SYSErr | LinkChg | RxOverflow |
                                  RxFIFOOver | TxErr | TxOK | RxOK | RxErr,
                .napi_event     = RxFIFOOver | TxErr | TxOK | RxOK | RxOverflow
@@ -2076,12 +2076,15 @@ static struct sk_buff *rtl8169_alloc_rx_skb(struct 
pci_dev *pdev,
 {
        struct sk_buff *skb;
        dma_addr_t mapping;
+       unsigned int pad;
 
-       skb = netdev_alloc_skb(dev, rx_buf_sz + align);
+       pad = align ? align : NET_IP_ALIGN;
+
+       skb = netdev_alloc_skb(dev, rx_buf_sz + pad);
        if (!skb)
                goto err_out;
 
-       skb_reserve(skb, (align - 1) & (unsigned long)skb->data);
+       skb_reserve(skb, align ? ((pad - 1) & (unsigned long)skb->data) : pad);
 
        mapping = pci_map_single(pdev, skb->data, rx_buf_sz,
                                 PCI_DMA_FROMDEVICE);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to