DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>, <shreyansh.jain@nxp.com>
Subject: Re: [dpdk-dev] [PATCH 1/2] mempool/dpaa2: fix the return value for alloc fail
Date: Thu, 8 Jun 2017 11:53:13 +0200	[thread overview]
Message-ID: <20170608115313.342853f3@platinum> (raw)
In-Reply-To: <1495532028-9700-1-git-send-email-hemant.agrawal@nxp.com>

Hi Hemant,

On Tue, 23 May 2017 15:03:47 +0530, Hemant Agrawal <hemant.agrawal@nxp.com> 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 <hemant.agrawal@nxp.com>
> ---
>  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

  parent reply	other threads:[~2017-06-08  9:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23  9:33 Hemant Agrawal
2017-05-23  9:33 ` [dpdk-dev] [PATCH 2/2] mempool/dpaa2: improving the alloc/free logging Hemant Agrawal
2017-06-08 10:08   ` Olivier Matz
2017-06-22 12:46     ` Hemant Agrawal
2017-06-08  9:53 ` Olivier Matz [this message]
2017-06-22 12:48 ` [dpdk-dev] [PATCH v2 1/2] mempool/dpaa2: fix the return value for alloc fail Hemant Agrawal
2017-06-22 12:48   ` [dpdk-dev] [PATCH v2 2/2] mempool/dpaa2: fix the incorrect free usages for bplist Hemant Agrawal
2017-07-10  8:11     ` Olivier Matz
2017-07-18 14:46     ` Shreyansh Jain
2017-07-10  8:10   ` [dpdk-dev] [PATCH v2 1/2] mempool/dpaa2: fix the return value for alloc fail Olivier Matz
2017-07-18 14:47   ` Shreyansh Jain
2017-07-21  6:29     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170608115313.342853f3@platinum \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).