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

Function setup_qps

dpdk/drivers/regex/mlx5/mlx5_regex_fastpath.c:614–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614static void
615setup_qps(struct mlx5_regex_priv *priv, struct mlx5_regex_qp *queue)
616{
617 size_t hw_qpid, entry;
618 uint32_t job_id;
619 for (hw_qpid = 0; hw_qpid < queue->nb_obj; hw_qpid++) {
620 struct mlx5_regex_hw_qp *qp_obj = &queue->qps[hw_qpid];
621 uint8_t *wqe = (uint8_t *)(uintptr_t)qp_obj->qp_obj.wqes;
622 for (entry = 0 ; entry < qp_size_get(qp_obj); entry++) {
623 job_id = hw_qpid * qp_size_get(qp_obj) + entry;
624 struct mlx5_regex_job *job = &queue->jobs[job_id];
625
626 /* Fill UMR WQE with NOP in advanced. */
627 if (priv->has_umr) {
628 set_wqe_ctrl_seg
629 ((struct mlx5_wqe_ctrl_seg *)wqe,
630 entry * 2, MLX5_OPCODE_NOP, 0,
631 qp_obj->qp_obj.qp->id, 0, 12, 0, 0);
632 wqe += MLX5_REGEX_UMR_WQE_SIZE;
633 }
634 set_metadata_seg((struct mlx5_wqe_metadata_seg *)
635 (wqe + MLX5_REGEX_WQE_METADATA_OFFSET),
636 0, queue->metadata->lkey,
637 (uintptr_t)job->metadata);
638 set_data_seg((struct mlx5_wqe_data_seg *)
639 (wqe + MLX5_REGEX_WQE_SCATTER_OFFSET),
640 MLX5_REGEX_MAX_OUTPUT,
641 queue->outputs->lkey,
642 (uintptr_t)job->output);
643 wqe += 64;
644 }
645 queue->free_qps |= 1ULL << hw_qpid;
646 }
647}
648
649static int
650setup_buffers(struct mlx5_regex_priv *priv, struct mlx5_regex_qp *qp)

Callers 1

Calls 4

qp_size_getFunction · 0.85
set_wqe_ctrl_segFunction · 0.85
set_metadata_segFunction · 0.85
set_data_segFunction · 0.85

Tested by

no test coverage detected