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

Function memif_msg_send_from_queue

dpdk/drivers/net/memif/memif_socket.c:57–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57static int
58memif_msg_send_from_queue(struct memif_control_channel *cc)
59{
60 ssize_t size;
61 int ret = 0;
62 struct memif_msg_queue_elt *e;
63
64 e = TAILQ_FIRST(&cc->msg_queue);
65 if (e == NULL)
66 return 0;
67
68 if (rte_intr_fd_get(cc->intr_handle) < 0)
69 return -1;
70
71 size = memif_msg_send(rte_intr_fd_get(cc->intr_handle), &e->msg,
72 e->fd);
73 if (size != sizeof(memif_msg_t)) {
74 MIF_LOG(ERR, "sendmsg fail: %s.", strerror(errno));
75 ret = -1;
76 } else {
77 MIF_LOG(DEBUG, "Sent msg type %u.", e->msg.type);
78 }
79 TAILQ_REMOVE(&cc->msg_queue, e, next);
80 rte_free(e);
81
82 return ret;
83}
84
85static struct memif_msg_queue_elt *
86memif_msg_enq(struct memif_control_channel *cc)

Callers 3

memif_disconnectFunction · 0.85
memif_intr_handlerFunction · 0.85
memif_listener_handlerFunction · 0.85

Calls 3

rte_intr_fd_getFunction · 0.85
memif_msg_sendFunction · 0.85
rte_freeFunction · 0.85

Tested by

no test coverage detected