Print a message out of a flow error. */
| 888 | #if defined(FF_FLOW_ISOLATE) || defined(FF_FDIR) |
| 889 | /** Print a message out of a flow error. */ |
| 890 | static int |
| 891 | port_flow_complain(struct rte_flow_error *error) |
| 892 | { |
| 893 | static const char *const errstrlist[] = { |
| 894 | [RTE_FLOW_ERROR_TYPE_NONE] = "no error", |
| 895 | [RTE_FLOW_ERROR_TYPE_UNSPECIFIED] = "cause unspecified", |
| 896 | [RTE_FLOW_ERROR_TYPE_HANDLE] = "flow rule (handle)", |
| 897 | [RTE_FLOW_ERROR_TYPE_ATTR_GROUP] = "group field", |
| 898 | [RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY] = "priority field", |
| 899 | [RTE_FLOW_ERROR_TYPE_ATTR_INGRESS] = "ingress field", |
| 900 | [RTE_FLOW_ERROR_TYPE_ATTR_EGRESS] = "egress field", |
| 901 | [RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER] = "transfer field", |
| 902 | [RTE_FLOW_ERROR_TYPE_ATTR] = "attributes structure", |
| 903 | [RTE_FLOW_ERROR_TYPE_ITEM_NUM] = "pattern length", |
| 904 | [RTE_FLOW_ERROR_TYPE_ITEM_SPEC] = "item specification", |
| 905 | [RTE_FLOW_ERROR_TYPE_ITEM_LAST] = "item specification range", |
| 906 | [RTE_FLOW_ERROR_TYPE_ITEM_MASK] = "item specification mask", |
| 907 | [RTE_FLOW_ERROR_TYPE_ITEM] = "specific pattern item", |
| 908 | [RTE_FLOW_ERROR_TYPE_ACTION_NUM] = "number of actions", |
| 909 | [RTE_FLOW_ERROR_TYPE_ACTION_CONF] = "action configuration", |
| 910 | [RTE_FLOW_ERROR_TYPE_ACTION] = "specific action", |
| 911 | }; |
| 912 | const char *errstr; |
| 913 | char buf[32]; |
| 914 | int err = rte_errno; |
| 915 | |
| 916 | if ((unsigned int)error->type >= RTE_DIM(errstrlist) || |
| 917 | !errstrlist[error->type]) |
| 918 | errstr = "unknown type"; |
| 919 | else |
| 920 | errstr = errstrlist[error->type]; |
| 921 | ff_log(FF_LOG_ERR, FF_LOGTYPE_FSTACK_LIB, "Caught error type %d (%s): %s%s: %s\n", |
| 922 | error->type, errstr, |
| 923 | error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ", |
| 924 | error->cause), buf) : "", |
| 925 | error->message ? error->message : "(no stated reason)", |
| 926 | rte_strerror(err)); |
| 927 | return -err; |
| 928 | } |
| 929 | #endif |
| 930 | |
| 931 |
no test coverage detected