[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/63] vdpa: Add SetSteeringEBPF method for NetClientState
|
From: |
Michael S. Tsirkin |
|
Subject: |
[PULL 21/63] vdpa: Add SetSteeringEBPF method for NetClientState |
|
Date: |
Tue, 7 Nov 2023 05:11:01 -0500 |
From: Hawkins Jiawei <yin31149@gmail.com>
At present, to enable the VIRTIO_NET_F_RSS feature, eBPF must
be loaded for the vhost backend.
Given that vhost-vdpa is one of the vhost backend, we need to
implement the SetSteeringEBPF method to support RSS for vhost-vdpa,
even if vhost-vdpa calculates the rss hash in the hardware device
instead of in the kernel by eBPF.
Although this requires QEMU to be compiled with `--enable-bpf`
configuration even if the vdpa device does not use eBPF to
calculate the rss hash, this can avoid adding the specific
conditional statements for vDPA case to enable the VIRTIO_NET_F_RSS
feature, which reduces code maintainbility.
Suggested-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Message-Id:
<280e20ddce55b6de60f1552ba0865bffffe909b2.1698195059.git.yin31149@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
net/vhost-vdpa.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 54f748d49d..3466936b87 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -241,6 +241,12 @@ static void vhost_vdpa_cleanup(NetClientState *nc)
}
}
+/** Dummy SetSteeringEBPF to support RSS for vhost-vdpa backend */
+static bool vhost_vdpa_set_steering_ebpf(NetClientState *nc, int prog_fd)
+{
+ return true;
+}
+
static bool vhost_vdpa_has_vnet_hdr(NetClientState *nc)
{
assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_VDPA);
@@ -423,6 +429,7 @@ static NetClientInfo net_vhost_vdpa_info = {
.has_vnet_hdr = vhost_vdpa_has_vnet_hdr,
.has_ufo = vhost_vdpa_has_ufo,
.check_peer_type = vhost_vdpa_check_peer_type,
+ .set_steering_ebpf = vhost_vdpa_set_steering_ebpf,
};
static int64_t vhost_vdpa_get_vring_group(int device_fd, unsigned vq_index,
@@ -1258,6 +1265,7 @@ static NetClientInfo net_vhost_vdpa_cvq_info = {
.has_vnet_hdr = vhost_vdpa_has_vnet_hdr,
.has_ufo = vhost_vdpa_has_ufo,
.check_peer_type = vhost_vdpa_check_peer_type,
+ .set_steering_ebpf = vhost_vdpa_set_steering_ebpf,
};
/*
--
MST
- [PULL 13/63] virtio-sound: handle VIRTIO_SND_R_PCM_SET_PARAMS, (continued)
- [PULL 13/63] virtio-sound: handle VIRTIO_SND_R_PCM_SET_PARAMS, Michael S. Tsirkin, 2023/11/07
- [PULL 09/63] Add virtio-sound-pci device, Michael S. Tsirkin, 2023/11/07
- [PULL 14/63] virtio-sound: handle VIRTIO_SND_R_PCM_PREPARE, Michael S. Tsirkin, 2023/11/07
- [PULL 15/63] virtio-sound: handle VIRTIO_SND_R_PCM_RELEASE, Michael S. Tsirkin, 2023/11/07
- [PULL 19/63] vdpa: Restore hash calculation state, Michael S. Tsirkin, 2023/11/07
- [PULL 16/63] virtio-sound: implement audio output (TX), Michael S. Tsirkin, 2023/11/07
- [PULL 17/63] virtio-sound: implement audio capture (RX), Michael S. Tsirkin, 2023/11/07
- [PULL 20/63] vdpa: Allow VIRTIO_NET_F_HASH_REPORT in SVQ, Michael S. Tsirkin, 2023/11/07
- [PULL 18/63] docs/system: add basic virtio-snd documentation, Michael S. Tsirkin, 2023/11/07
- [PULL 22/63] vdpa: Restore receive-side scaling state, Michael S. Tsirkin, 2023/11/07
- [PULL 21/63] vdpa: Add SetSteeringEBPF method for NetClientState,
Michael S. Tsirkin <=
- [PULL 24/63] tests: test-smp-parse: Add the test for cores/threads per socket helpers, Michael S. Tsirkin, 2023/11/07
- [PULL 26/63] tests: bios-tables-test: Add test for smbios type4 count, Michael S. Tsirkin, 2023/11/07
- [PULL 27/63] tests: bios-tables-test: Add ACPI table binaries for smbios type4 count test, Michael S. Tsirkin, 2023/11/07
- [PULL 25/63] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 count test, Michael S. Tsirkin, 2023/11/07
- [PULL 28/63] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 core count test, Michael S. Tsirkin, 2023/11/07
- [PULL 29/63] tests: bios-tables-test: Add test for smbios type4 core count, Michael S. Tsirkin, 2023/11/07
- [PULL 31/63] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 core count2 test, Michael S. Tsirkin, 2023/11/07
- [PULL 30/63] tests: bios-tables-test: Add ACPI table binaries for smbios type4 core count test, Michael S. Tsirkin, 2023/11/07
- [PULL 34/63] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 thread count test, Michael S. Tsirkin, 2023/11/07
- [PULL 33/63] tests: bios-tables-test: Update ACPI table binaries for smbios core count2 test, Michael S. Tsirkin, 2023/11/07