All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: <dev@dpdk.org>, <jerin.jacob@caviumnetworks.com>, <david.hunt@intel.com>
Subject: Re: [PATCH v3 2/2] mempool: pktmbuf pool default fallback for mempool ops error
Date: Thu, 13 Oct 2016 18:45:14 +0530	[thread overview]
Message-ID: <7e26965e-173b-1cf6-0beb-c94712ad615a@nxp.com> (raw)
In-Reply-To: <b7576317-e96b-5859-234f-c385a3051c2b@nxp.com>

Hi Olivier,
	Any updates w.r.t this patch set?

Regards
Hemant
On 9/22/2016 6:42 PM, Hemant Agrawal wrote:
> Hi Olivier
>
> On 9/19/2016 7:27 PM, Olivier Matz wrote:
>> Hi Hemant,
>>
>> On 09/16/2016 06:46 PM, Hemant Agrawal wrote:
>>> In the rte_pktmbuf_pool_create, if the default external mempool is
>>> not available, the implementation can default to "ring_mp_mc", which
>>> is an software implementation.
>>>
>>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>>> ---
>>> Changes in V3:
>>> * adding warning message to say that falling back to default sw pool
>>> ---
>>>  lib/librte_mbuf/rte_mbuf.c | 8 ++++++++
>>>  1 file changed, 8 insertions(+)
>>>
>>> diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
>>> index 4846b89..8ab0eb1 100644
>>> --- a/lib/librte_mbuf/rte_mbuf.c
>>> +++ b/lib/librte_mbuf/rte_mbuf.c
>>> @@ -176,6 +176,14 @@ rte_pktmbuf_pool_create(const char *name,
>>> unsigned n,
>>>
>>>      rte_errno = rte_mempool_set_ops_byname(mp,
>>>              RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL);
>>> +
>>> +    /* on error, try falling back to the software based default pool */
>>> +    if (rte_errno == -EOPNOTSUPP) {
>>> +        RTE_LOG(WARNING, MBUF, "Default HW Mempool not supported. "
>>> +            "falling back to sw mempool \"ring_mp_mc\"");
>>> +        rte_errno = rte_mempool_set_ops_byname(mp, "ring_mp_mc", NULL);
>>> +    }
>>> +
>>>      if (rte_errno != 0) {
>>>          RTE_LOG(ERR, MBUF, "error setting mempool handler\n");
>>>          return NULL;
>>>
>>
>> Without adding a new method ".supported()", the first call to
>> rte_mempool_populate() could return the same error ENOTSUP. In this
>> case, it is still possible to fallback.
>>
> It will be bit late.
>
> On failure, than we have to set the default ops and do a goto before
> rte_pktmbuf_pool_init(mp, &mbp_priv);
>
>
>> I've just submitted an RFC, which I think is quite linked:
>> http://dpdk.org/ml/archives/dev/2016-September/046974.html
>> Assuming a new parameter "mempool_ops" is added to
>> rte_pktmbuf_pool_create(), would it make sense to fallback to
>> "ring_mp_mc"? What about just returning ENOTSUP? The application could
>> do the job and decide which sw fallback to use.
>
> We ran into this issue when trying to run the standard DPDK examples
> (l3fwd) in VM. Do you think, is it practical to add fallback handling in
> each of the DPDK examples?
>
> Typically when someone is writing a application on host, he need not
> worry non-availability of the hw offloaded mempool. He may also want to
> run the same binary in virtual machine. In VM, it is not guaranteed that
> hw offloaded mempools will be available.
>
> w.r.t your RFC, we can do this:
> if the user has specified a mempool_ops in rte_pktmbuf_pool_create(),
> don't fallback. It will be responsibility for application to decide on
> calling again rte_pktmbuf_pool_create() with different mempool_ops.
>
>>
>>
>> Regards,
>> Olivier
>>
>
>
>

  reply	other threads:[~2016-10-13 13:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08 14:50 [PATCH 1/2] eal/mempool: introduce check for external mempool availability Hemant Agrawal
2016-09-08 14:50 ` [PATCH 2/2] mempool:pktmbuf pool default fallback for mempool ops error Hemant Agrawal
2016-09-15 17:13 ` [PATCH v2 1/2] eal/mempool: introduce check for external mempool availability Hemant Agrawal
2016-09-15 17:13   ` [PATCH v2 2/2] mempool:pktmbuf pool default fallback for mempool ops error Hemant Agrawal
2016-09-16  8:29     ` Hunt, David
2016-09-16  9:34       ` Hemant Agrawal
2016-09-16  9:13   ` [PATCH v2 1/2] eal/mempool: introduce check for external mempool availability Hunt, David
2016-09-16  9:34     ` Hemant Agrawal
2016-09-16 16:46   ` [PATCH v3 1/2] eal/mempool: check for external mempool support Hemant Agrawal
2016-09-16 16:46     ` [PATCH v3 2/2] mempool: pktmbuf pool default fallback for mempool ops error Hemant Agrawal
2016-09-19 13:57       ` Olivier Matz
2016-09-22 13:12         ` Hemant Agrawal
2016-10-13 13:15           ` Hemant Agrawal [this message]
2016-10-14 12:10             ` Olivier Matz
2016-11-07 12:30               ` Hemant Agrawal
2016-11-22  9:24                 ` Olivier Matz
2016-12-08  8:57                   ` Hemant Agrawal

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=7e26965e-173b-1cf6-0beb-c94712ad615a@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=olivier.matz@6wind.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.