git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
eal: allow user to override default mempool driver
[dpdk.git]
/
lib
/
librte_mbuf
/
rte_mbuf.c
diff --git
a/lib/librte_mbuf/rte_mbuf.c
b/lib/librte_mbuf/rte_mbuf.c
index
26a62b8
..
0e18709
100644
(file)
--- a/
lib/librte_mbuf/rte_mbuf.c
+++ b/
lib/librte_mbuf/rte_mbuf.c
@@
-144,7
+144,7
@@
rte_pktmbuf_init(struct rte_mempool *mp,
/* init some constant fields */
m->pool = mp;
m->nb_segs = 1;
/* init some constant fields */
m->pool = mp;
m->nb_segs = 1;
- m->port =
0xff
;
+ m->port =
MBUF_INVALID_PORT
;
rte_mbuf_refcnt_set(m, 1);
m->next = NULL;
}
rte_mbuf_refcnt_set(m, 1);
m->next = NULL;
}
@@
-157,6
+157,7
@@
rte_pktmbuf_pool_create(const char *name, unsigned n,
{
struct rte_mempool *mp;
struct rte_pktmbuf_pool_private mbp_priv;
{
struct rte_mempool *mp;
struct rte_pktmbuf_pool_private mbp_priv;
+ const char *mp_ops_name;
unsigned elt_size;
int ret;
unsigned elt_size;
int ret;
@@
-176,8
+177,8
@@
rte_pktmbuf_pool_create(const char *name, unsigned n,
if (mp == NULL)
return NULL;
if (mp == NULL)
return NULL;
- ret = rte_mempool_set_ops_byname(mp,
-
RTE_MBUF_DEFAULT_MEMPOOL_OPS
, NULL);
+ mp_ops_name = rte_eal_mbuf_default_mempool_ops();
+
ret = rte_mempool_set_ops_byname(mp, mp_ops_name
, NULL);
if (ret != 0) {
RTE_LOG(ERR, MBUF, "error setting mempool handler\n");
rte_mempool_free(mp);
if (ret != 0) {
RTE_LOG(ERR, MBUF, "error setting mempool handler\n");
rte_mempool_free(mp);