DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: David Hunt <david.hunt@intel.com>, dev@dpdk.org
Cc: viktorin@rehivetech.com, jerin.jacob@caviumnetworks.com
Subject: Re: [dpdk-dev] [PATCH v8 1/3] mempool: support external mempool operations
Date: Wed, 8 Jun 2016 14:13:22 +0200	[thread overview]
Message-ID: <57580BE2.9040204@6wind.com> (raw)
In-Reply-To: <1464965906-108927-2-git-send-email-david.hunt@intel.com>

Hi David,

Please find some comments below.

On 06/03/2016 04:58 PM, David Hunt wrote:

> --- a/lib/librte_mempool/rte_mempool.h
> +++ b/lib/librte_mempool/rte_mempool.h

> +/**
> + * Prototype for implementation specific data provisioning function.
> + *
> + * The function should provide the implementation specific memory for
> + * for use by the other mempool ops functions in a given mempool ops struct.
> + * E.g. the default ops provides an instance of the rte_ring for this purpose.
> + * it will mostlikely point to a different type of data structure, and
> + * will be transparent to the application programmer.
> + */
> +typedef void *(*rte_mempool_alloc_t)(struct rte_mempool *mp);

In http://dpdk.org/ml/archives/dev/2016-June/040233.html, I suggested
to change the prototype to return an int (-errno) and directly set
the set mp->pool_data (void *) or mp->pool_if (uint64_t). No cast
would be required in this latter case.

By the way, there is a typo in the comment:
"mostlikely" -> "most likely"

> --- /dev/null
> +++ b/lib/librte_mempool/rte_mempool_default.c

> +static void
> +common_ring_free(struct rte_mempool *mp)
> +{
> +	rte_ring_free((struct rte_ring *)mp->pool_data);
> +}

I don't think the cast is needed here.
(same in other functions)


> --- /dev/null
> +++ b/lib/librte_mempool/rte_mempool_ops.c

> +/* add a new ops struct in rte_mempool_ops_table, return its index */
> +int
> +rte_mempool_ops_register(const struct rte_mempool_ops *h)
> +{
> +	struct rte_mempool_ops *ops;
> +	int16_t ops_index;
> +
> +	rte_spinlock_lock(&rte_mempool_ops_table.sl);
> +
> +	if (rte_mempool_ops_table.num_ops >=
> +			RTE_MEMPOOL_MAX_OPS_IDX) {
> +		rte_spinlock_unlock(&rte_mempool_ops_table.sl);
> +		RTE_LOG(ERR, MEMPOOL,
> +			"Maximum number of mempool ops structs exceeded\n");
> +		return -ENOSPC;
> +	}
> +
> +	if (h->put == NULL || h->get == NULL || h->get_count == NULL) {
> +		rte_spinlock_unlock(&rte_mempool_ops_table.sl);
> +		RTE_LOG(ERR, MEMPOOL,
> +			"Missing callback while registering mempool ops\n");
> +		return -EINVAL;
> +	}
> +
> +	if (strlen(h->name) >= sizeof(ops->name) - 1) {
> +		RTE_LOG(DEBUG, EAL, "%s(): mempool_ops <%s>: name too long\n",
> +				__func__, h->name);
> +		rte_errno = EEXIST;
> +		return NULL;
> +	}

This has already been noticed by Shreyansh, but in case of:

rte_mempool_ops.c:75:10: error: return makes integer from pointer
without a cast [-Werror=int-conversion]
   return NULL;
          ^


> +/* sets mempool ops previously registered by rte_mempool_ops_register */
> +int
> +rte_mempool_set_ops_byname(struct rte_mempool *mp, const char *name)


When I compile with shared libraries enabled, I get the following error:

librte_reorder.so: undefined reference to `rte_mempool_ops_table'
librte_mbuf.so: undefined reference to `rte_mempool_set_ops_byname'
...

The new functions and global variables must be in
rte_mempool_version.map. This was in v5
( http://dpdk.org/ml/archives/dev/2016-May/039365.html ) but
was dropped in v6.




Regards,
Olivier

  parent reply	other threads:[~2016-06-08 12:13 UTC|newest]

Thread overview: 237+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 17:25 [dpdk-dev] [PATCH 0/5] add external mempool manager David Hunt
2016-01-26 17:25 ` [dpdk-dev] [PATCH 1/5] mempool: add external mempool manager support David Hunt
2016-01-28 17:52   ` Jerin Jacob
2016-02-03 14:16     ` Hunt, David
2016-02-04 13:23       ` Jerin Jacob
2016-02-04 14:52   ` Olivier MATZ
2016-02-04 16:47     ` Hunt, David
2016-02-08 11:02       ` Olivier MATZ
2016-02-04 17:34     ` Hunt, David
2016-02-05  9:26       ` Olivier MATZ
2016-03-01 13:32     ` Hunt, David
2016-03-04  9:05       ` Olivier MATZ
2016-03-08 10:04         ` Hunt, David
2016-01-26 17:25 ` [dpdk-dev] [PATCH 2/5] memool: add stack (lifo) based external mempool handler David Hunt
2016-01-26 17:25 ` [dpdk-dev] [PATCH 3/5] mempool: add custom external mempool handler example David Hunt
2016-01-28 17:54   ` Jerin Jacob
2016-01-26 17:25 ` [dpdk-dev] [PATCH 4/5] mempool: add autotest for external mempool custom example David Hunt
2016-01-26 17:25 ` [dpdk-dev] [PATCH 5/5] mempool: allow rte_pktmbuf_pool_create switch between memool handlers David Hunt
2016-02-05 10:11   ` Olivier MATZ
2016-01-28 17:26 ` [dpdk-dev] [PATCH 0/5] add external mempool manager Jerin Jacob
2016-01-29 13:40   ` Hunt, David
2016-01-29 17:16     ` Jerin Jacob
2016-02-16 14:48 ` [dpdk-dev] [PATCH 0/6] " David Hunt
2016-02-16 14:48   ` [dpdk-dev] [PATCH 1/6] mempool: add external mempool manager support David Hunt
2016-02-16 19:27     ` [dpdk-dev] [dpdk-dev, " Jan Viktorin
2016-02-19 13:30     ` [dpdk-dev] [PATCH " Olivier MATZ
2016-02-29 11:11       ` Hunt, David
2016-03-04  9:04         ` Olivier MATZ
2016-02-16 14:48   ` [dpdk-dev] [PATCH 2/6] mempool: add stack (lifo) based external mempool handler David Hunt
2016-02-19 13:31     ` Olivier MATZ
2016-02-29 11:04       ` Hunt, David
2016-03-04  9:04         ` Olivier MATZ
2016-03-08 20:45       ` Venkatesan, Venky
2016-03-09 14:53         ` Olivier MATZ
2016-02-16 14:48   ` [dpdk-dev] [PATCH 3/6] mempool: adds a simple ring-based mempool handler using mallocs for objects David Hunt
2016-02-16 14:48   ` [dpdk-dev] [PATCH 4/6] mempool: add autotest for external mempool custom example David Hunt
2016-02-16 14:48   ` [dpdk-dev] [PATCH 5/6] mempool: allow rte_pktmbuf_pool_create switch between memool handlers David Hunt
2016-02-16 14:48   ` [dpdk-dev] [PATCH 6/6] mempool: add in the RTE_NEXT_ABI protection for ABI breakages David Hunt
2016-02-19 13:33     ` Olivier MATZ
2016-02-19 13:25   ` [dpdk-dev] [PATCH 0/6] external mempool manager Olivier MATZ
2016-02-29 10:55     ` Hunt, David
2016-03-09  9:50   ` [dpdk-dev] [PATCH v3 0/4] " David Hunt
2016-03-09  9:50     ` [dpdk-dev] [PATCH v3 1/4] mempool: add external mempool manager support David Hunt
2016-04-11 22:52       ` Yuanhan Liu
2016-03-09  9:50     ` [dpdk-dev] [PATCH v3 2/4] mempool: add custom mempool handler example David Hunt
2016-03-09  9:50     ` [dpdk-dev] [PATCH v3 3/4] mempool: allow rte_pktmbuf_pool_create switch between memool handlers David Hunt
2016-03-09 10:54       ` Panu Matilainen
2016-03-09 11:38         ` Hunt, David
2016-03-09 11:44           ` Panu Matilainen
2016-03-09  9:50     ` [dpdk-dev] [PATCH v3 4/4] mempool: add in the RTE_NEXT_ABI for ABI breakages David Hunt
2016-03-09 10:46       ` Panu Matilainen
2016-03-09 11:30         ` Hunt, David
2016-03-09 14:59           ` Olivier MATZ
2016-03-09 16:28             ` Hunt, David
2016-03-09 16:31               ` Olivier MATZ
2016-03-09 16:39                 ` Hunt, David
2016-03-09 11:10     ` [dpdk-dev] [PATCH v3 0/4] external mempool manager Hunt, David
2016-04-11 22:46     ` Yuanhan Liu
2016-04-14 13:57     ` [dpdk-dev] [PATCH v4 0/3] " Olivier Matz
2016-04-14 13:57       ` [dpdk-dev] [PATCH v4 1/3] mempool: support external handler Olivier Matz
2016-04-14 13:57       ` [dpdk-dev] [PATCH v4 2/3] app/test: test external mempool handler Olivier Matz
2016-04-14 13:57       ` [dpdk-dev] [PATCH v4 3/3] mbuf: get default mempool handler from configuration Olivier Matz
2016-05-19 13:44       ` [dpdk-dev] mempool: external mempool manager David Hunt
2016-05-19 13:44         ` [dpdk-dev] [PATCH v5 1/3] mempool: support external handler David Hunt
2016-05-23 12:35           ` [dpdk-dev] [dpdk-dev,v5,1/3] " Jan Viktorin
2016-05-24 14:04             ` Hunt, David
2016-05-31  9:09             ` Hunt, David
2016-05-31 12:06               ` Jan Viktorin
2016-05-31 13:47                 ` Hunt, David
2016-05-31 20:40                   ` Olivier MATZ
2016-06-01  9:39                     ` Hunt, David
2016-06-01 12:30                     ` Jan Viktorin
2016-05-24 15:35           ` [dpdk-dev] [PATCH v5 1/3] " Jerin Jacob
2016-05-27  9:52             ` Hunt, David
2016-05-27 10:33               ` Jerin Jacob
2016-05-27 14:44                 ` Hunt, David
2016-05-30  9:41                   ` Jerin Jacob
2016-05-30 11:27                     ` Hunt, David
2016-05-31  8:53                       ` Jerin Jacob
2016-05-31 15:37                         ` Hunt, David
2016-05-31 16:03                           ` Jerin Jacob
2016-05-31 20:41                             ` Olivier MATZ
2016-05-31 21:11                               ` Jerin Jacob
2016-06-01 10:46                                 ` Hunt, David
2016-06-01 11:18                                   ` Jerin Jacob
2016-05-19 13:45         ` [dpdk-dev] [PATCH v5 2/3] app/test: test external mempool handler David Hunt
2016-05-23 12:45           ` [dpdk-dev] [dpdk-dev, v5, " Jan Viktorin
2016-05-31  9:17             ` Hunt, David
2016-05-31 12:14               ` Jan Viktorin
2016-05-31 20:40                 ` Olivier MATZ
2016-05-19 13:45         ` [dpdk-dev] [PATCH v5 3/3] mbuf: get default mempool handler from configuration David Hunt
2016-05-23 12:40           ` [dpdk-dev] [dpdk-dev, v5, " Jan Viktorin
2016-05-31  9:26             ` Hunt, David
2016-06-01 16:19         ` [dpdk-dev] [PATCH v6 0/5] mempool: add external mempool manager David Hunt
2016-06-01 16:19           ` [dpdk-dev] [PATCH v6 1/5] mempool: support external handler David Hunt
2016-06-01 16:29             ` Hunt, David
2016-06-01 17:54             ` Jan Viktorin
2016-06-02  9:11               ` Hunt, David
2016-06-02 11:23               ` Hunt, David
2016-06-02 13:43                 ` Jan Viktorin
2016-06-01 16:19           ` [dpdk-dev] [PATCH v6 2/5] mempool: remove rte_ring from rte_mempool struct David Hunt
2016-06-01 16:19           ` [dpdk-dev] [PATCH v6 3/5] mempool: add default external mempool handler David Hunt
2016-06-01 16:19           ` [dpdk-dev] [PATCH v6 4/5] app/test: test " David Hunt
2016-06-01 16:19           ` [dpdk-dev] [PATCH v6 5/5] mbuf: get default mempool handler from configuration David Hunt
2016-06-02 13:27           ` [dpdk-dev] [PATCH v7 0/5] mempool: add external mempool manager David Hunt
2016-06-02 13:27             ` [dpdk-dev] [PATCH v7 1/5] mempool: support external mempool operations David Hunt
2016-06-02 13:38               ` [dpdk-dev] [PATCH v7 0/5] mempool: add external mempool manager Hunt, David
2016-06-03  6:38               ` [dpdk-dev] [PATCH v7 1/5] mempool: support external mempool operations Jerin Jacob
2016-06-03 10:28                 ` Hunt, David
2016-06-03 10:49                   ` Jerin Jacob
2016-06-03 11:07                   ` Olivier MATZ
2016-06-03 11:42                     ` Jan Viktorin
2016-06-03 12:10                     ` Hunt, David
2016-06-03 12:28               ` Olivier MATZ
2016-06-02 13:27             ` [dpdk-dev] [PATCH v7 2/5] mempool: remove rte_ring from rte_mempool struct David Hunt
2016-06-03 12:28               ` Olivier MATZ
2016-06-03 14:17                 ` Hunt, David
2016-06-02 13:27             ` [dpdk-dev] [PATCH v7 3/5] mempool: add default external mempool ops David Hunt
2016-06-02 13:27             ` [dpdk-dev] [PATCH v7 4/5] app/test: test external mempool manager David Hunt
2016-06-02 13:27             ` [dpdk-dev] [PATCH v7 5/5] mbuf: allow apps to change default mempool ops David Hunt
2016-06-03 12:28               ` Olivier MATZ
2016-06-03 14:06                 ` Hunt, David
2016-06-03 14:10                   ` Olivier Matz
2016-06-03 14:14                     ` Hunt, David
2016-06-03 14:58             ` [dpdk-dev] [PATCH v8 0/5] mempool: add external mempool manager David Hunt
2016-06-03 14:58               ` [dpdk-dev] [PATCH v8 1/3] mempool: support external mempool operations David Hunt
2016-06-06 14:32                 ` Shreyansh Jain
2016-06-06 14:38                 ` Shreyansh Jain
2016-06-07  9:25                   ` Hunt, David
2016-06-08 13:48                     ` Shreyansh Jain
2016-06-09  9:39                       ` Hunt, David
2016-06-09 10:31                         ` Jerin Jacob
2016-06-09 11:06                           ` Hunt, David
2016-06-09 11:49                           ` Shreyansh Jain
2016-06-09 12:30                             ` Jerin Jacob
2016-06-09 13:03                               ` Shreyansh Jain
2016-06-09 13:18                               ` Hunt, David
2016-06-09 13:37                                 ` Jerin Jacob
2016-06-09 11:41                         ` Shreyansh Jain
2016-06-09 12:55                           ` Hunt, David
2016-06-09 13:09                         ` Jan Viktorin
2016-06-10  7:29                           ` Olivier Matz
2016-06-10  8:49                             ` Jan Viktorin
2016-06-10  9:02                               ` Hunt, David
2016-06-10  9:34                             ` Hunt, David
2016-06-10 11:29                               ` Shreyansh Jain
2016-06-10 11:13                             ` Jerin Jacob
2016-06-10 11:37                             ` Shreyansh Jain
2016-06-07  9:05                 ` Shreyansh Jain
2016-06-08 12:13                 ` Olivier Matz [this message]
2016-06-09 10:33                   ` Hunt, David
2016-06-08 14:28                 ` Shreyansh Jain
2016-06-03 14:58               ` [dpdk-dev] [PATCH v8 2/3] app/test: test external mempool manager David Hunt
2016-06-03 14:58               ` [dpdk-dev] [PATCH v8 3/3] mbuf: make default mempool ops configurable at build David Hunt
2016-06-10 15:16               ` [dpdk-dev] [PATCH v9 0/3] mempool: add external mempool manager David Hunt
2016-06-10 15:16                 ` [dpdk-dev] [PATCH v9 1/3] mempool: support external mempool operations David Hunt
2016-06-13 12:16                   ` Olivier Matz
2016-06-13 13:46                     ` Hunt, David
2016-06-10 15:16                 ` [dpdk-dev] [PATCH v9 2/3] app/test: test external mempool manager David Hunt
2016-06-10 15:16                 ` [dpdk-dev] [PATCH v9 3/3] mbuf: make default mempool ops configurable at build David Hunt
2016-06-14  9:46                 ` [dpdk-dev] [PATCH v10 0/3] mempool: add external mempool manager David Hunt
2016-06-14  9:46                   ` [dpdk-dev] [PATCH v10 1/3] mempool: support external mempool operations David Hunt
2016-06-14 11:38                     ` Shreyansh Jain
2016-06-14 12:55                     ` Thomas Monjalon
2016-06-14 13:20                       ` Hunt, David
2016-06-14 13:29                         ` Thomas Monjalon
2016-06-14  9:46                   ` [dpdk-dev] [PATCH v10 2/3] app/test: test external mempool manager David Hunt
2016-06-14 11:39                     ` Shreyansh Jain
2016-06-14  9:46                   ` [dpdk-dev] [PATCH v10 3/3] mbuf: make default mempool ops configurable at build David Hunt
2016-06-14 11:45                     ` Shreyansh Jain
2016-06-14 12:32                   ` [dpdk-dev] [PATCH v10 0/3] mempool: add external mempool manager Olivier MATZ
2016-06-14 15:48                   ` [dpdk-dev] [PATCH v11 " David Hunt
2016-06-14 15:48                     ` [dpdk-dev] [PATCH v11 1/3] mempool: support external mempool operations David Hunt
2016-06-14 16:08                       ` Thomas Monjalon
2016-06-14 15:49                     ` [dpdk-dev] [PATCH v11 2/3] app/test: test external mempool manager David Hunt
2016-06-14 15:49                     ` [dpdk-dev] [PATCH v11 3/3] mbuf: make default mempool ops configurable at build David Hunt
2016-06-15  7:47                     ` [dpdk-dev] [PATCH v12 0/3] mempool: add external mempool manager David Hunt
2016-06-15  7:47                       ` [dpdk-dev] [PATCH v12 1/3] mempool: support external mempool operations David Hunt
2016-06-15 10:14                         ` Jan Viktorin
2016-06-15 10:29                           ` Hunt, David
2016-06-15 11:26                             ` Jan Viktorin
2016-06-15 11:38                             ` Thomas Monjalon
2016-06-15  7:47                       ` [dpdk-dev] [PATCH v12 2/3] app/test: test external mempool manager David Hunt
2016-06-15  7:47                       ` [dpdk-dev] [PATCH v12 3/3] mbuf: make default mempool ops configurable at build David Hunt
2016-06-15 10:13                       ` [dpdk-dev] [PATCH v12 0/3] mempool: add external mempool manager Jan Viktorin
2016-06-15 11:47                         ` Hunt, David
2016-06-15 12:03                           ` Olivier MATZ
2016-06-15 12:38                             ` Hunt, David
2016-06-15 13:50                               ` Olivier MATZ
2016-06-15 14:02                                 ` Hunt, David
2016-06-15 14:10                                   ` Olivier MATZ
2016-06-15 14:47                                     ` Jan Viktorin
2016-06-15 16:03                                       ` Hunt, David
2016-06-15 16:34                             ` Hunt, David
2016-06-15 16:40                               ` Olivier MATZ
2016-06-16  4:35                                 ` Shreyansh Jain
2016-06-16  7:04                                   ` Hunt, David
2016-06-16  7:47                                 ` Hunt, David
2016-06-16  8:47                                   ` Olivier MATZ
2016-06-16  8:55                                     ` Hunt, David
2016-06-16  8:58                                       ` Olivier MATZ
2016-06-16 11:34                                         ` Hunt, David
2016-06-16 12:30                       ` [dpdk-dev] [PATCH v13 " David Hunt
2016-06-16 12:30                         ` [dpdk-dev] [PATCH v13 1/3] mempool: support external mempool operations David Hunt
2016-06-17  6:58                           ` Hunt, David
2016-06-17  8:08                             ` Olivier Matz
2016-06-17  8:42                               ` Hunt, David
2016-06-17  9:09                                 ` Thomas Monjalon
2016-06-17  9:24                                   ` Hunt, David
2016-06-17 10:19                                     ` Olivier Matz
2016-06-17 10:18                           ` Olivier Matz
2016-06-17 10:47                             ` Hunt, David
2016-06-16 12:30                         ` [dpdk-dev] [PATCH v13 2/3] app/test: test external mempool manager David Hunt
2016-06-16 12:30                         ` [dpdk-dev] [PATCH v13 3/3] mbuf: make default mempool ops configurable at build David Hunt
2016-06-17 13:53                         ` [dpdk-dev] [PATCH v14 0/3] mempool: add mempool handler feature David Hunt
2016-06-17 13:53                           ` [dpdk-dev] [PATCH v14 1/3] mempool: support mempool handler operations David Hunt
2016-06-17 14:35                             ` Jan Viktorin
2016-06-19 11:44                               ` Hunt, David
2016-06-17 13:53                           ` [dpdk-dev] [PATCH v14 2/3] app/test: test mempool handler David Hunt
2016-06-17 14:37                             ` Jan Viktorin
2016-06-17 13:53                           ` [dpdk-dev] [PATCH v14 3/3] mbuf: make default mempool ops configurable at build David Hunt
2016-06-17 14:41                             ` Jan Viktorin
2016-06-19 12:05                           ` [dpdk-dev] [PATCH v15 0/3] mempool: add mempool handler feature David Hunt
2016-06-19 12:05                             ` [dpdk-dev] [PATCH v15 1/3] mempool: support mempool handler operations David Hunt
2016-06-19 12:05                             ` [dpdk-dev] [PATCH v15 2/3] app/test: test mempool handler David Hunt
2016-06-19 12:05                             ` [dpdk-dev] [PATCH v15 3/3] mbuf: make default mempool ops configurable at build David Hunt
2016-06-22  7:56                             ` [dpdk-dev] [PATCH v15 0/3] mempool: add mempool handler feature Thomas Monjalon
2016-06-22  8:02                               ` Thomas Monjalon
2016-06-22  9:27                             ` [dpdk-dev] [PATCH v16 " David Hunt
2016-06-22  9:27                               ` [dpdk-dev] [PATCH v16 1/3] mempool: support mempool handler operations David Hunt
2016-06-22  9:27                               ` [dpdk-dev] [PATCH v16 2/3] app/test: test mempool handler David Hunt
2016-06-22  9:27                               ` [dpdk-dev] [PATCH v16 3/3] mbuf: make default mempool ops configurable at build David Hunt
2016-06-23 21:22                               ` [dpdk-dev] [PATCH v16 0/3] mempool: add mempool handler feature Thomas Monjalon
2016-06-24  4:55                                 ` Wiles, Keith
2016-06-24 11:20                                   ` Jan Viktorin
2016-06-24 11:24                                     ` Thomas Monjalon
2016-06-24 13:10                                       ` Jan Viktorin

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=57580BE2.9040204@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=viktorin@rehivetech.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).