MCPcopy Index your code
hub / github.com/F-Stack/f-stack / rte_flow_conv

Function rte_flow_conv

dpdk/lib/ethdev/rte_flow.c:1097–1155  ·  view source on GitHub ↗

Helper function to convert flow API objects. */

Source from the content-addressed store, hash-verified

1095
1096/** Helper function to convert flow API objects. */
1097int
1098rte_flow_conv(enum rte_flow_conv_op op,
1099 void *dst,
1100 size_t size,
1101 const void *src,
1102 struct rte_flow_error *error)
1103{
1104 int ret;
1105
1106 switch (op) {
1107 const struct rte_flow_attr *attr;
1108
1109 case RTE_FLOW_CONV_OP_NONE:
1110 ret = 0;
1111 break;
1112 case RTE_FLOW_CONV_OP_ATTR:
1113 attr = src;
1114 if (size > sizeof(*attr))
1115 size = sizeof(*attr);
1116 rte_memcpy(dst, attr, size);
1117 ret = sizeof(*attr);
1118 break;
1119 case RTE_FLOW_CONV_OP_ITEM:
1120 ret = rte_flow_conv_pattern(dst, size, src, 1, error);
1121 break;
1122 case RTE_FLOW_CONV_OP_ACTION:
1123 ret = rte_flow_conv_actions(dst, size, src, 1, error);
1124 break;
1125 case RTE_FLOW_CONV_OP_PATTERN:
1126 ret = rte_flow_conv_pattern(dst, size, src, 0, error);
1127 break;
1128 case RTE_FLOW_CONV_OP_ACTIONS:
1129 ret = rte_flow_conv_actions(dst, size, src, 0, error);
1130 break;
1131 case RTE_FLOW_CONV_OP_RULE:
1132 ret = rte_flow_conv_rule(dst, size, src, error);
1133 break;
1134 case RTE_FLOW_CONV_OP_ITEM_NAME:
1135 ret = rte_flow_conv_name(0, 0, dst, size, src, error);
1136 break;
1137 case RTE_FLOW_CONV_OP_ACTION_NAME:
1138 ret = rte_flow_conv_name(1, 0, dst, size, src, error);
1139 break;
1140 case RTE_FLOW_CONV_OP_ITEM_NAME_PTR:
1141 ret = rte_flow_conv_name(0, 1, dst, size, src, error);
1142 break;
1143 case RTE_FLOW_CONV_OP_ACTION_NAME_PTR:
1144 ret = rte_flow_conv_name(1, 1, dst, size, src, error);
1145 break;
1146 default:
1147 ret = rte_flow_error_set
1148 (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
1149 "unknown object conversion operation");
1150 }
1151
1152 rte_flow_trace_conv(op, dst, size, src, ret);
1153
1154 return ret;

Callers 13

rte_flow_copyFunction · 0.85
mlx5_dbg__print_patternFunction · 0.85
bond_flow_allocFunction · 0.85
fs_flow_allocateFunction · 0.85
port_flow_newFunction · 0.85
port_flow_queryFunction · 0.85
port_flow_listFunction · 0.85

Calls 6

rte_flow_conv_patternFunction · 0.85
rte_flow_conv_actionsFunction · 0.85
rte_flow_conv_nameFunction · 0.85
rte_flow_error_setFunction · 0.85
rte_flow_conv_ruleFunction · 0.70
rte_memcpyFunction · 0.50

Tested by

no test coverage detected