diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-01-09 03:06:37 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-01-09 03:06:37 +0000 |
commit | 4f5b45e3c27c0fca6ede7e70baaf397a33066ff3 (patch) | |
tree | 859e0afe374142885314be7c7aa54606aa27cb15 /target/linux/brcm47xx | |
parent | 5c886899ec2a8d16a791a616202ab9111921c5a0 (diff) | |
download | upstream-4f5b45e3c27c0fca6ede7e70baaf397a33066ff3.tar.gz upstream-4f5b45e3c27c0fca6ede7e70baaf397a33066ff3.tar.bz2 upstream-4f5b45e3c27c0fca6ede7e70baaf397a33066ff3.zip |
b44: fix misalignment and space-saving in rx packet handling (significant throughput and cpu load improvement)
SVN-Revision: 13946
Diffstat (limited to 'target/linux/brcm47xx')
-rw-r--r-- | target/linux/brcm47xx/patches-2.6.25/212-b44_alignment_fix.patch | 48 | ||||
-rw-r--r-- | target/linux/brcm47xx/patches-2.6.28/212-b44_alignment_fix.patch | 48 |
2 files changed, 96 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-2.6.25/212-b44_alignment_fix.patch b/target/linux/brcm47xx/patches-2.6.25/212-b44_alignment_fix.patch new file mode 100644 index 0000000000..d65c37e442 --- /dev/null +++ b/target/linux/brcm47xx/patches-2.6.25/212-b44_alignment_fix.patch @@ -0,0 +1,48 @@ +--- a/drivers/net/b44.c ++++ b/drivers/net/b44.c +@@ -73,8 +73,8 @@ + (BP)->tx_cons - (BP)->tx_prod - TX_RING_GAP(BP)) + #define NEXT_TX(N) (((N) + 1) & (B44_TX_RING_SIZE - 1)) + +-#define RX_PKT_OFFSET 30 +-#define RX_PKT_BUF_SZ (1536 + RX_PKT_OFFSET + 64) ++#define RX_PKT_OFFSET (RX_HEADER_LEN + 2) ++#define RX_PKT_BUF_SZ (1536 + RX_PKT_OFFSET) + + /* minimum number of free TX descriptors required to wake up TX process */ + #define B44_TX_WAKEUP_THRESH (B44_TX_RING_SIZE / 4) +@@ -682,7 +682,6 @@ static int b44_alloc_rx_skb(struct b44 * + } + + rh = (struct rx_header *) skb->data; +- skb_reserve(skb, RX_PKT_OFFSET); + + rh->len = 0; + rh->flags = 0; +@@ -693,13 +692,13 @@ static int b44_alloc_rx_skb(struct b44 * + if (src_map != NULL) + src_map->skb = NULL; + +- ctrl = (DESC_CTRL_LEN & (RX_PKT_BUF_SZ - RX_PKT_OFFSET)); ++ ctrl = (DESC_CTRL_LEN & RX_PKT_BUF_SZ); + if (dest_idx == (B44_RX_RING_SIZE - 1)) + ctrl |= DESC_CTRL_EOT; + + dp = &bp->rx_ring[dest_idx]; + dp->ctrl = cpu_to_le32(ctrl); +- dp->addr = cpu_to_le32((u32) mapping + RX_PKT_OFFSET + bp->dma_offset); ++ dp->addr = cpu_to_le32((u32) mapping + bp->dma_offset); + + if (bp->flags & B44_FLAG_RX_RING_HACK) + b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma, +@@ -809,8 +808,8 @@ static int b44_rx(struct b44 *bp, int bu + dma_unmap_single(bp->sdev->dma_dev, map, + skb_size, DMA_FROM_DEVICE); + /* Leave out rx_header */ +- skb_put(skb, len + RX_PKT_OFFSET); +- skb_pull(skb, RX_PKT_OFFSET); ++ skb_put(skb, len + RX_PKT_OFFSET); ++ skb_pull(skb, RX_PKT_OFFSET); + } else { + struct sk_buff *copy_skb; + diff --git a/target/linux/brcm47xx/patches-2.6.28/212-b44_alignment_fix.patch b/target/linux/brcm47xx/patches-2.6.28/212-b44_alignment_fix.patch new file mode 100644 index 0000000000..b5840f2966 --- /dev/null +++ b/target/linux/brcm47xx/patches-2.6.28/212-b44_alignment_fix.patch @@ -0,0 +1,48 @@ +--- a/drivers/net/b44.c ++++ b/drivers/net/b44.c +@@ -73,8 +73,8 @@ + (BP)->tx_cons - (BP)->tx_prod - TX_RING_GAP(BP)) + #define NEXT_TX(N) (((N) + 1) & (B44_TX_RING_SIZE - 1)) + +-#define RX_PKT_OFFSET 30 +-#define RX_PKT_BUF_SZ (1536 + RX_PKT_OFFSET + 64) ++#define RX_PKT_OFFSET (RX_HEADER_LEN + 2) ++#define RX_PKT_BUF_SZ (1536 + RX_PKT_OFFSET) + + /* minimum number of free TX descriptors required to wake up TX process */ + #define B44_TX_WAKEUP_THRESH (B44_TX_RING_SIZE / 4) +@@ -682,7 +682,6 @@ static int b44_alloc_rx_skb(struct b44 * + } + + rh = (struct rx_header *) skb->data; +- skb_reserve(skb, RX_PKT_OFFSET); + + rh->len = 0; + rh->flags = 0; +@@ -693,13 +692,13 @@ static int b44_alloc_rx_skb(struct b44 * + if (src_map != NULL) + src_map->skb = NULL; + +- ctrl = (DESC_CTRL_LEN & (RX_PKT_BUF_SZ - RX_PKT_OFFSET)); ++ ctrl = (DESC_CTRL_LEN & RX_PKT_BUF_SZ); + if (dest_idx == (B44_RX_RING_SIZE - 1)) + ctrl |= DESC_CTRL_EOT; + + dp = &bp->rx_ring[dest_idx]; + dp->ctrl = cpu_to_le32(ctrl); +- dp->addr = cpu_to_le32((u32) mapping + RX_PKT_OFFSET + bp->dma_offset); ++ dp->addr = cpu_to_le32((u32) mapping + bp->dma_offset); + + if (bp->flags & B44_FLAG_RX_RING_HACK) + b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma, +@@ -809,8 +808,8 @@ static int b44_rx(struct b44 *bp, int bu + ssb_dma_unmap_single(bp->sdev, map, + skb_size, DMA_FROM_DEVICE); + /* Leave out rx_header */ +- skb_put(skb, len + RX_PKT_OFFSET); +- skb_pull(skb, RX_PKT_OFFSET); ++ skb_put(skb, len + RX_PKT_OFFSET); ++ skb_pull(skb, RX_PKT_OFFSET); + } else { + struct sk_buff *copy_skb; + |