Skip to content

virtio-net: support dynamic coalescing moderation

Heng Qi netdev virtualization 8 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest4 patches 0 repliesApplied 4/4
  2. v74 patches 2 repliesSuperseded
  3. v65 patches 8 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v54 patches5 repliesSuperseded
v44 patches5 repliesSuperseded
v35 patches2 repliesSuperseded
v25 patches5 repliesSuperseded
v15 patches28 repliesSuperseded

Changes in v8 from the cover letter

- Add select DIMLIB.

Patches in v8 All 4 applied

#Subject and filesSizeRepliesApplied
1/4virtio-net: returns whether napi is completedrivers/net/virtio_net.c+5 -10 repliesApplied
2/4virtio-net: separate rx/tx coalescing moderation cmdsdrivers/net/virtio_net.c+28 -30 repliesApplied
3/4virtio-net: extract virtqueue coalescig cmd for reusedrivers/net/virtio_net.c+64 -420 repliesApplied
4/4virtio-net: support rx netdimdrivers/net/Kconfig drivers/net/virtio_net.c+163 -140 repliesApplied

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchJason Wang
1/4A-b
2/4A-b
3/4A-b
4/4

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

Read the v8 thread

Cover letter [PATCH net-next v8 0/4] virtio-net: support dynamic coalescing moderation

Now, virtio-net already supports per-queue moderation parameter setting. Based on this, we use the linux dimlib to support dynamic coalescing moderation for virtio-net.

Due to some scheduling issues, we only support and test the rx dim.

Some test results:

I. Sockperf UDP
=================================================
1. Env
rxq_0 with affinity to cpu_0.

2. Cmd
client: taskset -c 0 sockperf tp -p 8989 -i $IP -t 10 -m 16B
server: taskset -c 0 sockperf sr -p 8989

3. Result

dim off: 1143277.00 rxpps, throughput 17.844 MBps, cpu is 100%.
dim on:  1124161.00 rxpps, throughput 17.610 MBps, cpu is 83.5%.

=================================================

II. Redis
=================================================
1. Env
There are 8 rxqs, and rxq_i with affinity to cpu_i.

2. Result
When all cpus are 100%, ops/sec of memtier_benchmark client is

dim off:  978437.23
dim on:  1143638.28

=================================================

III. Nginx
=================================================
1. Env
There are 8 rxqs and rxq_i with affinity to cpu_i.

2. Result
When all cpus are 100%, requests/sec of wrk client is

dim off:  877931.67
dim on:  1019160.31

=================================================

IV. Latency of sockperf udp
=================================================
1. Rx cmd
taskset -c 0 sockperf sr -p 8989

2. Tx cmd
taskset -c 0 sockperf pp -i ${ip} -p 8989 -t 10

After running this cmd 5 times and averaging the results,

3. Result

dim off: 17.7735 usec
dim on:  18.0110 usec

=================================================

Changelog:
v7->v8:
- Add select DIMLIB.

v6->v7:
- Drop the patch titled "spin lock for ctrl cmd access"
- Use rtnl_trylock to avoid the deadlock.

v5->v6:
- Add patch(4/5): spin lock for ctrl cmd access
- Patch(5/5):
- Use spin lock and cancel_work_sync to synchronize

v4->v5:
- Patch(4/4):
- Fix possible synchronization issues with cancel_work_sync.
- Reduce if/else nesting levels

v3->v4:
- Patch(5/5): drop.

v2->v3:
- Patch(4/5): some minor modifications.

v1->v2:
- Patch(2/5): a minor fix.
- Patch(4/5):
- improve the judgment of dim switch conditions.
- Cancel the work when vq reset.
- Patch(5/5): drop the tx dim implementation.

Heng Qi (4):
virtio-net: returns whether napi is complete
virtio-net: separate rx/tx coalescing moderation cmds
virtio-net: extract virtqueue coalescig cmd for reuse
virtio-net: support rx netdim

 drivers/net/Kconfig      |   1 +
 drivers/net/virtio_net.c | 297 ++++++++++++++++++++++++++++++++-------
 2 files changed, 249 insertions(+), 49 deletions(-)
Signature · 1 line
2.19.1.6.gb485710b