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

Function __prep_one

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

Source from the content-addressed store, hash-verified

143}
144
145static inline void
146__prep_one(struct mlx5_regex_priv *priv, struct mlx5_regex_hw_qp *qp_obj,
147 struct rte_regex_ops *op, struct mlx5_regex_job *job,
148 size_t pi, struct mlx5_klm *klm)
149{
150 size_t wqe_offset = (pi & (qp_size_get(qp_obj) - 1)) *
151 (MLX5_SEND_WQE_BB << (priv->has_umr ? 2 : 0)) +
152 (priv->has_umr ? MLX5_REGEX_UMR_WQE_SIZE : 0);
153 uint16_t group0 = op->req_flags & RTE_REGEX_OPS_REQ_GROUP_ID0_VALID_F ?
154 op->group_id0 : 0;
155 uint16_t group1 = op->req_flags & RTE_REGEX_OPS_REQ_GROUP_ID1_VALID_F ?
156 op->group_id1 : 0;
157 uint16_t group2 = op->req_flags & RTE_REGEX_OPS_REQ_GROUP_ID2_VALID_F ?
158 op->group_id2 : 0;
159 uint16_t group3 = op->req_flags & RTE_REGEX_OPS_REQ_GROUP_ID3_VALID_F ?
160 op->group_id3 : 0;
161 uint8_t control = 0x0;
162
163 if (op->req_flags & RTE_REGEX_OPS_REQ_MATCH_HIGH_PRIORITY_F)
164 control = 0x1;
165 else if (op->req_flags & RTE_REGEX_OPS_REQ_STOP_ON_MATCH_F)
166 control = 0x2;
167
168 /* For backward compatibility. */
169 if (!(op->req_flags & (RTE_REGEX_OPS_REQ_GROUP_ID0_VALID_F |
170 RTE_REGEX_OPS_REQ_GROUP_ID1_VALID_F |
171 RTE_REGEX_OPS_REQ_GROUP_ID2_VALID_F |
172 RTE_REGEX_OPS_REQ_GROUP_ID3_VALID_F)))
173 group0 = op->group_id0;
174 uint8_t *wqe = (uint8_t *)(uintptr_t)qp_obj->qp_obj.wqes + wqe_offset;
175 int ds = 4; /* ctrl + meta + input + output */
176
177 set_wqe_ctrl_seg((struct mlx5_wqe_ctrl_seg *)wqe,
178 (priv->has_umr ? (pi * 4 + 3) : pi),
179 MLX5_OPCODE_MMO, MLX5_OPC_MOD_MMO_REGEX,
180 qp_obj->qp_obj.qp->id, 0, ds, 0, 0);
181 set_regex_ctrl_seg(wqe + 12, 0, group0, group1, group2, group3,
182 control);
183 struct mlx5_wqe_data_seg *input_seg =
184 (struct mlx5_wqe_data_seg *)(wqe +
185 MLX5_REGEX_WQE_GATHER_OFFSET);
186 input_seg->byte_count = rte_cpu_to_be_32(klm->byte_count);
187 input_seg->addr = rte_cpu_to_be_64(klm->address);
188 input_seg->lkey = klm->mkey;
189 job->user_id = op->user_id;
190}
191
192static inline void
193prep_one(struct mlx5_regex_priv *priv, struct mlx5_regex_qp *qp,

Callers 2

prep_oneFunction · 0.85
prep_nop_regex_wqe_setFunction · 0.85

Calls 3

qp_size_getFunction · 0.85
set_wqe_ctrl_segFunction · 0.85
set_regex_ctrl_segFunction · 0.85

Tested by

no test coverage detected