[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/40] vdpa: move around vhost_vdpa_set_address_space_id
From: |
Si-Wei Liu |
Subject: |
[PATCH 07/40] vdpa: move around vhost_vdpa_set_address_space_id |
Date: |
Thu, 7 Dec 2023 09:39:20 -0800 |
Move it a few lines ahead to make function call easier for those
before it. No funtional change involved.
Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
---
net/vhost-vdpa.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 1a738b2..dbfa192 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -335,6 +335,24 @@ static void vdpa_net_migration_state_notifier(Notifier
*notifier, void *data)
}
}
+static int vhost_vdpa_set_address_space_id(struct vhost_vdpa *v,
+ unsigned vq_group,
+ unsigned asid_num)
+{
+ struct vhost_vring_state asid = {
+ .index = vq_group,
+ .num = asid_num,
+ };
+ int r;
+
+ r = ioctl(v->shared->device_fd, VHOST_VDPA_SET_GROUP_ASID, &asid);
+ if (unlikely(r < 0)) {
+ error_report("Can't set vq group %u asid %u, errno=%d (%s)",
+ asid.index, asid.num, errno, g_strerror(errno));
+ }
+ return r;
+}
+
static void vhost_vdpa_net_data_start_first(VhostVDPAState *s)
{
struct vhost_vdpa *v = &s->vhost_vdpa;
@@ -490,24 +508,6 @@ static int64_t vhost_vdpa_get_vring_desc_group(int
device_fd,
return state.num;
}
-static int vhost_vdpa_set_address_space_id(struct vhost_vdpa *v,
- unsigned vq_group,
- unsigned asid_num)
-{
- struct vhost_vring_state asid = {
- .index = vq_group,
- .num = asid_num,
- };
- int r;
-
- r = ioctl(v->shared->device_fd, VHOST_VDPA_SET_GROUP_ASID, &asid);
- if (unlikely(r < 0)) {
- error_report("Can't set vq group %u asid %u, errno=%d (%s)",
- asid.index, asid.num, errno, g_strerror(errno));
- }
- return r;
-}
-
static void vhost_vdpa_cvq_unmap_buf(struct vhost_vdpa *v, void *addr)
{
VhostIOVATree *tree = v->shared->iova_tree;
--
1.8.3.1
- [PATCH 01/40] linux-headers: add vhost_types.h and vhost.h, (continued)
- [PATCH 01/40] linux-headers: add vhost_types.h and vhost.h, Si-Wei Liu, 2023/12/07
- [PATCH 05/40] vdpa: populate desc_group from net_vhost_vdpa_init, Si-Wei Liu, 2023/12/07
- [PATCH 03/40] vdpa: probe descriptor group index for data vqs, Si-Wei Liu, 2023/12/07
- [PATCH 02/40] vdpa: add vhost_vdpa_get_vring_desc_group, Si-Wei Liu, 2023/12/07
- [PATCH 06/40] vhost: make svq work with gpa without iova translation, Si-Wei Liu, 2023/12/07
- [PATCH 07/40] vdpa: move around vhost_vdpa_set_address_space_id,
Si-Wei Liu <=
- [PATCH 04/40] vdpa: piggyback desc_group index when probing isolated cvq, Si-Wei Liu, 2023/12/07
- [PATCH 09/40] vdpa: no repeat setting shadow_data, Si-Wei Liu, 2023/12/07
- [PATCH 10/40] vdpa: assign svq descriptors a separate ASID when possible, Si-Wei Liu, 2023/12/07
- [PATCH 13/40] vdpa: ref counting VhostVDPAShared, Si-Wei Liu, 2023/12/07
- [PATCH 14/40] vdpa: convert iova_tree to ref count based, Si-Wei Liu, 2023/12/07
- [PATCH 15/40] vdpa: add svq_switching and flush_map to header, Si-Wei Liu, 2023/12/07