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

Function mana_start_tx_queues

dpdk/drivers/net/mana/tx.c:65–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65int
66mana_start_tx_queues(struct rte_eth_dev *dev)
67{
68 struct mana_priv *priv = dev->data->dev_private;
69 int ret, i;
70
71 /* start TX queues */
72
73 for (i = 0; i < priv->num_queues; i++)
74 if (dev->data->tx_queue_state[i] == RTE_ETH_QUEUE_STATE_STARTED)
75 return -EINVAL;
76
77 for (i = 0; i < priv->num_queues; i++) {
78 struct mana_txq *txq;
79 struct ibv_qp_init_attr qp_attr = { 0 };
80 struct manadv_obj obj = {};
81 struct manadv_qp dv_qp;
82 struct manadv_cq dv_cq;
83
84 txq = dev->data->tx_queues[i];
85
86 manadv_set_context_attr(priv->ib_ctx,
87 MANADV_CTX_ATTR_BUF_ALLOCATORS,
88 (void *)((uintptr_t)&(struct manadv_ctx_allocators){
89 .alloc = &mana_alloc_verbs_buf,
90 .free = &mana_free_verbs_buf,
91 .data = (void *)(uintptr_t)txq->socket,
92 }));
93
94 txq->cq = ibv_create_cq(priv->ib_ctx, txq->num_desc,
95 NULL, NULL, 0);
96 if (!txq->cq) {
97 DRV_LOG(ERR, "failed to create cq queue index %d", i);
98 ret = -errno;
99 goto fail;
100 }
101
102 qp_attr.send_cq = txq->cq;
103 qp_attr.recv_cq = txq->cq;
104 qp_attr.cap.max_send_wr = txq->num_desc;
105 qp_attr.cap.max_send_sge = priv->max_send_sge;
106
107 /* Skip setting qp_attr.cap.max_inline_data */
108
109 qp_attr.qp_type = IBV_QPT_RAW_PACKET;
110 qp_attr.sq_sig_all = 0;
111
112 txq->qp = ibv_create_qp(priv->ib_parent_pd, &qp_attr);
113 if (!txq->qp) {
114 DRV_LOG(ERR, "Failed to create qp queue index %d", i);
115 ret = -errno;
116 goto fail;
117 }
118
119 /* Get the addresses of CQ, QP and DB */
120 obj.qp.in = txq->qp;
121 obj.qp.out = &dv_qp;
122 obj.cq.in = txq->cq;

Callers 1

mana_dev_startFunction · 0.85

Calls 1

mana_stop_tx_queuesFunction · 0.85

Tested by

no test coverage detected