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

Function memif_msg_receive_add_ring

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

Source from the content-addressed store, hash-verified

292}
293
294static int
295memif_msg_receive_add_ring(struct rte_eth_dev *dev, memif_msg_t *msg, int fd)
296{
297 struct pmd_internals *pmd = dev->data->dev_private;
298 memif_msg_add_ring_t *ar = &msg->add_ring;
299 struct memif_queue *mq;
300
301 if (fd < 0) {
302 memif_msg_enq_disconnect(pmd->cc, "Missing interrupt fd", 0);
303 return -1;
304 }
305
306 /* check if we have enough queues */
307 if (ar->flags & MEMIF_MSG_ADD_RING_FLAG_C2S) {
308 if (ar->index >= pmd->cfg.num_c2s_rings) {
309 memif_msg_enq_disconnect(pmd->cc, "Invalid ring index", 0);
310 return -1;
311 }
312 pmd->run.num_c2s_rings++;
313 } else {
314 if (ar->index >= pmd->cfg.num_s2c_rings) {
315 memif_msg_enq_disconnect(pmd->cc, "Invalid ring index", 0);
316 return -1;
317 }
318 pmd->run.num_s2c_rings++;
319 }
320
321 mq = (ar->flags & MEMIF_MSG_ADD_RING_FLAG_C2S) ?
322 dev->data->rx_queues[ar->index] : dev->data->tx_queues[ar->index];
323
324 if (rte_intr_fd_set(mq->intr_handle, fd))
325 return -1;
326
327 mq->log2_ring_size = ar->log2_ring_size;
328 mq->region = ar->region;
329 mq->ring_offset = ar->offset;
330
331 return 0;
332}
333
334static int
335memif_msg_receive_connect(struct rte_eth_dev *dev, memif_msg_t *msg)

Callers 1

memif_msg_receiveFunction · 0.85

Calls 2

memif_msg_enq_disconnectFunction · 0.85
rte_intr_fd_setFunction · 0.85

Tested by

no test coverage detected