From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v1 1/7] ethdev: expose flow API error helper Date: Wed, 11 Oct 2017 11:23:12 +0200 Message-ID: <2075344.22PATxnhkA@xps> References: <00db12469380e587ac434bfc5c63795e32cfddef.1507193185.git.adrien.mazarguil@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Ferruh Yigit , Gaetan Rivet , aconole@redhat.com, fbl@redhat.com To: Adrien Mazarguil Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id CDCE6223 for ; Wed, 11 Oct 2017 11:23:14 +0200 (CEST) In-Reply-To: <00db12469380e587ac434bfc5c63795e32cfddef.1507193185.git.adrien.mazarguil@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > --- > --- 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.