From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v8 5/9] nfp: adding link functionality Date: Wed, 25 Nov 2015 17:30:20 +0100 Message-ID: <2533348.HH4ZyNmTXY@xps13> References: <1448468395-15577-1-git-send-email-alejandro.lucero@netronome.com> <1448468395-15577-6-git-send-email-alejandro.lucero@netronome.com> <20151125082923.19bafdea@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id E7BE49398 for ; Wed, 25 Nov 2015 17:31:39 +0100 (CET) Received: by wmvv187 with SMTP id v187so265214045wmv.1 for ; Wed, 25 Nov 2015 08:31:39 -0800 (PST) In-Reply-To: <20151125082923.19bafdea@xeon-e3> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2015-11-25 08:29, Stephen Hemminger: > On Wed, 25 Nov 2015 16:19:51 +0000 > "Alejandro.Lucero" 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?