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

Function vhost_user_read_cb

dpdk/lib/vhost/socket.c:312–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312static void
313vhost_user_read_cb(int connfd, void *dat, int *remove)
314{
315 struct vhost_user_connection *conn = dat;
316 struct vhost_user_socket *vsocket = conn->vsocket;
317 int ret;
318
319 ret = vhost_user_msg_handler(conn->vid, connfd);
320 if (ret < 0) {
321 struct virtio_net *dev = get_device(conn->vid);
322
323 close(connfd);
324 *remove = 1;
325
326 if (dev)
327 vhost_destroy_device_notify(dev);
328
329 if (vsocket->notify_ops->destroy_connection)
330 vsocket->notify_ops->destroy_connection(conn->vid);
331
332 vhost_destroy_device(conn->vid);
333
334 if (vsocket->reconnect) {
335 create_unix_socket(vsocket);
336 vhost_user_start_client(vsocket);
337 }
338
339 pthread_mutex_lock(&vsocket->conn_mutex);
340 TAILQ_REMOVE(&vsocket->conn_list, conn, next);
341 pthread_mutex_unlock(&vsocket->conn_mutex);
342
343 free(conn);
344 }
345}
346
347static int
348create_unix_socket(struct vhost_user_socket *vsocket)

Callers

nothing calls this directly

Calls 10

vhost_user_msg_handlerFunction · 0.85
get_deviceFunction · 0.85
vhost_destroy_deviceFunction · 0.85
create_unix_socketFunction · 0.85
vhost_user_start_clientFunction · 0.85
pthread_mutex_lockFunction · 0.85
pthread_mutex_unlockFunction · 0.85
closeFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected