DPDK patches and discussions
 help / color / mirror / Atom feed
From: dvr <jinxiu.1006@163.com>
To: dev <dev@dpdk.org>
Subject: [dpdk-dev] About "Multi-process" sample application
Date: Thu, 12 Sep 2013 15:16:50 +0800 (CST)	[thread overview]
Message-ID: <79d21721.1dfcb.14111078f7b.Coremail.jinxiu.1006@163.com> (raw)

hi,all
    I tried to run multi-process sample application step by step according to the document of "sample_application_user_guide.pdf", but encount a problem: only the first rx_queue can receive packages, the other three rx_queue have no package at all. How could this happen? Did I need to do some other configuration?
    Any help will be appreciate.
Best regards.
Maria
    
From dmitryvyal@gmail.com  Thu Sep 12 09:52:00 2013
Return-Path: <dmitryvyal@gmail.com>
Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com
 [IPv6:2a00:1450:4010:c04::233])
 by dpdk.org (Postfix) with ESMTP id ED2E81F3
 for <dev@dpdk.org>; Thu, 12 Sep 2013 09:51:59 +0200 (CEST)
Received: by mail-lb0-f179.google.com with SMTP id x18so556823lbi.10
 for <dev@dpdk.org>; Thu, 12 Sep 2013 00:52:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=message-id:date:from:user-agent:mime-version:to:subject
 :content-type:content-transfer-encoding;
 bh=7FfwMTOZCdrtHq6d1e/dwM+Ny1Y1EYwStFjIJK6N2PA=;
 b=MNqY+uI+XChTW7Ya+FTmJ6kU2PFvKDIG3Nrj+cAy0eFDX2C4uPBZOlQONBElMNaGFr
 HlomGDd0wRxZCcFBhLShH70p9SUW/lW31Sv9UXB/4+0izwYok3f1A687SXI4cbLGkEPt
 T+Cvu8RTN/wC9rF5K8wU1mBsKy6OxJHUv7BlNF9aciFyhF+/Lvy6ZDykTAkD3z0KELsN
 7sUvnBrCCf5sJfPAWwzfatUCFPcnFoHkUD45AirCCp0XO1DKThDETxCLu56YICqbXMHo
 TWS+ijzzjg2YYJka49vTKPthQVB8Heb5FILkhvnnfdwGMi5tfkYtwcVPwgk3hprjOxIL
 Ta8w==
X-Received: by 10.112.40.110 with SMTP id w14mr156908lbk.42.1378972356380;
 Thu, 12 Sep 2013 00:52:36 -0700 (PDT)
Received: from [192.168.15.100] ([91.246.87.40])
 by mx.google.com with ESMTPSA id js17sm1016848lab.5.1969.12.31.16.00.00
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Thu, 12 Sep 2013 00:52:36 -0700 (PDT)
Message-ID: <523172C3.2040309@gmail.com>
Date: Thu, 12 Sep 2013 11:52:35 +0400
From: Dmitry Vyal <dmitryvyal@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:17.0) Gecko/20130623 Thunderbird/17.0.7
MIME-Version: 1.0
To: dev@dpdk.org
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Subject: [dpdk-dev] Looks like rte_mempool_free_count() and
	rte_mempool_count() are swapped
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Sep 2013 07:52:00 -0000

Greetings.

I had a suspect I run into a mbuf depletion issue and decided to check 
using rte_mempool_free_count(). To my surprise, it returned a value 
equal to mempool size. I tried calling rte_mempool_count() and it 
returned zero.

I inspected the code in dpdk-1.3.1-7 and dpdk.1.4.1-4:

rte_mempool_count(const struct rte_mempool *mp)
{
     unsigned count;

     count = rte_ring_count(mp->ring);

#if RTE_MEMPOOL_CACHE_MAX_SIZE > 0
     {
         unsigned lcore_id;
         if (mp->cache_size == 0)
             return count;

         for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++)
             count += mp->local_cache[lcore_id].len;
     }
#endif

     /*
      * due to race condition (access to len is not locked), the
      * total can be greater than size... so fix the result
      */
     if (count > mp->size)
         return mp->size;
     return count;
}

If I understand it correctly, the ring contains free buffers and 
rte_ring_count() returns a number of entries inside a ring. So this 
function actually calculates the number of free entries, not busy.

Moreover, rte_mempool_count() is used in many places. For example it's 
called in rte_mempool_free_count() and rte_mempool_full().

Can anyone confirm or refute my findings?

Regards,
Dmitry

                 reply	other threads:[~2013-09-12  7:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=79d21721.1dfcb.14111078f7b.Coremail.jinxiu.1006@163.com \
    --to=jinxiu.1006@163.com \
    --cc=dev@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).