* Initialize generic error structure. * * This function also sets rte_errno to a given value. * * @param[out] error * Pointer to error structure (may be NULL). * @param[in] code * Related error code (rte_errno). * @param[in] type * Cause field and error type. * @param[in] cause * Object responsible for the error. * @param[in] message * Human-readable error message. * * @re
| 235 | * Error code. |
| 236 | */ |
| 237 | static inline int |
| 238 | rte_mtr_error_set(struct rte_mtr_error *error, |
| 239 | int code, |
| 240 | enum rte_mtr_error_type type, |
| 241 | const void *cause, |
| 242 | const char *message) |
| 243 | { |
| 244 | if (error) { |
| 245 | *error = (struct rte_mtr_error){ |
| 246 | .type = type, |
| 247 | .cause = cause, |
| 248 | .message = message, |
| 249 | }; |
| 250 | } |
| 251 | rte_errno = code; |
| 252 | return code; |
| 253 | } |
| 254 | |
| 255 | /** |
| 256 | * Get generic traffic metering and policing operations structure from a port |
no outgoing calls
no test coverage detected