X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_vhost%2Fvdpa.c;h=99a926a7725cefb274ae437d061ff2ac2bcfb58c;hb=10b8c36af0abb654907d97738641d6a643408b99;hp=ef21ca2a1ef8c388a1764a2ab116d15b3e4f1aeb;hpb=a49f758d1170659a5ba9103081502094f9260fce;p=dpdk.git diff --git a/lib/librte_vhost/vdpa.c b/lib/librte_vhost/vdpa.c index ef21ca2a1e..99a926a772 100644 --- a/lib/librte_vhost/vdpa.c +++ b/lib/librte_vhost/vdpa.c @@ -77,6 +77,16 @@ rte_vdpa_register_device(struct rte_device *rte_dev, if (ops == NULL) return NULL; + /* Check mandatory ops are implemented */ + if (!ops->get_queue_num || !ops->get_features || + !ops->get_protocol_features || !ops->dev_conf || + !ops->dev_close || !ops->set_vring_state || + !ops->set_features) { + VHOST_LOG_CONFIG(ERR, + "Some mandatory vDPA ops aren't implemented\n"); + return NULL; + } + rte_spinlock_lock(&vdpa_device_list_lock); /* Check the device hasn't been register already */ dev = __vdpa_find_device_by_name(rte_dev->name); @@ -207,8 +217,8 @@ rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m) idx++; } - rte_smp_wmb(); - vq->used->idx = idx_m; + /* used idx is the synchronization point for the split vring */ + __atomic_store_n(&vq->used->idx, idx_m, __ATOMIC_RELEASE); if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) vring_used_event(s_vring) = idx_m;