From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id BB8FC952 for ; Wed, 8 Mar 2017 11:22:48 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id t189so26743910wmt.1 for ; Wed, 08 Mar 2017 02:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:date:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nNHEE7Y+iQ+jHt9Oagxc2jMBwSp1vb57GvgFeMVjCaI=; b=PIGdZ3WKLUxrdxWPqTvirpLyGGilEsTRTZKyMFHPHQR4ov9L9J1ewjEHbcuwFDZN3E TaNrufCEXDQLJKBdbHA22yqxYo2xkjcZrb1vzr5rYMxVKqihHs+/ODOAdZjREmfdk0DT V39n+0J8N2Uyr6Frt0xLbY2/S2Nso869dSU7gnZeMTxwG8nqap6a3KSRpHO4MzB6nGCF M+0vN2CiiR4e1Mti5cOQliTjwvELX/tUkzbCqtkt/Lcl/StABUBlrf5mrMfQV1mlPDPO vpJmaxadJgFVrPtGC3dl43I5T+Az2yDjEt7Wn0qpm8HTVtIBqtQHs2H/tLFxtKMuvi7J KLGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nNHEE7Y+iQ+jHt9Oagxc2jMBwSp1vb57GvgFeMVjCaI=; b=FHfSrNXGinmOTd6PwYxr8wR3wwllBCk0x2++K9fOvW/0dqPKvysq1lrXbf/Iv93hvc 7o8KKuWqFen/KOOHR7H3TqOsEuNr+SuowYjANNwNaGpk+a2o+GLLrAI7JQeJsfWv+RBK wRMKjTVXmx+6j0S84QtXlEZTu1TfQX9N7romJpkoNa5QKYYg2u3cmDKiD5j33OZc/+jh uOXaRTFligPA+S7qTZtXi+rHleLrL0VK6G2d4hA5GHOsMQrpEN6yxjtZ5EWnDd0WW/Fg pdCiGw2fazKKLlxioM7cTX8EkCMjVu+xo89pfVUoUirl4Sta1IwcuW+qfnngSAXR81Us p7Iw== X-Gm-Message-State: AMke39nxXEkhH1BfeEsqkcEH7WtSAGtXM0J+HAz6yoxOD7ftuBjjfQLXmBEoVbCErYcejfg8 X-Received: by 10.28.143.84 with SMTP id r81mr16117949wmd.14.1488968568549; Wed, 08 Mar 2017 02:22:48 -0800 (PST) Received: from glumotte.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id c58sm3559006wrc.9.2017.03.08.02.22.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Mar 2017 02:22:48 -0800 (PST) From: Olivier MATZ X-Google-Original-From: Olivier MATZ Date: Wed, 8 Mar 2017 11:22:40 +0100 To: Bruce Richardson Cc: olivier.matz@6wind.com, jerin.jacob@caviumnetworks.com, dev@dpdk.org Message-ID: <20170308112240.31bcb9e5@glumotte.dev.6wind.com> In-Reply-To: <20170307113217.11077-8-bruce.richardson@intel.com> References: <20170223172407.27664-1-bruce.richardson@intel.com> <20170307113217.11077-1-bruce.richardson@intel.com> <20170307113217.11077-8-bruce.richardson@intel.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 07/14] ring: make bulk and burst fn return vals consistent X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Mar 2017 10:22:48 -0000 On Tue, 7 Mar 2017 11:32:10 +0000, Bruce Richardson wrote: > The bulk fns for rings returns 0 for all elements enqueued and negative > for no space. Change that to make them consistent with the burst functions > in returning the number of elements enqueued/dequeued, i.e. 0 or N. > This change also allows the return value from enq/deq to be used directly > without a branch for error checking. > > Signed-off-by: Bruce Richardson [...] > @@ -716,7 +695,7 @@ rte_ring_enqueue_bulk(struct rte_ring *r, void * const *obj_table, > static inline int __attribute__((always_inline)) > rte_ring_mp_enqueue(struct rte_ring *r, void *obj) > { > - return rte_ring_mp_enqueue_bulk(r, &obj, 1); > + return rte_ring_mp_enqueue_bulk(r, &obj, 1) ? 0 : -ENOBUFS; > } > > /** I'm wondering if these functions (enqueue/dequeue of one element) should be modified to return 0 (fail) or 1 (success) too, for consistency with the bulk functions. Any opinion? Olivier