aboutsummaryrefslogtreecommitdiff
path: root/net/util.c
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2023-08-11 16:34:23 +0200
committerMichael S. Tsirkin <mst@redhat.com>2023-10-04 04:54:15 -0400
commit43d6376980d5567f2a6d00cfb30d10c0961671e6 (patch)
tree894ee07bbeba05676b153513f02426de97f64ca6 /net/util.c
parente213c45a042db2506b5e8f16293f1f1c5083a577 (diff)
downloadqemu-43d6376980d5567f2a6d00cfb30d10c0961671e6.zip
qemu-43d6376980d5567f2a6d00cfb30d10c0961671e6.tar.gz
qemu-43d6376980d5567f2a6d00cfb30d10c0961671e6.tar.bz2
virtio: don't zero out memory region cache for indirect descriptors
Lots of virtio functions that are on a hot path in data transmission are initializing indirect descriptor cache at the point of stack allocation. It's a 112 byte structure that is getting zeroed out on each call adding unnecessary overhead. It's going to be correctly initialized later via special init function. The only reason to actually initialize right away is the ability to safely destruct it. Replacing a designated initializer with a function to only initialize what is necessary. Removal of the unnecessary stack initializations improves throughput of virtio-net devices in terms of 64B packets per second by 6-14 % depending on the case. Tested with a proposed af-xdp network backend and a dpdk testpmd application in the guest, but should be beneficial for other virtio devices as well. Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Message-Id: <20230811143423.3258788-1-i.maximets@ovn.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'net/util.c')
0 files changed, 0 insertions, 0 deletions