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

Function ena_com_create_io_queue

dpdk/drivers/net/ena/base/ena_com.c:2110–2169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2108}
2109
2110int ena_com_create_io_queue(struct ena_com_dev *ena_dev,
2111 struct ena_com_create_io_ctx *ctx)
2112{
2113 struct ena_com_io_sq *io_sq;
2114 struct ena_com_io_cq *io_cq;
2115 int ret;
2116
2117 if (ctx->qid >= ENA_TOTAL_NUM_QUEUES) {
2118 ena_trc_err(ena_dev, "Qid (%d) is bigger than max num of queues (%d)\n",
2119 ctx->qid, ENA_TOTAL_NUM_QUEUES);
2120 return ENA_COM_INVAL;
2121 }
2122
2123 io_sq = &ena_dev->io_sq_queues[ctx->qid];
2124 io_cq = &ena_dev->io_cq_queues[ctx->qid];
2125
2126 memset(io_sq, 0x0, sizeof(*io_sq));
2127 memset(io_cq, 0x0, sizeof(*io_cq));
2128
2129 /* Init CQ */
2130 io_cq->q_depth = ctx->queue_size;
2131 io_cq->direction = ctx->direction;
2132 io_cq->qid = ctx->qid;
2133
2134 io_cq->msix_vector = ctx->msix_vector;
2135
2136 io_sq->q_depth = ctx->queue_size;
2137 io_sq->direction = ctx->direction;
2138 io_sq->qid = ctx->qid;
2139
2140 io_sq->mem_queue_type = ctx->mem_queue_type;
2141
2142 if (ctx->direction == ENA_COM_IO_QUEUE_DIRECTION_TX)
2143 /* header length is limited to 8 bits */
2144 io_sq->tx_max_header_size =
2145 ENA_MIN32(ena_dev->tx_max_header_size, SZ_256);
2146
2147 ret = ena_com_init_io_sq(ena_dev, ctx, io_sq);
2148 if (ret)
2149 goto error;
2150 ret = ena_com_init_io_cq(ena_dev, ctx, io_cq);
2151 if (ret)
2152 goto error;
2153
2154 ret = ena_com_create_io_cq(ena_dev, io_cq);
2155 if (ret)
2156 goto error;
2157
2158 ret = ena_com_create_io_sq(ena_dev, io_sq, io_cq->idx);
2159 if (ret)
2160 goto destroy_io_cq;
2161
2162 return 0;
2163
2164destroy_io_cq:
2165 ena_com_destroy_io_cq(ena_dev, io_cq);
2166error:
2167 ena_com_io_queue_free(ena_dev, io_sq, io_cq);

Callers 1

ena_create_io_queueFunction · 0.50

Calls 7

memsetFunction · 0.85
ena_com_init_io_sqFunction · 0.70
ena_com_init_io_cqFunction · 0.70
ena_com_create_io_cqFunction · 0.70
ena_com_create_io_sqFunction · 0.70
ena_com_destroy_io_cqFunction · 0.70
ena_com_io_queue_freeFunction · 0.70

Tested by

no test coverage detected