-From: Felix Fietkau <nbd@openwrt.org>
+From: Felix Fietkau <nbd@nbd.name>
Date: Sun, 12 Apr 2015 10:13:28 +0200
Subject: [PATCH] bgmac: set received skb headroom to NET_SKB_PAD
A packet buffer offset of 30 bytes is inefficient, because the first 2
bytes end up in a different cacheline.
-Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
-@@ -342,13 +342,13 @@ static int bgmac_dma_rx_skb_for_slot(str
+@@ -346,13 +346,13 @@ static int bgmac_dma_rx_skb_for_slot(str
return -ENOMEM;
/* Poison - if everything goes fine, hardware will overwrite it */
if (dma_mapping_error(dma_dev, dma_addr)) {
bgmac_err(bgmac, "DMA mapping error\n");
put_page(virt_to_head_page(buf));
-@@ -399,7 +399,7 @@ static int bgmac_dma_rx_read(struct bgma
+@@ -403,7 +403,7 @@ static int bgmac_dma_rx_read(struct bgma
while (ring->start != ring->end) {
struct device *dma_dev = bgmac->core->dma_dev;
struct bgmac_slot_info *slot = &ring->slots[ring->start];
struct sk_buff *skb;
void *buf = slot->buf;
u16 len, flags;
-@@ -450,8 +450,10 @@ static int bgmac_dma_rx_read(struct bgma
+@@ -454,8 +454,10 @@ static int bgmac_dma_rx_read(struct bgma
BGMAC_RX_BUF_SIZE, DMA_FROM_DEVICE);
skb = build_skb(buf, BGMAC_RX_ALLOC_SIZE);