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

Function ionic_adminq_post

dpdk/drivers/net/ionic/ionic_main.c:194–227  ·  view source on GitHub ↗

ionic_adminq_post - Post an admin command. * @lif: Handle to lif. * @cmd_ctx: Api admin command context. * * Post the command to an admin queue in the ethernet driver. If this command * succeeds, then the command has been posted, but that does not indicate a * completion. If this command returns success, then the completion callback * will eventually be called.

Source from the content-addressed store, hash-verified

192 * Return: zero or negative error status.
193 */
194static int
195ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx)
196{
197 struct ionic_queue *q = &lif->adminqcq->qcq.q;
198 struct ionic_admin_cmd *q_desc_base = q->base;
199 struct ionic_admin_cmd *q_desc;
200 void **info;
201 int err = 0;
202
203 rte_spinlock_lock(&lif->adminq_lock);
204
205 if (ionic_q_space_avail(q) < 1) {
206 err = -ENOSPC;
207 goto err_out;
208 }
209
210 q_desc = &q_desc_base[q->head_idx];
211
212 memcpy(q_desc, &ctx->cmd, sizeof(ctx->cmd));
213
214 info = IONIC_INFO_PTR(q, q->head_idx);
215 info[0] = ctx;
216
217 q->head_idx = Q_NEXT_TO_POST(q, 1);
218
219 /* Ring doorbell */
220 rte_wmb();
221 ionic_q_flush(q);
222
223err_out:
224 rte_spinlock_unlock(&lif->adminq_lock);
225
226 return err;
227}
228
229static int
230ionic_adminq_wait_for_completion(struct ionic_lif *lif,

Callers 1

ionic_adminq_post_waitFunction · 0.85

Calls 5

ionic_q_space_availFunction · 0.85
ionic_q_flushFunction · 0.85
rte_spinlock_lockFunction · 0.50
memcpyFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected