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

Function flow_dv_mreg_create_cb

dpdk/drivers/net/mlx5/mlx5_flow.c:5049–5163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5047}
5048
5049struct mlx5_list_entry *
5050flow_dv_mreg_create_cb(void *tool_ctx, void *cb_ctx)
5051{
5052 struct rte_eth_dev *dev = tool_ctx;
5053 struct mlx5_priv *priv = dev->data->dev_private;
5054 struct mlx5_flow_cb_ctx *ctx = cb_ctx;
5055 struct mlx5_flow_mreg_copy_resource *mcp_res;
5056 struct rte_flow_error *error = ctx->error;
5057 uint32_t idx = 0;
5058 int ret;
5059 uint32_t mark_id = *(uint32_t *)(ctx->data);
5060 struct rte_flow_attr attr = {
5061 .group = MLX5_FLOW_MREG_CP_TABLE_GROUP,
5062 .ingress = 1,
5063 };
5064 struct mlx5_rte_flow_item_tag tag_spec = {
5065 .data = mark_id,
5066 };
5067 struct rte_flow_item items[] = {
5068 [1] = { .type = RTE_FLOW_ITEM_TYPE_END, },
5069 };
5070 struct rte_flow_action_mark ftag = {
5071 .id = mark_id,
5072 };
5073 struct mlx5_flow_action_copy_mreg cp_mreg = {
5074 .dst = REG_B,
5075 .src = REG_NON,
5076 };
5077 struct rte_flow_action_jump jump = {
5078 .group = MLX5_FLOW_MREG_ACT_TABLE_GROUP,
5079 };
5080 struct rte_flow_action actions[] = {
5081 [3] = { .type = RTE_FLOW_ACTION_TYPE_END, },
5082 };
5083
5084 /* Fill the register fields in the flow. */
5085 ret = mlx5_flow_get_reg_id(dev, MLX5_FLOW_MARK, 0, error);
5086 if (ret < 0)
5087 return NULL;
5088 tag_spec.id = ret;
5089 ret = mlx5_flow_get_reg_id(dev, MLX5_METADATA_RX, 0, error);
5090 if (ret < 0)
5091 return NULL;
5092 cp_mreg.src = ret;
5093 /* Provide the full width of FLAG specific value. */
5094 if (mark_id == (priv->sh->dv_regc0_mask & MLX5_FLOW_MARK_DEFAULT))
5095 tag_spec.data = MLX5_FLOW_MARK_DEFAULT;
5096 /* Build a new flow. */
5097 if (mark_id != MLX5_DEFAULT_COPY_ID) {
5098 items[0] = (struct rte_flow_item){
5099 .type = (enum rte_flow_item_type)
5100 MLX5_RTE_FLOW_ITEM_TYPE_TAG,
5101 .spec = &tag_spec,
5102 };
5103 items[1] = (struct rte_flow_item){
5104 .type = RTE_FLOW_ITEM_TYPE_END,
5105 };
5106 actions[0] = (struct rte_flow_action){

Callers

nothing calls this directly

Calls 4

mlx5_flow_get_reg_idFunction · 0.85
mlx5_ipool_zmallocFunction · 0.85
flow_list_createFunction · 0.85
mlx5_ipool_freeFunction · 0.85

Tested by

no test coverage detected