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

Function port_flow_complain

dpdk/app/test-pmd/config.c:1407–1460  ·  view source on GitHub ↗

Print a message out of a flow error. */

Source from the content-addressed store, hash-verified

1405
1406/** Print a message out of a flow error. */
1407static int
1408port_flow_complain(struct rte_flow_error *error)
1409{
1410 static const char *const errstrlist[] = {
1411 [RTE_FLOW_ERROR_TYPE_NONE] = "no error",
1412 [RTE_FLOW_ERROR_TYPE_UNSPECIFIED] = "cause unspecified",
1413 [RTE_FLOW_ERROR_TYPE_HANDLE] = "flow rule (handle)",
1414 [RTE_FLOW_ERROR_TYPE_ATTR_GROUP] = "group field",
1415 [RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY] = "priority field",
1416 [RTE_FLOW_ERROR_TYPE_ATTR_INGRESS] = "ingress field",
1417 [RTE_FLOW_ERROR_TYPE_ATTR_EGRESS] = "egress field",
1418 [RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER] = "transfer field",
1419 [RTE_FLOW_ERROR_TYPE_ATTR] = "attributes structure",
1420 [RTE_FLOW_ERROR_TYPE_ITEM_NUM] = "pattern length",
1421 [RTE_FLOW_ERROR_TYPE_ITEM_SPEC] = "item specification",
1422 [RTE_FLOW_ERROR_TYPE_ITEM_LAST] = "item specification range",
1423 [RTE_FLOW_ERROR_TYPE_ITEM_MASK] = "item specification mask",
1424 [RTE_FLOW_ERROR_TYPE_ITEM] = "specific pattern item",
1425 [RTE_FLOW_ERROR_TYPE_ACTION_NUM] = "number of actions",
1426 [RTE_FLOW_ERROR_TYPE_ACTION_CONF] = "action configuration",
1427 [RTE_FLOW_ERROR_TYPE_ACTION] = "specific action",
1428 };
1429 const char *errstr;
1430 char buf[32];
1431 int err = rte_errno;
1432
1433 if ((unsigned int)error->type >= RTE_DIM(errstrlist) ||
1434 !errstrlist[error->type])
1435 errstr = "unknown type";
1436 else
1437 errstr = errstrlist[error->type];
1438 fprintf(stderr, "%s(): Caught PMD error type %d (%s): %s%s: %s\n",
1439 __func__, error->type, errstr,
1440 error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
1441 error->cause), buf) : "",
1442 error->message ? error->message : "(no stated reason)",
1443 rte_strerror(err));
1444
1445 switch (error->type) {
1446 case RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER:
1447 fprintf(stderr, "The status suggests the use of \"transfer\" "
1448 "as the possible cause of the failure. Make "
1449 "sure that the flow in question and its "
1450 "indirect components (if any) are managed "
1451 "via \"transfer\" proxy port. Use command "
1452 "\"show port (port_id) flow transfer proxy\" "
1453 "to figure out the proxy port ID\n");
1454 break;
1455 default:
1456 break;
1457 }
1458
1459 return -err;
1460}
1461
1462static void
1463rss_types_display(uint64_t rss_types, uint16_t char_num_per_line)

Calls 2

snprintfFunction · 0.85
rte_strerrorFunction · 0.85

Tested by

no test coverage detected