[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/20] net/tap: Allocating Large sized arrays to heap
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PULL 01/20] net/tap: Allocating Large sized arrays to heap |
Date: |
Mon, 23 May 2016 10:13:43 +0800 |
From: Zhou Jie <address@hidden>
net_init_tap has a huge stack usage of 8192 bytes approx.
Moving large arrays to heap to reduce stack usage.
Signed-off-by: Zhou Jie <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
net/tap.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/tap.c b/net/tap.c
index 740e8a2..49817c7 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -769,8 +769,8 @@ int net_init_tap(const NetClientOptions *opts, const char
*name,
return -1;
}
} else if (tap->has_fds) {
- char *fds[MAX_TAP_QUEUES];
- char *vhost_fds[MAX_TAP_QUEUES];
+ char **fds = g_new(char *, MAX_TAP_QUEUES);
+ char **vhost_fds = g_new(char *, MAX_TAP_QUEUES);
int nfds, nvhosts;
if (tap->has_ifname || tap->has_script || tap->has_downscript ||
@@ -818,6 +818,8 @@ int net_init_tap(const NetClientOptions *opts, const char
*name,
return -1;
}
}
+ g_free(fds);
+ g_free(vhost_fds);
} else if (tap->has_helper) {
if (tap->has_ifname || tap->has_script || tap->has_downscript ||
tap->has_vnet_hdr || tap->has_queues || tap->has_vhostfds) {
--
2.7.4
- [Qemu-devel] [PULL 00/20] Net patches, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 02/20] net: mipsnet: check packet length against buffer, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 01/20] net/tap: Allocating Large sized arrays to heap,
Jason Wang <=
- [Qemu-devel] [PULL 03/20] msix: make msix_clr_pending() visible for clients, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 05/20] pcie: Add support for PCIe CAP v1, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 04/20] pci: Introduce define for PM capability version 1.1, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 06/20] pcie: Introduce function for DSN capability creation, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 07/20] vmxnet3: Use generic function for DSN capability definition, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 08/20] net: Introduce Toeplitz hash calculator, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 09/20] net: Add macros for MAC address tracing, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 10/20] vmxnet3: Use common MAC address tracing macros, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 12/20] rtl8139: Move more TCP definitions to common header, Jason Wang, 2016/05/22
- [Qemu-devel] [PULL 14/20] vmxnet3: Use pci_dma_* API instead of cpu_physical_memory_*, Jason Wang, 2016/05/22