From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qc0-f169.google.com (mail-qc0-f169.google.com [209.85.216.169]) by dpdk.org (Postfix) with ESMTP id 6E3C358F8 for ; Thu, 15 May 2014 10:43:35 +0200 (CEST) Received: by mail-qc0-f169.google.com with SMTP id e16so1275147qcx.0 for ; Thu, 15 May 2014 01:43:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=kHulkzSO203ooM1h4HBB1ErTiTlIx6QBhji5ZUx3oOI=; b=Tnb0S63ltYGaBrcSr1wiAyAIzS03/3IcJ6iieFhR3YasE8l2OzqyyAW6kycVmn+8iJ dPTAiICZxZYM/43ULo66uoFQRqhXyrwOs3973/4/AOjOy17eYKdXwxRLq73EX0vNhaYv VxNGmUlfWZYaeeJPshYKmnECEbOyrbFNdmW/vfpkDhnd2AsX62VDIO3nJyHzw7DfmDK0 abmi5Cf4n3j8wmocyFUV8+cdtii3rDeqkgK81vMDBd0OyCgOYVgR0XDkprGw17cih8Pa XN4/Walx+mzaYWoU4ahZUqGdUQfATLaYj+p5rJIba+5x+PvI/26iS4tu/hFQqf4DF92B vemw== X-Gm-Message-State: ALoCoQnOWP31VAIJZqPE/zTJ2Aw9NcOPP0vHIUsd1AgO2ecTTvP9nOtzxhKLHWFnwUXX+4wJicUa MIME-Version: 1.0 X-Received: by 10.229.221.194 with SMTP id id2mr13463544qcb.5.1400143422128; Thu, 15 May 2014 01:43:42 -0700 (PDT) Received: by 10.140.109.73 with HTTP; Thu, 15 May 2014 01:43:42 -0700 (PDT) In-Reply-To: <20140514185743.414400480@networkplumber.org> References: <20140514185527.771828962@networkplumber.org> <20140514185743.414400480@networkplumber.org> Date: Thu, 15 May 2014 10:43:42 +0200 Message-ID: From: Ivan Boule To: Stephen Hemminger Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" , Stephen Hemminger Subject: Re: [dpdk-dev] [PATCH 2/6] Subjet: ethdev: add common code to atomicly access link 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: Thu, 15 May 2014 08:43:35 -0000 Hi Stephen, The new function rte_eth_dev_set_link() below is declared as void. Thus, the comments about its return value are wrong, and should be removed, unless they still refer to a desired behaviour, in which case it is the function itself that should be reworked to invoke rte_atomic64_cmpset and to return its result. Regards, Ivan 2014-05-14 20:55 GMT+02:00 Stephen Hemminger : > Many drivers copy/paste same code to atomicly access link information. > Add functions to do this instead. > > Signed-off-by: Stephen Hemminger > > --- a/lib/librte_ether/rte_ethdev.h 2014-05-14 11:27:07.409461720 -0700 > +++ b/lib/librte_ether/rte_ethdev.h 2014-05-14 11:27:07.409461720 -0700 > @@ -1704,6 +1704,45 @@ extern void rte_eth_link_get_nowait(uint > struct rte_eth_link *link); > > + > +/** > + * @internal > + * Set the link status from device in atomic fashion. > + * Returns non-zero on success; 0 on failure > + * Callers should retry on failure > + */ > +static inline void rte_eth_dev_set_link(struct rte_eth_dev *dev, > + struct rte_eth_link *link) > +{ > + rte_atomic64_t *dst = (rte_atomic64_t *)&dev->data->dev_link; > + > + rte_atomic64_set(dst, *(int64_t *)link); > +} > + > > -- Ivan BOULE 6WIND Software Engineer