Skip to content

RFC increase the limit of tuntap queues

Jason Wang lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: avoid high order memory allocation for queues by using flex arrayinclude/linux/netdevice.h net/core/dev.c net/core/net-sysfs.c+58 -2718 replies
2/3tuntap: reduce the size of tun_struct by using flex arraydrivers/net/tun.c net/openvswitch/flow.c+43 -130 replies
3/3tuntap: increase the max queues to 16drivers/net/tun.c+1 -43 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchMichael S. Tsirkin
1/3A-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [net-next rfc 0/3] increase the limit of tuntap queues

Hi all:

This series tries to increase the limit of tuntap queues. Histrocially there're two reasons which prevent us from doing this:

- We store the hash buckets in tun_struct which results a very large size of tun_struct, this high order memory allocation fail easily when the memory were fragmented.
- The netdev_queue and netdev_rx_queue array in netdevice were allocated through kmalloc, which may cause a high order memory allocation too when we have several queues. E.g. sizeof(netdev_queue) is 320, which means a high order allocation will happens when the device has more than 12 queues.

So this series tries to address those issues by switching to use flex array. All entries were preallocated, and since flex array always do a order-0 allocation, we can safely increase the limit after.

Only compile test, comments or review are more than welcomed.

Jason Wang (3):
net: avoid high order memory allocation for queues by using flex
array
tuntap: reduce the size of tun_struct by using flex array
tuntap: increase the max queues to 16

 drivers/net/tun.c         |   59 ++++++++++++++++++++++++++++++++------------
 include/linux/netdevice.h |   13 ++++++----
 net/core/dev.c            |   57 +++++++++++++++++++++++++++++++------------
 net/core/net-sysfs.c      |   15 +++++++----
 net/openvswitch/flow.c    |    2 +-
 5 files changed, 102 insertions(+), 44 deletions(-)