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

Function memif_msg_enq_add_ring

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

Source from the content-addressed store, hash-verified

442}
443
444static int
445memif_msg_enq_add_ring(struct rte_eth_dev *dev, uint8_t idx,
446 memif_ring_type_t type)
447{
448 struct pmd_internals *pmd = dev->data->dev_private;
449 struct memif_msg_queue_elt *e = memif_msg_enq(pmd->cc);
450 struct memif_queue *mq;
451 memif_msg_add_ring_t *ar;
452
453 if (e == NULL)
454 return -1;
455
456 ar = &e->msg.add_ring;
457 mq = (type == MEMIF_RING_C2S) ? dev->data->tx_queues[idx] :
458 dev->data->rx_queues[idx];
459
460 e->msg.type = MEMIF_MSG_TYPE_ADD_RING;
461 e->fd = rte_intr_fd_get(mq->intr_handle);
462 ar->index = idx;
463 ar->offset = mq->ring_offset;
464 ar->region = mq->region;
465 ar->log2_ring_size = mq->log2_ring_size;
466 ar->flags = (type == MEMIF_RING_C2S) ? MEMIF_MSG_ADD_RING_FLAG_C2S : 0;
467 ar->private_hdr_size = 0;
468
469 return 0;
470}
471
472static int
473memif_msg_enq_connect(struct rte_eth_dev *dev)

Callers 1

memif_msg_receiveFunction · 0.85

Calls 2

memif_msg_enqFunction · 0.85
rte_intr_fd_getFunction · 0.85

Tested by

no test coverage detected