[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 02/78] vdpa: Avoid using vhost_vdpa_net_load_*() outside vhost_
|
From: |
Michael S. Tsirkin |
|
Subject: |
[PULL v2 02/78] vdpa: Avoid using vhost_vdpa_net_load_*() outside vhost_vdpa_net_load() |
|
Date: |
Thu, 19 Oct 2023 14:21:17 -0400 |
From: Hawkins Jiawei <yin31149@gmail.com>
Next patches in this series will refactor vhost_vdpa_net_load_cmd()
to iterate through the control commands shadow buffers, allowing QEMU
to send CVQ state load commands in parallel at device startup.
Considering that QEMU always forwards the CVQ command serialized
outside of vhost_vdpa_net_load(), it is more elegant to send the
CVQ commands directly without invoking vhost_vdpa_net_load_*() helpers.
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id:
<254f0618efde7af7229ba4fdada667bb9d318991.1697165821.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 | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 618758596a..86b8d31244 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -1114,12 +1114,14 @@ static NetClientInfo net_vhost_vdpa_cvq_info = {
*/
static int vhost_vdpa_net_excessive_mac_filter_cvq_add(VhostVDPAState *s,
VirtQueueElement *elem,
- struct iovec *out)
+ struct iovec *out,
+ const struct iovec *in)
{
struct virtio_net_ctrl_mac mac_data, *mac_ptr;
struct virtio_net_ctrl_hdr *hdr_ptr;
uint32_t cursor;
ssize_t r;
+ uint8_t on = 1;
/* parse the non-multicast MAC address entries from CVQ command */
cursor = sizeof(*hdr_ptr);
@@ -1167,7 +1169,13 @@ static int
vhost_vdpa_net_excessive_mac_filter_cvq_add(VhostVDPAState *s,
* filter table to the vdpa device, it should send the
* VIRTIO_NET_CTRL_RX_PROMISC CVQ command to enable promiscuous mode
*/
- r = vhost_vdpa_net_load_rx_mode(s, VIRTIO_NET_CTRL_RX_PROMISC, 1);
+ hdr_ptr = out->iov_base;
+ out->iov_len = sizeof(*hdr_ptr) + sizeof(on);
+
+ hdr_ptr->class = VIRTIO_NET_CTRL_RX;
+ hdr_ptr->cmd = VIRTIO_NET_CTRL_RX_PROMISC;
+ iov_from_buf(out, 1, sizeof(*hdr_ptr), &on, sizeof(on));
+ r = vhost_vdpa_net_cvq_add(s, out, 1, in, 1);
if (unlikely(r < 0)) {
return r;
}
@@ -1285,7 +1293,7 @@ static int
vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
* the CVQ command directly.
*/
dev_written = vhost_vdpa_net_excessive_mac_filter_cvq_add(s, elem,
- &out);
+ &out, &vdpa_in);
if (unlikely(dev_written < 0)) {
goto out;
}
--
MST
- [PULL v2 00/78] virtio,pc,pci: features, cleanups, Michael S. Tsirkin, 2023/10/19
- [PULL v2 01/78] vdpa: Use iovec for vhost_vdpa_net_cvq_add(), Michael S. Tsirkin, 2023/10/19
- [PULL v2 04/78] vdpa: Move vhost_svq_poll() to the caller of vhost_vdpa_net_cvq_add(), Michael S. Tsirkin, 2023/10/19
- [PULL v2 05/78] vdpa: Introduce cursors to vhost_vdpa_net_loadx(), Michael S. Tsirkin, 2023/10/19
- [PULL v2 03/78] vdpa: Check device ack in vhost_vdpa_net_load_rx_mode(), Michael S. Tsirkin, 2023/10/19
- [PULL v2 08/78] tests: test-smp-parse: Add the test for cores/threads per socket helpers, Michael S. Tsirkin, 2023/10/19
- [PULL v2 02/78] vdpa: Avoid using vhost_vdpa_net_load_*() outside vhost_vdpa_net_load(),
Michael S. Tsirkin <=
- [PULL v2 06/78] vhost: Expose vhost_svq_available_slots(), Michael S. Tsirkin, 2023/10/19
- [PULL v2 11/78] tests: bios-tables-test: Add ACPI table binaries for smbios type4 count test, Michael S. Tsirkin, 2023/10/19
- [PULL v2 07/78] vdpa: Send cvq state load commands in parallel, Michael S. Tsirkin, 2023/10/19
- [PULL v2 17/78] tests: bios-tables-test: Update ACPI table binaries for smbios core count2 test, Michael S. Tsirkin, 2023/10/19
- [PULL v2 13/78] tests: bios-tables-test: Add test for smbios type4 core count, Michael S. Tsirkin, 2023/10/19
- [PULL v2 14/78] tests: bios-tables-test: Add ACPI table binaries for smbios type4 core count test, Michael S. Tsirkin, 2023/10/19
- [PULL v2 23/78] tests: bios-tables-test: Add ACPI table binaries for smbios type4 thread count2 test, Michael S. Tsirkin, 2023/10/19
- [PULL v2 10/78] tests: bios-tables-test: Add test for smbios type4 count, Michael S. Tsirkin, 2023/10/19
- [PULL v2 15/78] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 core count2 test, Michael S. Tsirkin, 2023/10/19
- [PULL v2 12/78] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 core count test, Michael S. Tsirkin, 2023/10/19