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

Function bnxt_validate_and_parse_flow

dpdk/drivers/net/bnxt/bnxt_flow.c:1228–1679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1226}
1227
1228static int
1229bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
1230 const struct rte_flow_item pattern[],
1231 const struct rte_flow_action actions[],
1232 const struct rte_flow_attr *attr,
1233 struct rte_flow_error *error,
1234 struct bnxt_filter_info *filter)
1235{
1236 const struct rte_flow_action *act =
1237 bnxt_flow_non_void_action(actions);
1238 struct bnxt *bp = dev->data->dev_private;
1239 struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
1240 struct bnxt_vnic_info *vnic = NULL, *vnic0 = NULL;
1241 const struct rte_flow_action_queue *act_q;
1242 const struct rte_flow_action_vf *act_vf;
1243 struct bnxt_filter_info *filter1 = NULL;
1244 const struct rte_flow_action_rss *rss;
1245 struct bnxt_rx_queue *rxq = NULL;
1246 int dflt_vnic, vnic_id;
1247 unsigned int rss_idx;
1248 uint32_t vf = 0, i;
1249 int rc, use_ntuple;
1250
1251 rc =
1252 bnxt_validate_and_parse_flow_type(attr, pattern, error, filter);
1253 if (rc != 0)
1254 goto ret;
1255
1256 rc = bnxt_flow_parse_attr(attr, error);
1257 if (rc != 0)
1258 goto ret;
1259
1260 /* Since we support ingress attribute only - right now. */
1261 if (filter->filter_type == HWRM_CFA_EM_FILTER)
1262 filter->flags = HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX;
1263
1264 use_ntuple = bnxt_filter_type_check(pattern, error);
1265
1266start:
1267 switch (act->type) {
1268 case RTE_FLOW_ACTION_TYPE_QUEUE:
1269 /* Allow this flow. Redirect to a VNIC. */
1270 act_q = (const struct rte_flow_action_queue *)act->conf;
1271 if (!act_q->index || act_q->index >= bp->rx_nr_rings) {
1272 rte_flow_error_set(error,
1273 EINVAL,
1274 RTE_FLOW_ERROR_TYPE_ACTION,
1275 act,
1276 "Invalid queue ID.");
1277 rc = -rte_errno;
1278 goto ret;
1279 }
1280 PMD_DRV_LOG(DEBUG, "Queue index %d\n", act_q->index);
1281
1282 vnic_id = attr->group;
1283 if (!vnic_id) {
1284 PMD_DRV_LOG(DEBUG, "Group id is 0\n");
1285 vnic_id = act_q->index;

Callers 2

bnxt_flow_validateFunction · 0.85
bnxt_flow_createFunction · 0.85

Calls 15

bnxt_flow_parse_attrFunction · 0.85
bnxt_filter_type_checkFunction · 0.85
rte_flow_error_setFunction · 0.85
bnxt_vnic_prepFunction · 0.85
bnxt_get_default_vnicFunction · 0.85
bnxt_get_l2_filterFunction · 0.85
bnxt_validate_rss_actionFunction · 0.85
bnxt_get_vnicFunction · 0.85

Tested by

no test coverage detected