[dpdk-dev] [PATCH v1 1/7] ethdev: expose flow API error helper

Thomas Monjalon thomas at monjalon.net
Wed Oct 11 11:23:12 CEST 2017


05/10/2017 11:49, Adrien Mazarguil:
> rte_flow_error_set() is a convenient helper to initialize error objects.
> 
> Since there is no fundamental reason to prevent applications from using it,
> expose it through the public interface after modifying its return value
> from positive to negative. This is done for consistency with the rest of
> the public interface.
> 
> Documentation is updated accordingly.
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
> ---
> --- a/lib/librte_ether/rte_flow.h
> +++ b/lib/librte_ether/rte_flow.h
>  /**
> + * Initialize flow error structure.
> + *
> + * @param[out] error
> + *   Pointer to flow error structure (may be NULL).
> + * @param code
> + *   Related error code (rte_errno).
> + * @param type
> + *   Cause field and error types.
> + * @param cause
> + *   Object responsible for the error.
> + * @param message
> + *   Human-readable error message.
> + *
> + * @return
> + *   Negative error code (errno value) and rte_errno is set.
> + */
> +static inline int
> +rte_flow_error_set(struct rte_flow_error *error,
> +		   int code,
> +		   enum rte_flow_error_type type,
> +		   const void *cause,
> +		   const char *message)

When calling this function, the performance is not critical.
So it must not be an inline function.
Please move it to the .c file and add it to the .map file.


More information about the dev mailing list