DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
To: hemant.agrawal@nxp.com, olivier.matz@6wind.com,
	santosh.shukla@caviumnetworks.com,
	jerin.jacob@caviumnetworks.com
Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Subject: [dpdk-dev]  [PATCH] eal: fix default mempool ops returning NULL
Date: Tue, 30 Jan 2018 21:27:47 +0530	[thread overview]
Message-ID: <20180130155747.12501-1-pbhagavatula@caviumnetworks.com> (raw)

If '--mbuf-pool-ops' is not passed to EAL as command line argument then
rte_eal_mbuf_default_mempool_ops will return NULL.

Instead check if internal_config.user_mbuf_pool_ops_name is NULL and
return compile time RTE_MBUF_DEFAULT_MEMPOOL_OPS.

Fixes: 8b0f7f43413 ("mbuf: maintain user and compile time mempool ops name")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---

 Currently, test/test/test_mempool_autotest is broken as it relies on
 rte_eal_mbuf_default_mempool_ops().

 lib/librte_eal/bsdapp/eal/eal.c   | 3 +++
 lib/librte_eal/linuxapp/eal/eal.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index ba1811a00..07b229fc7 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -115,6 +115,9 @@ int rte_cycles_vmware_tsc_map;
 const char *
 rte_eal_mbuf_default_mempool_ops(void)
 {
+	if (internal_config.user_mbuf_pool_ops_name == NULL)
+		return RTE_MBUF_DEFAULT_MEMPOOL_OPS;
+
 	return internal_config.user_mbuf_pool_ops_name;
 }

diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 66f7585a3..ddcdb6e1f 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -125,6 +125,9 @@ int rte_cycles_vmware_tsc_map;
 const char *
 rte_eal_mbuf_default_mempool_ops(void)
 {
+	if (internal_config.user_mbuf_pool_ops_name == NULL)
+		return RTE_MBUF_DEFAULT_MEMPOOL_OPS;
+
 	return internal_config.user_mbuf_pool_ops_name;
 }

--
2.16.0

             reply	other threads:[~2018-01-30 15:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30 15:57 Pavan Nikhilesh [this message]
2018-01-30 23:58 ` 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=20180130155747.12501-1-pbhagavatula@caviumnetworks.com \
    --to=pbhagavatula@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=olivier.matz@6wind.com \
    --cc=santosh.shukla@caviumnetworks.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 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).