MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_vhost_driver_get_features

Function rte_vhost_driver_get_features

dpdk/lib/vhost/socket.c:724–757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

722}
723
724int
725rte_vhost_driver_get_features(const char *path, uint64_t *features)
726{
727 struct vhost_user_socket *vsocket;
728 uint64_t vdpa_features;
729 struct rte_vdpa_device *vdpa_dev;
730 int ret = 0;
731
732 pthread_mutex_lock(&vhost_user.mutex);
733 vsocket = find_vhost_user_socket(path);
734 if (!vsocket) {
735 VHOST_LOG_CONFIG(path, ERR, "socket file is not registered yet.\n");
736 ret = -1;
737 goto unlock_exit;
738 }
739
740 vdpa_dev = vsocket->vdpa_dev;
741 if (!vdpa_dev) {
742 *features = vsocket->features;
743 goto unlock_exit;
744 }
745
746 if (vdpa_dev->ops->get_features(vdpa_dev, &vdpa_features) < 0) {
747 VHOST_LOG_CONFIG(path, ERR, "failed to get vdpa features for socket file.\n");
748 ret = -1;
749 goto unlock_exit;
750 }
751
752 *features = vsocket->features & vdpa_features;
753
754unlock_exit:
755 pthread_mutex_unlock(&vhost_user.mutex);
756 return ret;
757}
758
759int
760rte_vhost_driver_set_protocol_features(const char *path,

Callers 4

vduse_device_createFunction · 0.85
vhost_user_get_featuresFunction · 0.85
vhost_user_set_featuresFunction · 0.85

Calls 3

pthread_mutex_lockFunction · 0.85
find_vhost_user_socketFunction · 0.85
pthread_mutex_unlockFunction · 0.85

Tested by

no test coverage detected