]>
Commit | Line | Data |
---|---|---|
cc90b958 BS |
1 | From: jbeulich@novell.com |
2 | Subject: allow number of guest devices to be configurable | |
3 | Patch-mainline: obsolete | |
4 | ||
5 | ... and derive NR_DYNIRQS from this (rather than having a hard-coded | |
6 | value). | |
7 | Similarly, allow the number of simultaneous transmits in netback to be | |
8 | configurable. | |
9 | ||
10 | --- | |
11 | drivers/xen/Kconfig | 19 +++++++++++++++++++ | |
12 | drivers/xen/netback/netback.c | 3 ++- | |
13 | include/asm-x86/mach-xen/asm/irq_vectors.h | 2 +- | |
14 | 3 files changed, 22 insertions(+), 2 deletions(-) | |
15 | ||
16 | --- a/drivers/xen/Kconfig | |
17 | +++ b/drivers/xen/Kconfig | |
18 | @@ -74,6 +74,15 @@ config XEN_NETDEV_BACKEND | |
19 | network devices to other guests via a high-performance shared-memory | |
20 | interface. | |
21 | ||
22 | +config XEN_NETDEV_TX_SHIFT | |
23 | + int "Maximum simultaneous transmit requests (as a power of 2)" | |
24 | + depends on XEN_NETDEV_BACKEND | |
25 | + range 5 16 | |
26 | + default 8 | |
27 | + help | |
28 | + The maximum number transmits the driver can hold pending, expressed | |
29 | + as the exponent of a power of 2. | |
30 | + | |
31 | config XEN_NETDEV_PIPELINED_TRANSMITTER | |
32 | bool "Pipelined transmitter (DANGEROUS)" | |
33 | depends on XEN_NETDEV_BACKEND | |
34 | @@ -255,6 +264,16 @@ config XEN_SYSFS | |
35 | help | |
36 | Xen hypervisor attributes will show up under /sys/hypervisor/. | |
37 | ||
38 | +config XEN_NR_GUEST_DEVICES | |
39 | + int "Number of guest devices" | |
40 | + range 0 4032 if 64BIT | |
41 | + range 0 960 | |
42 | + default 256 if XEN_BACKEND | |
43 | + default 16 | |
44 | + help | |
45 | + Specify the total number of virtual devices (i.e. both frontend | |
46 | + and backend) that you want the kernel to be able to service. | |
47 | + | |
48 | choice | |
49 | prompt "Xen version compatibility" | |
50 | default XEN_COMPAT_030002_AND_LATER | |
51 | --- a/drivers/xen/netback/netback.c | |
52 | +++ b/drivers/xen/netback/netback.c | |
53 | @@ -74,7 +74,7 @@ static DECLARE_TASKLET(net_rx_tasklet, n | |
54 | static struct timer_list net_timer; | |
55 | static struct timer_list netbk_tx_pending_timer; | |
56 | ||
57 | -#define MAX_PENDING_REQS 256 | |
58 | +#define MAX_PENDING_REQS (1U << CONFIG_XEN_NETDEV_TX_SHIFT) | |
59 | ||
60 | static struct sk_buff_head rx_queue; | |
61 | ||
62 | @@ -1196,6 +1196,7 @@ static void net_tx_action(unsigned long | |
63 | net_tx_action_dealloc(); | |
64 | ||
65 | mop = tx_map_ops; | |
66 | + BUILD_BUG_ON(MAX_SKB_FRAGS >= MAX_PENDING_REQS); | |
67 | while (((NR_PENDING_REQS + MAX_SKB_FRAGS) < MAX_PENDING_REQS) && | |
68 | !list_empty(&net_schedule_list)) { | |
69 | /* Get a netif from the list with work to do. */ | |
70 | --- a/include/asm-x86/mach-xen/asm/irq_vectors.h | |
71 | +++ b/include/asm-x86/mach-xen/asm/irq_vectors.h | |
72 | @@ -44,7 +44,7 @@ | |
73 | #endif | |
74 | ||
75 | #define DYNIRQ_BASE (PIRQ_BASE + NR_PIRQS) | |
76 | -#define NR_DYNIRQS 256 | |
77 | +#define NR_DYNIRQS (64 + CONFIG_XEN_NR_GUEST_DEVICES) | |
78 | ||
79 | #define NR_IRQS (NR_PIRQS + NR_DYNIRQS) | |
80 | #define NR_IRQ_VECTORS NR_IRQS |