From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by dpdk.org (Postfix) with ESMTP id E257B9398 for ; Wed, 25 Nov 2015 17:29:14 +0100 (CET) Received: by pacej9 with SMTP id ej9so61862535pac.2 for ; Wed, 25 Nov 2015 08:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=xn9NrOFIF0XW7Xy+E2mSqEvF5y3MDk4fnB1bQXmUZuU=; b=j16oSX7ZQsd7ctd4qmXNOSiOQ8otA3rnTsNfQVciSWfebpx9dV1MWQ4QdQYgW0cRD5 TNmvRlIFDdelQBlTWK86lbSRMQD2uwWwzko4ZBoZIaoenpZIlLyc1wPsyXs0NUa9Gi3s ou/aBXdxSfNHLfG2A6qWaUDkRBPzAOsndc+ZL2UWkmHA+MX+sxdmQYbFy5NXF7iwGzGh Rn7lw2KAZQRXShuohU6g/9i6ur7Iq15mHHgEKhfl2MibnGZciAAGp+aBXQz3rNOfe+7M k1G5p5ocdZoG2xex44pzjno445Bo7f1Gr2dsnucA8ovkcS2sYhArLL/Pn3diU4YCaulz LZ2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=xn9NrOFIF0XW7Xy+E2mSqEvF5y3MDk4fnB1bQXmUZuU=; b=d7/VRAO5B/RKUSmTVRY40LyFLAWId4GNqwRpHWxHVuAwJLTGcKFxpN8nykFMqUgtMP 8RmsItP42yNTGPlNeLF3XkuoYpuhmrft6egFm5oxsGTt/YPgqLwB7YEome9F3H8CNk/l 7OyvbU1Up7XzB9v6MSxG5aulv+UN9HG2YROnLQ7jhGG/UDVjPJBr/GowsD/kcvSUWD+f S01DYGTjfz+wnBMe6IAvdYVXHHzEd20E6T7QBfZCLj5dxXL0ASs6wJoH9UMgbh0+fQ3U mN8fgcqS5t1L3/73V+rJMkvr4KCXKT+WtcIeKMS5keOIQbU8raX6BHQMzlEwtYTb7lup taqQ== X-Gm-Message-State: ALoCoQnhjw93sBrC1jfWCqh/6pdhjLOI2J2f84caFiR1XD1D/vjqPw7F31NIUyux2LUxJ7ZGroKD X-Received: by 10.98.11.71 with SMTP id t68mr33286064pfi.82.1448468954213; Wed, 25 Nov 2015 08:29:14 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id fm1sm16062059pab.6.2015.11.25.08.29.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Nov 2015 08:29:13 -0800 (PST) Date: Wed, 25 Nov 2015 08:29:23 -0800 From: Stephen Hemminger To: "Alejandro.Lucero" Message-ID: <20151125082923.19bafdea@xeon-e3> In-Reply-To: <1448468395-15577-6-git-send-email-alejandro.lucero@netronome.com> References: <1448468395-15577-1-git-send-email-alejandro.lucero@netronome.com> <1448468395-15577-6-git-send-email-alejandro.lucero@netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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:29:15 -0000 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.