]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.xen/xen-netback-nr-irqs
Corrected links and text on ids.cgi
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.xen / xen-netback-nr-irqs
1 From: jbeulich@novell.com
2 Subject: netback: reduce overhead of IRQ recording
3 Patch-mainline: obsolete
4
5 Since both NR_PIRQS and NR_DYNIRQS are no longer hardcoded, the
6 (memory) overhead of tracking which ones to send notifications to can
7 be pretty unbounded. Also, store the dynirq rather than the raw irq
8 to push up the limit where the type of notify_list needs to become
9 'int' rather than 'u16'.
10
11 --- head-2009-02-02.orig/drivers/xen/netback/interface.c 2009-02-02 09:40:43.000000000 +0100
12 +++ head-2009-02-02/drivers/xen/netback/interface.c 2009-02-02 10:20:51.000000000 +0100
13 @@ -280,6 +280,7 @@ int netif_map(netif_t *netif, unsigned l
14 netif->dev->name, netif);
15 if (err < 0)
16 goto err_hypervisor;
17 + BUG_ON(err < DYNIRQ_BASE || err >= DYNIRQ_BASE + NR_DYNIRQS);
18 netif->irq = err;
19 disable_irq(netif->irq);
20
21 --- head-2009-02-02.orig/drivers/xen/netback/netback.c 2008-12-23 09:35:35.000000000 +0100
22 +++ head-2009-02-02/drivers/xen/netback/netback.c 2008-12-23 09:35:42.000000000 +0100
23 @@ -580,8 +580,12 @@ static void net_rx_action(unsigned long
24 static mmu_update_t rx_mmu[NET_RX_RING_SIZE];
25 static gnttab_transfer_t grant_trans_op[NET_RX_RING_SIZE];
26 static gnttab_copy_t grant_copy_op[NET_RX_RING_SIZE];
27 - static unsigned char rx_notify[NR_IRQS];
28 + static DECLARE_BITMAP(rx_notify, NR_DYNIRQS);
29 +#if NR_DYNIRQS <= 0x10000
30 static u16 notify_list[NET_RX_RING_SIZE];
31 +#else
32 + static int notify_list[NET_RX_RING_SIZE];
33 +#endif
34 static struct netbk_rx_meta meta[NET_RX_RING_SIZE];
35
36 struct netrx_pending_operations npo = {
37 @@ -730,11 +734,9 @@ static void net_rx_action(unsigned long
38 nr_frags);
39
40 RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&netif->rx, ret);
41 - irq = netif->irq;
42 - if (ret && !rx_notify[irq]) {
43 - rx_notify[irq] = 1;
44 + irq = netif->irq - DYNIRQ_BASE;
45 + if (ret && !__test_and_set_bit(irq, rx_notify))
46 notify_list[notify_nr++] = irq;
47 - }
48
49 if (netif_queue_stopped(netif->dev) &&
50 netif_schedulable(netif) &&
51 @@ -748,8 +750,8 @@ static void net_rx_action(unsigned long
52
53 while (notify_nr != 0) {
54 irq = notify_list[--notify_nr];
55 - rx_notify[irq] = 0;
56 - notify_remote_via_irq(irq);
57 + __clear_bit(irq, rx_notify);
58 + notify_remote_via_irq(irq + DYNIRQ_BASE);
59 }
60
61 /* More work to do? */