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

Function rte_vhost_driver_enable_features

dpdk/lib/vhost/socket.c:680–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

678}
679
680int
681rte_vhost_driver_enable_features(const char *path, uint64_t features)
682{
683 struct vhost_user_socket *vsocket;
684
685 pthread_mutex_lock(&vhost_user.mutex);
686 vsocket = find_vhost_user_socket(path);
687 if (vsocket) {
688 if ((vsocket->supported_features & features) != features) {
689 /*
690 * trying to enable features the driver doesn't
691 * support.
692 */
693 pthread_mutex_unlock(&vhost_user.mutex);
694 return -1;
695 }
696 vsocket->features |= features;
697 }
698 pthread_mutex_unlock(&vhost_user.mutex);
699
700 return vsocket ? 0 : -1;
701}
702
703int
704rte_vhost_driver_set_features(const char *path, uint64_t features)

Callers 1

mainFunction · 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