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

Function dpdmai_get_rx_queue

dpdk/drivers/bus/fslmc/mc/dpdmai.c:365–400  ·  view source on GitHub ↗

* dpdmai_get_rx_queue() - Retrieve Rx queue attributes. * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPDMAI object * @queue_idx: Rx queue index. Accepted values are form 0 to num_queues * parameter provided in dpdmai_create * @priority: Select the queue relative to number of * priorities configured at DPDMAI crea

Source from the content-addressed store, hash-verified

363 * Return: '0' on Success; Error code otherwise.
364 */
365int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io,
366 uint32_t cmd_flags,
367 uint16_t token,
368 uint8_t queue_idx,
369 uint8_t priority,
370 struct dpdmai_rx_queue_attr *attr)
371{
372 struct dpdmai_cmd_get_queue *cmd_params;
373 struct dpdmai_rsp_get_rx_queue *rsp_params;
374 struct mc_command cmd = { 0 };
375 int err;
376
377 /* prepare command */
378 cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_GET_RX_QUEUE,
379 cmd_flags,
380 token);
381 cmd_params = (struct dpdmai_cmd_get_queue *)cmd.params;
382 cmd_params->priority = priority;
383 cmd_params->queue_idx = queue_idx;
384
385 /* send command to mc*/
386 err = mc_send_command(mc_io, &cmd);
387 if (err)
388 return err;
389
390 /* retrieve response parameters */
391 rsp_params = (struct dpdmai_rsp_get_rx_queue *)cmd.params;
392 attr->user_ctx = le64_to_cpu(rsp_params->user_ctx);
393 attr->fqid = le32_to_cpu(rsp_params->fqid);
394 attr->dest_cfg.dest_id = le32_to_cpu(rsp_params->dest_id);
395 attr->dest_cfg.priority = le32_to_cpu(rsp_params->dest_priority);
396 attr->dest_cfg.dest_type = dpdmai_get_field(rsp_params->dest_type,
397 DEST_TYPE);
398
399 return 0;
400}
401
402/**
403 * dpdmai_get_tx_queue() - Retrieve Tx queue attributes.

Callers 1

dpaa2_dpdmai_dev_initFunction · 0.85

Calls 2

mc_encode_cmd_headerFunction · 0.85
mc_send_commandFunction · 0.85

Tested by

no test coverage detected