* [PATCH v3 00/11] virtio-net RSS/hash report fixes
@ 2023-10-11 15:39 Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len() Akihiko Odaki
` (10 more replies)
0 siblings, 11 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki
This series contains fixes and improvements for virtio-net RSS and hash
reporting feature.
V2 -> V3:
Added patch "tap: Remove tap_probe_vnet_hdr_len()".
Added patch "tap: Remove qemu_using_vnet_hdr()".
Added patch "net: Move virtio-net header length assertion".
Added patch "net: Remove receive_raw()".
Added patch "tap: Shrink zeroed virtio-net header".
Dropped patch "tap: Fix virtio-net header buffer size".
V1 -> V2:
Added patch "ebpf: Fix RSS error handling".
Akihiko Odaki (11):
tap: Remove tap_probe_vnet_hdr_len()
tap: Remove qemu_using_vnet_hdr()
net: Move virtio-net header length assertion
net: Remove receive_raw()
tap: Shrink zeroed virtio-net header
virtio-net: Copy header only when necessary
virtio-net: Disable RSS on reset
virtio-net: Unify the logic to update NIC state for RSS
virtio-net: Return an error when vhost cannot enable RSS
virtio-net: Do not clear VIRTIO_NET_F_RSS
ebpf: Fix RSS error handling
ebpf/ebpf_rss.h | 2 +-
include/net/filter.h | 3 -
include/net/net.h | 7 -
include/net/queue.h | 7 -
include/sysemu/replay.h | 2 +-
net/tap_int.h | 1 -
ebpf/ebpf_rss-stub.c | 4 +-
ebpf/ebpf_rss.c | 68 ++++------
hw/net/e1000e.c | 1 -
hw/net/igb.c | 1 -
hw/net/net_tx_pkt.c | 4 +-
hw/net/virtio-net.c | 280 ++++++++++++++++++----------------------
hw/net/vmxnet3.c | 2 -
net/dump.c | 8 +-
net/filter-buffer.c | 4 +-
net/filter-mirror.c | 4 +-
net/filter-replay.c | 3 +-
net/filter-rewriter.c | 5 +-
net/filter.c | 8 +-
net/net.c | 83 ++++--------
net/netmap.c | 5 -
net/queue.c | 30 ++---
net/tap-bsd.c | 5 -
net/tap-linux.c | 20 ---
net/tap-solaris.c | 5 -
net/tap-stub.c | 5 -
net/tap.c | 74 +----------
replay/replay-net.c | 8 +-
tools/ebpf/rss.bpf.c | 20 +--
29 files changed, 224 insertions(+), 445 deletions(-)
--
2.42.0
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
2023-10-13 1:38 ` Jason Wang
2023-10-11 15:39 ` [PATCH v3 02/11] tap: Remove qemu_using_vnet_hdr() Akihiko Odaki
` (9 subsequent siblings)
10 siblings, 1 reply; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki
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 <akihiko.odaki@daynix.com>
---
net/tap_int.h | 1 -
net/tap-bsd.c | 5 -----
net/tap-linux.c | 20 --------------------
net/tap-solaris.c | 5 -----
net/tap-stub.c | 5 -----
net/tap.c | 10 ++--------
6 files changed, 2 insertions(+), 44 deletions(-)
diff --git a/net/tap_int.h b/net/tap_int.h
index 547f8a5a28..ff7ab23ad7 100644
--- a/net/tap_int.h
+++ b/net/tap_int.h
@@ -35,7 +35,6 @@ ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen);
void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp);
int tap_probe_vnet_hdr(int fd, Error **errp);
-int tap_probe_vnet_hdr_len(int fd, int len);
int tap_probe_has_ufo(int fd);
void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo);
void tap_fd_set_vnet_hdr_len(int fd, int len);
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index 4c98fdd337..bcd9e894a8 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -212,11 +212,6 @@ int tap_probe_has_ufo(int fd)
return 0;
}
-int tap_probe_vnet_hdr_len(int fd, int len)
-{
- return 0;
-}
-
void tap_fd_set_vnet_hdr_len(int fd, int len)
{
}
diff --git a/net/tap-linux.c b/net/tap-linux.c
index f54f308d35..985287816e 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -173,26 +173,6 @@ int tap_probe_has_ufo(int fd)
return 1;
}
-/* Verify that we can assign given length */
-int tap_probe_vnet_hdr_len(int fd, int len)
-{
- int orig;
- if (ioctl(fd, TUNGETVNETHDRSZ, &orig) == -1) {
- return 0;
- }
- if (ioctl(fd, TUNSETVNETHDRSZ, &len) == -1) {
- return 0;
- }
- /* Restore original length: we can't handle failure. */
- if (ioctl(fd, TUNSETVNETHDRSZ, &orig) == -1) {
- fprintf(stderr, "TUNGETVNETHDRSZ ioctl() failed: %s. Exiting.\n",
- strerror(errno));
- abort();
- return -errno;
- }
- return 1;
-}
-
void tap_fd_set_vnet_hdr_len(int fd, int len)
{
if (ioctl(fd, TUNSETVNETHDRSZ, &len) == -1) {
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index 38e15028bf..6ad79fecad 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -216,11 +216,6 @@ int tap_probe_has_ufo(int fd)
return 0;
}
-int tap_probe_vnet_hdr_len(int fd, int len)
-{
- return 0;
-}
-
void tap_fd_set_vnet_hdr_len(int fd, int len)
{
}
diff --git a/net/tap-stub.c b/net/tap-stub.c
index a0fa25804b..422257668c 100644
--- a/net/tap-stub.c
+++ b/net/tap-stub.c
@@ -47,11 +47,6 @@ int tap_probe_has_ufo(int fd)
return 0;
}
-int tap_probe_vnet_hdr_len(int fd, int len)
-{
- return 0;
-}
-
void tap_fd_set_vnet_hdr_len(int fd, int len)
{
}
diff --git a/net/tap.c b/net/tap.c
index c6639d9f20..0403729739 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -248,11 +248,7 @@ static bool tap_has_vnet_hdr(NetClientState *nc)
static bool tap_has_vnet_hdr_len(NetClientState *nc, int len)
{
- TAPState *s = DO_UPCAST(TAPState, nc, nc);
-
- assert(nc->info->type == NET_CLIENT_DRIVER_TAP);
-
- return !!tap_probe_vnet_hdr_len(s->fd, len);
+ return tap_has_vnet_hdr(nc);
}
static int tap_get_vnet_hdr_len(NetClientState *nc)
@@ -419,9 +415,7 @@ static TAPState *net_tap_fd_init(NetClientState *peer,
* Make sure host header length is set correctly in tap:
* it might have been modified by another instance of qemu.
*/
- if (tap_probe_vnet_hdr_len(s->fd, s->host_vnet_hdr_len)) {
- tap_fd_set_vnet_hdr_len(s->fd, s->host_vnet_hdr_len);
- }
+ tap_fd_set_vnet_hdr_len(s->fd, s->host_vnet_hdr_len);
tap_read_poll(s, true);
s->vhost_net = NULL;
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v3 02/11] tap: Remove qemu_using_vnet_hdr()
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len() Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 03/11] net: Move virtio-net header length assertion Akihiko Odaki
` (8 subsequent siblings)
10 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki, Dmitry Fleytman,
Sriram Yagnaraman, Luigi Rizzo, Giuseppe Lettieri,
Vincenzo Maffione
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().
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
include/net/net.h | 6 ------
hw/net/e1000e.c | 1 -
hw/net/igb.c | 1 -
hw/net/net_tx_pkt.c | 4 ++--
hw/net/virtio-net.c | 3 ---
hw/net/vmxnet3.c | 2 --
net/dump.c | 4 +---
net/net.c | 18 ------------------
net/netmap.c | 5 -----
net/tap.c | 22 ++--------------------
10 files changed, 5 insertions(+), 61 deletions(-)
diff --git a/include/net/net.h b/include/net/net.h
index 685ec58318..011031ef77 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -56,8 +56,6 @@ typedef RxFilterInfo *(QueryRxFilter)(NetClientState *);
typedef bool (HasUfo)(NetClientState *);
typedef bool (HasVnetHdr)(NetClientState *);
typedef bool (HasVnetHdrLen)(NetClientState *, int);
-typedef bool (GetUsingVnetHdr)(NetClientState *);
-typedef void (UsingVnetHdr)(NetClientState *, bool);
typedef void (SetOffload)(NetClientState *, int, int, int, int, int);
typedef int (GetVnetHdrLen)(NetClientState *);
typedef void (SetVnetHdrLen)(NetClientState *, int);
@@ -86,8 +84,6 @@ typedef struct NetClientInfo {
HasUfo *has_ufo;
HasVnetHdr *has_vnet_hdr;
HasVnetHdrLen *has_vnet_hdr_len;
- GetUsingVnetHdr *get_using_vnet_hdr;
- UsingVnetHdr *using_vnet_hdr;
SetOffload *set_offload;
GetVnetHdrLen *get_vnet_hdr_len;
SetVnetHdrLen *set_vnet_hdr_len;
@@ -191,8 +187,6 @@ void qemu_format_nic_info_str(NetClientState *nc, uint8_t macaddr[6]);
bool qemu_has_ufo(NetClientState *nc);
bool qemu_has_vnet_hdr(NetClientState *nc);
bool qemu_has_vnet_hdr_len(NetClientState *nc, int len);
-bool qemu_get_using_vnet_hdr(NetClientState *nc);
-void qemu_using_vnet_hdr(NetClientState *nc, bool enable);
void qemu_set_offload(NetClientState *nc, int csum, int tso4, int tso6,
int ecn, int ufo);
int qemu_get_vnet_hdr_len(NetClientState *nc);
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index e41a6c1038..4edb58858e 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -352,7 +352,6 @@ e1000e_init_net_peer(E1000EState *s, PCIDevice *pci_dev, uint8_t *macaddr)
for (i = 0; i < s->conf.peers.queues; i++) {
nc = qemu_get_subqueue(s->nic, i);
qemu_set_vnet_hdr_len(nc->peer, sizeof(struct virtio_net_hdr));
- qemu_using_vnet_hdr(nc->peer, true);
}
}
diff --git a/hw/net/igb.c b/hw/net/igb.c
index 8b713843d9..cfdb148051 100644
--- a/hw/net/igb.c
+++ b/hw/net/igb.c
@@ -339,7 +339,6 @@ igb_init_net_peer(IGBState *s, PCIDevice *pci_dev, uint8_t *macaddr)
for (i = 0; i < s->conf.peers.queues; i++) {
nc = qemu_get_subqueue(s->nic, i);
qemu_set_vnet_hdr_len(nc->peer, sizeof(struct virtio_net_hdr));
- qemu_using_vnet_hdr(nc->peer, true);
}
}
diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c
index 2e5f58b3c9..668871f8d8 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -578,7 +578,7 @@ static void net_tx_pkt_sendv(
{
NetClientState *nc = opaque;
- if (qemu_get_using_vnet_hdr(nc->peer)) {
+ if (qemu_get_vnet_hdr_len(nc->peer)) {
qemu_sendv_packet(nc, virt_iov, virt_iov_cnt);
} else {
qemu_sendv_packet(nc, iov, iov_cnt);
@@ -808,7 +808,7 @@ static bool net_tx_pkt_do_sw_fragmentation(struct NetTxPkt *pkt,
bool net_tx_pkt_send(struct NetTxPkt *pkt, NetClientState *nc)
{
- bool offload = qemu_get_using_vnet_hdr(nc->peer);
+ bool offload = !!qemu_get_vnet_hdr_len(nc->peer);
return net_tx_pkt_send_custom(pkt, offload, net_tx_pkt_sendv, nc);
}
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 9a93a2df01..cab79f19cb 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3709,9 +3709,6 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
peer_test_vnet_hdr(n);
if (peer_has_vnet_hdr(n)) {
- for (i = 0; i < n->max_queue_pairs; i++) {
- qemu_using_vnet_hdr(qemu_get_subqueue(n->nic, i)->peer, true);
- }
n->host_hdr_len = sizeof(struct virtio_net_hdr);
} else {
n->host_hdr_len = 0;
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 3df1d1b101..a9619108ca 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -2086,8 +2086,6 @@ static void vmxnet3_net_init(VMXNET3State *s)
if (s->peer_has_vhdr) {
qemu_set_vnet_hdr_len(qemu_get_queue(s->nic)->peer,
sizeof(struct virtio_net_hdr));
-
- qemu_using_vnet_hdr(qemu_get_queue(s->nic)->peer, 1);
}
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
diff --git a/net/dump.c b/net/dump.c
index 7d05f16ca7..d2defe4ed9 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -154,10 +154,8 @@ static ssize_t filter_dump_receive_iov(NetFilterState *nf, NetClientState *sndr,
int iovcnt, NetPacketSent *sent_cb)
{
NetFilterDumpState *nfds = FILTER_DUMP(nf);
- int offset = qemu_get_using_vnet_hdr(nf->netdev) ?
- qemu_get_vnet_hdr_len(nf->netdev) : 0;
- dump_receive_iov(&nfds->ds, iov, iovcnt, offset);
+ dump_receive_iov(&nfds->ds, iov, iovcnt, qemu_get_vnet_hdr_len(nf->netdev));
return 0;
}
diff --git a/net/net.c b/net/net.c
index 3523cceafc..1bb4f33a63 100644
--- a/net/net.c
+++ b/net/net.c
@@ -515,24 +515,6 @@ bool qemu_has_vnet_hdr_len(NetClientState *nc, int len)
return nc->info->has_vnet_hdr_len(nc, len);
}
-bool qemu_get_using_vnet_hdr(NetClientState *nc)
-{
- if (!nc || !nc->info->get_using_vnet_hdr) {
- return false;
- }
-
- return nc->info->get_using_vnet_hdr(nc);
-}
-
-void qemu_using_vnet_hdr(NetClientState *nc, bool enable)
-{
- if (!nc || !nc->info->using_vnet_hdr) {
- return;
- }
-
- nc->info->using_vnet_hdr(nc, enable);
-}
-
void qemu_set_offload(NetClientState *nc, int csum, int tso4, int tso6,
int ecn, int ufo)
{
diff --git a/net/netmap.c b/net/netmap.c
index 9e0cec58d3..b7a669f862 100644
--- a/net/netmap.c
+++ b/net/netmap.c
@@ -351,10 +351,6 @@ static bool netmap_has_vnet_hdr(NetClientState *nc)
return netmap_has_vnet_hdr_len(nc, sizeof(struct virtio_net_hdr));
}
-static void netmap_using_vnet_hdr(NetClientState *nc, bool enable)
-{
-}
-
static void netmap_set_vnet_hdr_len(NetClientState *nc, int len)
{
NetmapState *s = DO_UPCAST(NetmapState, nc, nc);
@@ -393,7 +389,6 @@ static NetClientInfo net_netmap_info = {
.has_ufo = netmap_has_vnet_hdr,
.has_vnet_hdr = netmap_has_vnet_hdr,
.has_vnet_hdr_len = netmap_has_vnet_hdr_len,
- .using_vnet_hdr = netmap_using_vnet_hdr,
.set_offload = netmap_set_offload,
.set_vnet_hdr_len = netmap_set_vnet_hdr_len,
};
diff --git a/net/tap.c b/net/tap.c
index 0403729739..4667933ffe 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -255,7 +255,7 @@ static int tap_get_vnet_hdr_len(NetClientState *nc)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
- return s->host_vnet_hdr_len;
+ return s->using_vnet_hdr ? s->host_vnet_hdr_len : 0;
}
static void tap_set_vnet_hdr_len(NetClientState *nc, int len)
@@ -269,23 +269,7 @@ static void tap_set_vnet_hdr_len(NetClientState *nc, int len)
tap_fd_set_vnet_hdr_len(s->fd, len);
s->host_vnet_hdr_len = len;
-}
-
-static bool tap_get_using_vnet_hdr(NetClientState *nc)
-{
- TAPState *s = DO_UPCAST(TAPState, nc, nc);
-
- return s->using_vnet_hdr;
-}
-
-static void tap_using_vnet_hdr(NetClientState *nc, bool using_vnet_hdr)
-{
- TAPState *s = DO_UPCAST(TAPState, nc, nc);
-
- assert(nc->info->type == NET_CLIENT_DRIVER_TAP);
- assert(!!s->host_vnet_hdr_len == using_vnet_hdr);
-
- s->using_vnet_hdr = using_vnet_hdr;
+ s->using_vnet_hdr = true;
}
static int tap_set_vnet_le(NetClientState *nc, bool is_le)
@@ -382,8 +366,6 @@ static NetClientInfo net_tap_info = {
.has_ufo = tap_has_ufo,
.has_vnet_hdr = tap_has_vnet_hdr,
.has_vnet_hdr_len = tap_has_vnet_hdr_len,
- .get_using_vnet_hdr = tap_get_using_vnet_hdr,
- .using_vnet_hdr = tap_using_vnet_hdr,
.set_offload = tap_set_offload,
.get_vnet_hdr_len = tap_get_vnet_hdr_len,
.set_vnet_hdr_len = tap_set_vnet_hdr_len,
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v3 03/11] net: Move virtio-net header length assertion
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len() Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 02/11] tap: Remove qemu_using_vnet_hdr() Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 04/11] net: Remove receive_raw() Akihiko Odaki
` (7 subsequent siblings)
10 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki
The virtio-net header length assertion should happen for any clients.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
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 1bb4f33a63..6d2fa8d40f 100644
--- a/net/net.c
+++ b/net/net.c
@@ -56,6 +56,7 @@
#include "net/filter.h"
#include "qapi/string-output-visitor.h"
#include "qapi/qobject-input-visitor.h"
+#include "standard-headers/linux/virtio_net.h"
/* Net bridge is currently not supported for W32. */
#if !defined(_WIN32)
@@ -540,6 +541,10 @@ void qemu_set_vnet_hdr_len(NetClientState *nc, int len)
return;
}
+ assert(len == sizeof(struct virtio_net_hdr_mrg_rxbuf) ||
+ len == sizeof(struct virtio_net_hdr) ||
+ len == sizeof(struct virtio_net_hdr_v1_hash));
+
nc->vnet_hdr_len = len;
nc->info->set_vnet_hdr_len(nc, len);
}
diff --git a/net/tap.c b/net/tap.c
index 4667933ffe..57389cacc3 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -263,9 +263,6 @@ static void tap_set_vnet_hdr_len(NetClientState *nc, int len)
TAPState *s = DO_UPCAST(TAPState, nc, nc);
assert(nc->info->type == NET_CLIENT_DRIVER_TAP);
- assert(len == sizeof(struct virtio_net_hdr_mrg_rxbuf) ||
- len == sizeof(struct virtio_net_hdr) ||
- len == sizeof(struct virtio_net_hdr_v1_hash));
tap_fd_set_vnet_hdr_len(s->fd, len);
s->host_vnet_hdr_len = len;
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v3 04/11] net: Remove receive_raw()
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
` (2 preceding siblings ...)
2023-10-11 15:39 ` [PATCH v3 03/11] net: Move virtio-net header length assertion Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 05/11] tap: Shrink zeroed virtio-net header Akihiko Odaki
` (6 subsequent siblings)
10 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki, Pavel Dovgalyuk,
Paolo Bonzini, Zhang Chen, Li Zhijian
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: allow extended virtio header with hash info")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
include/net/filter.h | 3 ---
include/net/net.h | 1 -
include/net/queue.h | 7 -----
include/sysemu/replay.h | 2 +-
net/dump.c | 4 +--
net/filter-buffer.c | 4 +--
net/filter-mirror.c | 4 +--
net/filter-replay.c | 3 +--
net/filter-rewriter.c | 5 ++--
net/filter.c | 8 +++---
net/net.c | 60 ++++++++++++++++-------------------------
net/queue.c | 30 +++++++--------------
net/tap.c | 37 -------------------------
replay/replay-net.c | 8 ++----
14 files changed, 47 insertions(+), 129 deletions(-)
diff --git a/include/net/filter.h b/include/net/filter.h
index 27ffc630df..e523771e72 100644
--- a/include/net/filter.h
+++ b/include/net/filter.h
@@ -26,7 +26,6 @@ typedef void (FilterCleanup) (NetFilterState *nf);
*/
typedef ssize_t (FilterReceiveIOV)(NetFilterState *nc,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb);
@@ -65,14 +64,12 @@ struct NetFilterState {
ssize_t qemu_netfilter_receive(NetFilterState *nf,
NetFilterDirection direction,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb);
/* pass the packet to the next filter */
ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
void *opaque);
diff --git a/include/net/net.h b/include/net/net.h
index 011031ef77..971dc54897 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -71,7 +71,6 @@ typedef struct NetClientInfo {
NetClientDriver type;
size_t size;
NetReceive *receive;
- NetReceive *receive_raw;
NetReceiveIOV *receive_iov;
NetCanReceive *can_receive;
NetStart *start;
diff --git a/include/net/queue.h b/include/net/queue.h
index 9f2f289d77..571f4e1436 100644
--- a/include/net/queue.h
+++ b/include/net/queue.h
@@ -30,16 +30,12 @@ typedef struct NetQueue NetQueue;
typedef void (NetPacketSent) (NetClientState *sender, ssize_t ret);
-#define QEMU_NET_PACKET_FLAG_NONE 0
-#define QEMU_NET_PACKET_FLAG_RAW (1<<0)
-
/* Returns:
* >0 - success
* 0 - queue packet for future redelivery
* <0 - failure (discard packet)
*/
typedef ssize_t (NetQueueDeliverFunc)(NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
void *opaque);
@@ -48,7 +44,6 @@ NetQueue *qemu_new_net_queue(NetQueueDeliverFunc *deliver, void *opaque);
void qemu_net_queue_append_iov(NetQueue *queue,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb);
@@ -65,14 +60,12 @@ ssize_t qemu_net_queue_receive_iov(NetQueue *queue,
ssize_t qemu_net_queue_send(NetQueue *queue,
NetClientState *sender,
- unsigned flags,
const uint8_t *data,
size_t size,
NetPacketSent *sent_cb);
ssize_t qemu_net_queue_send_iov(NetQueue *queue,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb);
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index 08aae5869f..67b2d3ac73 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -158,7 +158,7 @@ ReplayNetState *replay_register_net(NetFilterState *nfs);
/*! Unregisters replay network filter. */
void replay_unregister_net(ReplayNetState *rns);
/*! Called to write network packet to the replay log. */
-void replay_net_packet_event(ReplayNetState *rns, unsigned flags,
+void replay_net_packet_event(ReplayNetState *rns,
const struct iovec *iov, int iovcnt);
/* Audio */
diff --git a/net/dump.c b/net/dump.c
index d2defe4ed9..968ac7a82a 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -150,8 +150,8 @@ struct NetFilterDumpState {
};
static ssize_t filter_dump_receive_iov(NetFilterState *nf, NetClientState *sndr,
- unsigned flags, const struct iovec *iov,
- int iovcnt, NetPacketSent *sent_cb)
+ const struct iovec *iov, int iovcnt,
+ NetPacketSent *sent_cb)
{
NetFilterDumpState *nfds = FILTER_DUMP(nf);
diff --git a/net/filter-buffer.c b/net/filter-buffer.c
index 283dc9cbe6..6d8b581cd8 100644
--- a/net/filter-buffer.c
+++ b/net/filter-buffer.c
@@ -58,7 +58,6 @@ static void filter_buffer_release_timer(void *opaque)
/* filter APIs */
static ssize_t filter_buffer_receive_iov(NetFilterState *nf,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb)
@@ -79,8 +78,7 @@ static ssize_t filter_buffer_receive_iov(NetFilterState *nf,
* the packets without caring about the receiver. This is suboptimal.
* May need more thoughts (e.g keeping sent_cb).
*/
- qemu_net_queue_append_iov(s->incoming_queue, sender, flags,
- iov, iovcnt, NULL);
+ qemu_net_queue_append_iov(s->incoming_queue, sender, iov, iovcnt, NULL);
return iov_size(iov, iovcnt);
}
diff --git a/net/filter-mirror.c b/net/filter-mirror.c
index 34a63b5dbb..8a618f26c0 100644
--- a/net/filter-mirror.c
+++ b/net/filter-mirror.c
@@ -145,12 +145,12 @@ static void redirector_to_filter(NetFilterState *nf,
if (nf->direction == NET_FILTER_DIRECTION_ALL ||
nf->direction == NET_FILTER_DIRECTION_TX) {
- qemu_netfilter_pass_to_next(nf->netdev, 0, &iov, 1, nf);
+ qemu_netfilter_pass_to_next(nf->netdev, &iov, 1, nf);
}
if (nf->direction == NET_FILTER_DIRECTION_ALL ||
nf->direction == NET_FILTER_DIRECTION_RX) {
- qemu_netfilter_pass_to_next(nf->netdev->peer, 0, &iov, 1, nf);
+ qemu_netfilter_pass_to_next(nf->netdev->peer, &iov, 1, nf);
}
}
diff --git a/net/filter-replay.c b/net/filter-replay.c
index 54690676ef..ab132f6f24 100644
--- a/net/filter-replay.c
+++ b/net/filter-replay.c
@@ -31,7 +31,6 @@ struct NetFilterReplayState {
static ssize_t filter_replay_receive_iov(NetFilterState *nf,
NetClientState *sndr,
- unsigned flags,
const struct iovec *iov,
int iovcnt, NetPacketSent *sent_cb)
{
@@ -39,7 +38,7 @@ static ssize_t filter_replay_receive_iov(NetFilterState *nf,
switch (replay_mode) {
case REPLAY_MODE_RECORD:
if (nf->netdev == sndr) {
- replay_net_packet_event(nfrs->rns, flags, iov, iovcnt);
+ replay_net_packet_event(nfrs->rns, iov, iovcnt);
return iov_size(iov, iovcnt);
}
return 0;
diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c
index c18c4c2019..5da0b097db 100644
--- a/net/filter-rewriter.c
+++ b/net/filter-rewriter.c
@@ -251,7 +251,6 @@ static int handle_secondary_tcp_pkt(RewriterState *rf,
static ssize_t colo_rewriter_receive_iov(NetFilterState *nf,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb)
@@ -294,7 +293,7 @@ static ssize_t colo_rewriter_receive_iov(NetFilterState *nf,
if (sender == nf->netdev) {
/* NET_FILTER_DIRECTION_TX */
if (!handle_primary_tcp_pkt(s, conn, pkt, &key)) {
- qemu_net_queue_send(s->incoming_queue, sender, 0,
+ qemu_net_queue_send(s->incoming_queue, sender,
(const uint8_t *)pkt->data, pkt->size, NULL);
packet_destroy(pkt, NULL);
pkt = NULL;
@@ -307,7 +306,7 @@ static ssize_t colo_rewriter_receive_iov(NetFilterState *nf,
} else {
/* NET_FILTER_DIRECTION_RX */
if (!handle_secondary_tcp_pkt(s, conn, pkt, &key)) {
- qemu_net_queue_send(s->incoming_queue, sender, 0,
+ qemu_net_queue_send(s->incoming_queue, sender,
(const uint8_t *)pkt->data, pkt->size, NULL);
packet_destroy(pkt, NULL);
pkt = NULL;
diff --git a/net/filter.c b/net/filter.c
index 3fe88fa43f..14dfb6fa36 100644
--- a/net/filter.c
+++ b/net/filter.c
@@ -28,7 +28,6 @@ static inline bool qemu_can_skip_netfilter(NetFilterState *nf)
ssize_t qemu_netfilter_receive(NetFilterState *nf,
NetFilterDirection direction,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb)
@@ -39,7 +38,7 @@ ssize_t qemu_netfilter_receive(NetFilterState *nf,
if (nf->direction == direction ||
nf->direction == NET_FILTER_DIRECTION_ALL) {
return NETFILTER_GET_CLASS(OBJECT(nf))->receive_iov(
- nf, sender, flags, iov, iovcnt, sent_cb);
+ nf, sender, iov, iovcnt, sent_cb);
}
return 0;
@@ -62,7 +61,6 @@ static NetFilterState *netfilter_next(NetFilterState *nf,
}
ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
void *opaque)
@@ -96,7 +94,7 @@ ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
* to the sender, so sent_cb shouldn't be called later, just
* pass NULL to next.
*/
- ret = qemu_netfilter_receive(next, direction, sender, flags, iov,
+ ret = qemu_netfilter_receive(next, direction, sender, iov,
iovcnt, NULL);
if (ret) {
return ret;
@@ -111,7 +109,7 @@ ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
*/
if (sender && sender->peer) {
qemu_net_queue_send_iov(sender->peer->incoming_queue,
- sender, flags, iov, iovcnt, NULL);
+ sender, iov, iovcnt, NULL);
}
out:
diff --git a/net/net.c b/net/net.c
index 6d2fa8d40f..9334fd166e 100644
--- a/net/net.c
+++ b/net/net.c
@@ -250,7 +250,6 @@ static void qemu_net_client_destructor(NetClientState *nc)
g_free(nc);
}
static ssize_t qemu_deliver_packet_iov(NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
void *opaque);
@@ -604,7 +603,6 @@ int qemu_can_send_packet(NetClientState *sender)
static ssize_t filter_receive_iov(NetClientState *nc,
NetFilterDirection direction,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb)
@@ -614,7 +612,7 @@ static ssize_t filter_receive_iov(NetClientState *nc,
if (direction == NET_FILTER_DIRECTION_TX) {
QTAILQ_FOREACH(nf, &nc->filters, next) {
- ret = qemu_netfilter_receive(nf, direction, sender, flags, iov,
+ ret = qemu_netfilter_receive(nf, direction, sender, iov,
iovcnt, sent_cb);
if (ret) {
return ret;
@@ -622,7 +620,7 @@ static ssize_t filter_receive_iov(NetClientState *nc,
}
} else {
QTAILQ_FOREACH_REVERSE(nf, &nc->filters, next) {
- ret = qemu_netfilter_receive(nf, direction, sender, flags, iov,
+ ret = qemu_netfilter_receive(nf, direction, sender, iov,
iovcnt, sent_cb);
if (ret) {
return ret;
@@ -636,7 +634,6 @@ static ssize_t filter_receive_iov(NetClientState *nc,
static ssize_t filter_receive(NetClientState *nc,
NetFilterDirection direction,
NetClientState *sender,
- unsigned flags,
const uint8_t *data,
size_t size,
NetPacketSent *sent_cb)
@@ -646,7 +643,7 @@ static ssize_t filter_receive(NetClientState *nc,
.iov_len = size
};
- return filter_receive_iov(nc, direction, sender, flags, &iov, 1, sent_cb);
+ return filter_receive_iov(nc, direction, sender, &iov, 1, sent_cb);
}
void qemu_purge_queued_packets(NetClientState *nc)
@@ -683,10 +680,9 @@ void qemu_flush_queued_packets(NetClientState *nc)
qemu_flush_or_purge_queued_packets(nc, false);
}
-static ssize_t qemu_send_packet_async_with_flags(NetClientState *sender,
- unsigned flags,
- const uint8_t *buf, int size,
- NetPacketSent *sent_cb)
+ssize_t qemu_send_packet_async(NetClientState *sender,
+ const uint8_t *buf, int size,
+ NetPacketSent *sent_cb)
{
NetQueue *queue;
int ret;
@@ -702,28 +698,20 @@ static ssize_t qemu_send_packet_async_with_flags(NetClientState *sender,
/* Let filters handle the packet first */
ret = filter_receive(sender, NET_FILTER_DIRECTION_TX,
- sender, flags, buf, size, sent_cb);
+ sender, buf, size, sent_cb);
if (ret) {
return ret;
}
ret = filter_receive(sender->peer, NET_FILTER_DIRECTION_RX,
- sender, flags, buf, size, sent_cb);
+ sender, buf, size, sent_cb);
if (ret) {
return ret;
}
queue = sender->peer->incoming_queue;
- return qemu_net_queue_send(queue, sender, flags, buf, size, sent_cb);
-}
-
-ssize_t qemu_send_packet_async(NetClientState *sender,
- const uint8_t *buf, int size,
- NetPacketSent *sent_cb)
-{
- return qemu_send_packet_async_with_flags(sender, QEMU_NET_PACKET_FLAG_NONE,
- buf, size, sent_cb);
+ return qemu_net_queue_send(queue, sender, buf, size, sent_cb);
}
ssize_t qemu_send_packet(NetClientState *nc, const uint8_t *buf, int size)
@@ -752,12 +740,17 @@ ssize_t qemu_receive_packet_iov(NetClientState *nc, const struct iovec *iov,
ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int size)
{
- return qemu_send_packet_async_with_flags(nc, QEMU_NET_PACKET_FLAG_RAW,
- buf, size, NULL);
+ struct virtio_net_hdr_v1_hash vnet_hdr = { };
+ struct iovec iov[] = {
+ { .iov_base = &vnet_hdr, .iov_len = nc->vnet_hdr_len },
+ { .iov_base = (void *)buf, .iov_len = size }
+ };
+
+ return qemu_sendv_packet_async(nc, iov, ARRAY_SIZE(iov), NULL);
}
static ssize_t nc_sendv_compat(NetClientState *nc, const struct iovec *iov,
- int iovcnt, unsigned flags)
+ int iovcnt)
{
uint8_t *buf = NULL;
uint8_t *buffer;
@@ -777,18 +770,13 @@ static ssize_t nc_sendv_compat(NetClientState *nc, const struct iovec *iov,
offset = iov_to_buf(iov, iovcnt, 0, buf, offset);
}
- if (flags & QEMU_NET_PACKET_FLAG_RAW && nc->info->receive_raw) {
- ret = nc->info->receive_raw(nc, buffer, offset);
- } else {
- ret = nc->info->receive(nc, buffer, offset);
- }
+ ret = nc->info->receive(nc, buffer, offset);
g_free(buf);
return ret;
}
static ssize_t qemu_deliver_packet_iov(NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
void *opaque)
@@ -814,10 +802,10 @@ static ssize_t qemu_deliver_packet_iov(NetClientState *sender,
owned_reentrancy_guard->engaged_in_io = true;
}
- if (nc->info->receive_iov && !(flags & QEMU_NET_PACKET_FLAG_RAW)) {
+ if (nc->info->receive_iov) {
ret = nc->info->receive_iov(nc, iov, iovcnt);
} else {
- ret = nc_sendv_compat(nc, iov, iovcnt, flags);
+ ret = nc_sendv_compat(nc, iov, iovcnt);
}
if (owned_reentrancy_guard) {
@@ -849,22 +837,20 @@ ssize_t qemu_sendv_packet_async(NetClientState *sender,
/* Let filters handle the packet first */
ret = filter_receive_iov(sender, NET_FILTER_DIRECTION_TX, sender,
- QEMU_NET_PACKET_FLAG_NONE, iov, iovcnt, sent_cb);
+ iov, iovcnt, sent_cb);
if (ret) {
return ret;
}
ret = filter_receive_iov(sender->peer, NET_FILTER_DIRECTION_RX, sender,
- QEMU_NET_PACKET_FLAG_NONE, iov, iovcnt, sent_cb);
+ iov, iovcnt, sent_cb);
if (ret) {
return ret;
}
queue = sender->peer->incoming_queue;
- return qemu_net_queue_send_iov(queue, sender,
- QEMU_NET_PACKET_FLAG_NONE,
- iov, iovcnt, sent_cb);
+ return qemu_net_queue_send_iov(queue, sender, iov, iovcnt, sent_cb);
}
ssize_t
diff --git a/net/queue.c b/net/queue.c
index c872d51df8..70d29d7ac0 100644
--- a/net/queue.c
+++ b/net/queue.c
@@ -43,7 +43,6 @@
struct NetPacket {
QTAILQ_ENTRY(NetPacket) entry;
NetClientState *sender;
- unsigned flags;
int size;
NetPacketSent *sent_cb;
uint8_t data[];
@@ -92,7 +91,6 @@ void qemu_del_net_queue(NetQueue *queue)
static void qemu_net_queue_append(NetQueue *queue,
NetClientState *sender,
- unsigned flags,
const uint8_t *buf,
size_t size,
NetPacketSent *sent_cb)
@@ -104,7 +102,6 @@ static void qemu_net_queue_append(NetQueue *queue,
}
packet = g_malloc(sizeof(NetPacket) + size);
packet->sender = sender;
- packet->flags = flags;
packet->size = size;
packet->sent_cb = sent_cb;
memcpy(packet->data, buf, size);
@@ -115,7 +112,6 @@ static void qemu_net_queue_append(NetQueue *queue,
void qemu_net_queue_append_iov(NetQueue *queue,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb)
@@ -134,7 +130,6 @@ void qemu_net_queue_append_iov(NetQueue *queue,
packet = g_malloc(sizeof(NetPacket) + max_len);
packet->sender = sender;
packet->sent_cb = sent_cb;
- packet->flags = flags;
packet->size = 0;
for (i = 0; i < iovcnt; i++) {
@@ -150,7 +145,6 @@ void qemu_net_queue_append_iov(NetQueue *queue,
static ssize_t qemu_net_queue_deliver(NetQueue *queue,
NetClientState *sender,
- unsigned flags,
const uint8_t *data,
size_t size)
{
@@ -161,7 +155,7 @@ static ssize_t qemu_net_queue_deliver(NetQueue *queue,
};
queue->delivering = 1;
- ret = queue->deliver(sender, flags, &iov, 1, queue->opaque);
+ ret = queue->deliver(sender, &iov, 1, queue->opaque);
queue->delivering = 0;
return ret;
@@ -169,14 +163,13 @@ static ssize_t qemu_net_queue_deliver(NetQueue *queue,
static ssize_t qemu_net_queue_deliver_iov(NetQueue *queue,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt)
{
ssize_t ret = -1;
queue->delivering = 1;
- ret = queue->deliver(sender, flags, iov, iovcnt, queue->opaque);
+ ret = queue->deliver(sender, iov, iovcnt, queue->opaque);
queue->delivering = 0;
return ret;
@@ -190,7 +183,7 @@ ssize_t qemu_net_queue_receive(NetQueue *queue,
return 0;
}
- return qemu_net_queue_deliver(queue, NULL, 0, data, size);
+ return qemu_net_queue_deliver(queue, NULL, data, size);
}
ssize_t qemu_net_queue_receive_iov(NetQueue *queue,
@@ -201,12 +194,11 @@ ssize_t qemu_net_queue_receive_iov(NetQueue *queue,
return 0;
}
- return qemu_net_queue_deliver_iov(queue, NULL, 0, iov, iovcnt);
+ return qemu_net_queue_deliver_iov(queue, NULL, iov, iovcnt);
}
ssize_t qemu_net_queue_send(NetQueue *queue,
NetClientState *sender,
- unsigned flags,
const uint8_t *data,
size_t size,
NetPacketSent *sent_cb)
@@ -214,13 +206,13 @@ ssize_t qemu_net_queue_send(NetQueue *queue,
ssize_t ret;
if (queue->delivering || !qemu_can_send_packet(sender)) {
- qemu_net_queue_append(queue, sender, flags, data, size, sent_cb);
+ qemu_net_queue_append(queue, sender, data, size, sent_cb);
return 0;
}
- ret = qemu_net_queue_deliver(queue, sender, flags, data, size);
+ ret = qemu_net_queue_deliver(queue, sender, data, size);
if (ret == 0) {
- qemu_net_queue_append(queue, sender, flags, data, size, sent_cb);
+ qemu_net_queue_append(queue, sender, data, size, sent_cb);
return 0;
}
@@ -231,7 +223,6 @@ ssize_t qemu_net_queue_send(NetQueue *queue,
ssize_t qemu_net_queue_send_iov(NetQueue *queue,
NetClientState *sender,
- unsigned flags,
const struct iovec *iov,
int iovcnt,
NetPacketSent *sent_cb)
@@ -239,13 +230,13 @@ ssize_t qemu_net_queue_send_iov(NetQueue *queue,
ssize_t ret;
if (queue->delivering || !qemu_can_send_packet(sender)) {
- qemu_net_queue_append_iov(queue, sender, flags, iov, iovcnt, sent_cb);
+ qemu_net_queue_append_iov(queue, sender, iov, iovcnt, sent_cb);
return 0;
}
- ret = qemu_net_queue_deliver_iov(queue, sender, flags, iov, iovcnt);
+ ret = qemu_net_queue_deliver_iov(queue, sender, iov, iovcnt);
if (ret == 0) {
- qemu_net_queue_append_iov(queue, sender, flags, iov, iovcnt, sent_cb);
+ qemu_net_queue_append_iov(queue, sender, iov, iovcnt, sent_cb);
return 0;
}
@@ -285,7 +276,6 @@ bool qemu_net_queue_flush(NetQueue *queue)
ret = qemu_net_queue_deliver(queue,
packet->sender,
- packet->flags,
packet->data,
packet->size);
if (ret == 0) {
diff --git a/net/tap.c b/net/tap.c
index 57389cacc3..668d69c0de 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -131,41 +131,6 @@ static ssize_t tap_receive_iov(NetClientState *nc, const struct iovec *iov,
return tap_write_packet(s, iovp, iovcnt);
}
-static ssize_t tap_receive_raw(NetClientState *nc, const uint8_t *buf, size_t size)
-{
- TAPState *s = DO_UPCAST(TAPState, nc, nc);
- struct iovec iov[2];
- int iovcnt = 0;
- struct virtio_net_hdr_mrg_rxbuf hdr = { };
-
- if (s->host_vnet_hdr_len) {
- iov[iovcnt].iov_base = &hdr;
- iov[iovcnt].iov_len = s->host_vnet_hdr_len;
- iovcnt++;
- }
-
- iov[iovcnt].iov_base = (char *)buf;
- iov[iovcnt].iov_len = size;
- iovcnt++;
-
- return tap_write_packet(s, iov, iovcnt);
-}
-
-static ssize_t tap_receive(NetClientState *nc, const uint8_t *buf, size_t size)
-{
- TAPState *s = DO_UPCAST(TAPState, nc, nc);
- struct iovec iov[1];
-
- if (s->host_vnet_hdr_len && !s->using_vnet_hdr) {
- return tap_receive_raw(nc, buf, size);
- }
-
- iov[0].iov_base = (char *)buf;
- iov[0].iov_len = size;
-
- return tap_write_packet(s, iov, 1);
-}
-
#ifndef __sun__
ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen)
{
@@ -355,8 +320,6 @@ int tap_get_fd(NetClientState *nc)
static NetClientInfo net_tap_info = {
.type = NET_CLIENT_DRIVER_TAP,
.size = sizeof(TAPState),
- .receive = tap_receive,
- .receive_raw = tap_receive_raw,
.receive_iov = tap_receive_iov,
.poll = tap_poll,
.cleanup = tap_cleanup,
diff --git a/replay/replay-net.c b/replay/replay-net.c
index 3b70f71cf1..87e6d68f4e 100644
--- a/replay/replay-net.c
+++ b/replay/replay-net.c
@@ -24,7 +24,6 @@ struct ReplayNetState {
typedef struct NetEvent {
uint8_t id;
- uint32_t flags;
uint8_t *data;
size_t size;
} NetEvent;
@@ -50,11 +49,10 @@ void replay_unregister_net(ReplayNetState *rns)
g_free(rns);
}
-void replay_net_packet_event(ReplayNetState *rns, unsigned flags,
+void replay_net_packet_event(ReplayNetState *rns,
const struct iovec *iov, int iovcnt)
{
NetEvent *event = g_new(NetEvent, 1);
- event->flags = flags;
event->data = g_malloc(iov_size(iov, iovcnt));
event->size = iov_size(iov, iovcnt);
event->id = rns->id;
@@ -74,7 +72,7 @@ void replay_event_net_run(void *opaque)
assert(event->id < network_filters_count);
qemu_netfilter_pass_to_next(network_filters[event->id]->netdev,
- event->flags, &iov, 1, network_filters[event->id]);
+ &iov, 1, network_filters[event->id]);
g_free(event->data);
g_free(event);
@@ -85,7 +83,6 @@ void replay_event_net_save(void *opaque)
NetEvent *event = opaque;
replay_put_byte(event->id);
- replay_put_dword(event->flags);
replay_put_array(event->data, event->size);
}
@@ -94,7 +91,6 @@ void *replay_event_net_load(void)
NetEvent *event = g_new(NetEvent, 1);
event->id = replay_get_byte();
- event->flags = replay_get_dword();
replay_get_array_alloc(&event->data, &event->size);
return event;
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v3 05/11] tap: Shrink zeroed virtio-net header
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
` (3 preceding siblings ...)
2023-10-11 15:39 ` [PATCH v3 04/11] net: Remove receive_raw() Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 06/11] virtio-net: Copy header only when necessary Akihiko Odaki
` (5 subsequent siblings)
10 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki
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 <akihiko.odaki@daynix.com>
---
net/tap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tap.c b/net/tap.c
index 668d69c0de..4c1eb92076 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -118,7 +118,7 @@ static ssize_t tap_receive_iov(NetClientState *nc, const struct iovec *iov,
TAPState *s = DO_UPCAST(TAPState, nc, nc);
const struct iovec *iovp = iov;
struct iovec iov_copy[iovcnt + 1];
- struct virtio_net_hdr_mrg_rxbuf hdr = { };
+ struct virtio_net_hdr hdr = { };
if (s->host_vnet_hdr_len && !s->using_vnet_hdr) {
iov_copy[0].iov_base = &hdr;
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v3 06/11] virtio-net: Copy header only when necessary
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
` (4 preceding siblings ...)
2023-10-11 15:39 ` [PATCH v3 05/11] tap: Shrink zeroed virtio-net header Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 07/11] virtio-net: Disable RSS on reset Akihiko Odaki
` (4 subsequent siblings)
10 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki
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: reference implementation of hash report")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
hw/net/virtio-net.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index cab79f19cb..b1cc74881a 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -361,7 +361,8 @@ static void virtio_net_vnet_endian_status(VirtIONet *n, uint8_t status)
* can't do it, we fallback onto fixing the headers in the core
* virtio-net code.
*/
- n->needs_vnet_hdr_swap = virtio_net_set_vnet_endian(vdev, n->nic->ncs,
+ n->needs_vnet_hdr_swap = n->has_vnet_hdr &&
+ virtio_net_set_vnet_endian(vdev, n->nic->ncs,
queue_pairs, true);
} else if (virtio_net_started(n, vdev->status)) {
/* After using the device, we need to reset the network backend to
@@ -2690,7 +2691,7 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
return -EINVAL;
}
- if (n->has_vnet_hdr) {
+ if (n->needs_vnet_hdr_swap) {
if (iov_to_buf(out_sg, out_num, 0, &mhdr, n->guest_hdr_len) <
n->guest_hdr_len) {
virtio_error(vdev, "virtio-net header incorrect");
@@ -2698,19 +2699,16 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
g_free(elem);
return -EINVAL;
}
- if (n->needs_vnet_hdr_swap) {
- virtio_net_hdr_swap(vdev, (void *) &mhdr);
- sg2[0].iov_base = &mhdr;
- sg2[0].iov_len = n->guest_hdr_len;
- out_num = iov_copy(&sg2[1], ARRAY_SIZE(sg2) - 1,
- out_sg, out_num,
- n->guest_hdr_len, -1);
- if (out_num == VIRTQUEUE_MAX_SIZE) {
- goto drop;
- }
- out_num += 1;
- out_sg = sg2;
+ virtio_net_hdr_swap(vdev, (void *) &mhdr);
+ sg2[0].iov_base = &mhdr;
+ sg2[0].iov_len = n->guest_hdr_len;
+ out_num = iov_copy(&sg2[1], ARRAY_SIZE(sg2) - 1, out_sg, out_num,
+ n->guest_hdr_len, -1);
+ if (out_num == VIRTQUEUE_MAX_SIZE) {
+ goto drop;
}
+ out_num += 1;
+ out_sg = sg2;
}
/*
* If host wants to see the guest header as is, we can
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v3 07/11] virtio-net: Disable RSS on reset
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
` (5 preceding siblings ...)
2023-10-11 15:39 ` [PATCH v3 06/11] virtio-net: Copy header only when necessary Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 08/11] virtio-net: Unify the logic to update NIC state for RSS Akihiko Odaki
` (3 subsequent siblings)
10 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki
RSS is disabled by default.
Fixes: 590790297c ("virtio-net: implement RSS configuration command")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
hw/net/virtio-net.c | 70 +++++++++++++++++++++++----------------------
1 file changed, 36 insertions(+), 34 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index b1cc74881a..cd533fb91a 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -601,40 +601,6 @@ static void virtio_net_queue_enable(VirtIODevice *vdev, uint32_t queue_index)
}
}
-static void virtio_net_reset(VirtIODevice *vdev)
-{
- VirtIONet *n = VIRTIO_NET(vdev);
- int i;
-
- /* Reset back to compatibility mode */
- n->promisc = 1;
- n->allmulti = 0;
- n->alluni = 0;
- n->nomulti = 0;
- n->nouni = 0;
- n->nobcast = 0;
- /* multiqueue is disabled by default */
- n->curr_queue_pairs = 1;
- timer_del(n->announce_timer.tm);
- n->announce_timer.round = 0;
- n->status &= ~VIRTIO_NET_S_ANNOUNCE;
-
- /* Flush any MAC and VLAN filter table state */
- n->mac_table.in_use = 0;
- n->mac_table.first_multi = 0;
- n->mac_table.multi_overflow = 0;
- n->mac_table.uni_overflow = 0;
- memset(n->mac_table.macs, 0, MAC_TABLE_ENTRIES * ETH_ALEN);
- memcpy(&n->mac[0], &n->nic->conf->macaddr, sizeof(n->mac));
- qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
- memset(n->vlans, 0, MAX_VLAN >> 3);
-
- /* Flush any async TX */
- for (i = 0; i < n->max_queue_pairs; i++) {
- flush_or_purge_queued_packets(qemu_get_subqueue(n->nic, i));
- }
-}
-
static void peer_test_vnet_hdr(VirtIONet *n)
{
NetClientState *nc = qemu_get_queue(n->nic);
@@ -3786,6 +3752,42 @@ static void virtio_net_device_unrealize(DeviceState *dev)
virtio_cleanup(vdev);
}
+static void virtio_net_reset(VirtIODevice *vdev)
+{
+ VirtIONet *n = VIRTIO_NET(vdev);
+ int i;
+
+ /* Reset back to compatibility mode */
+ n->promisc = 1;
+ n->allmulti = 0;
+ n->alluni = 0;
+ n->nomulti = 0;
+ n->nouni = 0;
+ n->nobcast = 0;
+ /* multiqueue is disabled by default */
+ n->curr_queue_pairs = 1;
+ timer_del(n->announce_timer.tm);
+ n->announce_timer.round = 0;
+ n->status &= ~VIRTIO_NET_S_ANNOUNCE;
+
+ /* Flush any MAC and VLAN filter table state */
+ n->mac_table.in_use = 0;
+ n->mac_table.first_multi = 0;
+ n->mac_table.multi_overflow = 0;
+ n->mac_table.uni_overflow = 0;
+ memset(n->mac_table.macs, 0, MAC_TABLE_ENTRIES * ETH_ALEN);
+ memcpy(&n->mac[0], &n->nic->conf->macaddr, sizeof(n->mac));
+ qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
+ memset(n->vlans, 0, MAX_VLAN >> 3);
+
+ /* Flush any async TX */
+ for (i = 0; i < n->max_queue_pairs; i++) {
+ flush_or_purge_queued_packets(qemu_get_subqueue(n->nic, i));
+ }
+
+ virtio_net_disable_rss(n);
+}
+
static void virtio_net_instance_init(Object *obj)
{
VirtIONet *n = VIRTIO_NET(obj);
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v3 08/11] virtio-net: Unify the logic to update NIC state for RSS
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
` (6 preceding siblings ...)
2023-10-11 15:39 ` [PATCH v3 07/11] virtio-net: Disable RSS on reset Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 09/11] virtio-net: Return an error when vhost cannot enable RSS Akihiko Odaki
` (2 subsequent siblings)
10 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki
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 <akihiko.odaki@daynix.com>
---
hw/net/virtio-net.c | 90 ++++++++++++++++++---------------------------
1 file changed, 36 insertions(+), 54 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index cd533fb91a..25fc06bd93 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1212,18 +1212,6 @@ static int virtio_net_handle_announce(VirtIONet *n, uint8_t cmd,
}
}
-static void virtio_net_detach_epbf_rss(VirtIONet *n);
-
-static void virtio_net_disable_rss(VirtIONet *n)
-{
- if (n->rss_data.enabled) {
- trace_virtio_net_rss_disable();
- }
- n->rss_data.enabled = false;
-
- virtio_net_detach_epbf_rss(n);
-}
-
static bool virtio_net_attach_ebpf_to_backend(NICState *nic, int prog_fd)
{
NetClientState *nc = qemu_get_peer(qemu_get_queue(nic), 0);
@@ -1271,6 +1259,40 @@ static void virtio_net_detach_epbf_rss(VirtIONet *n)
virtio_net_attach_ebpf_to_backend(n->nic, -1);
}
+static void virtio_net_commit_rss_config(VirtIONet *n)
+{
+ if (n->rss_data.enabled) {
+ n->rss_data.enabled_software_rss = n->rss_data.populate_hash;
+ if (n->rss_data.populate_hash) {
+ virtio_net_detach_epbf_rss(n);
+ } else if (!virtio_net_attach_epbf_rss(n)) {
+ if (get_vhost_net(qemu_get_queue(n->nic)->peer)) {
+ warn_report("Can't use eBPF RSS for vhost");
+ } else {
+ warn_report("Can't use eBPF RSS - fallback to software RSS");
+ n->rss_data.enabled_software_rss = true;
+ }
+ }
+
+ trace_virtio_net_rss_enable(n->rss_data.hash_types,
+ n->rss_data.indirections_len,
+ sizeof(n->rss_data.key));
+ } else {
+ virtio_net_detach_epbf_rss(n);
+ trace_virtio_net_rss_disable();
+ }
+}
+
+static void virtio_net_disable_rss(VirtIONet *n)
+{
+ if (!n->rss_data.enabled) {
+ return;
+ }
+
+ n->rss_data.enabled = false;
+ virtio_net_commit_rss_config(n);
+}
+
static bool virtio_net_load_ebpf(VirtIONet *n)
{
if (!virtio_net_attach_ebpf_to_backend(n->nic, -1)) {
@@ -1399,28 +1421,7 @@ static uint16_t virtio_net_handle_rss(VirtIONet *n,
goto error;
}
n->rss_data.enabled = true;
-
- if (!n->rss_data.populate_hash) {
- if (!virtio_net_attach_epbf_rss(n)) {
- /* EBPF must be loaded for vhost */
- if (get_vhost_net(qemu_get_queue(n->nic)->peer)) {
- warn_report("Can't load eBPF RSS for vhost");
- goto error;
- }
- /* fallback to software RSS */
- warn_report("Can't load eBPF RSS - fallback to software RSS");
- n->rss_data.enabled_software_rss = true;
- }
- } else {
- /* use software RSS for hash populating */
- /* and detach eBPF if was loaded before */
- virtio_net_detach_epbf_rss(n);
- n->rss_data.enabled_software_rss = true;
- }
-
- trace_virtio_net_rss_enable(n->rss_data.hash_types,
- n->rss_data.indirections_len,
- temp.b);
+ virtio_net_commit_rss_config(n);
return queue_pairs;
error:
trace_virtio_net_rss_error(err_msg, err_value);
@@ -3016,26 +3017,7 @@ static int virtio_net_post_load_device(void *opaque, int version_id)
}
}
- if (n->rss_data.enabled) {
- n->rss_data.enabled_software_rss = n->rss_data.populate_hash;
- if (!n->rss_data.populate_hash) {
- if (!virtio_net_attach_epbf_rss(n)) {
- if (get_vhost_net(qemu_get_queue(n->nic)->peer)) {
- warn_report("Can't post-load eBPF RSS for vhost");
- } else {
- warn_report("Can't post-load eBPF RSS - "
- "fallback to software RSS");
- n->rss_data.enabled_software_rss = true;
- }
- }
- }
-
- trace_virtio_net_rss_enable(n->rss_data.hash_types,
- n->rss_data.indirections_len,
- sizeof(n->rss_data.key));
- } else {
- trace_virtio_net_rss_disable();
- }
+ virtio_net_commit_rss_config(n);
return 0;
}
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v3 09/11] virtio-net: Return an error when vhost cannot enable RSS
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
` (7 preceding siblings ...)
2023-10-11 15:39 ` [PATCH v3 08/11] virtio-net: Unify the logic to update NIC state for RSS Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 10/11] virtio-net: Do not clear VIRTIO_NET_F_RSS Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 11/11] ebpf: Fix RSS error handling Akihiko Odaki
10 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki
vhost requires eBPF for RSS. Even when eBPF is not available, virtio-net
reported RSS availability, and raised a warning only after the
guest requested RSS, and the guest could not know that RSS is not
available.
Check RSS availability during device realization and return an error
if RSS is requested but not available. Assert RSS availability when
the guest actually requests the feature.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
| 2 +-
| 4 +-
| 68 +++++++++-----------------
hw/net/virtio-net.c | 114 +++++++++++++++++++++----------------------
4 files changed, 82 insertions(+), 106 deletions(-)
--git a/ebpf/ebpf_rss.h b/ebpf/ebpf_rss.h
index bf3f2572c7..1128173572 100644
--- a/ebpf/ebpf_rss.h
+++ b/ebpf/ebpf_rss.h
@@ -36,7 +36,7 @@ bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx);
bool ebpf_rss_load(struct EBPFRSSContext *ctx);
-bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
+void ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
uint16_t *indirections_table, uint8_t *toeplitz_key);
void ebpf_rss_unload(struct EBPFRSSContext *ctx);
--git a/ebpf/ebpf_rss-stub.c b/ebpf/ebpf_rss-stub.c
index e71e229190..525b358597 100644
--- a/ebpf/ebpf_rss-stub.c
+++ b/ebpf/ebpf_rss-stub.c
@@ -28,10 +28,10 @@ bool ebpf_rss_load(struct EBPFRSSContext *ctx)
return false;
}
-bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
+void ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
uint16_t *indirections_table, uint8_t *toeplitz_key)
{
- return false;
+ g_assert_not_reached();
}
void ebpf_rss_unload(struct EBPFRSSContext *ctx)
--git a/ebpf/ebpf_rss.c b/ebpf/ebpf_rss.c
index cee658c158..6cdf82d059 100644
--- a/ebpf/ebpf_rss.c
+++ b/ebpf/ebpf_rss.c
@@ -74,42 +74,32 @@ error:
return false;
}
-static bool ebpf_rss_set_config(struct EBPFRSSContext *ctx,
+static void ebpf_rss_set_config(struct EBPFRSSContext *ctx,
struct EBPFRSSConfig *config)
{
uint32_t map_key = 0;
- if (!ebpf_rss_is_loaded(ctx)) {
- return false;
- }
- if (bpf_map_update_elem(ctx->map_configuration,
- &map_key, config, 0) < 0) {
- return false;
- }
- return true;
+ assert(ebpf_rss_is_loaded(ctx));
+ assert(!bpf_map_update_elem(ctx->map_configuration, &map_key, config, 0));
}
-static bool ebpf_rss_set_indirections_table(struct EBPFRSSContext *ctx,
+static void ebpf_rss_set_indirections_table(struct EBPFRSSContext *ctx,
uint16_t *indirections_table,
size_t len)
{
uint32_t i = 0;
- if (!ebpf_rss_is_loaded(ctx) || indirections_table == NULL ||
- len > VIRTIO_NET_RSS_MAX_TABLE_LEN) {
- return false;
- }
+ assert(ebpf_rss_is_loaded(ctx));
+ assert(indirections_table);
+ assert(len <= VIRTIO_NET_RSS_MAX_TABLE_LEN);
for (; i < len; ++i) {
- if (bpf_map_update_elem(ctx->map_indirections_table, &i,
- indirections_table + i, 0) < 0) {
- return false;
- }
+ assert(!bpf_map_update_elem(ctx->map_indirections_table, &i,
+ indirections_table + i, 0));
}
- return true;
}
-static bool ebpf_rss_set_toepliz_key(struct EBPFRSSContext *ctx,
+static void ebpf_rss_set_toepliz_key(struct EBPFRSSContext *ctx,
uint8_t *toeplitz_key)
{
uint32_t map_key = 0;
@@ -117,41 +107,29 @@ static bool ebpf_rss_set_toepliz_key(struct EBPFRSSContext *ctx,
/* prepare toeplitz key */
uint8_t toe[VIRTIO_NET_RSS_MAX_KEY_SIZE] = {};
- if (!ebpf_rss_is_loaded(ctx) || toeplitz_key == NULL) {
- return false;
- }
+ assert(ebpf_rss_is_loaded(ctx));
+ assert(toeplitz_key);
+
memcpy(toe, toeplitz_key, VIRTIO_NET_RSS_MAX_KEY_SIZE);
*(uint32_t *)toe = ntohl(*(uint32_t *)toe);
- if (bpf_map_update_elem(ctx->map_toeplitz_key, &map_key, toe,
- 0) < 0) {
- return false;
- }
- return true;
+ assert(!bpf_map_update_elem(ctx->map_toeplitz_key, &map_key, toe, 0));
}
-bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
+void ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
uint16_t *indirections_table, uint8_t *toeplitz_key)
{
- if (!ebpf_rss_is_loaded(ctx) || config == NULL ||
- indirections_table == NULL || toeplitz_key == NULL) {
- return false;
- }
-
- if (!ebpf_rss_set_config(ctx, config)) {
- return false;
- }
+ assert(ebpf_rss_is_loaded(ctx));
+ assert(config);
+ assert(indirections_table);
+ assert(toeplitz_key);
- if (!ebpf_rss_set_indirections_table(ctx, indirections_table,
- config->indirections_len)) {
- return false;
- }
+ ebpf_rss_set_config(ctx, config);
- if (!ebpf_rss_set_toepliz_key(ctx, toeplitz_key)) {
- return false;
- }
+ ebpf_rss_set_indirections_table(ctx, indirections_table,
+ config->indirections_len);
- return true;
+ ebpf_rss_set_toepliz_key(ctx, toeplitz_key);
}
void ebpf_rss_unload(struct EBPFRSSContext *ctx)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 25fc06bd93..20feb20bb1 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1242,14 +1242,10 @@ static bool virtio_net_attach_epbf_rss(VirtIONet *n)
rss_data_to_rss_config(&n->rss_data, &config);
- if (!ebpf_rss_set_all(&n->ebpf_rss, &config,
- n->rss_data.indirections_table, n->rss_data.key)) {
- return false;
- }
+ ebpf_rss_set_all(&n->ebpf_rss, &config,
+ n->rss_data.indirections_table, n->rss_data.key);
- if (!virtio_net_attach_ebpf_to_backend(n->nic, n->ebpf_rss.program_fd)) {
- return false;
- }
+ assert(virtio_net_attach_ebpf_to_backend(n->nic, n->ebpf_rss.program_fd));
return true;
}
@@ -1266,12 +1262,7 @@ static void virtio_net_commit_rss_config(VirtIONet *n)
if (n->rss_data.populate_hash) {
virtio_net_detach_epbf_rss(n);
} else if (!virtio_net_attach_epbf_rss(n)) {
- if (get_vhost_net(qemu_get_queue(n->nic)->peer)) {
- warn_report("Can't use eBPF RSS for vhost");
- } else {
- warn_report("Can't use eBPF RSS - fallback to software RSS");
- n->rss_data.enabled_software_rss = true;
- }
+ n->rss_data.enabled_software_rss = true;
}
trace_virtio_net_rss_enable(n->rss_data.hash_types,
@@ -3514,6 +3505,50 @@ static bool failover_hide_primary_device(DeviceListener *listener,
return qatomic_read(&n->failover_primary_hidden);
}
+static void virtio_net_device_unrealize(DeviceState *dev)
+{
+ VirtIODevice *vdev = VIRTIO_DEVICE(dev);
+ VirtIONet *n = VIRTIO_NET(dev);
+ int i, max_queue_pairs;
+
+ if (virtio_has_feature(n->host_features, VIRTIO_NET_F_RSS)) {
+ virtio_net_unload_ebpf(n);
+ }
+
+ /* This will stop vhost backend if appropriate. */
+ virtio_net_set_status(vdev, 0);
+
+ g_free(n->netclient_name);
+ n->netclient_name = NULL;
+ g_free(n->netclient_type);
+ n->netclient_type = NULL;
+
+ g_free(n->mac_table.macs);
+ g_free(n->vlans);
+
+ if (n->failover) {
+ qobject_unref(n->primary_opts);
+ device_listener_unregister(&n->primary_listener);
+ remove_migration_state_change_notifier(&n->migration_state);
+ } else {
+ assert(n->primary_opts == NULL);
+ }
+
+ max_queue_pairs = n->multiqueue ? n->max_queue_pairs : 1;
+ for (i = 0; i < max_queue_pairs; i++) {
+ virtio_net_del_queue(n, i);
+ }
+ /* delete also control vq */
+ virtio_del_queue(vdev, max_queue_pairs * 2);
+ qemu_announce_timer_del(&n->announce_timer, false);
+ g_free(n->vqs);
+ qemu_del_nic(n->nic);
+ virtio_net_rsc_cleanup(n);
+ g_free(n->rss_data.indirections_table);
+ net_rx_pkt_uninit(n->rx_pkt);
+ virtio_cleanup(vdev);
+}
+
static void virtio_net_device_realize(DeviceState *dev, Error **errp)
{
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
@@ -3685,53 +3720,16 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
net_rx_pkt_init(&n->rx_pkt);
- if (virtio_has_feature(n->host_features, VIRTIO_NET_F_RSS)) {
- virtio_net_load_ebpf(n);
- }
-}
-
-static void virtio_net_device_unrealize(DeviceState *dev)
-{
- VirtIODevice *vdev = VIRTIO_DEVICE(dev);
- VirtIONet *n = VIRTIO_NET(dev);
- int i, max_queue_pairs;
-
- if (virtio_has_feature(n->host_features, VIRTIO_NET_F_RSS)) {
- virtio_net_unload_ebpf(n);
- }
-
- /* This will stop vhost backend if appropriate. */
- virtio_net_set_status(vdev, 0);
-
- g_free(n->netclient_name);
- n->netclient_name = NULL;
- g_free(n->netclient_type);
- n->netclient_type = NULL;
-
- g_free(n->mac_table.macs);
- g_free(n->vlans);
-
- if (n->failover) {
- qobject_unref(n->primary_opts);
- device_listener_unregister(&n->primary_listener);
- remove_migration_state_change_notifier(&n->migration_state);
- } else {
- assert(n->primary_opts == NULL);
- }
+ if (virtio_has_feature(n->host_features, VIRTIO_NET_F_RSS) &&
+ !virtio_net_load_ebpf(n)) {
+ if (get_vhost_net(nc->peer)) {
+ error_setg(errp, "Can't load eBPF RSS for vhost");
+ virtio_net_device_unrealize(dev);
+ return;
+ }
- max_queue_pairs = n->multiqueue ? n->max_queue_pairs : 1;
- for (i = 0; i < max_queue_pairs; i++) {
- virtio_net_del_queue(n, i);
+ warn_report_once("Can't load eBPF RSS - fallback to software RSS");
}
- /* delete also control vq */
- virtio_del_queue(vdev, max_queue_pairs * 2);
- qemu_announce_timer_del(&n->announce_timer, false);
- g_free(n->vqs);
- qemu_del_nic(n->nic);
- virtio_net_rsc_cleanup(n);
- g_free(n->rss_data.indirections_table);
- net_rx_pkt_uninit(n->rx_pkt);
- virtio_cleanup(vdev);
}
static void virtio_net_reset(VirtIODevice *vdev)
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v3 10/11] virtio-net: Do not clear VIRTIO_NET_F_RSS
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
` (8 preceding siblings ...)
2023-10-11 15:39 ` [PATCH v3 09/11] virtio-net: Return an error when vhost cannot enable RSS Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 11/11] ebpf: Fix RSS error handling Akihiko Odaki
10 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki
Even if eBPF is not available, virtio-net can perform RSS on the
user-space if vhost is disabled although such a configuration results in
a warning. If vhost is enabled, the configuration will be rejected when
realizing the device. Therefore, VIRTIO_NET_F_RSS should not be cleared
even if eBPF is not loaded.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
hw/net/virtio-net.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 20feb20bb1..31a32bdff9 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -775,9 +775,6 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
return features;
}
- if (!ebpf_rss_is_loaded(&n->ebpf_rss)) {
- virtio_clear_feature(&features, VIRTIO_NET_F_RSS);
- }
features = vhost_net_get_features(get_vhost_net(nc->peer), features);
vdev->backend_features = features;
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v3 11/11] ebpf: Fix RSS error handling
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
` (9 preceding siblings ...)
2023-10-11 15:39 ` [PATCH v3 10/11] virtio-net: Do not clear VIRTIO_NET_F_RSS Akihiko Odaki
@ 2023-10-11 15:39 ` Akihiko Odaki
10 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-11 15:39 UTC (permalink / raw)
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin, Jason Wang, Akihiko Odaki
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 <akihiko.odaki@daynix.com>
---
| 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
--git a/tools/ebpf/rss.bpf.c b/tools/ebpf/rss.bpf.c
index 20f227e2ac..667ea6899e 100644
--- a/tools/ebpf/rss.bpf.c
+++ b/tools/ebpf/rss.bpf.c
@@ -377,18 +377,19 @@ error:
return err;
}
-static inline __u32 calculate_rss_hash(struct __sk_buff *skb,
- struct rss_config_t *config, struct toeplitz_key_data_t *toe)
+static inline bool calculate_rss_hash(struct __sk_buff *skb,
+ struct rss_config_t *config,
+ struct toeplitz_key_data_t *toe,
+ __u32 *result)
{
__u8 rss_input[HASH_CALCULATION_BUFFER_SIZE] = {};
size_t bytes_written = 0;
- __u32 result = 0;
int err = 0;
struct packet_hash_info_t packet_info = {};
err = parse_packet(skb, &packet_info);
if (err) {
- return 0;
+ return false;
}
if (packet_info.is_ipv4) {
@@ -521,11 +522,13 @@ static inline __u32 calculate_rss_hash(struct __sk_buff *skb,
}
}
- if (bytes_written) {
- net_toeplitz_add(&result, rss_input, bytes_written, toe);
+ if (!bytes_written) {
+ return false;
}
- return result;
+ net_toeplitz_add(result, rss_input, bytes_written, toe);
+
+ return true;
}
SEC("tun_rss_steering")
@@ -546,8 +549,7 @@ int tun_rss_steering_prog(struct __sk_buff *skb)
return config->default_queue;
}
- hash = calculate_rss_hash(skb, config, toe);
- if (hash) {
+ if (calculate_rss_hash(skb, config, toe, &hash)) {
__u32 table_idx = hash % config->indirections_len;
__u16 *queue = 0;
--
2.42.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-11 15:39 ` [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len() Akihiko Odaki
@ 2023-10-13 1:38 ` Jason Wang
2023-10-13 4:14 ` Akihiko Odaki
0 siblings, 1 reply; 25+ messages in thread
From: Jason Wang @ 2023-10-13 1:38 UTC (permalink / raw)
To: Akihiko Odaki
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin
On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>
> 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.
Where can I see this agreement?
Thanks
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 1:38 ` Jason Wang
@ 2023-10-13 4:14 ` Akihiko Odaki
2023-10-13 5:00 ` Jason Wang
2023-10-13 13:55 ` Michael S. Tsirkin
0 siblings, 2 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-13 4:14 UTC (permalink / raw)
To: Jason Wang
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin
On 2023/10/13 10:38, Jason Wang wrote:
> On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>
>> 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.
>
> Where can I see this agreement?
docs/about/build-platforms.rst says:
> The project aims to support the most recent major version at all times
> for up to five years after its initial release. Support for the
> previous major version will be dropped 2 years after the new major
> version is released or when the vendor itself drops support, whichever
> comes first. In this context, third-party efforts to extend the
> lifetime of a distro are not considered, even when they are endorsed
> by the vendor (eg. Debian LTS); the same is true of repositories that
> contain packages backported from later releases (e.g. Debian
> backports). Within each major release, only the most recent minor
> release is considered.
>
> For the purposes of identifying supported software versions available
> on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
> RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
> similar software versions.
All of the previous major versions of these distributions ship far newer
kernels.
CentOS Stream 8 and RHEL 8 ship 4.18.0.
Debian bullseye ships 5.10.0.
Fedora 37 ships 6.5.6.
openSUSE Leap 15.4 ships 5.14.21.
SLES 12 ships 4.12.14.
Ubuntu 20.04 ships 5.4.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 4:14 ` Akihiko Odaki
@ 2023-10-13 5:00 ` Jason Wang
2023-10-13 5:26 ` Akihiko Odaki
2023-10-13 13:55 ` Michael S. Tsirkin
1 sibling, 1 reply; 25+ messages in thread
From: Jason Wang @ 2023-10-13 5:00 UTC (permalink / raw)
To: Akihiko Odaki
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin
On Fri, Oct 13, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>
> On 2023/10/13 10:38, Jason Wang wrote:
> > On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> >>
> >> 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.
> >
> > Where can I see this agreement?
>
> docs/about/build-platforms.rst says:
> > The project aims to support the most recent major version at all times
> > for up to five years after its initial release. Support for the
> > previous major version will be dropped 2 years after the new major
> > version is released or when the vendor itself drops support, whichever
> > comes first. In this context, third-party efforts to extend the
> > lifetime of a distro are not considered, even when they are endorsed
> > by the vendor (eg. Debian LTS); the same is true of repositories that
> > contain packages backported from later releases (e.g. Debian
> > backports). Within each major release, only the most recent minor
> > release is considered.
> >
> > For the purposes of identifying supported software versions available
> > on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
> > RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
> > similar software versions.
Well it also says:
"""
If a platform is not listed here, it does not imply that QEMU won't
work. If an unlisted platform has comparable software versions to a
listed platform, there is every expectation that it will work.
"""
A lot of downstream have customized build scripts.
And is something similar to such removal that has been done for other
subsystems?
Thanks
>
> All of the previous major versions of these distributions ship far newer
> kernels.
>
> CentOS Stream 8 and RHEL 8 ship 4.18.0.
> Debian bullseye ships 5.10.0.
> Fedora 37 ships 6.5.6.
> openSUSE Leap 15.4 ships 5.14.21.
> SLES 12 ships 4.12.14.
> Ubuntu 20.04 ships 5.4.
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 5:00 ` Jason Wang
@ 2023-10-13 5:26 ` Akihiko Odaki
2023-10-13 14:17 ` Michael S. Tsirkin
2023-10-16 5:25 ` Jason Wang
0 siblings, 2 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-13 5:26 UTC (permalink / raw)
To: Jason Wang
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin
On 2023/10/13 14:00, Jason Wang wrote:
> On Fri, Oct 13, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>
>> On 2023/10/13 10:38, Jason Wang wrote:
>>> On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>>>
>>>> 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.
>>>
>>> Where can I see this agreement?
>>
>> docs/about/build-platforms.rst says:
>> > The project aims to support the most recent major version at all times
>> > for up to five years after its initial release. Support for the
>> > previous major version will be dropped 2 years after the new major
>> > version is released or when the vendor itself drops support, whichever
>> > comes first. In this context, third-party efforts to extend the
>> > lifetime of a distro are not considered, even when they are endorsed
>> > by the vendor (eg. Debian LTS); the same is true of repositories that
>> > contain packages backported from later releases (e.g. Debian
>> > backports). Within each major release, only the most recent minor
>> > release is considered.
>> >
>> > For the purposes of identifying supported software versions available
>> > on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
>> > RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
>> > similar software versions.
>
> Well it also says:
>
> """
> If a platform is not listed here, it does not imply that QEMU won't
> work. If an unlisted platform has comparable software versions to a
> listed platform, there is every expectation that it will work.
> """
>
> A lot of downstream have customized build scripts.
Still Linux versions older than 2.6.35 do not look like "comparable
software versions to a listed platform" in my opinion.
> And is something similar to such removal that has been done for other
> subsystems?
With commit c42e77a90d ("qemu/osdep: Remove fallback for
MAP_FIXED_NOREPLACE"), I remove the support for glibc older than 2.28.
Linux 2.6.35 is even older.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 4:14 ` Akihiko Odaki
2023-10-13 5:00 ` Jason Wang
@ 2023-10-13 13:55 ` Michael S. Tsirkin
2023-10-13 14:00 ` Akihiko Odaki
1 sibling, 1 reply; 25+ messages in thread
From: Michael S. Tsirkin @ 2023-10-13 13:55 UTC (permalink / raw)
To: Akihiko Odaki
Cc: Jason Wang, qemu-devel, Yuri Benditovich, Andrew Melnychenko
On Fri, Oct 13, 2023 at 01:14:32PM +0900, Akihiko Odaki wrote:
> On 2023/10/13 10:38, Jason Wang wrote:
> > On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> > >
> > > 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.
> >
> > Where can I see this agreement?
>
> docs/about/build-platforms.rst says:
> > The project aims to support the most recent major version at all times
> > for up to five years after its initial release. Support for the
> > previous major version will be dropped 2 years after the new major
> > version is released or when the vendor itself drops support, whichever
> > comes first. In this context, third-party efforts to extend the
> > lifetime of a distro are not considered, even when they are endorsed
> > by the vendor (eg. Debian LTS); the same is true of repositories that
> > contain packages backported from later releases (e.g. Debian
> > backports). Within each major release, only the most recent minor
> > release is considered.
> >
> > For the purposes of identifying supported software versions available
> > on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
> > RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
> > similar software versions.
>
> All of the previous major versions of these distributions ship far newer
> kernels.
>
> CentOS Stream 8 and RHEL 8 ship 4.18.0.
Yes but RHEL7 is still in full support.
> Debian bullseye ships 5.10.0.
> Fedora 37 ships 6.5.6.
> openSUSE Leap 15.4 ships 5.14.21.
> SLES 12 ships 4.12.14.
> Ubuntu 20.04 ships 5.4.
It does not matter that a newer version is shipped. What matters is
whether older one is still supported.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 13:55 ` Michael S. Tsirkin
@ 2023-10-13 14:00 ` Akihiko Odaki
0 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-13 14:00 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Jason Wang, qemu-devel, Yuri Benditovich, Andrew Melnychenko
On 2023/10/13 22:55, Michael S. Tsirkin wrote:
> On Fri, Oct 13, 2023 at 01:14:32PM +0900, Akihiko Odaki wrote:
>> On 2023/10/13 10:38, Jason Wang wrote:
>>> On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>>>
>>>> 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.
>>>
>>> Where can I see this agreement?
>>
>> docs/about/build-platforms.rst says:
>>> The project aims to support the most recent major version at all times
>>> for up to five years after its initial release. Support for the
>>> previous major version will be dropped 2 years after the new major
>>> version is released or when the vendor itself drops support, whichever
>>> comes first. In this context, third-party efforts to extend the
>>> lifetime of a distro are not considered, even when they are endorsed
>>> by the vendor (eg. Debian LTS); the same is true of repositories that
>>> contain packages backported from later releases (e.g. Debian
>>> backports). Within each major release, only the most recent minor
>>> release is considered.
>>>
>>> For the purposes of identifying supported software versions available
>>> on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
>>> RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
>>> similar software versions.
>>
>> All of the previous major versions of these distributions ship far newer
>> kernels.
>>
>> CentOS Stream 8 and RHEL 8 ship 4.18.0.
>
> Yes but RHEL7 is still in full support.
I don't think so. The downstream (Red Hat) may still support it, but
it's not supported by QEMU upstream according to
docs/about/build-platforms.rst.
>
>> Debian bullseye ships 5.10.0.
>> Fedora 37 ships 6.5.6.
>> openSUSE Leap 15.4 ships 5.14.21.
>> SLES 12 ships 4.12.14.
>> Ubuntu 20.04 ships 5.4.
>
> It does not matter that a newer version is shipped. What matters is
> whether older one is still supported.
These versions should be the oldest supported versions that match with
the description in docs/about/build-platforms.rst.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 5:26 ` Akihiko Odaki
@ 2023-10-13 14:17 ` Michael S. Tsirkin
2023-10-13 14:22 ` Akihiko Odaki
2023-10-16 5:25 ` Jason Wang
1 sibling, 1 reply; 25+ messages in thread
From: Michael S. Tsirkin @ 2023-10-13 14:17 UTC (permalink / raw)
To: Akihiko Odaki
Cc: Jason Wang, qemu-devel, Yuri Benditovich, Andrew Melnychenko
On Fri, Oct 13, 2023 at 02:26:03PM +0900, Akihiko Odaki wrote:
> On 2023/10/13 14:00, Jason Wang wrote:
> > On Fri, Oct 13, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> > >
> > > On 2023/10/13 10:38, Jason Wang wrote:
> > > > On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> > > > >
> > > > > 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.
> > > >
> > > > Where can I see this agreement?
> > >
> > > docs/about/build-platforms.rst says:
> > > > The project aims to support the most recent major version at all times
> > > > for up to five years after its initial release. Support for the
> > > > previous major version will be dropped 2 years after the new major
> > > > version is released or when the vendor itself drops support, whichever
> > > > comes first. In this context, third-party efforts to extend the
> > > > lifetime of a distro are not considered, even when they are endorsed
> > > > by the vendor (eg. Debian LTS); the same is true of repositories that
> > > > contain packages backported from later releases (e.g. Debian
> > > > backports). Within each major release, only the most recent minor
> > > > release is considered.
> > > >
> > > > For the purposes of identifying supported software versions available
> > > > on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
> > > > RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
> > > > similar software versions.
> >
> > Well it also says:
> >
> > """
> > If a platform is not listed here, it does not imply that QEMU won't
> > work. If an unlisted platform has comparable software versions to a
> > listed platform, there is every expectation that it will work.
> > """
> >
> > A lot of downstream have customized build scripts.
>
> Still Linux versions older than 2.6.35 do not look like "comparable software
> versions to a listed platform" in my opinion.
This is fine - I would be ok to replace support with an error message
and failure. Not checking that a capability is supported however
isn't a good idea. And once we do - do we still gain anything by
not working around that?
> > And is something similar to such removal that has been done for other
> > subsystems?
>
> With commit c42e77a90d ("qemu/osdep: Remove fallback for
> MAP_FIXED_NOREPLACE"), I remove the support for glibc older than 2.28. Linux
> 2.6.35 is even older.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 14:17 ` Michael S. Tsirkin
@ 2023-10-13 14:22 ` Akihiko Odaki
2023-10-13 14:32 ` Michael S. Tsirkin
0 siblings, 1 reply; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-13 14:22 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Jason Wang, qemu-devel, Yuri Benditovich, Andrew Melnychenko
On 2023/10/13 23:17, Michael S. Tsirkin wrote:
> On Fri, Oct 13, 2023 at 02:26:03PM +0900, Akihiko Odaki wrote:
>> On 2023/10/13 14:00, Jason Wang wrote:
>>> On Fri, Oct 13, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>>>
>>>> On 2023/10/13 10:38, Jason Wang wrote:
>>>>> On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>>>>>
>>>>>> 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.
>>>>>
>>>>> Where can I see this agreement?
>>>>
>>>> docs/about/build-platforms.rst says:
>>>> > The project aims to support the most recent major version at all times
>>>> > for up to five years after its initial release. Support for the
>>>> > previous major version will be dropped 2 years after the new major
>>>> > version is released or when the vendor itself drops support, whichever
>>>> > comes first. In this context, third-party efforts to extend the
>>>> > lifetime of a distro are not considered, even when they are endorsed
>>>> > by the vendor (eg. Debian LTS); the same is true of repositories that
>>>> > contain packages backported from later releases (e.g. Debian
>>>> > backports). Within each major release, only the most recent minor
>>>> > release is considered.
>>>> >
>>>> > For the purposes of identifying supported software versions available
>>>> > on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
>>>> > RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
>>>> > similar software versions.
>>>
>>> Well it also says:
>>>
>>> """
>>> If a platform is not listed here, it does not imply that QEMU won't
>>> work. If an unlisted platform has comparable software versions to a
>>> listed platform, there is every expectation that it will work.
>>> """
>>>
>>> A lot of downstream have customized build scripts.
>>
>> Still Linux versions older than 2.6.35 do not look like "comparable software
>> versions to a listed platform" in my opinion.
>
>
> This is fine - I would be ok to replace support with an error message
> and failure. Not checking that a capability is supported however
> isn't a good idea. And once we do - do we still gain anything by
> not working around that?
tap does still check if setting the header length succeeds so it should
be fine.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 14:22 ` Akihiko Odaki
@ 2023-10-13 14:32 ` Michael S. Tsirkin
2023-10-13 14:34 ` Akihiko Odaki
0 siblings, 1 reply; 25+ messages in thread
From: Michael S. Tsirkin @ 2023-10-13 14:32 UTC (permalink / raw)
To: Akihiko Odaki
Cc: Jason Wang, qemu-devel, Yuri Benditovich, Andrew Melnychenko
On Fri, Oct 13, 2023 at 11:22:10PM +0900, Akihiko Odaki wrote:
> On 2023/10/13 23:17, Michael S. Tsirkin wrote:
> > On Fri, Oct 13, 2023 at 02:26:03PM +0900, Akihiko Odaki wrote:
> > > On 2023/10/13 14:00, Jason Wang wrote:
> > > > On Fri, Oct 13, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> > > > >
> > > > > On 2023/10/13 10:38, Jason Wang wrote:
> > > > > > On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> > > > > > >
> > > > > > > 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.
> > > > > >
> > > > > > Where can I see this agreement?
> > > > >
> > > > > docs/about/build-platforms.rst says:
> > > > > > The project aims to support the most recent major version at all times
> > > > > > for up to five years after its initial release. Support for the
> > > > > > previous major version will be dropped 2 years after the new major
> > > > > > version is released or when the vendor itself drops support, whichever
> > > > > > comes first. In this context, third-party efforts to extend the
> > > > > > lifetime of a distro are not considered, even when they are endorsed
> > > > > > by the vendor (eg. Debian LTS); the same is true of repositories that
> > > > > > contain packages backported from later releases (e.g. Debian
> > > > > > backports). Within each major release, only the most recent minor
> > > > > > release is considered.
> > > > > >
> > > > > > For the purposes of identifying supported software versions available
> > > > > > on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
> > > > > > RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
> > > > > > similar software versions.
> > > >
> > > > Well it also says:
> > > >
> > > > """
> > > > If a platform is not listed here, it does not imply that QEMU won't
> > > > work. If an unlisted platform has comparable software versions to a
> > > > listed platform, there is every expectation that it will work.
> > > > """
> > > >
> > > > A lot of downstream have customized build scripts.
> > >
> > > Still Linux versions older than 2.6.35 do not look like "comparable software
> > > versions to a listed platform" in my opinion.
> >
> >
> > This is fine - I would be ok to replace support with an error message
> > and failure. Not checking that a capability is supported however
> > isn't a good idea. And once we do - do we still gain anything by
> > not working around that?
>
> tap does still check if setting the header length succeeds so it should be
> fine.
It asserts though doesn't it? Hardly user friendly ...
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 14:32 ` Michael S. Tsirkin
@ 2023-10-13 14:34 ` Akihiko Odaki
2023-10-13 15:01 ` Michael S. Tsirkin
0 siblings, 1 reply; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-13 14:34 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Jason Wang, qemu-devel, Yuri Benditovich, Andrew Melnychenko
On 2023/10/13 23:32, Michael S. Tsirkin wrote:
> On Fri, Oct 13, 2023 at 11:22:10PM +0900, Akihiko Odaki wrote:
>> On 2023/10/13 23:17, Michael S. Tsirkin wrote:
>>> On Fri, Oct 13, 2023 at 02:26:03PM +0900, Akihiko Odaki wrote:
>>>> On 2023/10/13 14:00, Jason Wang wrote:
>>>>> On Fri, Oct 13, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>>>>>
>>>>>> On 2023/10/13 10:38, Jason Wang wrote:
>>>>>>> On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>>>>>>>
>>>>>>>> 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.
>>>>>>>
>>>>>>> Where can I see this agreement?
>>>>>>
>>>>>> docs/about/build-platforms.rst says:
>>>>>> > The project aims to support the most recent major version at all times
>>>>>> > for up to five years after its initial release. Support for the
>>>>>> > previous major version will be dropped 2 years after the new major
>>>>>> > version is released or when the vendor itself drops support, whichever
>>>>>> > comes first. In this context, third-party efforts to extend the
>>>>>> > lifetime of a distro are not considered, even when they are endorsed
>>>>>> > by the vendor (eg. Debian LTS); the same is true of repositories that
>>>>>> > contain packages backported from later releases (e.g. Debian
>>>>>> > backports). Within each major release, only the most recent minor
>>>>>> > release is considered.
>>>>>> >
>>>>>> > For the purposes of identifying supported software versions available
>>>>>> > on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
>>>>>> > RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
>>>>>> > similar software versions.
>>>>>
>>>>> Well it also says:
>>>>>
>>>>> """
>>>>> If a platform is not listed here, it does not imply that QEMU won't
>>>>> work. If an unlisted platform has comparable software versions to a
>>>>> listed platform, there is every expectation that it will work.
>>>>> """
>>>>>
>>>>> A lot of downstream have customized build scripts.
>>>>
>>>> Still Linux versions older than 2.6.35 do not look like "comparable software
>>>> versions to a listed platform" in my opinion.
>>>
>>>
>>> This is fine - I would be ok to replace support with an error message
>>> and failure. Not checking that a capability is supported however
>>> isn't a good idea. And once we do - do we still gain anything by
>>> not working around that?
>>
>> tap does still check if setting the header length succeeds so it should be
>> fine.
>
> It asserts though doesn't it? Hardly user friendly ...
It prints an error message so the user should be able to figure out
what's missing:
fprintf(stderr, "TUNSETVNETHDRSZ ioctl() failed: %s. Exiting.\n",
strerror(errno));
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 14:34 ` Akihiko Odaki
@ 2023-10-13 15:01 ` Michael S. Tsirkin
0 siblings, 0 replies; 25+ messages in thread
From: Michael S. Tsirkin @ 2023-10-13 15:01 UTC (permalink / raw)
To: Akihiko Odaki
Cc: Jason Wang, qemu-devel, Yuri Benditovich, Andrew Melnychenko
On Fri, Oct 13, 2023 at 11:34:54PM +0900, Akihiko Odaki wrote:
> On 2023/10/13 23:32, Michael S. Tsirkin wrote:
> > On Fri, Oct 13, 2023 at 11:22:10PM +0900, Akihiko Odaki wrote:
> > > On 2023/10/13 23:17, Michael S. Tsirkin wrote:
> > > > On Fri, Oct 13, 2023 at 02:26:03PM +0900, Akihiko Odaki wrote:
> > > > > On 2023/10/13 14:00, Jason Wang wrote:
> > > > > > On Fri, Oct 13, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> > > > > > >
> > > > > > > On 2023/10/13 10:38, Jason Wang wrote:
> > > > > > > > On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> > > > > > > > >
> > > > > > > > > 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.
> > > > > > > >
> > > > > > > > Where can I see this agreement?
> > > > > > >
> > > > > > > docs/about/build-platforms.rst says:
> > > > > > > > The project aims to support the most recent major version at all times
> > > > > > > > for up to five years after its initial release. Support for the
> > > > > > > > previous major version will be dropped 2 years after the new major
> > > > > > > > version is released or when the vendor itself drops support, whichever
> > > > > > > > comes first. In this context, third-party efforts to extend the
> > > > > > > > lifetime of a distro are not considered, even when they are endorsed
> > > > > > > > by the vendor (eg. Debian LTS); the same is true of repositories that
> > > > > > > > contain packages backported from later releases (e.g. Debian
> > > > > > > > backports). Within each major release, only the most recent minor
> > > > > > > > release is considered.
> > > > > > > >
> > > > > > > > For the purposes of identifying supported software versions available
> > > > > > > > on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
> > > > > > > > RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
> > > > > > > > similar software versions.
> > > > > >
> > > > > > Well it also says:
> > > > > >
> > > > > > """
> > > > > > If a platform is not listed here, it does not imply that QEMU won't
> > > > > > work. If an unlisted platform has comparable software versions to a
> > > > > > listed platform, there is every expectation that it will work.
> > > > > > """
> > > > > >
> > > > > > A lot of downstream have customized build scripts.
> > > > >
> > > > > Still Linux versions older than 2.6.35 do not look like "comparable software
> > > > > versions to a listed platform" in my opinion.
> > > >
> > > >
> > > > This is fine - I would be ok to replace support with an error message
> > > > and failure. Not checking that a capability is supported however
> > > > isn't a good idea. And once we do - do we still gain anything by
> > > > not working around that?
> > >
> > > tap does still check if setting the header length succeeds so it should be
> > > fine.
> >
> > It asserts though doesn't it? Hardly user friendly ...
>
> It prints an error message so the user should be able to figure out what's
> missing:
> fprintf(stderr, "TUNSETVNETHDRSZ ioctl() failed: %s. Exiting.\n",
> strerror(errno));
OK.
Acked-by: Michael S. Tsirkin <mst@redhat.com>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-13 5:26 ` Akihiko Odaki
2023-10-13 14:17 ` Michael S. Tsirkin
@ 2023-10-16 5:25 ` Jason Wang
2023-10-16 5:30 ` Akihiko Odaki
1 sibling, 1 reply; 25+ messages in thread
From: Jason Wang @ 2023-10-16 5:25 UTC (permalink / raw)
To: Akihiko Odaki
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin
On Fri, Oct 13, 2023 at 1:26 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>
> On 2023/10/13 14:00, Jason Wang wrote:
> > On Fri, Oct 13, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> >>
> >> On 2023/10/13 10:38, Jason Wang wrote:
> >>> On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> >>>>
> >>>> 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.
> >>>
> >>> Where can I see this agreement?
> >>
> >> docs/about/build-platforms.rst says:
> >> > The project aims to support the most recent major version at all times
> >> > for up to five years after its initial release. Support for the
> >> > previous major version will be dropped 2 years after the new major
> >> > version is released or when the vendor itself drops support, whichever
> >> > comes first. In this context, third-party efforts to extend the
> >> > lifetime of a distro are not considered, even when they are endorsed
> >> > by the vendor (eg. Debian LTS); the same is true of repositories that
> >> > contain packages backported from later releases (e.g. Debian
> >> > backports). Within each major release, only the most recent minor
> >> > release is considered.
> >> >
> >> > For the purposes of identifying supported software versions available
> >> > on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
> >> > RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
> >> > similar software versions.
> >
> > Well it also says:
> >
> > """
> > If a platform is not listed here, it does not imply that QEMU won't
> > work. If an unlisted platform has comparable software versions to a
> > listed platform, there is every expectation that it will work.
> > """
> >
> > A lot of downstream have customized build scripts.
>
> Still Linux versions older than 2.6.35 do not look like "comparable
> software versions to a listed platform" in my opinion.
Linux provides ABI compatibility so I don't know why, unless there is
a strong dependency on a specific new syscall introduced after 2.6.35.
>
> > And is something similar to such removal that has been done for other
> > subsystems?
>
> With commit c42e77a90d ("qemu/osdep: Remove fallback for
> MAP_FIXED_NOREPLACE"), I remove the support for glibc older than 2.28.
> Linux 2.6.35 is even older.
>
Ok, this explains things a little bit. Btw, we also have soliars
support for TAP, time to drop that as well?
Thanks
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()
2023-10-16 5:25 ` Jason Wang
@ 2023-10-16 5:30 ` Akihiko Odaki
0 siblings, 0 replies; 25+ messages in thread
From: Akihiko Odaki @ 2023-10-16 5:30 UTC (permalink / raw)
To: Jason Wang
Cc: qemu-devel, Yuri Benditovich, Andrew Melnychenko,
Michael S . Tsirkin
On 2023/10/16 14:25, Jason Wang wrote:
> On Fri, Oct 13, 2023 at 1:26 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>
>> On 2023/10/13 14:00, Jason Wang wrote:
>>> On Fri, Oct 13, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>>>
>>>> On 2023/10/13 10:38, Jason Wang wrote:
>>>>> On Wed, Oct 11, 2023 at 11:40 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>>>>>
>>>>>> 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.
>>>>>
>>>>> Where can I see this agreement?
>>>>
>>>> docs/about/build-platforms.rst says:
>>>> > The project aims to support the most recent major version at all times
>>>> > for up to five years after its initial release. Support for the
>>>> > previous major version will be dropped 2 years after the new major
>>>> > version is released or when the vendor itself drops support, whichever
>>>> > comes first. In this context, third-party efforts to extend the
>>>> > lifetime of a distro are not considered, even when they are endorsed
>>>> > by the vendor (eg. Debian LTS); the same is true of repositories that
>>>> > contain packages backported from later releases (e.g. Debian
>>>> > backports). Within each major release, only the most recent minor
>>>> > release is considered.
>>>> >
>>>> > For the purposes of identifying supported software versions available
>>>> > on Linux, the project will look at CentOS, Debian, Fedora, openSUSE,
>>>> > RHEL, SLES and Ubuntu LTS. Other distros will be assumed to ship
>>>> > similar software versions.
>>>
>>> Well it also says:
>>>
>>> """
>>> If a platform is not listed here, it does not imply that QEMU won't
>>> work. If an unlisted platform has comparable software versions to a
>>> listed platform, there is every expectation that it will work.
>>> """
>>>
>>> A lot of downstream have customized build scripts.
>>
>> Still Linux versions older than 2.6.35 do not look like "comparable
>> software versions to a listed platform" in my opinion.
>
> Linux provides ABI compatibility so I don't know why, unless there is
> a strong dependency on a specific new syscall introduced after 2.6.35.
This patch drops a pre-check for ioctl introduced with 2.6.35.
>
>>
>>> And is something similar to such removal that has been done for other
>>> subsystems?
>>
>> With commit c42e77a90d ("qemu/osdep: Remove fallback for
>> MAP_FIXED_NOREPLACE"), I remove the support for glibc older than 2.28.
>> Linux 2.6.35 is even older.
>>
>
> Ok, this explains things a little bit. Btw, we also have soliars
> support for TAP, time to drop that as well?
Do you mean Solaris? Honestly I don't know. I don't think anyone dares
to use QEMU on Solaris (or to use Solaris at all), but apparently Oracle
has not abandoned it yet.
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2023-10-16 5:31 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-11 15:39 [PATCH v3 00/11] virtio-net RSS/hash report fixes Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len() Akihiko Odaki
2023-10-13 1:38 ` Jason Wang
2023-10-13 4:14 ` Akihiko Odaki
2023-10-13 5:00 ` Jason Wang
2023-10-13 5:26 ` Akihiko Odaki
2023-10-13 14:17 ` Michael S. Tsirkin
2023-10-13 14:22 ` Akihiko Odaki
2023-10-13 14:32 ` Michael S. Tsirkin
2023-10-13 14:34 ` Akihiko Odaki
2023-10-13 15:01 ` Michael S. Tsirkin
2023-10-16 5:25 ` Jason Wang
2023-10-16 5:30 ` Akihiko Odaki
2023-10-13 13:55 ` Michael S. Tsirkin
2023-10-13 14:00 ` Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 02/11] tap: Remove qemu_using_vnet_hdr() Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 03/11] net: Move virtio-net header length assertion Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 04/11] net: Remove receive_raw() Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 05/11] tap: Shrink zeroed virtio-net header Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 06/11] virtio-net: Copy header only when necessary Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 07/11] virtio-net: Disable RSS on reset Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 08/11] virtio-net: Unify the logic to update NIC state for RSS Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 09/11] virtio-net: Return an error when vhost cannot enable RSS Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 10/11] virtio-net: Do not clear VIRTIO_NET_F_RSS Akihiko Odaki
2023-10-11 15:39 ` [PATCH v3 11/11] ebpf: Fix RSS error handling Akihiko Odaki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).