aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-02-11 15:01:48 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-02-11 15:01:48 +0000
commited34e397132c301c5b6b33ccb7ecba1b25b0f3f3 (patch)
tree3d16b2d1efd7b7e866f9f8403e535d2bfbecd14e /target/linux/ar71xx/files/drivers
parentca74e862bc7e5966160de5664a1c3a0c5c8cd9cc (diff)
downloadmaster-187ad058-ed34e397132c301c5b6b33ccb7ecba1b25b0f3f3.tar.gz
master-187ad058-ed34e397132c301c5b6b33ccb7ecba1b25b0f3f3.tar.bz2
master-187ad058-ed34e397132c301c5b6b33ccb7ecba1b25b0f3f3.zip
ag71xx: optimize icache footprint of the receive poll function
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48691 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/drivers')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 6eafceef03..2f270c024f 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -995,15 +995,18 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
struct ag71xx_ring *ring = &ag->rx_ring;
int offset = ag71xx_buffer_offset(ag);
unsigned int pktlen_mask = ag->desc_pktlen_mask;
+ struct sk_buff_head queue;
+ struct sk_buff *skb;
int done = 0;
DBG("%s: rx packets, limit=%d, curr=%u, dirty=%u\n",
dev->name, limit, ring->curr, ring->dirty);
+ skb_queue_head_init(&queue);
+
while (done < limit) {
unsigned int i = ring->curr % ring->size;
struct ag71xx_desc *desc = ag71xx_ring_desc(ring, i);
- struct sk_buff *skb;
int pktlen;
int err = 0;
@@ -1044,8 +1047,7 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
} else {
skb->dev = dev;
skb->ip_summed = CHECKSUM_NONE;
- skb->protocol = eth_type_trans(skb, dev);
- netif_receive_skb(skb);
+ __skb_queue_tail(&queue, skb);
}
next:
@@ -1057,6 +1059,11 @@ next:
ag71xx_ring_rx_refill(ag);
+ while ((skb = __skb_dequeue(&queue)) != NULL) {
+ skb->protocol = eth_type_trans(skb, dev);
+ netif_receive_skb(skb);
+ }
+
DBG("%s: rx finish, curr=%u, dirty=%u, done=%d\n",
dev->name, ring->curr, ring->dirty, done);