On Sat, Nov 18, 2023 at 10:25:31AM -0800, Daniel Hoffman wrote:
> `kvm_enabled()` is compiled down to `0` and short-circuit logic is
> used to remmove references to undefined symbols at the compile stage.
> Some build configurations with some compilers don't attempt to
> simplify this logic down in
This conversion is pretty straight-forward. Standardized some formatting
so the +0 and +4 offset cases can recycle the same message.
Signed-off-by: Daniel Hoffman
---
hw/timer/hpet.c | 55 +--
hw/timer/trace-events | 16 +
2 files changed
`kvm_enabled()` is compiled down to `0` and short-circuit logic is
used to remmove references to undefined symbols at the compile stage.
Some build configurations with some compilers don't attempt to
simplify this logic down in some cases (the pattern appears to be
that the literal false must be th
On 17/11/23 20:31, Richard Henderson wrote:
Perform the loop increment unconditionally, not nested
within the predication.
Cc: qemu-sta...@nongnu.org
Fixes: 3916841ac75 ("target/arm: Implement FMOPA, FMOPS (widening)")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1985
Signed-off-by: R
This patch allows to display feature and status bits in
virtio-status.
Applications could find it helpful to compare status and features
that are numeric encoded. For example, an upper application could
use the features (encoded as a number) in the output of "ovs-vsctl
list interface" and the feat
When a vhost-user network device is restored from an unexpected
failure, the acked_features could be used as input for the
VHOST_USER_SET_FEATURES command because QEMU internally backups
the final features as acked_features after the guest acknowledges
features during virtio-net driver initializati
Markus made suggestions for the changes to version 2, and thanks
for that as well.
v2:
- rebase on master.
- drop the "show-bits" option.
- refine the comment.
v1:
The patchset "Fix the virtio features negotiation flaw" fix a
vhost-user negotiation flaw:
c9bdc449f9 vhost-user: Fix the virtio fe
Hi,
We are planning to add PCIe SR-IOV support to the virtio-net driver for
Windows ("NetKVM")[1], and we want a SR-IOV feature for virtio-net
emulation code in QEMU to test it. I expect there are other people
interested in such a feature, considering that people are using igb[2]
to test SR-I
From: Akihiko Odaki
This will save duplicate logic found in both of tap_receive_iov() and
tap_receive().
Suggested-by: "Zhang, Chen"
Signed-off-by: Akihiko Odaki
---
net/tap.c | 35 +--
1 file changed, 5 insertions(+), 30 deletions(-)
diff --git a/net/tap.c b/
This saves branches and makes later BPF program changes easier.
Signed-off-by: Akihiko Odaki
---
tools/ebpf/rss.bpf.c | 26 +++---
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/tools/ebpf/rss.bpf.c b/tools/ebpf/rss.bpf.c
index 22c75d5912..012af38df1 100644
-
tap prepends a zeroed virtio-net header when writing a packet to a
tap with virtio-net header enabled but not in use. This only happens
when s->host_vnet_hdr_len == sizeof(struct virtio_net_hdr).
Signed-off-by: Akihiko Odaki
---
net/tap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
di
This generalizes the rule to generate the skeleton and allows to add
another.
Signed-off-by: Akihiko Odaki
---
tools/ebpf/Makefile.ebpf | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/tools/ebpf/Makefile.ebpf b/tools/ebpf/Makefile.ebpf
index 3391e7ce08..572ca5
From: Akihiko Odaki
Warning about RSS fallback at device realization allows the user to
notice the configuration problem early.
Signed-off-by: Akihiko Odaki
---
hw/net/virtio-net.c | 24
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/hw/net/virtio-net.
The virtio-net header length assertion should happen for any clients.
Signed-off-by: Akihiko Odaki
---
net/net.c | 5 +
net/tap.c | 3 ---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/net.c b/net/net.c
index f603030dd6..2e7c3fcc2a 100644
--- a/net/net.c
+++ b/net/net.c
calculate_rss_hash() was using hash value 0 to tell if it calculated
a hash, but the hash value may be 0 on a rare occasion. Have a
distinct bool value for correctness.
Fixes: f3fa412de2 ("ebpf: Added eBPF RSS program.")
Signed-off-by: Akihiko Odaki
---
tools/ebpf/rss.bpf.c | 20 +++-
It makes easier to play with bpftool by allowing it to infer the program
type. It also makes it unnecessary to set the program type manually
when loading the program in ebpf_rss_load().
Signed-off-by: Akihiko Odaki
---
ebpf/rss.bpf.skeleton.h | 1514 ---
ebpf/
The code to attach or detach the eBPF program to RSS were duplicated so
unify them into one function to save some code.
Signed-off-by: Akihiko Odaki
---
hw/net/virtio-net.c | 90 ++---
1 file changed, 36 insertions(+), 54 deletions(-)
diff --git a/hw/net/
The peer buffer is qualified with const and not meant to be modified.
It also prevents enabling VIRTIO_NET_F_HASH_REPORT for peers without
virtio-net header support.
Signed-off-by: Akihiko Odaki
---
hw/net/virtio-net.c | 36 +---
1 file changed, 17 insertions(+),
It was necessary since an Linux older than 2.6.35 may implement the
virtio-net header but may not allow to change its length. Remove it
since such an old Linux is no longer supported.
Signed-off-by: Akihiko Odaki
Acked-by: Michael S. Tsirkin
---
net/tap_int.h | 1 -
net/tap-bsd.c | 5
vhost requires eBPF for RSS. When eBPF is not available, virtio-net
implicitly disables RSS even if the user explicitly requests it. Return
an error instead of implicitly disabling RSS if RSS is requested but not
available.
Signed-off-by: Akihiko Odaki
---
hw/net/virtio-net.c | 98 ++
The kernel interprets the returned value as an unsigned 32-bit so -1
will mean queue 4294967295, which is awkward. Return 0 instead.
Signed-off-by: Akihiko Odaki
---
ebpf/rss.bpf.skeleton.h | 1339 +++
tools/ebpf/rss.bpf.c|2 +-
2 files changed, 670 in
While netmap implements virtio-net header, it does not implement
receive_raw(). Instead of implementing receive_raw for netmap, add
virtio-net headers in the common code and use receive_iov()/receive()
instead. This also fixes the buffer size for the virtio-net header.
Fixes: fbbdbddec0 ("tap: all
RSS is disabled by default.
Fixes: 590790297c ("virtio-net: implement RSS configuration command")
Signed-off-by: Akihiko Odaki
Reviewed-by: Michael Tokarev
---
hw/net/virtio-net.c | 70 +++--
1 file changed, 36 insertions(+), 34 deletions(-)
diff --git a
The error handling procedures required when rss_bpf__open() and
rss_bpf__load(rss_bpf_ctx) are different so it's better to implement
them separately.
Signed-off-by: Akihiko Odaki
---
ebpf/ebpf_rss.c | 10 +++---
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/ebpf/ebpf_rss.c b/
The member is not cleared during reset so may have a stale value.
Signed-off-by: Akihiko Odaki
---
hw/net/virtio-net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 40beff2262..eed5a9bc46 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-n
It is necessary to copy the header only for byte swapping. Worse, when
byte swapping is not needed, the header can be larger than the buffer
due to VIRTIO_NET_F_HASH_REPORT, which results in buffer overflow.
Copy the header only when byte swapping is needed.
Fixes: e22f0603fb ("virtio-net: refere
Since qemu_set_vnet_hdr_len() is always called when
qemu_using_vnet_hdr() is called, we can merge them and save some code.
For consistency, express that the virtio-net header is not in use by
returning 0 with qemu_get_vnet_hdr_len() instead of having a dedicated
function, qemu_get_using_vnet_hdr()
Based-on: <20230524064704.47711-1-akihiko.od...@daynix.com>
("[PATCH 0/2] net: Update MemReentrancyGuard for NIC")
This series contains fixes and improvements for virtio-net RSS and hash
reporting feature.
V6 -> V7:
Dropped patch "virtio-net: Do not clear VIRTIO_NET_F_HASH_REPORT".
Dropped th
It was necessary since an Linux older than 2.6.35 may implement the
virtio-net header but may not allow to change its length. Remove it
since such an old Linux is no longer supported.
Signed-off-by: Akihiko Odaki
Acked-by: Michael S. Tsirkin
---
net/tap_int.h | 1 -
net/tap-bsd.c | 5
The virtio-net header length assertion should happen for any clients.
Signed-off-by: Akihiko Odaki
---
net/net.c | 5 +
net/tap.c | 3 ---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/net.c b/net/net.c
index f603030dd6..2e7c3fcc2a 100644
--- a/net/net.c
+++ b/net/net.c
Based-on: <20230524064704.47711-1-akihiko.od...@daynix.com>
("[PATCH 0/2] net: Update MemReentrancyGuard for NIC")
This series contains fixes and improvements for virtio-net RSS and hash
reporting feature.
V6 -> V7:
Dropped patch "virtio-net: Do not clear VIRTIO_NET_F_HASH_REPORT".
Dropped th
Since qemu_set_vnet_hdr_len() is always called when
qemu_using_vnet_hdr() is called, we can merge them and save some code.
For consistency, express that the virtio-net header is not in use by
returning 0 with qemu_get_vnet_hdr_len() instead of having a dedicated
function, qemu_get_using_vnet_hdr()
While netmap implements virtio-net header, it does not implement
receive_raw(). Instead of implementing receive_raw for netmap, add
virtio-net headers in the common code and use receive_iov()/receive()
instead. This also fixes the buffer size for the virtio-net header.
Fixes: fbbdbddec0 ("tap: all
33 matches
Mail list logo