[5/6] mempool: add namespace to driver register macro
Checks
Commit Message
Add RTE_ prefix to macro used to register mempool driver.
The old one is still available but deprecated.
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
doc/guides/prog_guide/mempool_lib.rst | 2 +-
doc/guides/rel_notes/deprecation.rst | 4 ++++
doc/guides/rel_notes/release_21_11.rst | 3 +++
drivers/mempool/bucket/rte_mempool_bucket.c | 2 +-
drivers/mempool/cnxk/cn10k_mempool_ops.c | 2 +-
drivers/mempool/cnxk/cn9k_mempool_ops.c | 2 +-
drivers/mempool/dpaa/dpaa_mempool.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/mempool/octeontx/rte_mempool_octeontx.c | 2 +-
drivers/mempool/octeontx2/otx2_mempool_ops.c | 2 +-
drivers/mempool/ring/rte_mempool_ring.c | 12 ++++++------
drivers/mempool/stack/rte_mempool_stack.c | 4 ++--
lib/mempool/rte_mempool.h | 6 +++++-
13 files changed, 28 insertions(+), 17 deletions(-)
Comments
On Mon, Oct 18, 2021 at 4:50 PM Andrew Rybchenko
<andrew.rybchenko@oktetlabs.ru> wrote:
>
> Add RTE_ prefix to macro used to register mempool driver.
> The old one is still available but deprecated.
ODP seems to use its own mempools.
$ git grep-all -w MEMPOOL_REGISTER_OPS
OpenDataplane/platform/linux-generic/pktio/dpdk.c:MEMPOOL_REGISTER_OPS(odp_pool_ops);
I'd say it counts as a driver macro.
If so, we could hide it in a driver-only header, along with
rte_mempool_register_ops getting marked as internal.
$ git grep-all -w rte_mempool_register_ops
FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
On 10/19/21 11:49 AM, David Marchand wrote:
> On Mon, Oct 18, 2021 at 4:50 PM Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru> wrote:
>>
>> Add RTE_ prefix to macro used to register mempool driver.
>> The old one is still available but deprecated.
>
> ODP seems to use its own mempools.
>
> $ git grep-all -w MEMPOOL_REGISTER_OPS
> OpenDataplane/platform/linux-generic/pktio/dpdk.c:MEMPOOL_REGISTER_OPS(odp_pool_ops);
>
> I'd say it counts as a driver macro.
> If so, we could hide it in a driver-only header, along with
> rte_mempool_register_ops getting marked as internal.
>
> $ git grep-all -w rte_mempool_register_ops
> FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
> FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
Do I understand correctly that it is required to remove it from
stable ABI/API, but still allow external SW to use it?
Should I add one more patch to the series?
On 10/19/21 12:04 PM, Andrew Rybchenko wrote:
> On 10/19/21 11:49 AM, David Marchand wrote:
>> On Mon, Oct 18, 2021 at 4:50 PM Andrew Rybchenko
>> <andrew.rybchenko@oktetlabs.ru> wrote:
>>>
>>> Add RTE_ prefix to macro used to register mempool driver.
>>> The old one is still available but deprecated.
>>
>> ODP seems to use its own mempools.
>>
>> $ git grep-all -w MEMPOOL_REGISTER_OPS
>> OpenDataplane/platform/linux-generic/pktio/dpdk.c:MEMPOOL_REGISTER_OPS(odp_pool_ops);
>>
>> I'd say it counts as a driver macro.
>> If so, we could hide it in a driver-only header, along with
>> rte_mempool_register_ops getting marked as internal.
>>
>> $ git grep-all -w rte_mempool_register_ops
>> FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
>> FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
>
> Do I understand correctly that it is required to remove it from
> stable ABI/API, but still allow external SW to use it?
>
> Should I add one more patch to the series?
>
I'm afraid not now. It is too invasive or too illogical.
Basically it should more rte_mempool_ops to the header
as well, but it is heavily used by inline functions in
rte_mempool.h.
Of course, it is possible to move just register API
to the mempool_driver.h header, but value of such
changes is not really big.
On Tue, Oct 19, 2021 at 11:05 AM Andrew Rybchenko
<andrew.rybchenko@oktetlabs.ru> wrote:
>
> On 10/19/21 11:49 AM, David Marchand wrote:
> > On Mon, Oct 18, 2021 at 4:50 PM Andrew Rybchenko
> > <andrew.rybchenko@oktetlabs.ru> wrote:
> >>
> >> Add RTE_ prefix to macro used to register mempool driver.
> >> The old one is still available but deprecated.
> >
> > ODP seems to use its own mempools.
> >
> > $ git grep-all -w MEMPOOL_REGISTER_OPS
> > OpenDataplane/platform/linux-generic/pktio/dpdk.c:MEMPOOL_REGISTER_OPS(odp_pool_ops);
> >
> > I'd say it counts as a driver macro.
> > If so, we could hide it in a driver-only header, along with
> > rte_mempool_register_ops getting marked as internal.
> >
> > $ git grep-all -w rte_mempool_register_ops
> > FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
> > FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
>
> Do I understand correctly that it is required to remove it from
> stable ABI/API, but still allow external SW to use it?
>
> Should I add one more patch to the series?
If we want to do the full job, we need to inspect driver-only symbols
in rte_mempool.h.
But this goes way further than a simple prefixing as this series intended.
I just read your reply, I think we agree.
Let's go with simple prefix and take a note to cleanup in the future.
On 10/19/21 12:27 PM, David Marchand wrote:
> On Tue, Oct 19, 2021 at 11:05 AM Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru> wrote:
>>
>> On 10/19/21 11:49 AM, David Marchand wrote:
>>> On Mon, Oct 18, 2021 at 4:50 PM Andrew Rybchenko
>>> <andrew.rybchenko@oktetlabs.ru> wrote:
>>>>
>>>> Add RTE_ prefix to macro used to register mempool driver.
>>>> The old one is still available but deprecated.
>>>
>>> ODP seems to use its own mempools.
>>>
>>> $ git grep-all -w MEMPOOL_REGISTER_OPS
>>> OpenDataplane/platform/linux-generic/pktio/dpdk.c:MEMPOOL_REGISTER_OPS(odp_pool_ops);
>>>
>>> I'd say it counts as a driver macro.
>>> If so, we could hide it in a driver-only header, along with
>>> rte_mempool_register_ops getting marked as internal.
>>>
>>> $ git grep-all -w rte_mempool_register_ops
>>> FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
>>> FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
>>
>> Do I understand correctly that it is required to remove it from
>> stable ABI/API, but still allow external SW to use it?
>>
>> Should I add one more patch to the series?
>
> If we want to do the full job, we need to inspect driver-only symbols
> in rte_mempool.h.
> But this goes way further than a simple prefixing as this series intended.
>
> I just read your reply, I think we agree.
> Let's go with simple prefix and take a note to cleanup in the future.
Agreed.
19/10/2021 11:27, David Marchand:
> On Tue, Oct 19, 2021 at 11:05 AM Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru> wrote:
> >
> > On 10/19/21 11:49 AM, David Marchand wrote:
> > > On Mon, Oct 18, 2021 at 4:50 PM Andrew Rybchenko
> > > <andrew.rybchenko@oktetlabs.ru> wrote:
> > >>
> > >> Add RTE_ prefix to macro used to register mempool driver.
> > >> The old one is still available but deprecated.
> > >
> > > ODP seems to use its own mempools.
> > >
> > > $ git grep-all -w MEMPOOL_REGISTER_OPS
> > > OpenDataplane/platform/linux-generic/pktio/dpdk.c:MEMPOOL_REGISTER_OPS(odp_pool_ops);
> > >
> > > I'd say it counts as a driver macro.
> > > If so, we could hide it in a driver-only header, along with
> > > rte_mempool_register_ops getting marked as internal.
> > >
> > > $ git grep-all -w rte_mempool_register_ops
> > > FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
> > > FD.io-VPP/src/plugins/dpdk/buffer.c: rte_mempool_register_ops (&ops);
> >
> > Do I understand correctly that it is required to remove it from
> > stable ABI/API, but still allow external SW to use it?
> >
> > Should I add one more patch to the series?
>
> If we want to do the full job, we need to inspect driver-only symbols
> in rte_mempool.h.
> But this goes way further than a simple prefixing as this series intended.
>
> I just read your reply, I think we agree.
> Let's go with simple prefix and take a note to cleanup in the future.
Yes, and we should probably discuss in techboard what should be kept
compatible for external mempool drivers.
@@ -115,7 +115,7 @@ management systems and software based memory allocators, to be used with DPDK.
There are two aspects to a mempool handler.
* Adding the code for your new mempool operations (ops). This is achieved by
- adding a new mempool ops code, and using the ``MEMPOOL_REGISTER_OPS`` macro.
+ adding a new mempool ops code, and using the ``RTE_MEMPOOL_REGISTER_OPS`` macro.
* Using the new API to call ``rte_mempool_create_empty()`` and
``rte_mempool_set_ops_byname()`` to create a new mempool and specifying which
@@ -47,6 +47,10 @@ Deprecation Notices
be removed in DPDK 22.11. The replacement macro
``RTE_MEMPOOL_HEADER_SIZE()`` is internal only.
+* mempool: Macro to register mempool driver ``MEMPOOL_REGISTER_OPS()`` is
+ deprecated and will be removed in DPDK 22.11. Use replacement macro
+ ``RTE_MEMPOOL_REGISTER_OPS()``.
+
* mbuf: The mbuf offload flags ``PKT_*`` will be renamed as ``RTE_MBUF_F_*``.
A compatibility layer will be kept until DPDK 22.11, except for the flags
that are already deprecated (``PKT_RX_L4_CKSUM_BAD``, ``PKT_RX_IP_CKSUM_BAD``,
@@ -270,6 +270,9 @@ API Changes
* mempool: Helper macro ``MEMPOOL_HEADER_SIZE()`` is deprecated.
The replacement macro ``RTE_MEMPOOL_HEADER_SIZE()`` is internal only.
+* mempool: Macro to register mempool driver ``MEMPOOL_REGISTER_OPS()`` is
+ deprecated. Use replacement ``RTE_MEMPOOL_REGISTER_OPS()``.
+
* net: Renamed ``s_addr`` and ``d_addr`` fields of ``rte_ether_hdr`` structure
to ``src_addr`` and ``dst_addr``, respectively.
@@ -663,4 +663,4 @@ static const struct rte_mempool_ops ops_bucket = {
};
-MEMPOOL_REGISTER_OPS(ops_bucket);
+RTE_MEMPOOL_REGISTER_OPS(ops_bucket);
@@ -316,4 +316,4 @@ static struct rte_mempool_ops cn10k_mempool_ops = {
.populate = cnxk_mempool_populate,
};
-MEMPOOL_REGISTER_OPS(cn10k_mempool_ops);
+RTE_MEMPOOL_REGISTER_OPS(cn10k_mempool_ops);
@@ -86,4 +86,4 @@ static struct rte_mempool_ops cn9k_mempool_ops = {
.populate = cnxk_mempool_populate,
};
-MEMPOOL_REGISTER_OPS(cn9k_mempool_ops);
+RTE_MEMPOOL_REGISTER_OPS(cn9k_mempool_ops);
@@ -358,4 +358,4 @@ static const struct rte_mempool_ops dpaa_mpool_ops = {
.populate = dpaa_populate,
};
-MEMPOOL_REGISTER_OPS(dpaa_mpool_ops);
+RTE_MEMPOOL_REGISTER_OPS(dpaa_mpool_ops);
@@ -455,6 +455,6 @@ static const struct rte_mempool_ops dpaa2_mpool_ops = {
.populate = dpaa2_populate,
};
-MEMPOOL_REGISTER_OPS(dpaa2_mpool_ops);
+RTE_MEMPOOL_REGISTER_OPS(dpaa2_mpool_ops);
RTE_LOG_REGISTER_DEFAULT(dpaa2_logtype_mempool, NOTICE);
@@ -202,4 +202,4 @@ static struct rte_mempool_ops octeontx_fpavf_ops = {
.populate = octeontx_fpavf_populate,
};
-MEMPOOL_REGISTER_OPS(octeontx_fpavf_ops);
+RTE_MEMPOOL_REGISTER_OPS(octeontx_fpavf_ops);
@@ -898,4 +898,4 @@ static struct rte_mempool_ops otx2_npa_ops = {
#endif
};
-MEMPOOL_REGISTER_OPS(otx2_npa_ops);
+RTE_MEMPOOL_REGISTER_OPS(otx2_npa_ops);
@@ -198,9 +198,9 @@ static const struct rte_mempool_ops ops_mt_hts = {
.get_count = common_ring_get_count,
};
-MEMPOOL_REGISTER_OPS(ops_mp_mc);
-MEMPOOL_REGISTER_OPS(ops_sp_sc);
-MEMPOOL_REGISTER_OPS(ops_mp_sc);
-MEMPOOL_REGISTER_OPS(ops_sp_mc);
-MEMPOOL_REGISTER_OPS(ops_mt_rts);
-MEMPOOL_REGISTER_OPS(ops_mt_hts);
+RTE_MEMPOOL_REGISTER_OPS(ops_mp_mc);
+RTE_MEMPOOL_REGISTER_OPS(ops_sp_sc);
+RTE_MEMPOOL_REGISTER_OPS(ops_mp_sc);
+RTE_MEMPOOL_REGISTER_OPS(ops_sp_mc);
+RTE_MEMPOOL_REGISTER_OPS(ops_mt_rts);
+RTE_MEMPOOL_REGISTER_OPS(ops_mt_hts);
@@ -93,5 +93,5 @@ static struct rte_mempool_ops ops_lf_stack = {
.get_count = stack_get_count
};
-MEMPOOL_REGISTER_OPS(ops_stack);
-MEMPOOL_REGISTER_OPS(ops_lf_stack);
+RTE_MEMPOOL_REGISTER_OPS(ops_stack);
+RTE_MEMPOOL_REGISTER_OPS(ops_lf_stack);
@@ -905,12 +905,16 @@ int rte_mempool_register_ops(const struct rte_mempool_ops *ops);
* Note that the rte_mempool_register_ops fails silently here when
* more than RTE_MEMPOOL_MAX_OPS_IDX is registered.
*/
-#define MEMPOOL_REGISTER_OPS(ops) \
+#define RTE_MEMPOOL_REGISTER_OPS(ops) \
RTE_INIT(mp_hdlr_init_##ops) \
{ \
rte_mempool_register_ops(&ops); \
}
+/** Deprecated. Use RTE_MEMPOOL_REGISTER_OPS() instead. */
+#define MEMPOOL_REGISTER_OPS(ops) \
+ RTE_DEPRECATED(RTE_MEMPOOL_REGISTER_OPS(ops))
+
/**
* An object callback function for mempool.
*