From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 95BC12BBB for ; Thu, 8 Jun 2017 11:53:15 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id 7so134260076wmo.1 for ; Thu, 08 Jun 2017 02:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gAW7DZ+WgrJ+zerUawzk+Kp++jNw8v/L8s/L3fP+moc=; b=j+pTv9rPd5LY/HdPYfcw36VIxS/Rl16kVbKl1Ckq2qdBQ3Oy9fizY9r+M26FdR+chL HH6eFI2z+18WpDfB0eB6JzWEPUhUXyIKXKQQsQxuP8RqWNmkDxObMhFlKvUrJXdcKH6L ypdPsH7ZZnOz7E/pWEBZTNjmt8x3X6gr59c9FE48fDcYWrmCu79Mm9w8S3z5nHT+ThRJ Kq3yFCL2izdwTBn8P5nyqc6oSTGv40pQvukfIEOFQjzLJ+lTuyyW8V3gNbN8ceOSGiNV a1RKH0cIvwA1XhFheuV1K8GV72BpI83rLd7iTg0Wh2knbcRa/PqMmY2sAM1LS1GDDgfl pFmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gAW7DZ+WgrJ+zerUawzk+Kp++jNw8v/L8s/L3fP+moc=; b=pZbeyskjtnMHfJdT8L9TDwjsCbuIeh6BU4bgum//sc9+5fVYfWRj/TL0+IanhYSHlO bYnc1LINyZF/lqW4ESniXSGwAB/SihjPtzKgDPYn6XXVmB+roRhTvDrYzc+HbL5SbcH4 ff3kWYynhzLxQfiH5EiEVBSyU+a51goq1SxBzk6rUSNaqLh8DwbmQN62Gelugq82vl4J 9Be9Zo3GjgMcpqn7EzQ+rY/1eU8v4iCwwbtAxzSDWviAahoNkB3v9KbEYq7ZbxCvXcar 2BUyB72yTJ3Rl//5tzDned7wIyR6cj/m5sZARsS4sujICwRCDOFxjf08SDPMI2DDvMjc xXvg== X-Gm-Message-State: AODbwcDwVmreTT9mSM68hmtrstVOxqYFWEFz0b58KSmFUrkWgVYo/4Vu lAT1wR8dD4pDetJi X-Received: by 10.28.100.68 with SMTP id y65mr2865706wmb.40.1496915595297; Thu, 08 Jun 2017 02:53:15 -0700 (PDT) Received: from platinum (2a01cb0c03c651000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:3c6:5100:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id r142sm5908456wmg.24.2017.06.08.02.53.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jun 2017 02:53:15 -0700 (PDT) Date: Thu, 8 Jun 2017 11:53:13 +0200 From: Olivier Matz To: Hemant Agrawal Cc: , , Message-ID: <20170608115313.342853f3@platinum> In-Reply-To: <1495532028-9700-1-git-send-email-hemant.agrawal@nxp.com> References: <1495532028-9700-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; 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 1/2] mempool/dpaa2: fix the return value for alloc fail 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: Thu, 08 Jun 2017 09:53:15 -0000 Hi Hemant, On Tue, 23 May 2017 15:03:47 +0530, Hemant Agrawal wrote: > In case the alloc api is not able to allocate the required > number of buffer, it can return '0', which will not indicate > the failure to the calling function. > This patch fix the return value to indicate the failure. > > Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool") > CC: stable@dpdk.org > > Signed-off-by: Hemant Agrawal > --- > drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c > index 5a5d6aa..60dd1c0 100644 > --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c > +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c > @@ -294,7 +294,7 @@ > /* Releasing all buffers allocated */ > rte_dpaa2_mbuf_release(pool, obj_table, bpid, > bp_info->meta_data_size, n); > - return ret; > + return -1; > } > /* assigning mbuf from the acquired objects */ > for (i = 0; (i < ret) && bufs[i]; i++) { Wouldn't it be better to return an errno as done in ring handler (see common_ring_mp_enqueue()) or in stack handler (see stack_alloc())? Olivier