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

Adrien Mazarguil adrien.mazarguil at 6wind.com
Wed Oct 11 13:56:42 CEST 2017


On Wed, Oct 11, 2017 at 11:23:12AM +0200, Thomas Monjalon wrote:
> 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.

I'll do it as part of moving this patch into my upcoming series for mlx4,
since it relies on the new return value.

Now for the record, I believe that static inlines, particularly short ones
that are not expected to be modified any time soon (provided they are
defined properly that is) are harmless.

Yes, that means modifying them, depending on what they do, may cause a
global ABI breakage of the underlying library which translates to a major
version bump, however exactly the same applies to some macros (in particular
the *_MAX ones), structure and other type definitions and so on.

What I'm getting at is, making this function part of the .map file won't
help all that much with the goal of reaching a stable ABI. Making it a
normal function on the other hand successfully prevents PMDs and
applications from considering its use in their data plane (flow rules
management from the data plane is likely the next step for rte_flow).

In my opinion, performance (even if hypothetical) matters more than ABI
stability, particularly since the current pattern is for the whole ABI to be
broken every other release. I think that with DPDK, ABI stability can only
be properly guaranteed in stable/maintenance releases but that effort is
vain in the master branch, affected by way too many changes for it to ever
become reality. This doesn't mean we shouldn't even try, however we
shouldn't restrict ourselves; when the ABI needs to be broken, so be it.

(end of rant, thanks for reading)

-- 
Adrien Mazarguil
6WIND


More information about the dev mailing list