Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app/vfe-vdpa: Remove GUEST_ANNOUNCE feature when set #67

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions drivers/vdpa/virtio/virtio_vdpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,9 @@ virtio_vdpa_features_set(int vid)
/* TO_DO: check why --- */
features |= (1ULL << VIRTIO_F_IOMMU_PLATFORM);
features |= (1ULL << VIRTIO_F_RING_RESET);
if (priv->dev_ops->set_vdpa_feature)
priv->dev_ops->set_vdpa_feature(&features);

if (priv->configured)
DRV_LOG(ERR, "%s vid %d set feature after driver ok, only when live migration", priv->vdev->device->name, vid);
else
Expand Down
1 change: 1 addition & 0 deletions drivers/vdpa/virtio/virtio_vdpa.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ struct virtio_vdpa_device_callback {
int (*unreg_dev_intr)(struct virtio_vdpa_priv* priv);
int (*vdpa_queue_num_unit_get)(void);
void (*add_vdpa_feature)(uint64_t *features);
void (*set_vdpa_feature)(uint64_t *features);
};

int virtio_vdpa_dev_pf_filter_dump(struct vdpa_vf_params *vf_info, int max_vf_num, struct virtio_vdpa_pf_priv *pf_priv);
Expand Down
1 change: 1 addition & 0 deletions drivers/vdpa/virtio/virtio_vdpa_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,6 @@ struct virtio_vdpa_device_callback virtio_vdpa_blk_callback = {
.unreg_dev_intr = virtio_vdpa_blk_unreg_dev_interrupt,
.vdpa_queue_num_unit_get = virtio_vdpa_blk_queue_num_unit_get,
.add_vdpa_feature = NULL,
.set_vdpa_feature = NULL,
};

11 changes: 9 additions & 2 deletions drivers/vdpa/virtio/virtio_vdpa_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,24 @@ virtio_vdpa_net_queue_num_unit_get(void)
}

static void
virtio_vdpa_net_add_vdap_feature(uint64_t *features)
virtio_vdpa_net_add_vdpa_feature(uint64_t *features)
{
*features |= (1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE);
}

static void
virtio_vdpa_net_set_vdpa_feature(uint64_t *features)
{
*features &= (~(1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE));
}

struct virtio_vdpa_device_callback virtio_vdpa_net_callback = {
.vhost_feature_get = virtio_vdpa_net_vhost_feature_get,
.dirty_desc_get = virtio_vdpa_net_dirty_desc_get,
.reg_dev_intr = NULL,
.unreg_dev_intr = NULL,
.vdpa_queue_num_unit_get = virtio_vdpa_net_queue_num_unit_get,
.add_vdpa_feature = virtio_vdpa_net_add_vdap_feature,
.add_vdpa_feature = virtio_vdpa_net_add_vdpa_feature,
.set_vdpa_feature = virtio_vdpa_net_set_vdpa_feature,
};