OSDN Git Service

netdevsim: Add multi-queue support
authorPeilin Ye <peilin.ye@bytedance.com>
Fri, 16 Jul 2021 01:52:45 +0000 (18:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jul 2021 18:17:56 +0000 (11:17 -0700)
commitd4861fc6be581561d6964700110a4dede54da6a6
tree3f41458f5188057c4dfec1ce51655a2527aadb94
parentb83d23a2a38b1770da0491257ae81d52307f7816
netdevsim: Add multi-queue support

Currently netdevsim only supports a single queue per port, which is
insufficient for testing multi-queue TC schedulers e.g. sch_mq.  Extend
the current sysfs interface so that users can create ports with multiple
queues:

$ echo "[ID] [PORT_COUNT] [NUM_QUEUES]" > /sys/bus/netdevsim/new_device

As an example, echoing "2 4 8" creates 4 ports, with 8 queues per port.
Note, this is compatible with the current interface, with default number
of queues set to 1.  For example, echoing "2 4" creates 4 ports with 1
queue per port; echoing "2" simply creates 1 port with 1 queue.

Reviewed-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/bus.c
drivers/net/netdevsim/netdev.c
drivers/net/netdevsim/netdevsim.h