dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
To: "Wiles,
	Roger Keith"
	<keith.wiles-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
Cc: "<dev-VfR2kkLFssw@public.gmane.org>" <dev-VfR2kkLFssw@public.gmane.org>
Subject: Re: [PATCH] Function __mempool_get_bulk() returns wrong count.
Date: Sat, 27 Sep 2014 20:38:30 -0400	[thread overview]
Message-ID: <20140928003830.GB27849@localhost.localdomain> (raw)
In-Reply-To: <82107A2E-6373-4A8E-9CDA-10FE18EDEFB6-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>

On Sat, Sep 27, 2014 at 06:41:41PM +0000, Wiles, Roger Keith wrote:
> 
> When __mempool_get_bulk() grabs entries from the cache it
> returns zero instead of the number of entries obtained. Plus
> the stats were increased by the wrong count of objects.
> 
> Signed-off-by: Keith Wiles <keith.wiles-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
> ---
>  lib/librte_mempool/rte_mempool.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
> index 299d4d7..6750e78 100644
> --- a/lib/librte_mempool/rte_mempool.h
> +++ b/lib/librte_mempool/rte_mempool.h
> @@ -988,9 +988,9 @@ __mempool_get_bulk(struct rte_mempool *mp, void **obj_table,
>  
>         cache->len -= n;
>  
> -       __MEMPOOL_STAT_ADD(mp, get_success, n_orig);
> +       __MEMPOOL_STAT_ADD(mp, get_success, n);
>  
> -       return 0;
> +       return n;
>  
>  ring_dequeue:
>  #endif /* RTE_MEMPOOL_CACHE_MAX_SIZE > 0 */
> @@ -1004,7 +1004,7 @@ ring_dequeue:
>         if (ret < 0)
>                 __MEMPOOL_STAT_ADD(mp, get_fail, n_orig);
>         else
> -               __MEMPOOL_STAT_ADD(mp, get_success, n_orig);
> +               __MEMPOOL_STAT_ADD(mp, get_success, ret);
>  
>         return ret;
>  }
> -- 
> 2.1.0Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
> 
> 
Acked-by: Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>

  parent reply	other threads:[~2014-09-28  0:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-27 18:41 [PATCH] Function __mempool_get_bulk() returns wrong count Wiles, Roger Keith
     [not found] ` <82107A2E-6373-4A8E-9CDA-10FE18EDEFB6-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2014-09-28  0:38   ` Neil Horman [this message]
2014-09-28 22:25   ` Ananyev, Konstantin
     [not found]     ` <2601191342CEEE43887BDE71AB977258213851AC-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-28 22:57       ` Wiles, Roger Keith
     [not found]         ` <2085FE90-8322-4249-B22D-776E8F213A36-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2014-09-28 23:00           ` Ananyev, Konstantin

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=20140928003830.GB27849@localhost.localdomain \
    --to=nhorman-2xusbdqka4r54taoqtywwq@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=keith.wiles-CWA4WttNNZF54TAoqtyWWQ@public.gmane.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).