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

Function dpdmai_set_rx_queue

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

* dpdmai_set_rx_queue() - Set Rx queue configuration * @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 creatio

Source from the content-addressed store, hash-verified

321 * Return: '0' on Success; Error code otherwise.
322 */
323int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io,
324 uint32_t cmd_flags,
325 uint16_t token,
326 uint8_t queue_idx,
327 uint8_t priority,
328 const struct dpdmai_rx_queue_cfg *cfg)
329{
330 struct dpdmai_cmd_set_rx_queue *cmd_params;
331 struct mc_command cmd = { 0 };
332
333 /* prepare command */
334 cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_SET_RX_QUEUE,
335 cmd_flags,
336 token);
337 cmd_params = (struct dpdmai_cmd_set_rx_queue *)cmd.params;
338 cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id);
339 cmd_params->dest_priority = cfg->dest_cfg.priority;
340 cmd_params->priority = priority;
341 cmd_params->queue_idx = queue_idx;
342 cmd_params->user_ctx = cpu_to_le64(cfg->user_ctx);
343 cmd_params->options = cpu_to_le32(cfg->options);
344 dpdmai_set_field(cmd_params->dest_type,
345 DEST_TYPE,
346 cfg->dest_cfg.dest_type);
347
348 /* send command to mc*/
349 return mc_send_command(mc_io, &cmd);
350}
351
352/**
353 * dpdmai_get_rx_queue() - Retrieve Rx 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