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

Function rte_vhost_driver_start

dpdk/lib/vhost/socket.c:1186–1225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1184}
1185
1186int
1187rte_vhost_driver_start(const char *path)
1188{
1189 struct vhost_user_socket *vsocket;
1190 static rte_thread_t fdset_tid;
1191
1192 pthread_mutex_lock(&vhost_user.mutex);
1193 vsocket = find_vhost_user_socket(path);
1194 pthread_mutex_unlock(&vhost_user.mutex);
1195
1196 if (!vsocket)
1197 return -1;
1198
1199 if (vsocket->is_vduse)
1200 return vduse_device_create(path, vsocket->net_compliant_ol_flags);
1201
1202 if (fdset_tid.opaque_id == 0) {
1203 /**
1204 * create a pipe which will be waited by poll and notified to
1205 * rebuild the wait list of poll.
1206 */
1207 if (fdset_pipe_init(&vhost_user.fdset) < 0) {
1208 VHOST_LOG_CONFIG(path, ERR, "failed to create pipe for vhost fdset\n");
1209 return -1;
1210 }
1211
1212 int ret = rte_thread_create_internal_control(&fdset_tid,
1213 "vhost-evt", fdset_event_dispatch, &vhost_user.fdset);
1214 if (ret != 0) {
1215 VHOST_LOG_CONFIG(path, ERR, "failed to create fdset handling thread\n");
1216 fdset_pipe_uninit(&vhost_user.fdset);
1217 return -1;
1218 }
1219 }
1220
1221 if (vsocket->is_server)
1222 return vhost_user_start_server(vsocket);
1223 else
1224 return vhost_user_start_client(vsocket);
1225}

Callers 5

vhost_driver_setupFunction · 0.85
mainFunction · 0.85
start_vdpaFunction · 0.85
mainFunction · 0.85

Calls 9

pthread_mutex_lockFunction · 0.85
find_vhost_user_socketFunction · 0.85
pthread_mutex_unlockFunction · 0.85
fdset_pipe_initFunction · 0.85
fdset_pipe_uninitFunction · 0.85
vhost_user_start_clientFunction · 0.85
vduse_device_createFunction · 0.70
vhost_user_start_serverFunction · 0.70

Tested by

no test coverage detected