vdpa: add back vhost_vdpa_net_first_nc_vdpa
Previous commits had it removed. Now adding it back because this function will be needed by future patches. Message-Id: <1707910082-10243-2-git-send-email-si-wei.liu@oracle.com> Reviewed-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
7489f7f3f8
commit
573581b18d
@ -287,6 +287,16 @@ static ssize_t vhost_vdpa_receive(NetClientState *nc, const uint8_t *buf,
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** From any vdpa net client, get the netclient of the first queue pair */
|
||||||
|
static VhostVDPAState *vhost_vdpa_net_first_nc_vdpa(VhostVDPAState *s)
|
||||||
|
{
|
||||||
|
NICState *nic = qemu_get_nic(s->nc.peer);
|
||||||
|
NetClientState *nc0 = qemu_get_peer(nic->ncs, 0);
|
||||||
|
|
||||||
|
return DO_UPCAST(VhostVDPAState, nc, nc0);
|
||||||
|
}
|
||||||
|
|
||||||
static void vhost_vdpa_net_log_global_enable(VhostVDPAState *s, bool enable)
|
static void vhost_vdpa_net_log_global_enable(VhostVDPAState *s, bool enable)
|
||||||
{
|
{
|
||||||
struct vhost_vdpa *v = &s->vhost_vdpa;
|
struct vhost_vdpa *v = &s->vhost_vdpa;
|
||||||
@ -511,7 +521,7 @@ dma_map_err:
|
|||||||
|
|
||||||
static int vhost_vdpa_net_cvq_start(NetClientState *nc)
|
static int vhost_vdpa_net_cvq_start(NetClientState *nc)
|
||||||
{
|
{
|
||||||
VhostVDPAState *s;
|
VhostVDPAState *s, *s0;
|
||||||
struct vhost_vdpa *v;
|
struct vhost_vdpa *v;
|
||||||
int64_t cvq_group;
|
int64_t cvq_group;
|
||||||
int r;
|
int r;
|
||||||
@ -522,7 +532,8 @@ static int vhost_vdpa_net_cvq_start(NetClientState *nc)
|
|||||||
s = DO_UPCAST(VhostVDPAState, nc, nc);
|
s = DO_UPCAST(VhostVDPAState, nc, nc);
|
||||||
v = &s->vhost_vdpa;
|
v = &s->vhost_vdpa;
|
||||||
|
|
||||||
v->shadow_vqs_enabled = v->shared->shadow_data;
|
s0 = vhost_vdpa_net_first_nc_vdpa(s);
|
||||||
|
v->shadow_vqs_enabled = s0->vhost_vdpa.shadow_vqs_enabled;
|
||||||
s->vhost_vdpa.address_space_id = VHOST_VDPA_GUEST_PA_ASID;
|
s->vhost_vdpa.address_space_id = VHOST_VDPA_GUEST_PA_ASID;
|
||||||
|
|
||||||
if (v->shared->shadow_data) {
|
if (v->shared->shadow_data) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user