[dpdk-dev] [PATCH v8 5/9] nfp: adding link functionality

Thomas Monjalon thomas.monjalon at 6wind.com
Wed Nov 25 17:30:20 CET 2015


2015-11-25 08:29, Stephen Hemminger:
> On Wed, 25 Nov 2015 16:19:51 +0000
> "Alejandro.Lucero" <alejandro.lucero at netronome.com> wrote:
> 
> > +/*
> > + * Atomically reads link status information from global structure rte_eth_dev.
> > + *
> > + * @param dev
> > + *   - Pointer to the structure rte_eth_dev to read from.
> > + *   - Pointer to the buffer to be saved with the link status.
> > + *
> > + * @return
> > + *   - On success, zero.
> > + *   - On failure, negative value.
> > + */
> > +static inline int
> > +nfp_net_dev_atomic_read_link_status(struct rte_eth_dev *dev,
> > +				    struct rte_eth_link *link)
> > +{
> > +	struct rte_eth_link *dst = link;
> > +	struct rte_eth_link *src = &dev->data->dev_link;
> > +
> > +	if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,
> > +				*(uint64_t *)src) == 0)
> > +		return -1;
> > +
> > +	return 0;
> > +}
> > +
> > +/
> 
> Sigh, this code has been copied and pasted to every driver.
> Why is it not part of standard rte_ethdev code.

Because nobody made the patch.

Stephen, how is your mood today?


More information about the dev mailing list