From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding :content-type; bh=lDjh8cyaLpDJPdABHxYezf4KEDl+s9cu2ds63GWAwVs=; b=y/zTfZzh6PwZV4OnYveeD1P5K3sB/prvNQHCjWEzmzQB9ciIVchbA1hV0bVd/F4GbY SUHWYMWOhzjNw1O8GZfismm593Qt9hmQ8yIbHtGDOASKH5yPucdlDRsqHGE0vev9eDyz vqh1skuzsf2bJwH3jepkBCAbAcQ0scRJF8QcfqrtqQ77MjU6WUFqg/BxaGDrXgM24SmF 93SJ1iEzPDL385HzlYrOPdlCJDX8up5EdffywWDwuQXDreEFcFZGuXauH/o1kzgUuSLp FH6E19QXkWc2N/WWAxwM7+ccl7i80QnvtO06Ttw5UL1bEG3WL5vmgXGZc0+LWN3oXULw k9YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=lDjh8cyaLpDJPdABHxYezf4KEDl+s9cu2ds63GWAwVs=; b=Pjuetlh7Ja8EZMr6BjmgtcIOFt18ZoMVCUapKfc/qkrvHWuJysGWOESd0Kl1JuI2Nk SofjJhWXHIitUfB8hqHU4o9YvWY8AgBvXiyEQcqH/J3vPBlYbxkHsTb8d8dIr7mnp5c8 Mec+yfTDQNDLfAuUWH3cJArjv07EHnUXP7OlVggKRH26OG09vc5w2wRtfnyZVAN5bPvQ 8JVGUhpGxo5KTiHGhYGtsgrpFa5MYTLVupOQoho4kMM8e0P7utoUqY+2HP3tI7J7xYhx ZyUVr+cAqlynU52NfSGTz8MubOkjsIyI0sXw15E5mmAPU/kZjdTC82b5PNIZs7FjRmrj 0rzg== X-Gm-Message-State: ALoCoQk5YFmUGBq3qr0am70nGJVCdTQTuWo8HF+lf+NNRQTyDwX0d9OFdUp4OyIOm4QW4+/v1wPJ X-Received: by 10.194.90.243 with SMTP id bz19mr40146112wjb.128.1448469099696; Wed, 25 Nov 2015 08:31:39 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id z66sm4305199wmz.7.2015.11.25.08.31.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Nov 2015 08:31:38 -0800 (PST) From: Thomas Monjalon To: Stephen Hemminger Date: Wed, 25 Nov 2015 17:30:20 +0100 Message-ID: <2533348.HH4ZyNmTXY@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20151125082923.19bafdea@xeon-e3> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v8 5/9] nfp: adding link functionality X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2015 16:31:40 -0000 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?