[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 38/53] vdpa: reuse virtio_vdev_has_feature()
From: |
Michael S. Tsirkin |
Subject: |
[PULL 38/53] vdpa: reuse virtio_vdev_has_feature() |
Date: |
Mon, 26 Jun 2023 08:29:42 -0400 |
From: Hawkins Jiawei <yin31149@gmail.com>
We can use virtio_vdev_has_feature() instead of manually
accessing the features.
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id:
<ff838d30206209fd865511b16ffb34cc0d5e8d8f.1685704856.git.yin31149@gmail.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Tested-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
net/vhost-vdpa.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 8840ca2ea4..c3ef0139a6 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -629,8 +629,7 @@ static ssize_t vhost_vdpa_net_load_cmd(VhostVDPAState *s,
uint8_t class,
static int vhost_vdpa_net_load_mac(VhostVDPAState *s, const VirtIONet *n)
{
- uint64_t features = n->parent_obj.guest_features;
- if (features & BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR)) {
+ if (virtio_vdev_has_feature(&n->parent_obj, VIRTIO_NET_F_CTRL_MAC_ADDR)) {
ssize_t dev_written = vhost_vdpa_net_load_cmd(s, VIRTIO_NET_CTRL_MAC,
VIRTIO_NET_CTRL_MAC_ADDR_SET,
n->mac, sizeof(n->mac));
@@ -648,10 +647,9 @@ static int vhost_vdpa_net_load_mq(VhostVDPAState *s,
const VirtIONet *n)
{
struct virtio_net_ctrl_mq mq;
- uint64_t features = n->parent_obj.guest_features;
ssize_t dev_written;
- if (!(features & BIT_ULL(VIRTIO_NET_F_MQ))) {
+ if (!virtio_vdev_has_feature(&n->parent_obj, VIRTIO_NET_F_MQ)) {
return 0;
}
--
MST
- [PULL 18/53] hw/virtio/virtio-mem: Use qemu_ram_get_fd() helper, (continued)
- [PULL 18/53] hw/virtio/virtio-mem: Use qemu_ram_get_fd() helper, Michael S. Tsirkin, 2023/06/26
- [PULL 14/53] hw/scsi: Introduce VHOST_SCSI_COMMON symbol in Kconfig, Michael S. Tsirkin, 2023/06/26
- [PULL 23/53] vhost: release memory_listener object in error path, Michael S. Tsirkin, 2023/06/26
- [PULL 24/53] vhost: release virtqueue objects in error path, Michael S. Tsirkin, 2023/06/26
- [PULL 25/53] pci: ROM preallocation for incoming migration, Michael S. Tsirkin, 2023/06/26
- [PULL 16/53] hw/scsi: Rename target-specific source set as 'specific_virtio_scsi_ss', Michael S. Tsirkin, 2023/06/26
- [PULL 27/53] vdpa: return errno in vhost_vdpa_get_vring_group error, Michael S. Tsirkin, 2023/06/26
- [PULL 30/53] hw/acpi: Fix PM control register access, Michael S. Tsirkin, 2023/06/26
- [PULL 38/53] vdpa: reuse virtio_vdev_has_feature(),
Michael S. Tsirkin <=
- [PULL 20/53] hw/virtio/virtio-iommu: Use target-agnostic qemu_target_page_mask(), Michael S. Tsirkin, 2023/06/26
- [PULL 37/53] include/hw/virtio: make some VirtIODevice const, Michael S. Tsirkin, 2023/06/26
- [PULL 21/53] hw/virtio: Remove unnecessary 'virtio-access.h' header, Michael S. Tsirkin, 2023/06/26
- [PULL 26/53] virtio-mem: Simplify bitmap handling and virtio_mem_set_block_state(), Michael S. Tsirkin, 2023/06/26
- [PULL 28/53] vdpa: move CVQ isolation check to net_init_vhost_vdpa, Michael S. Tsirkin, 2023/06/26
- [PULL 29/53] cryptodev: fix memory leak during stats query, Michael S. Tsirkin, 2023/06/26
- [PULL 31/53] hw/i386/pc: Default to use SMBIOS 3.0 for newer machine models, Michael S. Tsirkin, 2023/06/26
- [PULL 17/53] hw/virtio: Introduce VHOST_VSOCK_COMMON symbol in Kconfig, Michael S. Tsirkin, 2023/06/26
- [PULL 19/53] hw/virtio/vhost-vsock: Include missing 'virtio/virtio-bus.h' header, Michael S. Tsirkin, 2023/06/26