DPDK patches and discussions
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* Re: [PATCH v2 1/1] mempool: implement index-based per core cache
    @ 2022-01-21  9:12  0%         ` Bruce Richardson
  1 sibling, 0 replies; 200+ results
From: Bruce Richardson @ 2022-01-21  9:12 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Morten Brørup, Dharmik Thakkar, Olivier Matz,
	Andrew Rybchenko, dev, nd, Ruifeng Wang, Beilei Xing

On Fri, Jan 21, 2022 at 06:01:23AM +0000, Honnappa Nagarahalli wrote:
> 
> > 
> > +CC Beilei as i40e maintainer
> > 
> > > From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com] Sent:
> > > Thursday, 13 January 2022 06.37
> > >
> > > Current mempool per core cache implementation stores pointers to
> > > mbufs On 64b architectures, each pointer consumes 8B This patch
> > > replaces it with index-based implementation, where in each buffer is
> > > addressed by (pool base address + index) It reduces the amount of
> > > memory/cache required for per core cache
> > >
> > > L3Fwd performance testing reveals minor improvements in the cache
> > > performance (L1 and L2 misses reduced by 0.60%) with no change in
> > > throughput
> > >
> > > Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com> Reviewed-by:
> > > Ruifeng Wang <ruifeng.wang@arm.com> --- lib/mempool/rte_mempool.h
> > > | 150 +++++++++++++++++++++++++-
> > > lib/mempool/rte_mempool_ops_default.c |   7 ++ 2 files changed, 156
> > > insertions(+), 1 deletion(-)
> > >
> > > diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
> > > index 1e7a3c15273c..f2403fbc97a7 100644 ---
> > > a/lib/mempool/rte_mempool.h +++ b/lib/mempool/rte_mempool.h @@ -50,6
> > > +50,10 @@ #include <rte_memcpy.h> #include <rte_common.h>
> > >
> > > +#ifdef RTE_MEMPOOL_INDEX_BASED_LCORE_CACHE +#include <rte_vect.h>
> > > +#endif + #include "rte_mempool_trace_fp.h"
> > >
> > >  #ifdef __cplusplus @@ -239,6 +243,9 @@ struct rte_mempool { int32_t
> > >  ops_index;
> > >
> > >  	struct rte_mempool_cache *local_cache; /**< Per-lcore local cache
> > >  	*/ +#ifdef RTE_MEMPOOL_INDEX_BASED_LCORE_CACHE +	void
> > >  	*pool_base_value; /**< Base value to calculate indices */ +#endif
> > >
> > >  	uint32_t populated_size;         /**< Number of populated objects.
> > >  	*/ struct rte_mempool_objhdr_list elt_list; /**< List of objects in
> > >  	pool */ @@ -1314,7 +1321,22 @@ rte_mempool_cache_flush(struct
> > >  	rte_mempool_cache *cache, if (cache == NULL || cache->len == 0)
> > >  	return; rte_mempool_trace_cache_flush(cache, mp); + +#ifdef
> > >  	RTE_MEMPOOL_INDEX_BASED_LCORE_CACHE +	unsigned int i; +
> > >  	unsigned int cache_len = cache->len; +	void
> > >  	*obj_table[RTE_MEMPOOL_CACHE_MAX_SIZE * 3]; +	void *base_value =
> > >  	mp->pool_base_value; +	uint32_t *cache_objs = (uint32_t *)
> > >  	cache->objs;
> > 
> > Hi Dharmik and Honnappa,
> > 
> > The essence of this patch is based on recasting the type of the objs
> > field in the rte_mempool_cache structure from an array of pointers to
> > an array of uint32_t.
> > 
> > However, this effectively breaks the ABI, because the rte_mempool_cache
> > structure is public and part of the API.
> The patch does not change the public structure, the new member is under
> compile time flag, not sure how it breaks the ABI.
> 
> > 
> > Some drivers [1] even bypass the mempool API and access the
> > rte_mempool_cache structure directly, assuming that the objs array in
> > the cache is an array of pointers. So you cannot recast the fields in
> > the rte_mempool_cache structure the way this patch requires.
> IMO, those drivers are at fault. The mempool cache structure is public
> only because the APIs are inline. We should still maintain modularity and
> not use the members of structures belonging to another library directly.
> A similar effort involving rte_ring was not accepted sometime back [1]
> 
> [1]
> http://inbox.dpdk.org/dev/DBAPR08MB5814907968595EE56F5E20A798390@DBAPR08MB5814.eurprd08.prod.outlook.com/
> 
> > 
> > Although I do consider bypassing an API's accessor functions "spaghetti
> > code", this driver's behavior is formally acceptable as long as the
> > rte_mempool_cache structure is not marked as internal.
> > 
> > I really liked your idea of using indexes instead of pointers, so I'm
> > very sorry to shoot it down. :-(
> > 
> > [1]: E.g. the Intel i40e PMD,
> > http://code.dpdk.org/dpdk/latest/source/drivers/net/i40e/i40e_rxtx_vec_avx
> > 512.c#L25
> It is possible to throw an error when this feature is enabled in this
> file. Alternatively, this PMD could implement the code for index based
> mempool.
>
Yes, it can implement it, and if this model get put in mempool it probably
will [even if it's just a fallback to the mempool code in that case].

However, I would object to adding in this model in the library right now if it
cannot be proved to show some benefit in a realworld case. As I understand
it, the only benefit seen has been in unit test cases? I want to ensure
that for any perf improvements we put in that they have some real-world
applicabilty - the amoung of applicability will depend on the scope and
impact - and by the same token that we don't reject simplifications or
improvements on the basis that they *might* cause issues, if all perf data
fails to show any problem.

So for this patch, can we get some perf numbers for an app where it does
show the value of it? L3fwd is a very trivial app, and as such is usually
fairly reliable in showing perf benefits of optimizations if they exist.
Perhaps for this case, we need something with a bigger cache footprint
perhaps?

Regards,
/Bruce

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v6 00/26] Net/SPNIC: support SPNIC into DPDK 22.03
  @ 2022-01-21  9:27  0%   ` Yanling Song
  2022-01-21 10:22  0%     ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Yanling Song @ 2022-01-21  9:27 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, yanling.song, yanggan, xuyun, stephen, lihuisong

On Wed, 19 Jan 2022 16:56:52 +0000
Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 12/30/2021 6:08 AM, Yanling Song wrote:
> > The patchsets introduce SPNIC driver for Ramaxel's SPNxx serial NIC
> > cards into DPDK 22.03. Ramaxel Memory Technology is a company which
> > supply a lot of electric products: storage, communication, PCB...
> > SPNxxx is a serial PCIE interface NIC cards:
> > SPN110: 2 PORTs *25G
> > SPN120: 4 PORTs *25G
> > SPN130: 2 PORTs *100G
> >   
> 
> Hi Yanling,
> 
> As far as I can see hnic (from Huawei) and this spnic drivers are
> alike, what is the relation between these two?
> 
It is hard to create a brand new driver from scratch, so we referenced
to hinic driver when developing spnic.

> > The following is main features of our SPNIC:
> > - TSO
> > - LRO
> > - Flow control
> > - SR-IOV(Partially supported)
> > - VLAN offload
> > - VLAN filter
> > - CRC offload
> > - Promiscuous mode
> > - RSS
> > 
> > v6->v5, No real changes:
> > 1. Move the fix of RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS from patch 26
> > to patch 2; 2. Change the description of patch 26.
> > 
> > v5->v4:
> > 1. Add prefix "spinc_" for external functions;
> > 2. Remove temporary MACRO: RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS
> > 3. Do not use void* for keeping the type information
> > 
> > v3->v4:
> > 1. Fix ABI test failure;
> > 2. Remove some descriptions in spnic.rst.
> > 
> > v2->v3:
> > 1. Fix clang compiling failure.
> > 
> > v1->v2:
> > 1. Fix coding style issues and compiling failures;
> > 2. Only support linux in meson.build;
> > 3. Use CLOCK_MONOTONIC_COARSE instead of
> > CLOCK_MONOTONIC/CLOCK_MONOTONIC_RAW; 4. Fix time_before();
> > 5. Remove redundant checks in spnic_dev_configure();
> > 
> > Yanling Song (26):
> >    drivers/net: introduce a new PMD driver
> >    net/spnic: initialize the HW interface
> >    net/spnic: add mbox message channel
> >    net/spnic: introduce event queue
> >    net/spnic: add mgmt module
> >    net/spnic: add cmdq and work queue
> >    net/spnic: add interface handling cmdq message
> >    net/spnic: add hardware info initialization
> >    net/spnic: support MAC and link event handling
> >    net/spnic: add function info initialization
> >    net/spnic: add queue pairs context initialization
> >    net/spnic: support mbuf handling of Tx/Rx
> >    net/spnic: support Rx congfiguration
> >    net/spnic: add port/vport enable
> >    net/spnic: support IO packets handling
> >    net/spnic: add device configure/version/info
> >    net/spnic: support RSS configuration update and get
> >    net/spnic: support VLAN filtering and offloading
> >    net/spnic: support promiscuous and allmulticast Rx modes
> >    net/spnic: support flow control
> >    net/spnic: support getting Tx/Rx queues info
> >    net/spnic: net/spnic: support xstats statistics
> >    net/spnic: support VFIO interrupt
> >    net/spnic: support Tx/Rx queue start/stop
> >    net/spnic: add doc infrastructure
> >    net/spnic: fixes unsafe C style code  
> 
> <...>


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v6 00/26] Net/SPNIC: support SPNIC into DPDK 22.03
  2022-01-21  9:27  0%   ` Yanling Song
@ 2022-01-21 10:22  0%     ` Ferruh Yigit
  2022-01-24  5:12  0%       ` Hemant Agrawal
  2022-02-12 14:01  0%       ` Yanling Song
  0 siblings, 2 replies; 200+ results
From: Ferruh Yigit @ 2022-01-21 10:22 UTC (permalink / raw)
  To: Yanling Song
  Cc: dev, yanling.song, yanggan, xuyun, stephen, lihuisong,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Hemant Agrawal

On 1/21/2022 9:27 AM, Yanling Song wrote:
> On Wed, 19 Jan 2022 16:56:52 +0000
> Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
>> On 12/30/2021 6:08 AM, Yanling Song wrote:
>>> The patchsets introduce SPNIC driver for Ramaxel's SPNxx serial NIC
>>> cards into DPDK 22.03. Ramaxel Memory Technology is a company which
>>> supply a lot of electric products: storage, communication, PCB...
>>> SPNxxx is a serial PCIE interface NIC cards:
>>> SPN110: 2 PORTs *25G
>>> SPN120: 4 PORTs *25G
>>> SPN130: 2 PORTs *100G
>>>    
>>
>> Hi Yanling,
>>
>> As far as I can see hnic (from Huawei) and this spnic drivers are
>> alike, what is the relation between these two?
>>
> It is hard to create a brand new driver from scratch, so we referenced
> to hinic driver when developing spnic.
> 

That is OK, but based on the familiarity of the code you may consider
keeping the original code Copyright, I didn't investigate in
that level but cc'ed hinic maintainers for info.
Also cc'ed Hemant for guidance.


But my question was more related to the HW, is there any relation between
the hinic HW and spnic HW? Like one is derived from other etc...

>>> The following is main features of our SPNIC:
>>> - TSO
>>> - LRO
>>> - Flow control
>>> - SR-IOV(Partially supported)
>>> - VLAN offload
>>> - VLAN filter
>>> - CRC offload
>>> - Promiscuous mode
>>> - RSS
>>>
>>> v6->v5, No real changes:
>>> 1. Move the fix of RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS from patch 26
>>> to patch 2; 2. Change the description of patch 26.
>>>
>>> v5->v4:
>>> 1. Add prefix "spinc_" for external functions;
>>> 2. Remove temporary MACRO: RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS
>>> 3. Do not use void* for keeping the type information
>>>
>>> v3->v4:
>>> 1. Fix ABI test failure;
>>> 2. Remove some descriptions in spnic.rst.
>>>
>>> v2->v3:
>>> 1. Fix clang compiling failure.
>>>
>>> v1->v2:
>>> 1. Fix coding style issues and compiling failures;
>>> 2. Only support linux in meson.build;
>>> 3. Use CLOCK_MONOTONIC_COARSE instead of
>>> CLOCK_MONOTONIC/CLOCK_MONOTONIC_RAW; 4. Fix time_before();
>>> 5. Remove redundant checks in spnic_dev_configure();
>>>
>>> Yanling Song (26):
>>>     drivers/net: introduce a new PMD driver
>>>     net/spnic: initialize the HW interface
>>>     net/spnic: add mbox message channel
>>>     net/spnic: introduce event queue
>>>     net/spnic: add mgmt module
>>>     net/spnic: add cmdq and work queue
>>>     net/spnic: add interface handling cmdq message
>>>     net/spnic: add hardware info initialization
>>>     net/spnic: support MAC and link event handling
>>>     net/spnic: add function info initialization
>>>     net/spnic: add queue pairs context initialization
>>>     net/spnic: support mbuf handling of Tx/Rx
>>>     net/spnic: support Rx congfiguration
>>>     net/spnic: add port/vport enable
>>>     net/spnic: support IO packets handling
>>>     net/spnic: add device configure/version/info
>>>     net/spnic: support RSS configuration update and get
>>>     net/spnic: support VLAN filtering and offloading
>>>     net/spnic: support promiscuous and allmulticast Rx modes
>>>     net/spnic: support flow control
>>>     net/spnic: support getting Tx/Rx queues info
>>>     net/spnic: net/spnic: support xstats statistics
>>>     net/spnic: support VFIO interrupt
>>>     net/spnic: support Tx/Rx queue start/stop
>>>     net/spnic: add doc infrastructure
>>>     net/spnic: fixes unsafe C style code
>>
>> <...>
> 


^ permalink raw reply	[relevance 0%]

* RE: [EXT] [PATCH v2 4/8] crypto/dpaa2_sec: support AES-GMAC
  @ 2022-01-21 11:29  3%     ` Akhil Goyal
  2022-02-08 14:15  0%       ` Gagandeep Singh
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2022-01-21 11:29 UTC (permalink / raw)
  To: Gagandeep Singh, dev; +Cc: Akhil Goyal

> From: Akhil Goyal <akhil.goyal@nxp.com>
> 
> This patch supports AES_GMAC algorithm for DPAA2
> driver.
> 
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---
>  doc/guides/cryptodevs/features/dpaa2_sec.ini |  1 +
>  drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c  | 14 ++++++++-
>  drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h    | 30 ++++++++++++++++++++
>  lib/cryptodev/rte_crypto_sym.h               |  4 ++-
>  4 files changed, 47 insertions(+), 2 deletions(-)

This patch should be split in two - cryptodev change should be separate patch.

> diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
> index daa090b978..4644fa3e25 100644
> --- a/lib/cryptodev/rte_crypto_sym.h
> +++ b/lib/cryptodev/rte_crypto_sym.h
> @@ -467,8 +467,10 @@ enum rte_crypto_aead_algorithm {
>  	/**< AES algorithm in CCM mode. */
>  	RTE_CRYPTO_AEAD_AES_GCM,
>  	/**< AES algorithm in GCM mode. */
> -	RTE_CRYPTO_AEAD_CHACHA20_POLY1305
> +	RTE_CRYPTO_AEAD_CHACHA20_POLY1305,
>  	/**< Chacha20 cipher with poly1305 authenticator */
> +	RTE_CRYPTO_AEAD_AES_GMAC
> +	/**< AES algorithm in GMAC mode. */
>  };
AES-GMAC is also defined as AUTH algo. It may be removed but that would be
ABI break.
Is it not possible to use AES-GMAC as auth algo?

^ permalink raw reply	[relevance 3%]

* [PATCH v2] eventdev/rx_adapter: add event port get api
@ 2022-01-22 17:02  4% Naga Harish K S V
  0 siblings, 0 replies; 200+ results
From: Naga Harish K S V @ 2022-01-22 17:02 UTC (permalink / raw)
  To: jerinjacobk, jay.jayatheerthan; +Cc: dev

This patch introduces new api for retrieving event port id
of eth rx adapter.

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
---
 doc/guides/rel_notes/release_22_03.rst  |  2 ++
 lib/eventdev/rte_event_eth_rx_adapter.c | 20 ++++++++++++++++++++
 lib/eventdev/rte_event_eth_rx_adapter.h | 20 ++++++++++++++++++++
 lib/eventdev/version.map                |  3 +++
 4 files changed, 45 insertions(+)

diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 6d99d1eaa9..288d94c0e6 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -83,6 +83,8 @@ API Changes
    This section is a comment. Do not overwrite or remove it.
    Also, make sure to start the actual text at the margin.
    =======================================================
+* eventdev: Added new API ``rte_event_eth_rx_adapter_event_port_get``,
+  to retrieve event port id of eth rx adapter.
 
 
 ABI Changes
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index f946137b25..ae1e260c08 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -3123,6 +3123,26 @@ rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id)
 	return rx_adapter->service_inited ? 0 : -ESRCH;
 }
 
+int
+rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id)
+{
+	struct event_eth_rx_adapter *rx_adapter;
+
+	if (rxa_memzone_lookup())
+		return -ENOMEM;
+
+	RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	rx_adapter = rxa_id_to_adapter(id);
+	if (rx_adapter == NULL || event_port_id == NULL)
+		return -EINVAL;
+
+	if (rx_adapter->service_inited)
+		*event_port_id = rx_adapter->event_port_id;
+
+	return rx_adapter->service_inited ? 0 : -ESRCH;
+}
+
 int
 rte_event_eth_rx_adapter_cb_register(uint8_t id,
 					uint16_t eth_dev_id,
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h
index 9546d792e9..3608a7b2cf 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.h
+++ b/lib/eventdev/rte_event_eth_rx_adapter.h
@@ -37,6 +37,7 @@
  *  - rte_event_eth_rx_adapter_queue_conf_get()
  *  - rte_event_eth_rx_adapter_queue_stats_get()
  *  - rte_event_eth_rx_adapter_queue_stats_reset()
+ *  - rte_event_eth_rx_adapter_event_port_get()
  *
  * The application creates an ethernet to event adapter using
  * rte_event_eth_rx_adapter_create_ext() or rte_event_eth_rx_adapter_create()
@@ -684,6 +685,25 @@ rte_event_eth_rx_adapter_queue_stats_reset(uint8_t id,
 		uint16_t eth_dev_id,
 		uint16_t rx_queue_id);
 
+/**
+ * Retrieve the event port ID of an adapter. If the adapter doesn't use
+ * a rte_service function, this function returns -ESRCH.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param [out] event_port_id
+ *  A pointer to a uint8_t, to be filled in with the port id.
+ *
+ * @return
+ *  - 0: Success
+ *  - <0: Error code on failure, if the adapter doesn't use a rte_service
+ * function, this function returns -ESRCH.
+ */
+__rte_experimental
+int
+rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map
index ade1f1182e..cd5dada07f 100644
--- a/lib/eventdev/version.map
+++ b/lib/eventdev/version.map
@@ -105,6 +105,9 @@ EXPERIMENTAL {
 	rte_event_eth_rx_adapter_queue_conf_get;
 	rte_event_eth_rx_adapter_queue_stats_get;
 	rte_event_eth_rx_adapter_queue_stats_reset;
+
+	# added in 22.03
+	rte_event_eth_rx_adapter_event_port_get;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* [PATCH v2] eventdev/rx_adapter: add event port get api
  @ 2022-01-22 17:07  4% ` Naga Harish K S V
  2022-01-22 17:14  4%   ` [PATCH v3] eventdev/eth_rx: " Naga Harish K S V
  0 siblings, 1 reply; 200+ results
From: Naga Harish K S V @ 2022-01-22 17:07 UTC (permalink / raw)
  To: jerinjacobk, jay.jayatheerthan; +Cc: dev

This patch introduces new api for retrieving event port id
of eth rx adapter.

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
---
 doc/guides/rel_notes/release_22_03.rst  |  2 ++
 lib/eventdev/rte_event_eth_rx_adapter.c | 20 ++++++++++++++++++++
 lib/eventdev/rte_event_eth_rx_adapter.h | 20 ++++++++++++++++++++
 lib/eventdev/version.map                |  3 +++
 4 files changed, 45 insertions(+)

diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 6d99d1eaa9..288d94c0e6 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -83,6 +83,8 @@ API Changes
    This section is a comment. Do not overwrite or remove it.
    Also, make sure to start the actual text at the margin.
    =======================================================
+* eventdev: Added new API ``rte_event_eth_rx_adapter_event_port_get``,
+  to retrieve event port id of eth rx adapter.
 
 
 ABI Changes
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index f946137b25..ae1e260c08 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -3123,6 +3123,26 @@ rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id)
 	return rx_adapter->service_inited ? 0 : -ESRCH;
 }
 
+int
+rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id)
+{
+	struct event_eth_rx_adapter *rx_adapter;
+
+	if (rxa_memzone_lookup())
+		return -ENOMEM;
+
+	RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	rx_adapter = rxa_id_to_adapter(id);
+	if (rx_adapter == NULL || event_port_id == NULL)
+		return -EINVAL;
+
+	if (rx_adapter->service_inited)
+		*event_port_id = rx_adapter->event_port_id;
+
+	return rx_adapter->service_inited ? 0 : -ESRCH;
+}
+
 int
 rte_event_eth_rx_adapter_cb_register(uint8_t id,
 					uint16_t eth_dev_id,
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h
index 9546d792e9..3608a7b2cf 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.h
+++ b/lib/eventdev/rte_event_eth_rx_adapter.h
@@ -37,6 +37,7 @@
  *  - rte_event_eth_rx_adapter_queue_conf_get()
  *  - rte_event_eth_rx_adapter_queue_stats_get()
  *  - rte_event_eth_rx_adapter_queue_stats_reset()
+ *  - rte_event_eth_rx_adapter_event_port_get()
  *
  * The application creates an ethernet to event adapter using
  * rte_event_eth_rx_adapter_create_ext() or rte_event_eth_rx_adapter_create()
@@ -684,6 +685,25 @@ rte_event_eth_rx_adapter_queue_stats_reset(uint8_t id,
 		uint16_t eth_dev_id,
 		uint16_t rx_queue_id);
 
+/**
+ * Retrieve the event port ID of an adapter. If the adapter doesn't use
+ * a rte_service function, this function returns -ESRCH.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param [out] event_port_id
+ *  A pointer to a uint8_t, to be filled in with the port id.
+ *
+ * @return
+ *  - 0: Success
+ *  - <0: Error code on failure, if the adapter doesn't use a rte_service
+ * function, this function returns -ESRCH.
+ */
+__rte_experimental
+int
+rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map
index ade1f1182e..cd5dada07f 100644
--- a/lib/eventdev/version.map
+++ b/lib/eventdev/version.map
@@ -105,6 +105,9 @@ EXPERIMENTAL {
 	rte_event_eth_rx_adapter_queue_conf_get;
 	rte_event_eth_rx_adapter_queue_stats_get;
 	rte_event_eth_rx_adapter_queue_stats_reset;
+
+	# added in 22.03
+	rte_event_eth_rx_adapter_event_port_get;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* [PATCH v3] eventdev/eth_rx: add event port get api
  2022-01-22 17:07  4% ` [PATCH v2] " Naga Harish K S V
@ 2022-01-22 17:14  4%   ` Naga Harish K S V
  2022-01-23 15:32  0%     ` Jerin Jacob
  0 siblings, 1 reply; 200+ results
From: Naga Harish K S V @ 2022-01-22 17:14 UTC (permalink / raw)
  To: jerinjacobk, jay.jayatheerthan; +Cc: dev

This patch introduces new api for retrieving event port id
of eth rx adapter.

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>

---
v3:
* update commit message head line

v2:
* address review comments

v1:
* initial implementation
---
 doc/guides/rel_notes/release_22_03.rst  |  2 ++
 lib/eventdev/rte_event_eth_rx_adapter.c | 20 ++++++++++++++++++++
 lib/eventdev/rte_event_eth_rx_adapter.h | 20 ++++++++++++++++++++
 lib/eventdev/version.map                |  3 +++
 4 files changed, 45 insertions(+)

diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 6d99d1eaa9..288d94c0e6 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -83,6 +83,8 @@ API Changes
    This section is a comment. Do not overwrite or remove it.
    Also, make sure to start the actual text at the margin.
    =======================================================
+* eventdev: Added new API ``rte_event_eth_rx_adapter_event_port_get``,
+  to retrieve event port id of eth rx adapter.
 
 
 ABI Changes
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index f946137b25..ae1e260c08 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -3123,6 +3123,26 @@ rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id)
 	return rx_adapter->service_inited ? 0 : -ESRCH;
 }
 
+int
+rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id)
+{
+	struct event_eth_rx_adapter *rx_adapter;
+
+	if (rxa_memzone_lookup())
+		return -ENOMEM;
+
+	RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	rx_adapter = rxa_id_to_adapter(id);
+	if (rx_adapter == NULL || event_port_id == NULL)
+		return -EINVAL;
+
+	if (rx_adapter->service_inited)
+		*event_port_id = rx_adapter->event_port_id;
+
+	return rx_adapter->service_inited ? 0 : -ESRCH;
+}
+
 int
 rte_event_eth_rx_adapter_cb_register(uint8_t id,
 					uint16_t eth_dev_id,
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h
index 9546d792e9..3608a7b2cf 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.h
+++ b/lib/eventdev/rte_event_eth_rx_adapter.h
@@ -37,6 +37,7 @@
  *  - rte_event_eth_rx_adapter_queue_conf_get()
  *  - rte_event_eth_rx_adapter_queue_stats_get()
  *  - rte_event_eth_rx_adapter_queue_stats_reset()
+ *  - rte_event_eth_rx_adapter_event_port_get()
  *
  * The application creates an ethernet to event adapter using
  * rte_event_eth_rx_adapter_create_ext() or rte_event_eth_rx_adapter_create()
@@ -684,6 +685,25 @@ rte_event_eth_rx_adapter_queue_stats_reset(uint8_t id,
 		uint16_t eth_dev_id,
 		uint16_t rx_queue_id);
 
+/**
+ * Retrieve the event port ID of an adapter. If the adapter doesn't use
+ * a rte_service function, this function returns -ESRCH.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param [out] event_port_id
+ *  A pointer to a uint8_t, to be filled in with the port id.
+ *
+ * @return
+ *  - 0: Success
+ *  - <0: Error code on failure, if the adapter doesn't use a rte_service
+ * function, this function returns -ESRCH.
+ */
+__rte_experimental
+int
+rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map
index ade1f1182e..cd5dada07f 100644
--- a/lib/eventdev/version.map
+++ b/lib/eventdev/version.map
@@ -105,6 +105,9 @@ EXPERIMENTAL {
 	rte_event_eth_rx_adapter_queue_conf_get;
 	rte_event_eth_rx_adapter_queue_stats_get;
 	rte_event_eth_rx_adapter_queue_stats_reset;
+
+	# added in 22.03
+	rte_event_eth_rx_adapter_event_port_get;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* Re: [PATCH v3] eventdev/eth_rx: add event port get api
  2022-01-22 17:14  4%   ` [PATCH v3] eventdev/eth_rx: " Naga Harish K S V
@ 2022-01-23 15:32  0%     ` Jerin Jacob
  0 siblings, 0 replies; 200+ results
From: Jerin Jacob @ 2022-01-23 15:32 UTC (permalink / raw)
  To: Naga Harish K S V; +Cc: Jayatheerthan, Jay, dpdk-dev

On Sat, Jan 22, 2022 at 10:44 PM Naga Harish K S V
<s.v.naga.harish.k@intel.com> wrote:
>
> This patch introduces new api for retrieving event port id
> of eth rx adapter.
>
> Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
> Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
>
> ---
> v3:
> * update commit message head line


Applied to dpdk-next-net-eventdev/for-main with the following changes. Thanks

1) api -> API in git commit message
2) Added following in "New Features" section in
doc/guides/rel_notes/release_22_03.rst

* **Added an API to retrieve event port id of eth rx adapter.**

  A new API, ``rte_event_eth_rx_adapter_event_port_get()``, was added.

>
> v2:
> * address review comments
>
> v1:
> * initial implementation
> ---
>  doc/guides/rel_notes/release_22_03.rst  |  2 ++
>  lib/eventdev/rte_event_eth_rx_adapter.c | 20 ++++++++++++++++++++
>  lib/eventdev/rte_event_eth_rx_adapter.h | 20 ++++++++++++++++++++
>  lib/eventdev/version.map                |  3 +++
>  4 files changed, 45 insertions(+)
>
> diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
> index 6d99d1eaa9..288d94c0e6 100644
> --- a/doc/guides/rel_notes/release_22_03.rst
> +++ b/doc/guides/rel_notes/release_22_03.rst
> @@ -83,6 +83,8 @@ API Changes
>     This section is a comment. Do not overwrite or remove it.
>     Also, make sure to start the actual text at the margin.
>     =======================================================
> +* eventdev: Added new API ``rte_event_eth_rx_adapter_event_port_get``,
> +  to retrieve event port id of eth rx adapter.
>
>
>  ABI Changes
> diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
> index f946137b25..ae1e260c08 100644
> --- a/lib/eventdev/rte_event_eth_rx_adapter.c
> +++ b/lib/eventdev/rte_event_eth_rx_adapter.c
> @@ -3123,6 +3123,26 @@ rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id)
>         return rx_adapter->service_inited ? 0 : -ESRCH;
>  }
>
> +int
> +rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id)
> +{
> +       struct event_eth_rx_adapter *rx_adapter;
> +
> +       if (rxa_memzone_lookup())
> +               return -ENOMEM;
> +
> +       RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
> +
> +       rx_adapter = rxa_id_to_adapter(id);
> +       if (rx_adapter == NULL || event_port_id == NULL)
> +               return -EINVAL;
> +
> +       if (rx_adapter->service_inited)
> +               *event_port_id = rx_adapter->event_port_id;
> +
> +       return rx_adapter->service_inited ? 0 : -ESRCH;
> +}
> +
>  int
>  rte_event_eth_rx_adapter_cb_register(uint8_t id,
>                                         uint16_t eth_dev_id,
> diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h
> index 9546d792e9..3608a7b2cf 100644
> --- a/lib/eventdev/rte_event_eth_rx_adapter.h
> +++ b/lib/eventdev/rte_event_eth_rx_adapter.h
> @@ -37,6 +37,7 @@
>   *  - rte_event_eth_rx_adapter_queue_conf_get()
>   *  - rte_event_eth_rx_adapter_queue_stats_get()
>   *  - rte_event_eth_rx_adapter_queue_stats_reset()
> + *  - rte_event_eth_rx_adapter_event_port_get()
>   *
>   * The application creates an ethernet to event adapter using
>   * rte_event_eth_rx_adapter_create_ext() or rte_event_eth_rx_adapter_create()
> @@ -684,6 +685,25 @@ rte_event_eth_rx_adapter_queue_stats_reset(uint8_t id,
>                 uint16_t eth_dev_id,
>                 uint16_t rx_queue_id);
>
> +/**
> + * Retrieve the event port ID of an adapter. If the adapter doesn't use
> + * a rte_service function, this function returns -ESRCH.
> + *
> + * @param id
> + *  Adapter identifier.
> + *
> + * @param [out] event_port_id
> + *  A pointer to a uint8_t, to be filled in with the port id.
> + *
> + * @return
> + *  - 0: Success
> + *  - <0: Error code on failure, if the adapter doesn't use a rte_service
> + * function, this function returns -ESRCH.
> + */
> +__rte_experimental
> +int
> +rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
> +
>  #ifdef __cplusplus
>  }
>  #endif
> diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map
> index ade1f1182e..cd5dada07f 100644
> --- a/lib/eventdev/version.map
> +++ b/lib/eventdev/version.map
> @@ -105,6 +105,9 @@ EXPERIMENTAL {
>         rte_event_eth_rx_adapter_queue_conf_get;
>         rte_event_eth_rx_adapter_queue_stats_get;
>         rte_event_eth_rx_adapter_queue_stats_reset;
> +
> +       # added in 22.03
> +       rte_event_eth_rx_adapter_event_port_get;
>  };
>
>  INTERNAL {
> --
> 2.25.1
>

^ permalink raw reply	[relevance 0%]

* [PATCH v3] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if.
    @ 2022-01-23 21:07  8%   ` Michael Barker
  2022-01-23 21:20  8%     ` [PATCH v4] " Michael Barker
  1 sibling, 1 reply; 200+ results
From: Michael Barker @ 2022-01-23 21:07 UTC (permalink / raw)
  To: dev; +Cc: Michael Barker, Ray Kinsella

When compiling with clang using -Wall (or -Wgcc-compat) the use of diagnose_if kicks up a warning:

.../include/rte_interrupts.h:623:1: error: 'diagnose_if' is a clang extension [-Werror,-Wgcc-compat]
__rte_internal
^
.../include/rte_compat.h:36:16: note: expanded from macro '__rte_internal'
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \

This change ignores the '-Wgcc-compat' warning in the specific location
where the warning occurs.  It is safe to do in this circumstance as the
specific macro is only defined when using the clang compiler.

Signed-off-by: Michael Barker <mikeb01@gmail.com>
---
 lib/eal/include/rte_compat.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/eal/include/rte_compat.h b/lib/eal/include/rte_compat.h
index 2718612cce..9556bbf4d0 100644
--- a/lib/eal/include/rte_compat.h
+++ b/lib/eal/include/rte_compat.h
@@ -33,8 +33,11 @@ section(".text.internal")))
 #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */
 
 #define __rte_internal \
+_Pragma("GCC diagnostic push") \
+_Pragma("GCC diagnostic ignored \"-Wgcc-compat\"") \
 __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
-section(".text.internal")))
+section(".text.internal"))) \
+_Pragma("GCC diagnostic pop")
 
 #else
 
-- 
2.25.1


^ permalink raw reply	[relevance 8%]

* Re: [PATCH v2] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if.
  @ 2022-01-23 21:17  0%     ` Michael Barker
  0 siblings, 0 replies; 200+ results
From: Michael Barker @ 2022-01-23 21:17 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Ray Kinsella

[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]

On Fri, 21 Jan 2022 at 03:16, Thomas Monjalon <thomas@monjalon.net> wrote:

> 18/01/2022 00:23, Michael Barker:
> > When using clang with -Wall the use of diagnose_if kicks up a warning,
>
> Please could you copy the warning in the commit log?
>

I've updated the commit log to be more descriptive (and included the
associated warning).

> requiring all dpdk includes to be wrapped with the pragma.  This change
> > isolates the ignore just the appropriate location and makes it easier
> > for users to apply -Wall,-Werror
>
> Please could you explain how it is related to -Wgcc-compat?
>

I'm currently working on some code that makes use of DPDK, which is built
with '-Wall,-Werror' enabled.  When using the clang toolchain the build
fails as a result of this macro that this patch updates.  The workaround
from my application is to wrap all of the DPDK header includes in pragma to
disable the warnings (see below).  This has the unfortunate side effect of
disabling this warning across all of the included DPDK headers, which is
not ideal.  Hence the reason to submit the patch which disables the warning
just in the location where it occurs.

#if defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wgcc-compat"
#endif
#include <rte_ethdev.h>
#if defined(__clang__)
#pragma GCC diagnostic pop "-Wgcc-compat"
#endif



>
> [...]
> >  #define __rte_internal \
> > +_Pragma("GCC diagnostic push") \
> > +_Pragma("GCC diagnostic ignored \"-Wgcc-compat\"") \
> >  __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
> > -section(".text.internal")))
> > +section(".text.internal"))) \
> > +_Pragma("GCC diagnostic pop")
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 3549 bytes --]

^ permalink raw reply	[relevance 0%]

* [PATCH v4] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if.
  2022-01-23 21:07  8%   ` [PATCH v3] " Michael Barker
@ 2022-01-23 21:20  8%     ` Michael Barker
  2022-01-25 10:33  0%       ` Ray Kinsella
  2022-01-31  0:05  8%       ` [PATCH v5] " Michael Barker
  0 siblings, 2 replies; 200+ results
From: Michael Barker @ 2022-01-23 21:20 UTC (permalink / raw)
  To: dev; +Cc: Michael Barker, Ray Kinsella

When compiling with clang using -Wall (or -Wgcc-compat) the use of
diagnose_if kicks up a warning:

.../include/rte_interrupts.h:623:1: error: 'diagnose_if' is a clang
extension [-Werror,-Wgcc-compat]
__rte_internal
^
.../include/rte_compat.h:36:16: note: expanded from macro '__rte_internal'
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \

This change ignores the '-Wgcc-compat' warning in the specific location
where the warning occurs.  It is safe to do in this circumstance as the
specific macro is only defined when using the clang compiler.

Signed-off-by: Michael Barker <mikeb01@gmail.com>
---
 lib/eal/include/rte_compat.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/eal/include/rte_compat.h b/lib/eal/include/rte_compat.h
index 2718612cce..9556bbf4d0 100644
--- a/lib/eal/include/rte_compat.h
+++ b/lib/eal/include/rte_compat.h
@@ -33,8 +33,11 @@ section(".text.internal")))
 #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */
 
 #define __rte_internal \
+_Pragma("GCC diagnostic push") \
+_Pragma("GCC diagnostic ignored \"-Wgcc-compat\"") \
 __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
-section(".text.internal")))
+section(".text.internal"))) \
+_Pragma("GCC diagnostic pop")
 
 #else
 
-- 
2.25.1


^ permalink raw reply	[relevance 8%]

* Re: [PATCH v6 00/26] Net/SPNIC: support SPNIC into DPDK 22.03
  2022-01-21 10:22  0%     ` Ferruh Yigit
@ 2022-01-24  5:12  0%       ` Hemant Agrawal
  2022-02-12 14:01  0%       ` Yanling Song
  1 sibling, 0 replies; 200+ results
From: Hemant Agrawal @ 2022-01-24  5:12 UTC (permalink / raw)
  To: Ferruh Yigit, Yanling Song
  Cc: dev, yanling.song, yanggan, xuyun, stephen, lihuisong,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Hemant Agrawal


On 1/21/2022 3:52 PM, Ferruh Yigit wrote:
> On 1/21/2022 9:27 AM, Yanling Song wrote:
>> On Wed, 19 Jan 2022 16:56:52 +0000
>> Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>>> On 12/30/2021 6:08 AM, Yanling Song wrote:
>>>> The patchsets introduce SPNIC driver for Ramaxel's SPNxx serial NIC
>>>> cards into DPDK 22.03. Ramaxel Memory Technology is a company which
>>>> supply a lot of electric products: storage, communication, PCB...
>>>> SPNxxx is a serial PCIE interface NIC cards:
>>>> SPN110: 2 PORTs *25G
>>>> SPN120: 4 PORTs *25G
>>>> SPN130: 2 PORTs *100G
>>>
>>> Hi Yanling,
>>>
>>> As far as I can see hnic (from Huawei) and this spnic drivers are
>>> alike, what is the relation between these two?
>>>
>> It is hard to create a brand new driver from scratch, so we referenced
>> to hinic driver when developing spnic.
>>
>
> That is OK, but based on the familiarity of the code you may consider
> keeping the original code Copyright, I didn't investigate in
> that level but cc'ed hinic maintainers for info.
> Also cc'ed Hemant for guidance.
>
>
Yes, if large part of code is driven from an existing driver, it is 
advisable to keep the original copyright. You can add your copyright as 
well, if you have changed the code.

Alternately, you provide reference in the file header, that this file id 
driver from xx file having license type Y.


> But my question was more related to the HW, is there any relation between
> the hinic HW and spnic HW? Like one is derived from other etc...
>
>>>> The following is main features of our SPNIC:
>>>> - TSO
>>>> - LRO
>>>> - Flow control
>>>> - SR-IOV(Partially supported)
>>>> - VLAN offload
>>>> - VLAN filter
>>>> - CRC offload
>>>> - Promiscuous mode
>>>> - RSS
>>>>
>>>> v6->v5, No real changes:
>>>> 1. Move the fix of RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS from patch 26
>>>> to patch 2; 2. Change the description of patch 26.
>>>>
>>>> v5->v4:
>>>> 1. Add prefix "spinc_" for external functions;
>>>> 2. Remove temporary MACRO: RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS
>>>> 3. Do not use void* for keeping the type information
>>>>
>>>> v3->v4:
>>>> 1. Fix ABI test failure;
>>>> 2. Remove some descriptions in spnic.rst.
>>>>
>>>> v2->v3:
>>>> 1. Fix clang compiling failure.
>>>>
>>>> v1->v2:
>>>> 1. Fix coding style issues and compiling failures;
>>>> 2. Only support linux in meson.build;
>>>> 3. Use CLOCK_MONOTONIC_COARSE instead of
>>>> CLOCK_MONOTONIC/CLOCK_MONOTONIC_RAW; 4. Fix time_before();
>>>> 5. Remove redundant checks in spnic_dev_configure();
>>>>
>>>> Yanling Song (26):
>>>>     drivers/net: introduce a new PMD driver
>>>>     net/spnic: initialize the HW interface
>>>>     net/spnic: add mbox message channel
>>>>     net/spnic: introduce event queue
>>>>     net/spnic: add mgmt module
>>>>     net/spnic: add cmdq and work queue
>>>>     net/spnic: add interface handling cmdq message
>>>>     net/spnic: add hardware info initialization
>>>>     net/spnic: support MAC and link event handling
>>>>     net/spnic: add function info initialization
>>>>     net/spnic: add queue pairs context initialization
>>>>     net/spnic: support mbuf handling of Tx/Rx
>>>>     net/spnic: support Rx congfiguration
>>>>     net/spnic: add port/vport enable
>>>>     net/spnic: support IO packets handling
>>>>     net/spnic: add device configure/version/info
>>>>     net/spnic: support RSS configuration update and get
>>>>     net/spnic: support VLAN filtering and offloading
>>>>     net/spnic: support promiscuous and allmulticast Rx modes
>>>>     net/spnic: support flow control
>>>>     net/spnic: support getting Tx/Rx queues info
>>>>     net/spnic: net/spnic: support xstats statistics
>>>>     net/spnic: support VFIO interrupt
>>>>     net/spnic: support Tx/Rx queue start/stop
>>>>     net/spnic: add doc infrastructure
>>>>     net/spnic: fixes unsafe C style code
>>>
>>> <...>
>>
>

^ permalink raw reply	[relevance 0%]

* [PATCH v6 1/2] net: add functions to calculate UDP/TCP cksum in mbuf
  @ 2022-01-24 12:28  3%   ` Xiaoyun Li
  0 siblings, 0 replies; 200+ results
From: Xiaoyun Li @ 2022-01-24 12:28 UTC (permalink / raw)
  To: ktraynor, Aman.Deep.Singh, ferruh.yigit, olivier.matz, mb,
	konstantin.ananyev, stephen, vladimir.medvedkin
  Cc: dev, Xiaoyun Li, Aman Singh, Sunil Pai G

Add functions to call rte_raw_cksum_mbuf() to calculate IPv4/6
UDP/TCP checksum in mbuf which can be over multi-segments.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Sunil Pai G <sunil.pai.g@intel.com>
---
 doc/guides/rel_notes/release_22_03.rst |  11 ++
 lib/net/rte_ip.h                       | 186 +++++++++++++++++++++++++
 2 files changed, 197 insertions(+)

diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 6d99d1eaa9..785fd22001 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -55,6 +55,14 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Added functions to calculate UDP/TCP checksum in mbuf.**
+
+  * Added the following functions to calculate UDP/TCP checksum of packets
+    which can be over multi-segments:
+    - ``rte_ipv4_udptcp_cksum_mbuf()``
+    - ``rte_ipv4_udptcp_cksum_mbuf_verify()``
+    - ``rte_ipv6_udptcp_cksum_mbuf()``
+    - ``rte_ipv6_udptcp_cksum_mbuf_verify()``
 
 Removed Items
 -------------
@@ -84,6 +92,9 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* net: added experimental functions ``rte_ipv4_udptcp_cksum_mbuf()``,
+  ``rte_ipv4_udptcp_cksum_mbuf_verify()``, ``rte_ipv6_udptcp_cksum_mbuf()``,
+  ``rte_ipv6_udptcp_cksum_mbuf_verify()``
 
 ABI Changes
 -----------
diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h
index c575250852..534f401d26 100644
--- a/lib/net/rte_ip.h
+++ b/lib/net/rte_ip.h
@@ -400,6 +400,65 @@ rte_ipv4_udptcp_cksum(const struct rte_ipv4_hdr *ipv4_hdr, const void *l4_hdr)
 	return cksum;
 }
 
+/**
+ * @internal Calculate the non-complemented IPv4 L4 checksum of a packet
+ */
+static inline uint16_t
+__rte_ipv4_udptcp_cksum_mbuf(const struct rte_mbuf *m,
+			     const struct rte_ipv4_hdr *ipv4_hdr,
+			     uint16_t l4_off)
+{
+	uint16_t raw_cksum;
+	uint32_t cksum;
+
+	if (l4_off > m->pkt_len)
+		return 0;
+
+	if (rte_raw_cksum_mbuf(m, l4_off, m->pkt_len - l4_off, &raw_cksum))
+		return 0;
+
+	cksum = raw_cksum + rte_ipv4_phdr_cksum(ipv4_hdr, 0);
+
+	cksum = ((cksum & 0xffff0000) >> 16) + (cksum & 0xffff);
+
+	return (uint16_t)cksum;
+}
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Compute the IPv4 UDP/TCP checksum of a packet.
+ *
+ * @param m
+ *   The pointer to the mbuf.
+ * @param ipv4_hdr
+ *   The pointer to the contiguous IPv4 header.
+ * @param l4_off
+ *   The offset in bytes to start L4 checksum.
+ * @return
+ *   The complemented checksum to set in the L4 header.
+ */
+__rte_experimental
+static inline uint16_t
+rte_ipv4_udptcp_cksum_mbuf(const struct rte_mbuf *m,
+			   const struct rte_ipv4_hdr *ipv4_hdr, uint16_t l4_off)
+{
+	uint16_t cksum = __rte_ipv4_udptcp_cksum_mbuf(m, ipv4_hdr, l4_off);
+
+	cksum = ~cksum;
+
+	/*
+	 * Per RFC 768: If the computed checksum is zero for UDP,
+	 * it is transmitted as all ones
+	 * (the equivalent in one's complement arithmetic).
+	 */
+	if (cksum == 0 && ipv4_hdr->next_proto_id == IPPROTO_UDP)
+		cksum = 0xffff;
+
+	return cksum;
+}
+
 /**
  * Validate the IPv4 UDP or TCP checksum.
  *
@@ -426,6 +485,38 @@ rte_ipv4_udptcp_cksum_verify(const struct rte_ipv4_hdr *ipv4_hdr,
 	return 0;
 }
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Verify the IPv4 UDP/TCP checksum of a packet.
+ *
+ * In case of UDP, the caller must first check if udp_hdr->dgram_cksum is 0
+ * (i.e. no checksum).
+ *
+ * @param m
+ *   The pointer to the mbuf.
+ * @param ipv4_hdr
+ *   The pointer to the contiguous IPv4 header.
+ * @param l4_off
+ *   The offset in bytes to start L4 checksum.
+ * @return
+ *   Return 0 if the checksum is correct, else -1.
+ */
+__rte_experimental
+static inline uint16_t
+rte_ipv4_udptcp_cksum_mbuf_verify(const struct rte_mbuf *m,
+				  const struct rte_ipv4_hdr *ipv4_hdr,
+				  uint16_t l4_off)
+{
+	uint16_t cksum = __rte_ipv4_udptcp_cksum_mbuf(m, ipv4_hdr, l4_off);
+
+	if (cksum != 0xffff)
+		return -1;
+
+	return 0;
+}
+
 /**
  * IPv6 Header
  */
@@ -538,6 +629,68 @@ rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr)
 	return cksum;
 }
 
+/**
+ * @internal Calculate the non-complemented IPv6 L4 checksum of a packet
+ */
+static inline uint16_t
+__rte_ipv6_udptcp_cksum_mbuf(const struct rte_mbuf *m,
+			     const struct rte_ipv6_hdr *ipv6_hdr,
+			     uint16_t l4_off)
+{
+	uint16_t raw_cksum;
+	uint32_t cksum;
+
+	if (l4_off > m->pkt_len)
+		return 0;
+
+	if (rte_raw_cksum_mbuf(m, l4_off, m->pkt_len - l4_off, &raw_cksum))
+		return 0;
+
+	cksum = raw_cksum + rte_ipv6_phdr_cksum(ipv6_hdr, 0);
+
+	cksum = ((cksum & 0xffff0000) >> 16) + (cksum & 0xffff);
+
+	return (uint16_t)cksum;
+}
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Process the IPv6 UDP or TCP checksum of a packet.
+ *
+ * The IPv6 header must not be followed by extension headers. The layer 4
+ * checksum must be set to 0 in the L4 header by the caller.
+ *
+ * @param m
+ *   The pointer to the mbuf.
+ * @param ipv6_hdr
+ *   The pointer to the contiguous IPv6 header.
+ * @param l4_off
+ *   The offset in bytes to start L4 checksum.
+ * @return
+ *   The complemented checksum to set in the L4 header.
+ */
+__rte_experimental
+static inline uint16_t
+rte_ipv6_udptcp_cksum_mbuf(const struct rte_mbuf *m,
+			   const struct rte_ipv6_hdr *ipv6_hdr, uint16_t l4_off)
+{
+	uint16_t cksum = __rte_ipv6_udptcp_cksum_mbuf(m, ipv6_hdr, l4_off);
+
+	cksum = ~cksum;
+
+	/*
+	 * Per RFC 768: If the computed checksum is zero for UDP,
+	 * it is transmitted as all ones
+	 * (the equivalent in one's complement arithmetic).
+	 */
+	if (cksum == 0 && ipv6_hdr->proto == IPPROTO_UDP)
+		cksum = 0xffff;
+
+	return cksum;
+}
+
 /**
  * Validate the IPv6 UDP or TCP checksum.
  *
@@ -565,6 +718,39 @@ rte_ipv6_udptcp_cksum_verify(const struct rte_ipv6_hdr *ipv6_hdr,
 	return 0;
 }
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Validate the IPv6 UDP or TCP checksum of a packet.
+ *
+ * In case of UDP, the caller must first check if udp_hdr->dgram_cksum is 0:
+ * this is either invalid or means no checksum in some situations. See 8.1
+ * (Upper-Layer Checksums) in RFC 8200.
+ *
+ * @param m
+ *   The pointer to the mbuf.
+ * @param ipv6_hdr
+ *   The pointer to the contiguous IPv6 header.
+ * @param l4_off
+ *   The offset in bytes to start L4 checksum.
+ * @return
+ *   Return 0 if the checksum is correct, else -1.
+ */
+__rte_experimental
+static inline int
+rte_ipv6_udptcp_cksum_mbuf_verify(const struct rte_mbuf *m,
+				  const struct rte_ipv6_hdr *ipv6_hdr,
+				  uint16_t l4_off)
+{
+	uint16_t cksum = __rte_ipv6_udptcp_cksum_mbuf(m, ipv6_hdr, l4_off);
+
+	if (cksum != 0xffff)
+		return -1;
+
+	return 0;
+}
+
 /** IPv6 fragment extension header. */
 #define	RTE_IPV6_EHDR_MF_SHIFT	0
 #define	RTE_IPV6_EHDR_MF_MASK	1
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 1/1] mempool: implement index-based per core cache
  @ 2022-01-24 13:05  0%           ` Ray Kinsella
  0 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2022-01-24 13:05 UTC (permalink / raw)
  To: Morten Brørup
  Cc: Honnappa Nagarahalli, Dharmik Thakkar, Olivier Matz,
	Andrew Rybchenko, dev, Ruifeng Wang, Beilei Xing, nd


Morten Brørup <mb@smartsharesystems.com> writes:

> +Ray Kinsella, ABI Policy maintainer
>
>> From: Honnappa Nagarahalli [mailto:Honnappa.Nagarahalli@arm.com]
>> Sent: Friday, 21 January 2022 07.01
>> 
>> >
>> > +CC Beilei as i40e maintainer
>> >
>> > > From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
>> > > Sent: Thursday, 13 January 2022 06.37
>> > >
>> > > Current mempool per core cache implementation stores pointers to
>> mbufs
>> > > On 64b architectures, each pointer consumes 8B This patch replaces
>> it
>> > > with index-based implementation, where in each buffer is addressed
>> by
>> > > (pool base address + index) It reduces the amount of memory/cache
>> > > required for per core cache
>> > >
>> > > L3Fwd performance testing reveals minor improvements in the cache
>> > > performance (L1 and L2 misses reduced by 0.60%) with no change in
>> > > throughput
>> > >
>> > > Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
>> > > Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
>> > > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
>> > > ---
>> > >  lib/mempool/rte_mempool.h             | 150
>> +++++++++++++++++++++++++-
>> > >  lib/mempool/rte_mempool_ops_default.c |   7 ++
>> > >  2 files changed, 156 insertions(+), 1 deletion(-)
>> > >
>> > > diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
>> > > index 1e7a3c15273c..f2403fbc97a7 100644
>> > > --- a/lib/mempool/rte_mempool.h
>> > > +++ b/lib/mempool/rte_mempool.h
>> > > @@ -50,6 +50,10 @@
>> > >  #include <rte_memcpy.h>
>> > >  #include <rte_common.h>
>> > >
>> > > +#ifdef RTE_MEMPOOL_INDEX_BASED_LCORE_CACHE
>> > > +#include <rte_vect.h>
>> > > +#endif
>> > > +
>> > >  #include "rte_mempool_trace_fp.h"
>> > >
>> > >  #ifdef __cplusplus
>> > > @@ -239,6 +243,9 @@ struct rte_mempool {
>> > >  	int32_t ops_index;
>> > >
>> > >  	struct rte_mempool_cache *local_cache; /**< Per-lcore local cache
>> */
>> > > +#ifdef RTE_MEMPOOL_INDEX_BASED_LCORE_CACHE
>> > > +	void *pool_base_value; /**< Base value to calculate indices */
>> > > +#endif
>> > >
>> > >  	uint32_t populated_size;         /**< Number of populated
>> > > objects. */
>> > >  	struct rte_mempool_objhdr_list elt_list; /**< List of objects in
>> > > pool */ @@ -1314,7 +1321,22 @@ rte_mempool_cache_flush(struct
>> > > rte_mempool_cache *cache,
>> > >  	if (cache == NULL || cache->len == 0)
>> > >  		return;
>> > >  	rte_mempool_trace_cache_flush(cache, mp);
>> > > +
>> > > +#ifdef RTE_MEMPOOL_INDEX_BASED_LCORE_CACHE
>> > > +	unsigned int i;
>> > > +	unsigned int cache_len = cache->len;
>> > > +	void *obj_table[RTE_MEMPOOL_CACHE_MAX_SIZE * 3];
>> > > +	void *base_value = mp->pool_base_value;
>> > > +	uint32_t *cache_objs = (uint32_t *) cache->objs;
>> >
>> > Hi Dharmik and Honnappa,
>> >
>> > The essence of this patch is based on recasting the type of the objs
>> field in the
>> > rte_mempool_cache structure from an array of pointers to an array of
>> > uint32_t.
>> >
>> > However, this effectively breaks the ABI, because the
>> rte_mempool_cache
>> > structure is public and part of the API.
>> The patch does not change the public structure, the new member is under
>> compile time flag, not sure how it breaks the ABI.
>> 
>> >
>> > Some drivers [1] even bypass the mempool API and access the
>> > rte_mempool_cache structure directly, assuming that the objs array in
>> the
>> > cache is an array of pointers. So you cannot recast the fields in the
>> > rte_mempool_cache structure the way this patch requires.
>> IMO, those drivers are at fault. The mempool cache structure is public
>> only because the APIs are inline. We should still maintain modularity
>> and not use the members of structures belonging to another library
>> directly. A similar effort involving rte_ring was not accepted sometime
>> back [1]
>> 
>> [1]
>> http://inbox.dpdk.org/dev/DBAPR08MB5814907968595EE56F5E20A798390@DBAPR0
>> 8MB5814.eurprd08.prod.outlook.com/
>> 
>> >
>> > Although I do consider bypassing an API's accessor functions
>> "spaghetti
>> > code", this driver's behavior is formally acceptable as long as the
>> > rte_mempool_cache structure is not marked as internal.
>> >
>> > I really liked your idea of using indexes instead of pointers, so I'm
>> very sorry to
>> > shoot it down. :-(
>> >
>> > [1]: E.g. the Intel i40e PMD,
>> >
>> http://code.dpdk.org/dpdk/latest/source/drivers/net/i40e/i40e_rxtx_vec_
>> avx
>> > 512.c#L25
>> It is possible to throw an error when this feature is enabled in this
>> file. Alternatively, this PMD could implement the code for index based
>> mempool.
>> 
>
> I agree with both your points, Honnappa.
>
> The ABI remains intact, and only changes when this feature is enabled at compile time.
>
> In addition to your suggestions, I propose that the patch modifies the objs type in the mempool cache structure itself, instead of type casting it through an access variable. This should throw an error when compiling an application that accesses it as a pointer array instead of a uint32_t array - like the affected Intel PMDs.
>
> The updated objs field in the mempool cache structure should have the same size when compiled as the original objs field, so this feature doesn't change anything else in the ABI, only the type of the mempool cache objects.
>
> Also, the description of the feature should stress that applications accessing the cache objects directly will fail miserably.

Thanks for CC'ing me Morten.

My 2c is that, I would be slow in supporting this patch as it introduces
code paths that are harder (impossible?) to test regularly. So yes, it
is optional, in that case are we just adding automatically dead code -
I would ask, if a runtime option not make more sense for this?

Also we can't automatically assume what the PMD's are doing are breaking
an unwritten rule (breaking abstractions) - I would guess these are
doing it for solid performance reasons. If so that would futher support
my point about making the mempool runtime configurable and query-able
(is this mempool a bucket of indexes or pointers etc), and enabling the
PMDs to ask rather than assume.

Like Morten, I like the idea, saving memory and reducing cache misses
with indexes, this is all good IMHO.

-- 
Regards, Ray K

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  @ 2022-01-24 14:36  3%     ` Jerin Jacob
  2022-01-24 17:35  0%       ` Thomas Monjalon
  2022-01-24 17:40  0%       ` Ajit Khaparde
  0 siblings, 2 replies; 200+ results
From: Jerin Jacob @ 2022-01-24 14:36 UTC (permalink / raw)
  To: Alexander Kozyrev
  Cc: dpdk-dev, Ori Kam, Thomas Monjalon, Ivan Malov, Andrew Rybchenko,
	Ferruh Yigit, mohammad.abdul.awal, Qi Zhang, Jerin Jacob,
	Ajit Khaparde

On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev <akozyrev@nvidia.com> wrote:
>
> The flow rules creation/destruction at a large scale incurs a performance
> penalty and may negatively impact the packet processing when used
> as part of the datapath logic. This is mainly because software/hardware
> resources are allocated and prepared during the flow rule creation.
>
> In order to optimize the insertion rate, PMD may use some hints provided
> by the application at the initialization phase. The rte_flow_configure()
> function allows to pre-allocate all the needed resources beforehand.
> These resources can be used at a later stage without costly allocations.
> Every PMD may use only the subset of hints and ignore unused ones or
> fail in case the requested configuration is not supported.
>
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> ---

>
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Flow engine port configuration attributes.
> + */
> +__extension__

Is this __extension__ required ?


> +struct rte_flow_port_attr {
> +       /**
> +        * Version of the struct layout, should be 0.
> +        */
> +       uint32_t version;

Why version number? Across DPDK, we are using dynamic function
versioning, I think, that would
 be sufficient for ABI versioning

> +       /**
> +        * Number of counter actions pre-configured.
> +        * If set to 0, PMD will allocate counters dynamically.
> +        * @see RTE_FLOW_ACTION_TYPE_COUNT
> +        */
> +       uint32_t nb_counters;
> +       /**
> +        * Number of aging actions pre-configured.
> +        * If set to 0, PMD will allocate aging dynamically.
> +        * @see RTE_FLOW_ACTION_TYPE_AGE
> +        */
> +       uint32_t nb_aging;
> +       /**
> +        * Number of traffic metering actions pre-configured.
> +        * If set to 0, PMD will allocate meters dynamically.
> +        * @see RTE_FLOW_ACTION_TYPE_METER
> +        */
> +       uint32_t nb_meters;
> +};
> +
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Configure flow rules module.
> + * To pre-allocate resources as per the flow port attributes
> + * this configuration function must be called before any flow rule is created.
> + * Must be called only after Ethernet device is configured, but may be called
> + * before or after the device is started as long as there are no flow rules.
> + * No other rte_flow function should be called while this function is invoked.
> + * This function can be called again to change the configuration.
> + * Some PMDs may not support re-configuration at all,
> + * or may only allow increasing the number of resources allocated.

Following comment from Ivan looks good to me

* Pre-configure the port's flow API engine.
*
* This API can only be invoked before the application
* starts using the rest of the flow library functions.
*
* The API can be invoked multiple times to change the
* settings. The port, however, may reject the changes.

> + *
> + * @param port_id
> + *   Port identifier of Ethernet device.
> + * @param[in] port_attr
> + *   Port configuration attributes.
> + * @param[out] error
> + *   Perform verbose error reporting if not NULL.
> + *   PMDs initialize this structure in case of error only.
> + *
> + * @return
> + *   0 on success, a negative errno value otherwise and rte_errno is set.
> + */
> +__rte_experimental
> +int
> +rte_flow_configure(uint16_t port_id,

Should we couple, setting resource limit hint to configure function as
if we add future items in
configuration, we may pain to manage all state. Instead how about,
rte_flow_resource_reserve_hint_set()?


> +                  const struct rte_flow_port_attr *port_attr,
> +                  struct rte_flow_error *error);

I think, we should have _get function to get those limit numbers otherwise,
we can not write portable applications as the return value is  kind of
boolean now if
don't define exact values for rte_errno for reasons.



> +
>  #ifdef __cplusplus
>  }
>  #endif
> diff --git a/lib/ethdev/rte_flow_driver.h b/lib/ethdev/rte_flow_driver.h
> index f691b04af4..5f722f1a39 100644
> --- a/lib/ethdev/rte_flow_driver.h
> +++ b/lib/ethdev/rte_flow_driver.h
> @@ -152,6 +152,11 @@ struct rte_flow_ops {
>                 (struct rte_eth_dev *dev,
>                  const struct rte_flow_item_flex_handle *handle,
>                  struct rte_flow_error *error);
> +       /** See rte_flow_configure() */
> +       int (*configure)
> +               (struct rte_eth_dev *dev,
> +                const struct rte_flow_port_attr *port_attr,
> +                struct rte_flow_error *err);
>  };
>
>  /**
> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
> index c2fb0669a4..7645796739 100644
> --- a/lib/ethdev/version.map
> +++ b/lib/ethdev/version.map
> @@ -256,6 +256,9 @@ EXPERIMENTAL {
>         rte_flow_flex_item_create;
>         rte_flow_flex_item_release;
>         rte_flow_pick_transfer_proxy;
> +
> +       # added in 22.03
> +       rte_flow_configure;
>  };
>
>  INTERNAL {
> --
> 2.18.2
>

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v3] mempool: fix put objects to mempool with cache
  @ 2022-01-24 15:39  3%   ` Olivier Matz
  2022-01-28  9:37  0%     ` Morten Brørup
  0 siblings, 1 reply; 200+ results
From: Olivier Matz @ 2022-01-24 15:39 UTC (permalink / raw)
  To: Morten Brørup; +Cc: andrew.rybchenko, bruce.richardson, jerinjacobk, dev

Hi Morten,

On Wed, Jan 19, 2022 at 04:03:01PM +0100, Morten Brørup wrote:
> mempool: fix put objects to mempool with cache
> 
> This patch optimizes the rte_mempool_do_generic_put() caching algorithm,
> and fixes a bug in it.

I think we should avoid grouping fixes and optimizations in one
patch. The main reason is that fixes aims to be backported, which
is not the case of optimizations.

> The existing algorithm was:
>  1. Add the objects to the cache
>  2. Anything greater than the cache size (if it crosses the cache flush
>     threshold) is flushed to the ring.
> 
> Please note that the description in the source code said that it kept
> "cache min value" objects after flushing, but the function actually kept
> "size" objects, which is reflected in the above description.
> 
> Now, the algorithm is:
>  1. If the objects cannot be added to the cache without crossing the
>     flush threshold, flush the cache to the ring.
>  2. Add the objects to the cache.
> 
> This patch changes these details:
> 
> 1. Bug: The cache was still full after flushing.
> In the opposite direction, i.e. when getting objects from the cache, the
> cache is refilled to full level when it crosses the low watermark (which
> happens to be zero).
> Similarly, the cache should be flushed to empty level when it crosses
> the high watermark (which happens to be 1.5 x the size of the cache).
> The existing flushing behaviour was suboptimal for real applications,
> because crossing the low or high watermark typically happens when the
> application is in a state where the number of put/get events are out of
> balance, e.g. when absorbing a burst of packets into a QoS queue
> (getting more mbufs from the mempool), or when a burst of packets is
> trickling out from the QoS queue (putting the mbufs back into the
> mempool).
> NB: When the application is in a state where put/get events are in
> balance, the cache should remain within its low and high watermarks, and
> the algorithms for refilling/flushing the cache should not come into
> play.
> Now, the mempool cache is completely flushed when crossing the flush
> threshold, so only the newly put (hot) objects remain in the mempool
> cache afterwards.

I'm not sure we should call this behavior a bug. What is the impact
on applications, from a user perspective? Can it break a use-case, or
have an important performance impact?


> 2. Minor bug: The flush threshold comparison has been corrected; it must
> be "len > flushthresh", not "len >= flushthresh".
> Reasoning: Consider a flush multiplier of 1 instead of 1.5; the cache
> would be flushed already when reaching size elements, not when exceeding
> size elements.
> Now, flushing is triggered when the flush threshold is exceeded, not
> when reached.

Same here, we should ask ourselves what is the impact before calling
it a bug.


> 3. Optimization: The most recent (hot) objects are flushed, leaving the
> oldest (cold) objects in the mempool cache.
> This is bad for CPUs with a small L1 cache, because when they get
> objects from the mempool after the mempool cache has been flushed, they
> get cold objects instead of hot objects.
> Now, the existing (cold) objects in the mempool cache are flushed before
> the new (hot) objects are added the to the mempool cache.
> 
> 4. Optimization: Using the x86 variant of rte_memcpy() is inefficient
> here, where n is relatively small and unknown at compile time.
> Now, it has been replaced by an alternative copying method, optimized
> for the fact that most Ethernet PMDs operate in bursts of 4 or 8 mbufs
> or multiples thereof.

For these optimizations, do you have an idea of what is the performance
gain? Ideally (I understand it is not always possible), each optimization
is done separately, and its impact is measured.


> v2 changes:
> 
> - Not adding the new objects to the mempool cache before flushing it
> also allows the memory allocated for the mempool cache to be reduced
> from 3 x to 2 x RTE_MEMPOOL_CACHE_MAX_SIZE.
> However, such this change would break the ABI, so it was removed in v2.
> 
> - The mempool cache should be cache line aligned for the benefit of the
> copying method, which on some CPU architectures performs worse on data
> crossing a cache boundary.
> However, such this change would break the ABI, so it was removed in v2;
> and yet another alternative copying method replaced the rte_memcpy().

OK, we may want to keep this in mind for the next abi breakage.


> 
> v3 changes:
> 
> - Actually remove my modifications of the rte_mempool_cache structure.
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>  lib/mempool/rte_mempool.h | 51 +++++++++++++++++++++++++++++----------
>  1 file changed, 38 insertions(+), 13 deletions(-)
> 
> diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
> index 1e7a3c1527..7b364cfc74 100644
> --- a/lib/mempool/rte_mempool.h
> +++ b/lib/mempool/rte_mempool.h
> @@ -1334,6 +1334,7 @@ static __rte_always_inline void
>  rte_mempool_do_generic_put(struct rte_mempool *mp, void * const *obj_table,
>  			   unsigned int n, struct rte_mempool_cache *cache)
>  {
> +	uint32_t index;
>  	void **cache_objs;
>  
>  	/* increment stat now, adding in mempool always success */
> @@ -1344,31 +1345,56 @@ rte_mempool_do_generic_put(struct rte_mempool *mp, void * const *obj_table,
>  	if (unlikely(cache == NULL || n > RTE_MEMPOOL_CACHE_MAX_SIZE))
>  		goto ring_enqueue;
>  
> -	cache_objs = &cache->objs[cache->len];
> +	/* If the request itself is too big for the cache */
> +	if (unlikely(n > cache->flushthresh))
> +		goto ring_enqueue;
>  
>  	/*
>  	 * The cache follows the following algorithm
> -	 *   1. Add the objects to the cache
> -	 *   2. Anything greater than the cache min value (if it crosses the
> -	 *   cache flush threshold) is flushed to the ring.
> +	 *   1. If the objects cannot be added to the cache without
> +	 *   crossing the flush threshold, flush the cache to the ring.
> +	 *   2. Add the objects to the cache.
>  	 */
>  
> -	/* Add elements back into the cache */
> -	rte_memcpy(&cache_objs[0], obj_table, sizeof(void *) * n);
> +	if (cache->len + n <= cache->flushthresh) {
> +		cache_objs = &cache->objs[cache->len];
>  
> -	cache->len += n;
> +		cache->len += n;
> +	} else {
> +		cache_objs = cache->objs;
>  
> -	if (cache->len >= cache->flushthresh) {
> -		rte_mempool_ops_enqueue_bulk(mp, &cache->objs[cache->size],
> -				cache->len - cache->size);
> -		cache->len = cache->size;
> +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
> +		if (rte_mempool_ops_enqueue_bulk(mp, cache_objs, cache->len) < 0)
> +			rte_panic("cannot put objects in mempool\n");
> +#else
> +		rte_mempool_ops_enqueue_bulk(mp, cache_objs, cache->len);
> +#endif
> +		cache->len = n;
> +	}
> +
> +	/* Add the objects to the cache. */
> +	for (index = 0; index < (n & ~0x3); index += 4) {
> +		cache_objs[index] = obj_table[index];
> +		cache_objs[index + 1] = obj_table[index + 1];
> +		cache_objs[index + 2] = obj_table[index + 2];
> +		cache_objs[index + 3] = obj_table[index + 3];
> +	}
> +	switch (n & 0x3) {
> +	case 3:
> +		cache_objs[index] = obj_table[index];
> +		index++; /* fallthrough */
> +	case 2:
> +		cache_objs[index] = obj_table[index];
> +		index++; /* fallthrough */
> +	case 1:
> +		cache_objs[index] = obj_table[index];
>  	}
>  
>  	return;
>  
>  ring_enqueue:
>  
> -	/* push remaining objects in ring */
> +	/* Put the objects into the ring */
>  #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
>  	if (rte_mempool_ops_enqueue_bulk(mp, obj_table, n) < 0)
>  		rte_panic("cannot put objects in mempool\n");
> @@ -1377,7 +1403,6 @@ rte_mempool_do_generic_put(struct rte_mempool *mp, void * const *obj_table,
>  #endif
>  }
>  
> -
>  /**
>   * Put several objects back in the mempool.
>   *
> -- 
> 2.17.1
> 

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v3] mempool: fix the description of some function return values
  @ 2022-01-24 17:04  3%   ` Olivier Matz
  0 siblings, 0 replies; 200+ results
From: Olivier Matz @ 2022-01-24 17:04 UTC (permalink / raw)
  To: Zhiheng Chen; +Cc: Andrew Rybchenko, dev

Hi Zhiheng,

Thank you for your patch proposal.

On Thu, Dec 23, 2021 at 10:07:41AM +0000, Zhiheng Chen wrote:
> In rte_mempool_ring.c, the committer uses the symbol ENOBUFS to
> describe the return value of function common_ring_sc_dequeue,
> but in rte_mempool.h, the symbol ENOENT is used to describe
> the return value of function rte_mempool_get. If the user of
> dpdk uses the symbol ENOENT as the judgment condition of
> the return value, it may cause some abnormal phenomena
> in their own programs, such as when the mempool space is exhausted.

The issue I see with this approach is that currently, there
is no standard error code in mempool drivers dequeue:

  bucket: -ENOBUFS
  cn10k: -ENOENT
  cn9k: -ENOENT
  dpaa: -1, -ENOBUFS
  dpaa2: -1, -ENOENT, -ENOBUFS
  octeontx: -ENOMEM
  ring: -ENOBUFS
  stack: -ENOBUFS

After your patch, the drivers do not match the documentation.

I agree it would be better to return the same code for the same error,
whatever the driver is used. But I think we should keep the possibility
for a driver to return another code. For instance, it could be an
hardware error in case of hardware mempool driver.

I see 2 possibilities:

1/ simplest one: relax documentation and do not talk about -ENOENT or
   -ENOBUFS, just say negative value is an error

2/ fix driver and doc

   Mempool drivers should be modified first, knowing that changing
   them is an ABI modification (which I think is acceptable, because the
   error code varies depending on driver). Then, this patch could be applied.

For reference, note that the documentation was probably right initially,
but the behavior changed in commit cfa7c9e6fc1f ("ring: make bulk and
burst return values consistent"), returning -ENOBUFS instead of -ENOENT
on dequeue error.


> v2:
> * Update the descriptions of underlying functions.
> 
> v3:
> * Correct the description that the return value cannot be greater than 0
> * Update the description of the dequeue function prototype
> 
> Signed-off-by: Zhiheng Chen <chenzhiheng0227@gmail.com>
> ---
>  lib/mempool/rte_mempool.h | 34 ++++++++++++++++++++++------------
>  1 file changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
> index 1e7a3c1527..cae81d8a32 100644
> --- a/lib/mempool/rte_mempool.h
> +++ b/lib/mempool/rte_mempool.h
> @@ -447,6 +447,16 @@ typedef int (*rte_mempool_enqueue_t)(struct rte_mempool *mp,
>  
>  /**
>   * Dequeue an object from the external pool.
> + *
> + * @param mp
> + *   Pointer to the memory pool.
> + * @param obj_table
> + *   Pointer to a table of void * pointers (objects).
> + * @param n
> + *   Number of objects to get.
> + * @return
> + *   - 0: Success; got n objects.
> + *   - -ENOBUFS: Not enough entries in the mempool; no object is retrieved.

Also, we should have, in addition to -ENOBUFS:

 - <0: Another driver-specific error code (-errno)

This comment applies for the other functions below.

>   */
>  typedef int (*rte_mempool_dequeue_t)(struct rte_mempool *mp,
>  		void **obj_table, unsigned int n);
> @@ -738,7 +748,7 @@ rte_mempool_ops_alloc(struct rte_mempool *mp);
>   *   Number of objects to get.
>   * @return
>   *   - 0: Success; got n objects.
> - *   - <0: Error; code of dequeue function.
> + *   - -ENOBUFS: Not enough entries in the mempool; no object is retrieved.
>   */
>  static inline int
>  rte_mempool_ops_dequeue_bulk(struct rte_mempool *mp,
> @@ -1452,8 +1462,8 @@ rte_mempool_put(struct rte_mempool *mp, void *obj)
>   * @param cache
>   *   A pointer to a mempool cache structure. May be NULL if not needed.
>   * @return
> - *   - >=0: Success; number of objects supplied.
> - *   - <0: Error; code of ring dequeue function.
> + *   - 0: Success; got n objects.
> + *   - -ENOBUFS: Not enough entries in the mempool; no object is retrieved.
>   */
>  static __rte_always_inline int
>  rte_mempool_do_generic_get(struct rte_mempool *mp, void **obj_table,
> @@ -1521,7 +1531,7 @@ rte_mempool_do_generic_get(struct rte_mempool *mp, void **obj_table,
>   * Get several objects from the mempool.
>   *
>   * If cache is enabled, objects will be retrieved first from cache,
> - * subsequently from the common pool. Note that it can return -ENOENT when
> + * subsequently from the common pool. Note that it can return -ENOBUFS when
>   * the local cache and common pool are empty, even if cache from other
>   * lcores are full.
>   *
> @@ -1534,8 +1544,8 @@ rte_mempool_do_generic_get(struct rte_mempool *mp, void **obj_table,
>   * @param cache
>   *   A pointer to a mempool cache structure. May be NULL if not needed.
>   * @return
> - *   - 0: Success; objects taken.
> - *   - -ENOENT: Not enough entries in the mempool; no object is retrieved.
> + *   - 0: Success; got n objects.
> + *   - -ENOBUFS: Not enough entries in the mempool; no object is retrieved.
>   */
>  static __rte_always_inline int
>  rte_mempool_generic_get(struct rte_mempool *mp, void **obj_table,
> @@ -1557,7 +1567,7 @@ rte_mempool_generic_get(struct rte_mempool *mp, void **obj_table,
>   * mempool creation time (see flags).
>   *
>   * If cache is enabled, objects will be retrieved first from cache,
> - * subsequently from the common pool. Note that it can return -ENOENT when
> + * subsequently from the common pool. Note that it can return -ENOBUFS when
>   * the local cache and common pool are empty, even if cache from other
>   * lcores are full.
>   *
> @@ -1568,8 +1578,8 @@ rte_mempool_generic_get(struct rte_mempool *mp, void **obj_table,
>   * @param n
>   *   The number of objects to get from the mempool to obj_table.
>   * @return
> - *   - 0: Success; objects taken
> - *   - -ENOENT: Not enough entries in the mempool; no object is retrieved.
> + *   - 0: Success; got n objects.
> + *   - -ENOBUFS: Not enough entries in the mempool; no object is retrieved.
>   */
>  static __rte_always_inline int
>  rte_mempool_get_bulk(struct rte_mempool *mp, void **obj_table, unsigned int n)
> @@ -1588,7 +1598,7 @@ rte_mempool_get_bulk(struct rte_mempool *mp, void **obj_table, unsigned int n)
>   * mempool creation (see flags).
>   *
>   * If cache is enabled, objects will be retrieved first from cache,
> - * subsequently from the common pool. Note that it can return -ENOENT when
> + * subsequently from the common pool. Note that it can return -ENOBUFS when
>   * the local cache and common pool are empty, even if cache from other
>   * lcores are full.
>   *
> @@ -1597,8 +1607,8 @@ rte_mempool_get_bulk(struct rte_mempool *mp, void **obj_table, unsigned int n)
>   * @param obj_p
>   *   A pointer to a void * pointer (object) that will be filled.
>   * @return
> - *   - 0: Success; objects taken.
> - *   - -ENOENT: Not enough entries in the mempool; no object is retrieved.
> + *   - 0: Success; got n objects.
> + *   - -ENOBUFS: Not enough entries in the mempool; no object is retrieved.
>   */
>  static __rte_always_inline int
>  rte_mempool_get(struct rte_mempool *mp, void **obj_p)
> -- 
> 2.32.0
> 

Thanks,
Olivier

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-24 14:36  3%     ` Jerin Jacob
@ 2022-01-24 17:35  0%       ` Thomas Monjalon
  2022-01-24 17:46  0%         ` Jerin Jacob
  2022-01-24 17:40  0%       ` Ajit Khaparde
  1 sibling, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-01-24 17:35 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Alexander Kozyrev, dev, Ori Kam, Ivan Malov, Andrew Rybchenko,
	Ferruh Yigit, mohammad.abdul.awal, Qi Zhang, Jerin Jacob,
	Ajit Khaparde, bruce.richardson, david.marchand, olivier.matz,
	stephen

24/01/2022 15:36, Jerin Jacob:
> On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev <akozyrev@nvidia.com> wrote:
> > +struct rte_flow_port_attr {
> > +       /**
> > +        * Version of the struct layout, should be 0.
> > +        */
> > +       uint32_t version;
> 
> Why version number? Across DPDK, we are using dynamic function
> versioning, I think, that would be sufficient for ABI versioning

Function versioning is not ideal when the structure is accessed
in many places like many drivers and library functions.

The idea of this version field (which can be a bitfield)
is to update it when some new features are added,
so the users of the struct can check if a feature is there
before trying to use it.
It means a bit more code in the functions, but avoid duplicating functions
as in function versioning.

Another approach was suggested by Bruce, and applied to dmadev.
It is assuming we only add new fields at the end (no removal),
and focus on the size of the struct.
By passing sizeof as an extra parameter, the function knows
which fields are OK to use.
Example: http://code.dpdk.org/dpdk/v21.11/source/lib/dmadev/rte_dmadev.c#L476



^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-24 14:36  3%     ` Jerin Jacob
  2022-01-24 17:35  0%       ` Thomas Monjalon
@ 2022-01-24 17:40  0%       ` Ajit Khaparde
  2022-01-25  1:28  0%         ` Alexander Kozyrev
  1 sibling, 1 reply; 200+ results
From: Ajit Khaparde @ 2022-01-24 17:40 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Alexander Kozyrev, dpdk-dev, Ori Kam, Thomas Monjalon,
	Ivan Malov, Andrew Rybchenko, Ferruh Yigit, mohammad.abdul.awal,
	Qi Zhang, Jerin Jacob

On Mon, Jan 24, 2022 at 6:37 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
>
> On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev <akozyrev@nvidia.com> wrote:
> >
> > The flow rules creation/destruction at a large scale incurs a performance
> > penalty and may negatively impact the packet processing when used
> > as part of the datapath logic. This is mainly because software/hardware
> > resources are allocated and prepared during the flow rule creation.
> >
> > In order to optimize the insertion rate, PMD may use some hints provided
> > by the application at the initialization phase. The rte_flow_configure()
> > function allows to pre-allocate all the needed resources beforehand.
> > These resources can be used at a later stage without costly allocations.
> > Every PMD may use only the subset of hints and ignore unused ones or
> > fail in case the requested configuration is not supported.
> >
> > Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> > ---
>
> >
> > +/**
> > + * @warning
> > + * @b EXPERIMENTAL: this API may change without prior notice.
> > + *
> > + * Flow engine port configuration attributes.
> > + */
> > +__extension__
>
> Is this __extension__ required ?
>
>
> > +struct rte_flow_port_attr {
> > +       /**
> > +        * Version of the struct layout, should be 0.
> > +        */
> > +       uint32_t version;
>
> Why version number? Across DPDK, we are using dynamic function
> versioning, I think, that would
>  be sufficient for ABI versioning
>
> > +       /**
> > +        * Number of counter actions pre-configured.
> > +        * If set to 0, PMD will allocate counters dynamically.
> > +        * @see RTE_FLOW_ACTION_TYPE_COUNT
> > +        */
> > +       uint32_t nb_counters;
> > +       /**
> > +        * Number of aging actions pre-configured.
> > +        * If set to 0, PMD will allocate aging dynamically.
> > +        * @see RTE_FLOW_ACTION_TYPE_AGE
> > +        */
> > +       uint32_t nb_aging;
> > +       /**
> > +        * Number of traffic metering actions pre-configured.
> > +        * If set to 0, PMD will allocate meters dynamically.
> > +        * @see RTE_FLOW_ACTION_TYPE_METER
> > +        */
> > +       uint32_t nb_meters;
> > +};
> > +
> > +/**
> > + * @warning
> > + * @b EXPERIMENTAL: this API may change without prior notice.
> > + *
> > + * Configure flow rules module.
> > + * To pre-allocate resources as per the flow port attributes
> > + * this configuration function must be called before any flow rule is created.
> > + * Must be called only after Ethernet device is configured, but may be called
> > + * before or after the device is started as long as there are no flow rules.
> > + * No other rte_flow function should be called while this function is invoked.
> > + * This function can be called again to change the configuration.
> > + * Some PMDs may not support re-configuration at all,
> > + * or may only allow increasing the number of resources allocated.
>
> Following comment from Ivan looks good to me
>
> * Pre-configure the port's flow API engine.
> *
> * This API can only be invoked before the application
> * starts using the rest of the flow library functions.
> *
> * The API can be invoked multiple times to change the
> * settings. The port, however, may reject the changes.
>
> > + *
> > + * @param port_id
> > + *   Port identifier of Ethernet device.
> > + * @param[in] port_attr
> > + *   Port configuration attributes.
> > + * @param[out] error
> > + *   Perform verbose error reporting if not NULL.
> > + *   PMDs initialize this structure in case of error only.
> > + *
> > + * @return
> > + *   0 on success, a negative errno value otherwise and rte_errno is set.
> > + */
> > +__rte_experimental
> > +int
> > +rte_flow_configure(uint16_t port_id,
>
> Should we couple, setting resource limit hint to configure function as
> if we add future items in
> configuration, we may pain to manage all state. Instead how about,
> rte_flow_resource_reserve_hint_set()?
+1

>
>
> > +                  const struct rte_flow_port_attr *port_attr,
> > +                  struct rte_flow_error *error);
>
> I think, we should have _get function to get those limit numbers otherwise,
> we can not write portable applications as the return value is  kind of
> boolean now if
> don't define exact values for rte_errno for reasons.
+1

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-24 17:35  0%       ` Thomas Monjalon
@ 2022-01-24 17:46  0%         ` Jerin Jacob
  2022-01-24 18:08  3%           ` Bruce Richardson
  0 siblings, 1 reply; 200+ results
From: Jerin Jacob @ 2022-01-24 17:46 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Alexander Kozyrev, dpdk-dev, Ori Kam, Ivan Malov,
	Andrew Rybchenko, Ferruh Yigit, mohammad.abdul.awal, Qi Zhang,
	Jerin Jacob, Ajit Khaparde, Richardson, Bruce, David Marchand,
	Olivier Matz, Stephen Hemminger

On Mon, Jan 24, 2022 at 11:05 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 24/01/2022 15:36, Jerin Jacob:
> > On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev <akozyrev@nvidia.com> wrote:
> > > +struct rte_flow_port_attr {
> > > +       /**
> > > +        * Version of the struct layout, should be 0.
> > > +        */
> > > +       uint32_t version;
> >
> > Why version number? Across DPDK, we are using dynamic function
> > versioning, I think, that would be sufficient for ABI versioning
>
> Function versioning is not ideal when the structure is accessed
> in many places like many drivers and library functions.
>
> The idea of this version field (which can be a bitfield)
> is to update it when some new features are added,
> so the users of the struct can check if a feature is there
> before trying to use it.
> It means a bit more code in the functions, but avoid duplicating functions
> as in function versioning.
>
> Another approach was suggested by Bruce, and applied to dmadev.
> It is assuming we only add new fields at the end (no removal),
> and focus on the size of the struct.
> By passing sizeof as an extra parameter, the function knows
> which fields are OK to use.
> Example: http://code.dpdk.org/dpdk/v21.11/source/lib/dmadev/rte_dmadev.c#L476

+ @Richardson, Bruce
Either approach is fine, No strong opinion.  We can have one approach
and use it across DPDK for consistency.

>
>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-24 17:46  0%         ` Jerin Jacob
@ 2022-01-24 18:08  3%           ` Bruce Richardson
  2022-01-25  1:14  0%             ` Alexander Kozyrev
  2022-01-25 15:58  4%             ` Ori Kam
  0 siblings, 2 replies; 200+ results
From: Bruce Richardson @ 2022-01-24 18:08 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Thomas Monjalon, Alexander Kozyrev, dpdk-dev, Ori Kam,
	Ivan Malov, Andrew Rybchenko, Ferruh Yigit, mohammad.abdul.awal,
	Qi Zhang, Jerin Jacob, Ajit Khaparde, David Marchand,
	Olivier Matz, Stephen Hemminger

On Mon, Jan 24, 2022 at 11:16:15PM +0530, Jerin Jacob wrote:
> On Mon, Jan 24, 2022 at 11:05 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > 24/01/2022 15:36, Jerin Jacob:
> > > On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev <akozyrev@nvidia.com> wrote:
> > > > +struct rte_flow_port_attr {
> > > > +       /**
> > > > +        * Version of the struct layout, should be 0.
> > > > +        */
> > > > +       uint32_t version;
> > >
> > > Why version number? Across DPDK, we are using dynamic function
> > > versioning, I think, that would be sufficient for ABI versioning
> >
> > Function versioning is not ideal when the structure is accessed
> > in many places like many drivers and library functions.
> >
> > The idea of this version field (which can be a bitfield)
> > is to update it when some new features are added,
> > so the users of the struct can check if a feature is there
> > before trying to use it.
> > It means a bit more code in the functions, but avoid duplicating functions
> > as in function versioning.
> >
> > Another approach was suggested by Bruce, and applied to dmadev.
> > It is assuming we only add new fields at the end (no removal),
> > and focus on the size of the struct.
> > By passing sizeof as an extra parameter, the function knows
> > which fields are OK to use.
> > Example: http://code.dpdk.org/dpdk/v21.11/source/lib/dmadev/rte_dmadev.c#L476
> 
> + @Richardson, Bruce
> Either approach is fine, No strong opinion.  We can have one approach
> and use it across DPDK for consistency.
> 

In general I prefer the size-based approach, mainly because of its
simplicity. However, some other reasons why we may want to choose it:

* It's completely hidden from the end user, and there is no need for an
  extra struct field that needs to be filled in

* Related to that, for the version-field approach, if the field is present
  in a user-allocated struct, then you probably need to start preventing user
  error via:
   - having the external struct not have the field and use a separate
     internal struct to add in the version info after the fact in the
     versioned function. Alternatively,
   - provide a separate init function for each structure to fill in the
     version field appropriately

* In general, using the size-based approach like in the linked example is
  more resilient since it's compiler-inserted, so there is reduced chance
  of error.

* A sizeof field allows simple-enough handling in the drivers - especially
  since it does not allow removed fields. Each driver only needs to check
  that the size passed in is greater than that expected, thereby allowing
  us to have both updated and non-updated drivers co-existing simultaneously.
  [For a version field, the same scheme could also work if we keep the
  no-delete rule, but for a bitmask field, I believe things may get more
  complex in terms of checking]

In terms of the limitations of using sizeof - requiring new fields to
always go on the end, and preventing shrinking the struct - I think that the
simplicity gains far outweigh the impact of these strictions.

* Adding fields to struct is far more common than wanting to remove one

* So long as the added field is at the end, even if the struct size doesn't
  change the scheme can still work as the versioned function for the old
  struct can ensure that the extra field is appropriately zeroed (rather than
  random) on entry into any driver function

* If we do want to remove a field, the space simply needs to be marked as
  reserved in the struct, until the next ABI break release, when it can be
  compacted. Again, function versioning can take care of appropriately
  zeroing this field on return, if necessary.

My 2c from considering this for the implementation in dmadev. :-)

/Bruce

^ permalink raw reply	[relevance 3%]

* RE: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-24 18:08  3%           ` Bruce Richardson
@ 2022-01-25  1:14  0%             ` Alexander Kozyrev
  2022-01-25 15:58  4%             ` Ori Kam
  1 sibling, 0 replies; 200+ results
From: Alexander Kozyrev @ 2022-01-25  1:14 UTC (permalink / raw)
  To: Bruce Richardson, Jerin Jacob
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	dpdk-dev, Ori Kam, Ivan Malov, Andrew Rybchenko, Ferruh Yigit,
	mohammad.abdul.awal, Qi Zhang, Jerin Jacob, Ajit Khaparde,
	David Marchand, Olivier Matz, Stephen Hemminger

On Monday, January 24, 2022 13:09 Bruce Richardson <bruce.richardson@intel.com> wrote:
> On Mon, Jan 24, 2022 at 11:16:15PM +0530, Jerin Jacob wrote:
> > On Mon, Jan 24, 2022 at 11:05 PM Thomas Monjalon
> <thomas@monjalon.net> wrote:
> > >
> > > 24/01/2022 15:36, Jerin Jacob:
> > > > On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev
> <akozyrev@nvidia.com> wrote:
> > > > > +struct rte_flow_port_attr {
> > > > > +       /**
> > > > > +        * Version of the struct layout, should be 0.
> > > > > +        */
> > > > > +       uint32_t version;
> > > >
> > > > Why version number? Across DPDK, we are using dynamic function
> > > > versioning, I think, that would be sufficient for ABI versioning
> > >
> > > Function versioning is not ideal when the structure is accessed
> > > in many places like many drivers and library functions.
> > >
> > > The idea of this version field (which can be a bitfield)
> > > is to update it when some new features are added,
> > > so the users of the struct can check if a feature is there
> > > before trying to use it.
> > > It means a bit more code in the functions, but avoid duplicating functions
> > > as in function versioning.
> > >
> > > Another approach was suggested by Bruce, and applied to dmadev.
> > > It is assuming we only add new fields at the end (no removal),
> > > and focus on the size of the struct.
> > > By passing sizeof as an extra parameter, the function knows
> > > which fields are OK to use.
> > > Example:
> http://code.dpdk.org/dpdk/v21.11/source/lib/dmadev/rte_dmadev.c#L476
> >
> > + @Richardson, Bruce
> > Either approach is fine, No strong opinion.  We can have one approach
> > and use it across DPDK for consistency.
> >
> 
> In general I prefer the size-based approach, mainly because of its
> simplicity. However, some other reasons why we may want to choose it:
> 
> * It's completely hidden from the end user, and there is no need for an
>   extra struct field that needs to be filled in
> 
> * Related to that, for the version-field approach, if the field is present
>   in a user-allocated struct, then you probably need to start preventing user
>   error via:
>    - having the external struct not have the field and use a separate
>      internal struct to add in the version info after the fact in the
>      versioned function. Alternatively,
>    - provide a separate init function for each structure to fill in the
>      version field appropriately
> 
> * In general, using the size-based approach like in the linked example is
>   more resilient since it's compiler-inserted, so there is reduced chance
>   of error.
> 
> * A sizeof field allows simple-enough handling in the drivers - especially
>   since it does not allow removed fields. Each driver only needs to check
>   that the size passed in is greater than that expected, thereby allowing
>   us to have both updated and non-updated drivers co-existing
> simultaneously.
>   [For a version field, the same scheme could also work if we keep the
>   no-delete rule, but for a bitmask field, I believe things may get more
>   complex in terms of checking]
> 
> In terms of the limitations of using sizeof - requiring new fields to
> always go on the end, and preventing shrinking the struct - I think that the
> simplicity gains far outweigh the impact of these strictions.
> 
> * Adding fields to struct is far more common than wanting to remove one
> 
> * So long as the added field is at the end, even if the struct size doesn't
>   change the scheme can still work as the versioned function for the old
>   struct can ensure that the extra field is appropriately zeroed (rather than
>   random) on entry into any driver function
> 
> * If we do want to remove a field, the space simply needs to be marked as
>   reserved in the struct, until the next ABI break release, when it can be
>   compacted. Again, function versioning can take care of appropriately
>   zeroing this field on return, if necessary.
> 
> My 2c from considering this for the implementation in dmadev. :-)
> 
> /Bruce

Thank you for the suggestions. I have no objections in adopting a size-based approach.
I can keep versions or switch to sizeof as long as we can agree on some uniform way.

^ permalink raw reply	[relevance 0%]

* RE: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-24 17:40  0%       ` Ajit Khaparde
@ 2022-01-25  1:28  0%         ` Alexander Kozyrev
    0 siblings, 1 reply; 200+ results
From: Alexander Kozyrev @ 2022-01-25  1:28 UTC (permalink / raw)
  To: Ajit Khaparde, Jerin Jacob
  Cc: dpdk-dev, Ori Kam, NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ivan Malov, Andrew Rybchenko, Ferruh Yigit, mohammad.abdul.awal,
	Qi Zhang, Jerin Jacob

On Monday, January 24, 2022 12:41 Ajit Khaparde <ajit.khaparde@broadcom.com> wrote:
> On Mon, Jan 24, 2022 at 6:37 AM Jerin Jacob <jerinjacobk@gmail.com>
> wrote:
> >
> > On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev
> <akozyrev@nvidia.com> wrote:
> > >
> > > The flow rules creation/destruction at a large scale incurs a performance
> > > penalty and may negatively impact the packet processing when used
> > > as part of the datapath logic. This is mainly because software/hardware
> > > resources are allocated and prepared during the flow rule creation.
> > >
> > > In order to optimize the insertion rate, PMD may use some hints
> provided
> > > by the application at the initialization phase. The rte_flow_configure()
> > > function allows to pre-allocate all the needed resources beforehand.
> > > These resources can be used at a later stage without costly allocations.
> > > Every PMD may use only the subset of hints and ignore unused ones or
> > > fail in case the requested configuration is not supported.
> > >
> > > Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> > > ---
> >
> > >
> > > +/**
> > > + * @warning
> > > + * @b EXPERIMENTAL: this API may change without prior notice.
> > > + *
> > > + * Flow engine port configuration attributes.
> > > + */
> > > +__extension__
> >
> > Is this __extension__ required ?
No, it is not longer required as I removed bitfield from this structure. Thanks for catching.

> >
> > > +struct rte_flow_port_attr {
> > > +       /**
> > > +        * Version of the struct layout, should be 0.
> > > +        */
> > > +       uint32_t version;
> >
> > Why version number? Across DPDK, we are using dynamic function
> > versioning, I think, that would
> >  be sufficient for ABI versioning
> >
> > > +       /**
> > > +        * Number of counter actions pre-configured.
> > > +        * If set to 0, PMD will allocate counters dynamically.
> > > +        * @see RTE_FLOW_ACTION_TYPE_COUNT
> > > +        */
> > > +       uint32_t nb_counters;
> > > +       /**
> > > +        * Number of aging actions pre-configured.
> > > +        * If set to 0, PMD will allocate aging dynamically.
> > > +        * @see RTE_FLOW_ACTION_TYPE_AGE
> > > +        */
> > > +       uint32_t nb_aging;
> > > +       /**
> > > +        * Number of traffic metering actions pre-configured.
> > > +        * If set to 0, PMD will allocate meters dynamically.
> > > +        * @see RTE_FLOW_ACTION_TYPE_METER
> > > +        */
> > > +       uint32_t nb_meters;
> > > +};
> > > +
> > > +/**
> > > + * @warning
> > > + * @b EXPERIMENTAL: this API may change without prior notice.
> > > + *
> > > + * Configure flow rules module.
> > > + * To pre-allocate resources as per the flow port attributes
> > > + * this configuration function must be called before any flow rule is
> created.
> > > + * Must be called only after Ethernet device is configured, but may be
> called
> > > + * before or after the device is started as long as there are no flow rules.
> > > + * No other rte_flow function should be called while this function is
> invoked.
> > > + * This function can be called again to change the configuration.
> > > + * Some PMDs may not support re-configuration at all,
> > > + * or may only allow increasing the number of resources allocated.
> >
> > Following comment from Ivan looks good to me
> >
> > * Pre-configure the port's flow API engine.
> > *
> > * This API can only be invoked before the application
> > * starts using the rest of the flow library functions.
> > *
> > * The API can be invoked multiple times to change the
> > * settings. The port, however, may reject the changes.
Ok, I'll adopt this wording in the v3.

> > > + *
> > > + * @param port_id
> > > + *   Port identifier of Ethernet device.
> > > + * @param[in] port_attr
> > > + *   Port configuration attributes.
> > > + * @param[out] error
> > > + *   Perform verbose error reporting if not NULL.
> > > + *   PMDs initialize this structure in case of error only.
> > > + *
> > > + * @return
> > > + *   0 on success, a negative errno value otherwise and rte_errno is set.
> > > + */
> > > +__rte_experimental
> > > +int
> > > +rte_flow_configure(uint16_t port_id,
> >
> > Should we couple, setting resource limit hint to configure function as
> > if we add future items in
> > configuration, we may pain to manage all state. Instead how about,
> > rte_flow_resource_reserve_hint_set()?
> +1
Port attributes are the hints, PMD can safely ignore anything that is not supported/deemed unreasonable.
Having several functions to call instead of one configuration function seems like a burden to me.

> 
> >
> >
> > > +                  const struct rte_flow_port_attr *port_attr,
> > > +                  struct rte_flow_error *error);
> >
> > I think, we should have _get function to get those limit numbers otherwise,
> > we can not write portable applications as the return value is  kind of
> > boolean now if
> > don't define exact values for rte_errno for reasons.
> +1
We had this discussion in RFC. The limits will vary from NIC to NIC and from system to
system, depending on hardware capabilities and amount of free memory for example.
It is easier to reject a configuration with a clear error description as we do for flow creation.

^ permalink raw reply	[relevance 0%]

* RE: [RFC 1/3] ethdev: support GRE optional fields
  @ 2022-01-25  9:49  0%         ` Sean Zhang (Networking SW)
  2022-01-25 11:37  0%           ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Sean Zhang (Networking SW) @ 2022-01-25  9:49 UTC (permalink / raw)
  To: Ori Kam, NBU-Contact-Thomas Monjalon (EXTERNAL),
	Matan Azrad, Ferruh Yigit
  Cc: Andrew Rybchenko, dev

Hi,

> -----Original Message-----
> From: Ori Kam <orika@nvidia.com>
> Sent: Wednesday, January 19, 2022 6:57 PM
> To: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> Sean Zhang (Networking SW) <xiazhang@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Ferruh Yigit <ferruh.yigit@intel.com>
> Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org
> Subject: RE: [RFC 1/3] ethdev: support GRE optional fields
> 
> Hi,
> 
> > -----Original Message-----
> > From: Thomas Monjalon <thomas@monjalon.net>
> > Subject: Re: [RFC 1/3] ethdev: support GRE optional fields
> >
> > 19/01/2022 10:53, Ferruh Yigit:
> > > On 12/30/2021 3:08 AM, Sean Zhang wrote:
> > > > --- a/lib/ethdev/rte_flow.h
> > > > +++ b/lib/ethdev/rte_flow.h
> > > >   /**
> > > > + * RTE_FLOW_ITEM_TYPE_GRE_OPTION.
> > > > + *
> > > > + * Matches GRE optional fields in header.
> > > > + */
> > > > +struct rte_gre_hdr_option {
> > > > +	rte_be16_t checksum;
> > > > +	rte_be32_t key;
> > > > +	rte_be32_t sequence;
> > > > +};
> > > > +
> > >
> > > Hi Ori, Andrew,
> > >
> > > The decision was to have protocol structs in the net library and
> > > flow structs use from there, wasn't it?
> > > (Btw, a deprecation notice is still pending to clear some existing
> > > ones)
> > >
> > > So for the GRE optional fields, what about having a struct in the
> 'rte_gre.h'?
> > > (Also perhaps an GRE extended protocol header can be defined
> > > combining 'rte_gre_hdr' and optional fields struct.) Later flow API
> > > struct can embed that struct.
> >
> > +1 for using librte_net.
> > This addition in rte_flow looks to be a mistake.
> > Please fix the next version.
> >
> Nice idea,
> but my main concern is that the header should have the header is defined.
> Since some of the fields are optional this will look something like this:
> gre_hdr_option_checksum {
> rte_be_16_t checksum;
> }
> 
> gre_hdr_option_key {
> rte_be_32_t key;
> }
> 
> gre_hdr_option_ sequence {
> rte_be_32_t sequence;
> }
> 
> I don't want to have so many rte_flow_items, Has more and more protocols
> have optional data it doesn't make sense to create the item for each.
> 
> If I'm looking at it from an ideal place, I would like that the optional fields will
> be part of the original item.
> For example in test pmd I would like to write:
> Eth / ipv4 / udp / gre flags is key & checksum checksum is yyy key is xxx / end
> And not Eth / ipv4 / udp / gre flags is key & checksum / gre_option checksum
> is yyy key is xxx / end This means that the structure will look like this:
> struct rte_flow_item_gre {
> 	union {
> 		struct {
> 			/**
> 		 	* Checksum (1b), reserved 0 (12b), version (3b).
> 			 * Refer to RFC 2784.
> 			 */
> 			rte_be16_t c_rsvd0_ver;
> 			rte_be16_t protocol; /**< Protocol type. */
> 		}
> 		struct rte_gre_hdr hdr
> 	}
> 	rte_be_16_t checksum;
> 	rte_be_32_t key;
> 	rte_be_32_t sequence;
> };
> The main issue with this is that it breaks ABI, Maybe to solve this we can
> create a new structure gre_ext?
> 
> In any way I think we should think how we allow adding members to
> structures without ABI breakage.
> 
> Best,
> Ori

Thanks for the comments and suggestion.
So the acceptable solution is to have new structs define in rte_gre.h?
struct gre_hdr_opt_checksum {
	rte_be_16_t checksum;
}
 
struct gre_hdr_opt_key {
	rte_be_32_t key;
}
 
struct gre_hdr_opt_ sequence {
	rte_be_32_t sequence;
}

And to add new struct gre_ext defined in rte_flow.h:
struct gre_ext {
	struct rte_gre_hdr hdr;
	struct gre_hdr_opt_checkum checksum;
	struct rte_hdr_opt_key key;
	struct rte_hdr_opt_seq seq;
};

And we use struct gre_ext for this new added flow item gre_option.

Correct me if my understanding is not right.

Thanks,
Sean



^ permalink raw reply	[relevance 0%]

* Re: [PATCH v4] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if.
  2022-01-23 21:20  8%     ` [PATCH v4] " Michael Barker
@ 2022-01-25 10:33  0%       ` Ray Kinsella
  2022-01-31  0:05  8%       ` [PATCH v5] " Michael Barker
  1 sibling, 0 replies; 200+ results
From: Ray Kinsella @ 2022-01-25 10:33 UTC (permalink / raw)
  To: Michael Barker, Stephen Hemminger; +Cc: dev


Michael Barker <mikeb01@gmail.com> writes:

> When compiling with clang using -Wall (or -Wgcc-compat) the use of
> diagnose_if kicks up a warning:
>
> .../include/rte_interrupts.h:623:1: error: 'diagnose_if' is a clang
> extension [-Werror,-Wgcc-compat]
> __rte_internal
> ^
> .../include/rte_compat.h:36:16: note: expanded from macro '__rte_internal'
> __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
>
> This change ignores the '-Wgcc-compat' warning in the specific location
> where the warning occurs.  It is safe to do in this circumstance as the
> specific macro is only defined when using the clang compiler.
>
> Signed-off-by: Michael Barker <mikeb01@gmail.com>
> ---
>  lib/eal/include/rte_compat.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/eal/include/rte_compat.h b/lib/eal/include/rte_compat.h
> index 2718612cce..9556bbf4d0 100644
> --- a/lib/eal/include/rte_compat.h
> +++ b/lib/eal/include/rte_compat.h
> @@ -33,8 +33,11 @@ section(".text.internal")))
>  #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /*
> For clang */

Why doesn't the __has_attribute take care of this?
I would have thought that gcc would check the for the attribute, find it
doesn't support it and ignore the whole thing?

>  
>  #define __rte_internal \
> +_Pragma("GCC diagnostic push") \
> +_Pragma("GCC diagnostic ignored \"-Wgcc-compat\"") \
>  __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
> -section(".text.internal")))
> +section(".text.internal"))) \
> +_Pragma("GCC diagnostic pop")
>  
>  #else


-- 
Regards, Ray K

^ permalink raw reply	[relevance 0%]

* Re: [RFC 1/3] ethdev: support GRE optional fields
  2022-01-25  9:49  0%         ` Sean Zhang (Networking SW)
@ 2022-01-25 11:37  0%           ` Ferruh Yigit
  2022-01-25 13:06  0%             ` Ori Kam
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2022-01-25 11:37 UTC (permalink / raw)
  To: Sean Zhang (Networking SW),
	Ori Kam, NBU-Contact-Thomas Monjalon (EXTERNAL),
	Matan Azrad
  Cc: Andrew Rybchenko, dev

On 1/25/2022 9:49 AM, Sean Zhang (Networking SW) wrote:
> Hi,
> 
>> -----Original Message-----
>> From: Ori Kam <orika@nvidia.com>
>> Sent: Wednesday, January 19, 2022 6:57 PM
>> To: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
>> Sean Zhang (Networking SW) <xiazhang@nvidia.com>; Matan Azrad
>> <matan@nvidia.com>; Ferruh Yigit <ferruh.yigit@intel.com>
>> Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org
>> Subject: RE: [RFC 1/3] ethdev: support GRE optional fields
>>
>> Hi,
>>
>>> -----Original Message-----
>>> From: Thomas Monjalon <thomas@monjalon.net>
>>> Subject: Re: [RFC 1/3] ethdev: support GRE optional fields
>>>
>>> 19/01/2022 10:53, Ferruh Yigit:
>>>> On 12/30/2021 3:08 AM, Sean Zhang wrote:
>>>>> --- a/lib/ethdev/rte_flow.h
>>>>> +++ b/lib/ethdev/rte_flow.h
>>>>>    /**
>>>>> + * RTE_FLOW_ITEM_TYPE_GRE_OPTION.
>>>>> + *
>>>>> + * Matches GRE optional fields in header.
>>>>> + */
>>>>> +struct rte_gre_hdr_option {
>>>>> +	rte_be16_t checksum;
>>>>> +	rte_be32_t key;
>>>>> +	rte_be32_t sequence;
>>>>> +};
>>>>> +
>>>>
>>>> Hi Ori, Andrew,
>>>>
>>>> The decision was to have protocol structs in the net library and
>>>> flow structs use from there, wasn't it?
>>>> (Btw, a deprecation notice is still pending to clear some existing
>>>> ones)
>>>>
>>>> So for the GRE optional fields, what about having a struct in the
>> 'rte_gre.h'?
>>>> (Also perhaps an GRE extended protocol header can be defined
>>>> combining 'rte_gre_hdr' and optional fields struct.) Later flow API
>>>> struct can embed that struct.
>>>
>>> +1 for using librte_net.
>>> This addition in rte_flow looks to be a mistake.
>>> Please fix the next version.
>>>
>> Nice idea,
>> but my main concern is that the header should have the header is defined.
>> Since some of the fields are optional this will look something like this:
>> gre_hdr_option_checksum {
>> rte_be_16_t checksum;
>> }
>>
>> gre_hdr_option_key {
>> rte_be_32_t key;
>> }
>>
>> gre_hdr_option_ sequence {
>> rte_be_32_t sequence;
>> }
>>
>> I don't want to have so many rte_flow_items, Has more and more protocols
>> have optional data it doesn't make sense to create the item for each.
>>
>> If I'm looking at it from an ideal place, I would like that the optional fields will
>> be part of the original item.
>> For example in test pmd I would like to write:
>> Eth / ipv4 / udp / gre flags is key & checksum checksum is yyy key is xxx / end
>> And not Eth / ipv4 / udp / gre flags is key & checksum / gre_option checksum
>> is yyy key is xxx / end This means that the structure will look like this:
>> struct rte_flow_item_gre {
>> 	union {
>> 		struct {
>> 			/**
>> 		 	* Checksum (1b), reserved 0 (12b), version (3b).
>> 			 * Refer to RFC 2784.
>> 			 */
>> 			rte_be16_t c_rsvd0_ver;
>> 			rte_be16_t protocol; /**< Protocol type. */
>> 		}
>> 		struct rte_gre_hdr hdr
>> 	}
>> 	rte_be_16_t checksum;
>> 	rte_be_32_t key;
>> 	rte_be_32_t sequence;
>> };
>> The main issue with this is that it breaks ABI, Maybe to solve this we can
>> create a new structure gre_ext?
>>
>> In any way I think we should think how we allow adding members to
>> structures without ABI breakage.
>>
>> Best,
>> Ori
> 
> Thanks for the comments and suggestion.
> So the acceptable solution is to have new structs define in rte_gre.h?
> struct gre_hdr_opt_checksum {
> 	rte_be_16_t checksum;
> }
>   
> struct gre_hdr_opt_key {
> 	rte_be_32_t key;
> }
>   
> struct gre_hdr_opt_ sequence {
> 	rte_be_32_t sequence;
> }
> 
> And to add new struct gre_ext defined in rte_flow.h:
> struct gre_ext {
> 	struct rte_gre_hdr hdr;
> 	struct gre_hdr_opt_checkum checksum;
> 	struct rte_hdr_opt_key key;
> 	struct rte_hdr_opt_seq seq;
> };
> 
> And we use struct gre_ext for this new added flow item gre_option.
> 

What about having a struct for 'options' and use in in flow item for options,
like:

struct gre_hdr_opt {
   struct gre_hdr_opt_checkum checksum;
   struct rte_hdr_opt_key key;
   struct rte_hdr_opt_seq seq;
}

struct gre_hdr_ext {
   struct rte_gre_hdr hdr;
   struct gre_hdr_opt;
}

struct rte_flow_item_gre_opt {
   struct gre_hdr_opt hdr;
}

> Correct me if my understanding is not right.
> 
> Thanks,
> Sean
> 
> 


^ permalink raw reply	[relevance 0%]

* RE: [RFC 1/3] ethdev: support GRE optional fields
  2022-01-25 11:37  0%           ` Ferruh Yigit
@ 2022-01-25 13:06  0%             ` Ori Kam
  2022-01-25 14:29  0%               ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Ori Kam @ 2022-01-25 13:06 UTC (permalink / raw)
  To: Ferruh Yigit, Sean Zhang (Networking SW),
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Matan Azrad
  Cc: Andrew Rybchenko, dev

Hi Ferruh,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Subject: Re: [RFC 1/3] ethdev: support GRE optional fields
> 
> On 1/25/2022 9:49 AM, Sean Zhang (Networking SW) wrote:
> > Hi,
> >
> >> -----Original Message-----
> >> From: Ori Kam <orika@nvidia.com>
> >> Sent: Wednesday, January 19, 2022 6:57 PM
> >> To: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> >> Sean Zhang (Networking SW) <xiazhang@nvidia.com>; Matan Azrad
> >> <matan@nvidia.com>; Ferruh Yigit <ferruh.yigit@intel.com>
> >> Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org
> >> Subject: RE: [RFC 1/3] ethdev: support GRE optional fields
> >>
> >> Hi,
> >>
> >>> -----Original Message-----
> >>> From: Thomas Monjalon <thomas@monjalon.net>
> >>> Subject: Re: [RFC 1/3] ethdev: support GRE optional fields
> >>>
> >>> 19/01/2022 10:53, Ferruh Yigit:
> >>>> On 12/30/2021 3:08 AM, Sean Zhang wrote:
> >>>>> --- a/lib/ethdev/rte_flow.h
> >>>>> +++ b/lib/ethdev/rte_flow.h
> >>>>>    /**
> >>>>> + * RTE_FLOW_ITEM_TYPE_GRE_OPTION.
> >>>>> + *
> >>>>> + * Matches GRE optional fields in header.
> >>>>> + */
> >>>>> +struct rte_gre_hdr_option {
> >>>>> +	rte_be16_t checksum;
> >>>>> +	rte_be32_t key;
> >>>>> +	rte_be32_t sequence;
> >>>>> +};
> >>>>> +
> >>>>
> >>>> Hi Ori, Andrew,
> >>>>
> >>>> The decision was to have protocol structs in the net library and
> >>>> flow structs use from there, wasn't it?
> >>>> (Btw, a deprecation notice is still pending to clear some existing
> >>>> ones)
> >>>>
> >>>> So for the GRE optional fields, what about having a struct in the
> >> 'rte_gre.h'?
> >>>> (Also perhaps an GRE extended protocol header can be defined
> >>>> combining 'rte_gre_hdr' and optional fields struct.) Later flow API
> >>>> struct can embed that struct.
> >>>
> >>> +1 for using librte_net.
> >>> This addition in rte_flow looks to be a mistake.
> >>> Please fix the next version.
> >>>
> >> Nice idea,
> >> but my main concern is that the header should have the header is defined.
> >> Since some of the fields are optional this will look something like this:
> >> gre_hdr_option_checksum {
> >> rte_be_16_t checksum;
> >> }
> >>
> >> gre_hdr_option_key {
> >> rte_be_32_t key;
> >> }
> >>
> >> gre_hdr_option_ sequence {
> >> rte_be_32_t sequence;
> >> }
> >>
> >> I don't want to have so many rte_flow_items, Has more and more protocols
> >> have optional data it doesn't make sense to create the item for each.
> >>
> >> If I'm looking at it from an ideal place, I would like that the optional fields will
> >> be part of the original item.
> >> For example in test pmd I would like to write:
> >> Eth / ipv4 / udp / gre flags is key & checksum checksum is yyy key is xxx / end
> >> And not Eth / ipv4 / udp / gre flags is key & checksum / gre_option checksum
> >> is yyy key is xxx / end This means that the structure will look like this:
> >> struct rte_flow_item_gre {
> >> 	union {
> >> 		struct {
> >> 			/**
> >> 		 	* Checksum (1b), reserved 0 (12b), version (3b).
> >> 			 * Refer to RFC 2784.
> >> 			 */
> >> 			rte_be16_t c_rsvd0_ver;
> >> 			rte_be16_t protocol; /**< Protocol type. */
> >> 		}
> >> 		struct rte_gre_hdr hdr
> >> 	}
> >> 	rte_be_16_t checksum;
> >> 	rte_be_32_t key;
> >> 	rte_be_32_t sequence;
> >> };
> >> The main issue with this is that it breaks ABI, Maybe to solve this we can
> >> create a new structure gre_ext?
> >>
> >> In any way I think we should think how we allow adding members to
> >> structures without ABI breakage.
> >>
> >> Best,
> >> Ori
> >
> > Thanks for the comments and suggestion.
> > So the acceptable solution is to have new structs define in rte_gre.h?
> > struct gre_hdr_opt_checksum {
> > 	rte_be_16_t checksum;
> > }
> >
> > struct gre_hdr_opt_key {
> > 	rte_be_32_t key;
> > }
> >
> > struct gre_hdr_opt_ sequence {
> > 	rte_be_32_t sequence;
> > }
> >
> > And to add new struct gre_ext defined in rte_flow.h:
> > struct gre_ext {
> > 	struct rte_gre_hdr hdr;
> > 	struct gre_hdr_opt_checkum checksum;
> > 	struct rte_hdr_opt_key key;
> > 	struct rte_hdr_opt_seq seq;
> > };
> >
> > And we use struct gre_ext for this new added flow item gre_option.
> >
> 
> What about having a struct for 'options' and use in in flow item for options,
> like:
> 
> struct gre_hdr_opt {
>    struct gre_hdr_opt_checkum checksum;
>    struct rte_hdr_opt_key key;
>    struct rte_hdr_opt_seq seq;
> }
> 
> struct gre_hdr_ext {
>    struct rte_gre_hdr hdr;
>    struct gre_hdr_opt;
> }
> 
> struct rte_flow_item_gre_opt {
>    struct gre_hdr_opt hdr;
> }

Fom my understanding the header should reflect structures
as they appear in the spec.

If we look at the spec, from my understanding each of those items is stand-alone.
It is possible to have just key or key and seq or any other combination.
So the struct you suggested is not valid struct in gre header.

If you are O.K with adding such a struct to the gre file I will also be O.K with it.

Best,
Ori
> 
> > Correct me if my understanding is not right.
> >
> > Thanks,
> > Sean
> >
> >


^ permalink raw reply	[relevance 0%]

* Re: [RFC 1/3] ethdev: support GRE optional fields
  2022-01-25 13:06  0%             ` Ori Kam
@ 2022-01-25 14:29  0%               ` Ferruh Yigit
  2022-01-25 16:03  0%                 ` Ori Kam
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2022-01-25 14:29 UTC (permalink / raw)
  To: Ori Kam, Sean Zhang (Networking SW),
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Matan Azrad
  Cc: Andrew Rybchenko, dev

On 1/25/2022 1:06 PM, Ori Kam wrote:
> Hi Ferruh,
> 
>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> Subject: Re: [RFC 1/3] ethdev: support GRE optional fields
>>
>> On 1/25/2022 9:49 AM, Sean Zhang (Networking SW) wrote:
>>> Hi,
>>>
>>>> -----Original Message-----
>>>> From: Ori Kam <orika@nvidia.com>
>>>> Sent: Wednesday, January 19, 2022 6:57 PM
>>>> To: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
>>>> Sean Zhang (Networking SW) <xiazhang@nvidia.com>; Matan Azrad
>>>> <matan@nvidia.com>; Ferruh Yigit <ferruh.yigit@intel.com>
>>>> Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org
>>>> Subject: RE: [RFC 1/3] ethdev: support GRE optional fields
>>>>
>>>> Hi,
>>>>
>>>>> -----Original Message-----
>>>>> From: Thomas Monjalon <thomas@monjalon.net>
>>>>> Subject: Re: [RFC 1/3] ethdev: support GRE optional fields
>>>>>
>>>>> 19/01/2022 10:53, Ferruh Yigit:
>>>>>> On 12/30/2021 3:08 AM, Sean Zhang wrote:
>>>>>>> --- a/lib/ethdev/rte_flow.h
>>>>>>> +++ b/lib/ethdev/rte_flow.h
>>>>>>>     /**
>>>>>>> + * RTE_FLOW_ITEM_TYPE_GRE_OPTION.
>>>>>>> + *
>>>>>>> + * Matches GRE optional fields in header.
>>>>>>> + */
>>>>>>> +struct rte_gre_hdr_option {
>>>>>>> +	rte_be16_t checksum;
>>>>>>> +	rte_be32_t key;
>>>>>>> +	rte_be32_t sequence;
>>>>>>> +};
>>>>>>> +
>>>>>>
>>>>>> Hi Ori, Andrew,
>>>>>>
>>>>>> The decision was to have protocol structs in the net library and
>>>>>> flow structs use from there, wasn't it?
>>>>>> (Btw, a deprecation notice is still pending to clear some existing
>>>>>> ones)
>>>>>>
>>>>>> So for the GRE optional fields, what about having a struct in the
>>>> 'rte_gre.h'?
>>>>>> (Also perhaps an GRE extended protocol header can be defined
>>>>>> combining 'rte_gre_hdr' and optional fields struct.) Later flow API
>>>>>> struct can embed that struct.
>>>>>
>>>>> +1 for using librte_net.
>>>>> This addition in rte_flow looks to be a mistake.
>>>>> Please fix the next version.
>>>>>
>>>> Nice idea,
>>>> but my main concern is that the header should have the header is defined.
>>>> Since some of the fields are optional this will look something like this:
>>>> gre_hdr_option_checksum {
>>>> rte_be_16_t checksum;
>>>> }
>>>>
>>>> gre_hdr_option_key {
>>>> rte_be_32_t key;
>>>> }
>>>>
>>>> gre_hdr_option_ sequence {
>>>> rte_be_32_t sequence;
>>>> }
>>>>
>>>> I don't want to have so many rte_flow_items, Has more and more protocols
>>>> have optional data it doesn't make sense to create the item for each.
>>>>
>>>> If I'm looking at it from an ideal place, I would like that the optional fields will
>>>> be part of the original item.
>>>> For example in test pmd I would like to write:
>>>> Eth / ipv4 / udp / gre flags is key & checksum checksum is yyy key is xxx / end
>>>> And not Eth / ipv4 / udp / gre flags is key & checksum / gre_option checksum
>>>> is yyy key is xxx / end This means that the structure will look like this:
>>>> struct rte_flow_item_gre {
>>>> 	union {
>>>> 		struct {
>>>> 			/**
>>>> 		 	* Checksum (1b), reserved 0 (12b), version (3b).
>>>> 			 * Refer to RFC 2784.
>>>> 			 */
>>>> 			rte_be16_t c_rsvd0_ver;
>>>> 			rte_be16_t protocol; /**< Protocol type. */
>>>> 		}
>>>> 		struct rte_gre_hdr hdr
>>>> 	}
>>>> 	rte_be_16_t checksum;
>>>> 	rte_be_32_t key;
>>>> 	rte_be_32_t sequence;
>>>> };
>>>> The main issue with this is that it breaks ABI, Maybe to solve this we can
>>>> create a new structure gre_ext?
>>>>
>>>> In any way I think we should think how we allow adding members to
>>>> structures without ABI breakage.
>>>>
>>>> Best,
>>>> Ori
>>>
>>> Thanks for the comments and suggestion.
>>> So the acceptable solution is to have new structs define in rte_gre.h?
>>> struct gre_hdr_opt_checksum {
>>> 	rte_be_16_t checksum;
>>> }
>>>
>>> struct gre_hdr_opt_key {
>>> 	rte_be_32_t key;
>>> }
>>>
>>> struct gre_hdr_opt_ sequence {
>>> 	rte_be_32_t sequence;
>>> }
>>>
>>> And to add new struct gre_ext defined in rte_flow.h:
>>> struct gre_ext {
>>> 	struct rte_gre_hdr hdr;
>>> 	struct gre_hdr_opt_checkum checksum;
>>> 	struct rte_hdr_opt_key key;
>>> 	struct rte_hdr_opt_seq seq;
>>> };
>>>
>>> And we use struct gre_ext for this new added flow item gre_option.
>>>
>>
>> What about having a struct for 'options' and use in in flow item for options,
>> like:
>>
>> struct gre_hdr_opt {
>>     struct gre_hdr_opt_checkum checksum;
>>     struct rte_hdr_opt_key key;
>>     struct rte_hdr_opt_seq seq;
>> }
>>
>> struct gre_hdr_ext {
>>     struct rte_gre_hdr hdr;
>>     struct gre_hdr_opt;
>> }
>>
>> struct rte_flow_item_gre_opt {
>>     struct gre_hdr_opt hdr;
>> }
> 
> Fom my understanding the header should reflect structures
> as they appear in the spec.
> 
> If we look at the spec, from my understanding each of those items is stand-alone.
> It is possible to have just key or key and seq or any other combination.
> So the struct you suggested is not valid struct in gre header.
> 

If it is not valid header representation, please forget about it.

But this means initially suggested 'struct gre_ext' is wrong, right?

So should 'rte_flow_item_gre_opt' use separate structs, like:

struct rte_flow_item_gre_opt {
   struct gre_hdr_opt_checkum checksum;
   struct rte_hdr_opt_key key;
   struct rte_hdr_opt_seq seq;
}


> If you are O.K with adding such a struct to the gre file I will also be O.K with it.
> 
> Best,
> Ori
>>
>>> Correct me if my understanding is not right.
>>>
>>> Thanks,
>>> Sean
>>>
>>>
> 


^ permalink raw reply	[relevance 0%]

* RE: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-24 18:08  3%           ` Bruce Richardson
  2022-01-25  1:14  0%             ` Alexander Kozyrev
@ 2022-01-25 15:58  4%             ` Ori Kam
  2022-01-25 18:09  3%               ` Bruce Richardson
  1 sibling, 1 reply; 200+ results
From: Ori Kam @ 2022-01-25 15:58 UTC (permalink / raw)
  To: Bruce Richardson, Jerin Jacob
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	Alexander Kozyrev, dpdk-dev, Ivan Malov, Andrew Rybchenko,
	Ferruh Yigit, mohammad.abdul.awal, Qi Zhang, Jerin Jacob,
	Ajit Khaparde, David Marchand, Olivier Matz, Stephen Hemminger

Hi Bruce,

> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Monday, January 24, 2022 8:09 PM
> Subject: Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
> 
> On Mon, Jan 24, 2022 at 11:16:15PM +0530, Jerin Jacob wrote:
> > On Mon, Jan 24, 2022 at 11:05 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > >
> > > 24/01/2022 15:36, Jerin Jacob:
> > > > On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev <akozyrev@nvidia.com> wrote:
> > > > > +struct rte_flow_port_attr {
> > > > > +       /**
> > > > > +        * Version of the struct layout, should be 0.
> > > > > +        */
> > > > > +       uint32_t version;
> > > >
> > > > Why version number? Across DPDK, we are using dynamic function
> > > > versioning, I think, that would be sufficient for ABI versioning
> > >
> > > Function versioning is not ideal when the structure is accessed
> > > in many places like many drivers and library functions.
> > >
> > > The idea of this version field (which can be a bitfield)
> > > is to update it when some new features are added,
> > > so the users of the struct can check if a feature is there
> > > before trying to use it.
> > > It means a bit more code in the functions, but avoid duplicating functions
> > > as in function versioning.
> > >
> > > Another approach was suggested by Bruce, and applied to dmadev.
> > > It is assuming we only add new fields at the end (no removal),
> > > and focus on the size of the struct.
> > > By passing sizeof as an extra parameter, the function knows
> > > which fields are OK to use.
> > > Example: http://code.dpdk.org/dpdk/v21.11/source/lib/dmadev/rte_dmadev.c#L476
> >
> > + @Richardson, Bruce
> > Either approach is fine, No strong opinion.  We can have one approach
> > and use it across DPDK for consistency.
> >
> 
> In general I prefer the size-based approach, mainly because of its
> simplicity. However, some other reasons why we may want to choose it:
> 
> * It's completely hidden from the end user, and there is no need for an
>   extra struct field that needs to be filled in
> 
> * Related to that, for the version-field approach, if the field is present
>   in a user-allocated struct, then you probably need to start preventing user
>   error via:
>    - having the external struct not have the field and use a separate
>      internal struct to add in the version info after the fact in the
>      versioned function. Alternatively,
>    - provide a separate init function for each structure to fill in the
>      version field appropriately
> 
> * In general, using the size-based approach like in the linked example is
>   more resilient since it's compiler-inserted, so there is reduced chance
>   of error.
> 
> * A sizeof field allows simple-enough handling in the drivers - especially
>   since it does not allow removed fields. Each driver only needs to check
>   that the size passed in is greater than that expected, thereby allowing
>   us to have both updated and non-updated drivers co-existing simultaneously.
>   [For a version field, the same scheme could also work if we keep the
>   no-delete rule, but for a bitmask field, I believe things may get more
>   complex in terms of checking]
> 
> In terms of the limitations of using sizeof - requiring new fields to
> always go on the end, and preventing shrinking the struct - I think that the
> simplicity gains far outweigh the impact of these strictions.
> 
> * Adding fields to struct is far more common than wanting to remove one
> 
> * So long as the added field is at the end, even if the struct size doesn't
>   change the scheme can still work as the versioned function for the old
>   struct can ensure that the extra field is appropriately zeroed (rather than
>   random) on entry into any driver function
> 

Zero can be a valid value so this is may result in an issue.

> * If we do want to remove a field, the space simply needs to be marked as
>   reserved in the struct, until the next ABI break release, when it can be
>   compacted. Again, function versioning can take care of appropriately
>   zeroing this field on return, if necessary.
> 

This means that PMD will have to change just for removal of a field
I would say removal is not allowed.

> My 2c from considering this for the implementation in dmadev. :-)

Some concerns I have about your suggestion:
1. The size of the struct is dependent on the system, for example
Assume this struct 
{
Uint16_t a;
Uint32_t b;
Uint8_t c;
Uint32_t d;
}
Incase of 32 bit machine the size will be 128 bytes, while in 64 machine it will be 96

2. ABI breakage, as far as I know changing size of a struct is ABI breakage, since if 
the application got the size from previous version and for example created array
or allocated memory then using the new structure will result in memory override.

I know that flags/version is not easy since it means creating new 
Structure for each change. I prefer to declare that size can change between
DPDK releases is allowd but as long as we say ABI breakage is forbidden then I don't think your
solution is valid.
And we must go with the version/flags and create new structure for each change.

Best,
Ori
> 
> /Bruce

^ permalink raw reply	[relevance 4%]

* RE: [RFC 1/3] ethdev: support GRE optional fields
  2022-01-25 14:29  0%               ` Ferruh Yigit
@ 2022-01-25 16:03  0%                 ` Ori Kam
  0 siblings, 0 replies; 200+ results
From: Ori Kam @ 2022-01-25 16:03 UTC (permalink / raw)
  To: Ferruh Yigit, Sean Zhang (Networking SW),
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Matan Azrad
  Cc: Andrew Rybchenko, dev

Hi Ferruh,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Tuesday, January 25, 2022 4:29 PM
> Subject: Re: [RFC 1/3] ethdev: support GRE optional fields
> 
> On 1/25/2022 1:06 PM, Ori Kam wrote:
> > Hi Ferruh,
> >
> >> -----Original Message-----
> >> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >> Subject: Re: [RFC 1/3] ethdev: support GRE optional fields
> >>
> >> On 1/25/2022 9:49 AM, Sean Zhang (Networking SW) wrote:
> >>> Hi,
> >>>
> >>>> -----Original Message-----
> >>>> From: Ori Kam <orika@nvidia.com>
> >>>> Sent: Wednesday, January 19, 2022 6:57 PM
> >>>> To: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> >>>> Sean Zhang (Networking SW) <xiazhang@nvidia.com>; Matan Azrad
> >>>> <matan@nvidia.com>; Ferruh Yigit <ferruh.yigit@intel.com>
> >>>> Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org
> >>>> Subject: RE: [RFC 1/3] ethdev: support GRE optional fields
> >>>>
> >>>> Hi,
> >>>>
> >>>>> -----Original Message-----
> >>>>> From: Thomas Monjalon <thomas@monjalon.net>
> >>>>> Subject: Re: [RFC 1/3] ethdev: support GRE optional fields
> >>>>>
> >>>>> 19/01/2022 10:53, Ferruh Yigit:
> >>>>>> On 12/30/2021 3:08 AM, Sean Zhang wrote:
> >>>>>>> --- a/lib/ethdev/rte_flow.h
> >>>>>>> +++ b/lib/ethdev/rte_flow.h
> >>>>>>>     /**
> >>>>>>> + * RTE_FLOW_ITEM_TYPE_GRE_OPTION.
> >>>>>>> + *
> >>>>>>> + * Matches GRE optional fields in header.
> >>>>>>> + */
> >>>>>>> +struct rte_gre_hdr_option {
> >>>>>>> +	rte_be16_t checksum;
> >>>>>>> +	rte_be32_t key;
> >>>>>>> +	rte_be32_t sequence;
> >>>>>>> +};
> >>>>>>> +
> >>>>>>
> >>>>>> Hi Ori, Andrew,
> >>>>>>
> >>>>>> The decision was to have protocol structs in the net library and
> >>>>>> flow structs use from there, wasn't it?
> >>>>>> (Btw, a deprecation notice is still pending to clear some existing
> >>>>>> ones)
> >>>>>>
> >>>>>> So for the GRE optional fields, what about having a struct in the
> >>>> 'rte_gre.h'?
> >>>>>> (Also perhaps an GRE extended protocol header can be defined
> >>>>>> combining 'rte_gre_hdr' and optional fields struct.) Later flow API
> >>>>>> struct can embed that struct.
> >>>>>
> >>>>> +1 for using librte_net.
> >>>>> This addition in rte_flow looks to be a mistake.
> >>>>> Please fix the next version.
> >>>>>
> >>>> Nice idea,
> >>>> but my main concern is that the header should have the header is defined.
> >>>> Since some of the fields are optional this will look something like this:
> >>>> gre_hdr_option_checksum {
> >>>> rte_be_16_t checksum;
> >>>> }
> >>>>
> >>>> gre_hdr_option_key {
> >>>> rte_be_32_t key;
> >>>> }
> >>>>
> >>>> gre_hdr_option_ sequence {
> >>>> rte_be_32_t sequence;
> >>>> }
> >>>>
> >>>> I don't want to have so many rte_flow_items, Has more and more protocols
> >>>> have optional data it doesn't make sense to create the item for each.
> >>>>
> >>>> If I'm looking at it from an ideal place, I would like that the optional fields will
> >>>> be part of the original item.
> >>>> For example in test pmd I would like to write:
> >>>> Eth / ipv4 / udp / gre flags is key & checksum checksum is yyy key is xxx / end
> >>>> And not Eth / ipv4 / udp / gre flags is key & checksum / gre_option checksum
> >>>> is yyy key is xxx / end This means that the structure will look like this:
> >>>> struct rte_flow_item_gre {
> >>>> 	union {
> >>>> 		struct {
> >>>> 			/**
> >>>> 		 	* Checksum (1b), reserved 0 (12b), version (3b).
> >>>> 			 * Refer to RFC 2784.
> >>>> 			 */
> >>>> 			rte_be16_t c_rsvd0_ver;
> >>>> 			rte_be16_t protocol; /**< Protocol type. */
> >>>> 		}
> >>>> 		struct rte_gre_hdr hdr
> >>>> 	}
> >>>> 	rte_be_16_t checksum;
> >>>> 	rte_be_32_t key;
> >>>> 	rte_be_32_t sequence;
> >>>> };
> >>>> The main issue with this is that it breaks ABI, Maybe to solve this we can
> >>>> create a new structure gre_ext?
> >>>>
> >>>> In any way I think we should think how we allow adding members to
> >>>> structures without ABI breakage.
> >>>>
> >>>> Best,
> >>>> Ori
> >>>
> >>> Thanks for the comments and suggestion.
> >>> So the acceptable solution is to have new structs define in rte_gre.h?
> >>> struct gre_hdr_opt_checksum {
> >>> 	rte_be_16_t checksum;
> >>> }
> >>>
> >>> struct gre_hdr_opt_key {
> >>> 	rte_be_32_t key;
> >>> }
> >>>
> >>> struct gre_hdr_opt_ sequence {
> >>> 	rte_be_32_t sequence;
> >>> }
> >>>
> >>> And to add new struct gre_ext defined in rte_flow.h:
> >>> struct gre_ext {
> >>> 	struct rte_gre_hdr hdr;
> >>> 	struct gre_hdr_opt_checkum checksum;
> >>> 	struct rte_hdr_opt_key key;
> >>> 	struct rte_hdr_opt_seq seq;
> >>> };
> >>>
> >>> And we use struct gre_ext for this new added flow item gre_option.
> >>>
> >>
> >> What about having a struct for 'options' and use in in flow item for options,
> >> like:
> >>
> >> struct gre_hdr_opt {
> >>     struct gre_hdr_opt_checkum checksum;
> >>     struct rte_hdr_opt_key key;
> >>     struct rte_hdr_opt_seq seq;
> >> }
> >>
> >> struct gre_hdr_ext {
> >>     struct rte_gre_hdr hdr;
> >>     struct gre_hdr_opt;
> >> }
> >>
> >> struct rte_flow_item_gre_opt {
> >>     struct gre_hdr_opt hdr;
> >> }
> >
> > Fom my understanding the header should reflect structures
> > as they appear in the spec.
> >
> > If we look at the spec, from my understanding each of those items is stand-alone.
> > It is possible to have just key or key and seq or any other combination.
> > So the struct you suggested is not valid struct in gre header.
> >
> 
> If it is not valid header representation, please forget about it.
> 
> But this means initially suggested 'struct gre_ext' is wrong, right?
> 
> So should 'rte_flow_item_gre_opt' use separate structs, like:
> 
> struct rte_flow_item_gre_opt {
>    struct gre_hdr_opt_checkum checksum;
>    struct rte_hdr_opt_key key;
>    struct rte_hdr_opt_seq seq;
> }
> 
Yes this is the last suggestion from Sean, the only difference is that
he created a new item gre_ext that holds the struct that you listed above
and added the gre header. This means that from rte_flow thre is only one GRE item
(the old one can be deprecated) 

Ori
> 
> > If you are O.K with adding such a struct to the gre file I will also be O.K with it.
> >
> > Best,
> > Ori
> >>
> >>> Correct me if my understanding is not right.
> >>>
> >>> Thanks,
> >>> Sean
> >>>
> >>>
> >


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-25 15:58  4%             ` Ori Kam
@ 2022-01-25 18:09  3%               ` Bruce Richardson
  2022-01-25 18:14  3%                 ` Bruce Richardson
  0 siblings, 1 reply; 200+ results
From: Bruce Richardson @ 2022-01-25 18:09 UTC (permalink / raw)
  To: Ori Kam
  Cc: Jerin Jacob, NBU-Contact-Thomas Monjalon (EXTERNAL),
	Alexander Kozyrev, dpdk-dev, Ivan Malov, Andrew Rybchenko,
	Ferruh Yigit, mohammad.abdul.awal, Qi Zhang, Jerin Jacob,
	Ajit Khaparde, David Marchand, Olivier Matz, Stephen Hemminger

On Tue, Jan 25, 2022 at 03:58:45PM +0000, Ori Kam wrote:
> Hi Bruce,
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Monday, January 24, 2022 8:09 PM
> > Subject: Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
> > 
> > On Mon, Jan 24, 2022 at 11:16:15PM +0530, Jerin Jacob wrote:
> > > On Mon, Jan 24, 2022 at 11:05 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > > >
> > > > 24/01/2022 15:36, Jerin Jacob:
> > > > > On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev <akozyrev@nvidia.com> wrote:
> > > > > > +struct rte_flow_port_attr {
> > > > > > +       /**
> > > > > > +        * Version of the struct layout, should be 0.
> > > > > > +        */
> > > > > > +       uint32_t version;
> > > > >
> > > > > Why version number? Across DPDK, we are using dynamic function
> > > > > versioning, I think, that would be sufficient for ABI versioning
> > > >
> > > > Function versioning is not ideal when the structure is accessed
> > > > in many places like many drivers and library functions.
> > > >
> > > > The idea of this version field (which can be a bitfield)
> > > > is to update it when some new features are added,
> > > > so the users of the struct can check if a feature is there
> > > > before trying to use it.
> > > > It means a bit more code in the functions, but avoid duplicating functions
> > > > as in function versioning.
> > > >
> > > > Another approach was suggested by Bruce, and applied to dmadev.
> > > > It is assuming we only add new fields at the end (no removal),
> > > > and focus on the size of the struct.
> > > > By passing sizeof as an extra parameter, the function knows
> > > > which fields are OK to use.
> > > > Example: http://code.dpdk.org/dpdk/v21.11/source/lib/dmadev/rte_dmadev.c#L476
> > >
> > > + @Richardson, Bruce
> > > Either approach is fine, No strong opinion.  We can have one approach
> > > and use it across DPDK for consistency.
> > >
> > 
> > In general I prefer the size-based approach, mainly because of its
> > simplicity. However, some other reasons why we may want to choose it:
> > 
> > * It's completely hidden from the end user, and there is no need for an
> >   extra struct field that needs to be filled in
> > 
> > * Related to that, for the version-field approach, if the field is present
> >   in a user-allocated struct, then you probably need to start preventing user
> >   error via:
> >    - having the external struct not have the field and use a separate
> >      internal struct to add in the version info after the fact in the
> >      versioned function. Alternatively,
> >    - provide a separate init function for each structure to fill in the
> >      version field appropriately
> > 
> > * In general, using the size-based approach like in the linked example is
> >   more resilient since it's compiler-inserted, so there is reduced chance
> >   of error.
> > 
> > * A sizeof field allows simple-enough handling in the drivers - especially
> >   since it does not allow removed fields. Each driver only needs to check
> >   that the size passed in is greater than that expected, thereby allowing
> >   us to have both updated and non-updated drivers co-existing simultaneously.
> >   [For a version field, the same scheme could also work if we keep the
> >   no-delete rule, but for a bitmask field, I believe things may get more
> >   complex in terms of checking]
> > 
> > In terms of the limitations of using sizeof - requiring new fields to
> > always go on the end, and preventing shrinking the struct - I think that the
> > simplicity gains far outweigh the impact of these strictions.
> > 
> > * Adding fields to struct is far more common than wanting to remove one
> > 
> > * So long as the added field is at the end, even if the struct size doesn't
> >   change the scheme can still work as the versioned function for the old
> >   struct can ensure that the extra field is appropriately zeroed (rather than
> >   random) on entry into any driver function
> > 
> 
> Zero can be a valid value so this is may result in an issue.
> 

In this instance, I was using zero as a neutral, default-option value. If
having zero as the default causes problems, we can always make the
structure size change to force a new size value.

> > * If we do want to remove a field, the space simply needs to be marked as
> >   reserved in the struct, until the next ABI break release, when it can be
> >   compacted. Again, function versioning can take care of appropriately
> >   zeroing this field on return, if necessary.
> > 
> 
> This means that PMD will have to change just for removal of a field
> I would say removal is not allowed.
> 
> > My 2c from considering this for the implementation in dmadev. :-)
> 
> Some concerns I have about your suggestion:
> 1. The size of the struct is dependent on the system, for example
> Assume this struct 
> {
> Uint16_t a;
> Uint32_t b;
> Uint8_t c;
> Uint32_t d;
> }
> Incase of 32 bit machine the size will be 128 bytes, while in 64 machine it will be 96

Actually, I believe that in just about every system we support it will be
4x4B i.e. 16 bytes in size. How do you compute 96 or 128 byte sizes? In any
case, the actual size value doesn't matter in practice, since all sizes
should be computed by the compiler using sizeof, rather than hard-coded.

> 
> 2. ABI breakage, as far as I know changing size of a struct is ABI breakage, since if 
> the application got the size from previous version and for example created array
> or allocated memory then using the new structure will result in memory override.
> 
> I know that flags/version is not easy since it means creating new 
> Structure for each change. I prefer to declare that size can change between
> DPDK releases is allowd but as long as we say ABI breakage is forbidden then I don't think your
> solution is valid.
> And we must go with the version/flags and create new structure for each change.
> 

whatever approach is taken for this, I believe we will always need to
create a new structure for the changes. This is because only functions can
be versioned, not structures. The only question therefore becomes how to
pass ABI version information, and therefore by extension structure version
information across a library to driver boundary. This has to be an extra
field somewhere, either in a structure or as a function parameter. I'd
prefer not in the structure as it exposes it to the user. In terms of the
field value, it can either be explicit version info as version number or
version flags, or implicit versioning via "size". Based off the "YAGNI"
principle, I really would prefer just using sizes, as it's far easier to
manage and work with for all concerned, and requires no additional
documentation for the programmer or driver developer to understand.

Regards,
/Bruce

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-25 18:09  3%               ` Bruce Richardson
@ 2022-01-25 18:14  3%                 ` Bruce Richardson
  2022-01-26  9:45  0%                   ` Ori Kam
  0 siblings, 1 reply; 200+ results
From: Bruce Richardson @ 2022-01-25 18:14 UTC (permalink / raw)
  To: Ori Kam
  Cc: Jerin Jacob, NBU-Contact-Thomas Monjalon (EXTERNAL),
	Alexander Kozyrev, dpdk-dev, Ivan Malov, Andrew Rybchenko,
	Ferruh Yigit, mohammad.abdul.awal, Qi Zhang, Jerin Jacob,
	Ajit Khaparde, David Marchand, Olivier Matz, Stephen Hemminger

On Tue, Jan 25, 2022 at 06:09:42PM +0000, Bruce Richardson wrote:
> On Tue, Jan 25, 2022 at 03:58:45PM +0000, Ori Kam wrote:
> > Hi Bruce,
> > 
> > > -----Original Message----- From: Bruce Richardson
> > > <bruce.richardson@intel.com> Sent: Monday, January 24, 2022 8:09 PM
> > > Subject: Re: [PATCH v2 01/10] ethdev: introduce flow
> > > pre-configuration hints
> > > 
> > > On Mon, Jan 24, 2022 at 11:16:15PM +0530, Jerin Jacob wrote:
> > > > On Mon, Jan 24, 2022 at 11:05 PM Thomas Monjalon
> > > > <thomas@monjalon.net> wrote:
> > > > >
> > > > > 24/01/2022 15:36, Jerin Jacob:
> > > > > > On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev
> > > > > > <akozyrev@nvidia.com> wrote:
> > > > > > > +struct rte_flow_port_attr { +       /** +        * Version
> > > > > > > of the struct layout, should be 0.  +        */ +
> > > > > > > uint32_t version;
> > > > > >
> > > > > > Why version number? Across DPDK, we are using dynamic function
> > > > > > versioning, I think, that would be sufficient for ABI
> > > > > > versioning
> > > > >
> > > > > Function versioning is not ideal when the structure is accessed
> > > > > in many places like many drivers and library functions.
> > > > >
> > > > > The idea of this version field (which can be a bitfield) is to
> > > > > update it when some new features are added, so the users of the
> > > > > struct can check if a feature is there before trying to use it.
> > > > > It means a bit more code in the functions, but avoid duplicating
> > > > > functions as in function versioning.
> > > > >
> > > > > Another approach was suggested by Bruce, and applied to dmadev.
> > > > > It is assuming we only add new fields at the end (no removal),
> > > > > and focus on the size of the struct.  By passing sizeof as an
> > > > > extra parameter, the function knows which fields are OK to use.
> > > > > Example:
> > > > > http://code.dpdk.org/dpdk/v21.11/source/lib/dmadev/rte_dmadev.c#L476
> > > >
> > > > + @Richardson, Bruce Either approach is fine, No strong opinion.
> > > > We can have one approach and use it across DPDK for consistency.
> > > >
> > > 
> > > In general I prefer the size-based approach, mainly because of its
> > > simplicity. However, some other reasons why we may want to choose it:
> > > 
> > > * It's completely hidden from the end user, and there is no need for
> > > an extra struct field that needs to be filled in
> > > 
> > > * Related to that, for the version-field approach, if the field is
> > > present in a user-allocated struct, then you probably need to start
> > > preventing user error via: - having the external struct not have the
> > > field and use a separate internal struct to add in the version info
> > > after the fact in the versioned function. Alternatively, - provide a
> > > separate init function for each structure to fill in the version
> > > field appropriately
> > > 
> > > * In general, using the size-based approach like in the linked
> > > example is more resilient since it's compiler-inserted, so there is
> > > reduced chance of error.
> > > 
> > > * A sizeof field allows simple-enough handling in the drivers -
> > > especially since it does not allow removed fields. Each driver only
> > > needs to check that the size passed in is greater than that expected,
> > > thereby allowing us to have both updated and non-updated drivers
> > > co-existing simultaneously.  [For a version field, the same scheme
> > > could also work if we keep the no-delete rule, but for a bitmask
> > > field, I believe things may get more complex in terms of checking]
> > > 
> > > In terms of the limitations of using sizeof - requiring new fields to
> > > always go on the end, and preventing shrinking the struct - I think
> > > that the simplicity gains far outweigh the impact of these
> > > strictions.
> > > 
> > > * Adding fields to struct is far more common than wanting to remove
> > > one
> > > 
> > > * So long as the added field is at the end, even if the struct size
> > > doesn't change the scheme can still work as the versioned function
> > > for the old struct can ensure that the extra field is appropriately
> > > zeroed (rather than random) on entry into any driver function
> > > 
> > 
> > Zero can be a valid value so this is may result in an issue.
> > 
> 
> In this instance, I was using zero as a neutral, default-option value. If
> having zero as the default causes problems, we can always make the
> structure size change to force a new size value.
> 
> > > * If we do want to remove a field, the space simply needs to be
> > > marked as reserved in the struct, until the next ABI break release,
> > > when it can be compacted. Again, function versioning can take care of
> > > appropriately zeroing this field on return, if necessary.
> > > 
> > 
> > This means that PMD will have to change just for removal of a field I
> > would say removal is not allowed.
> > 
> > > My 2c from considering this for the implementation in dmadev. :-)
> > 
> > Some concerns I have about your suggestion: 1. The size of the struct
> > is dependent on the system, for example Assume this struct { Uint16_t
> > a; Uint32_t b; Uint8_t c; Uint32_t d; } Incase of 32 bit machine the
> > size will be 128 bytes, while in 64 machine it will be 96
> 
> Actually, I believe that in just about every system we support it will be
> 4x4B i.e. 16 bytes in size. How do you compute 96 or 128 byte sizes? In
> any case, the actual size value doesn't matter in practice, since all
> sizes should be computed by the compiler using sizeof, rather than
> hard-coded.
> 
> > 
> > 2. ABI breakage, as far as I know changing size of a struct is ABI
> > breakage, since if the application got the size from previous version
> > and for example created array or allocated memory then using the new
> > structure will result in memory override.
> > 
> > I know that flags/version is not easy since it means creating new
> > Structure for each change. I prefer to declare that size can change
> > between DPDK releases is allowd but as long as we say ABI breakage is
> > forbidden then I don't think your solution is valid.  And we must go
> > with the version/flags and create new structure for each change.
> > 
> 
> whatever approach is taken for this, I believe we will always need to
> create a new structure for the changes. This is because only functions
> can be versioned, not structures. The only question therefore becomes how
> to pass ABI version information, and therefore by extension structure
> version information across a library to driver boundary. This has to be
> an extra field somewhere, either in a structure or as a function
> parameter. I'd prefer not in the structure as it exposes it to the user.
> In terms of the field value, it can either be explicit version info as
> version number or version flags, or implicit versioning via "size". Based
> off the "YAGNI" principle, I really would prefer just using sizes, as
> it's far easier to manage and work with for all concerned, and requires
> no additional documentation for the programmer or driver developer to
> understand.
> 
As a third alternative that I would find acceptable, we could also just
take the approach of passing the ABI version explicitly across the function
call i.e. 22 for DPDK_21.11. I'd find this ok too on the basis that it's
largely self explanatory, and can be inserted automatically by the compiler
- again reducing chances of errors. [However, I also believe that using
sizes is still simpler again, which is why it's still my first choice! :-)]

/Bruce

^ permalink raw reply	[relevance 3%]

* RE: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-25 18:14  3%                 ` Bruce Richardson
@ 2022-01-26  9:45  0%                   ` Ori Kam
  2022-01-26 10:52  4%                     ` Bruce Richardson
  0 siblings, 1 reply; 200+ results
From: Ori Kam @ 2022-01-26  9:45 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Jerin Jacob, NBU-Contact-Thomas Monjalon (EXTERNAL),
	Alexander Kozyrev, dpdk-dev, Ivan Malov, Andrew Rybchenko,
	Ferruh Yigit, mohammad.abdul.awal, Qi Zhang, Jerin Jacob,
	Ajit Khaparde, David Marchand, Olivier Matz, Stephen Hemminger



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, January 25, 2022 8:14 PM
> To: Ori Kam <orika@nvidia.com>
> Subject: Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
> 
> On Tue, Jan 25, 2022 at 06:09:42PM +0000, Bruce Richardson wrote:
> > On Tue, Jan 25, 2022 at 03:58:45PM +0000, Ori Kam wrote:
> > > Hi Bruce,
> > >
> > > > -----Original Message----- From: Bruce Richardson
> > > > <bruce.richardson@intel.com> Sent: Monday, January 24, 2022 8:09 PM
> > > > Subject: Re: [PATCH v2 01/10] ethdev: introduce flow
> > > > pre-configuration hints
> > > >
> > > > On Mon, Jan 24, 2022 at 11:16:15PM +0530, Jerin Jacob wrote:
> > > > > On Mon, Jan 24, 2022 at 11:05 PM Thomas Monjalon
> > > > > <thomas@monjalon.net> wrote:
> > > > > >
> > > > > > 24/01/2022 15:36, Jerin Jacob:
> > > > > > > On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev
> > > > > > > <akozyrev@nvidia.com> wrote:
> > > > > > > > +struct rte_flow_port_attr { +       /** +        * Version
> > > > > > > > of the struct layout, should be 0.  +        */ +
> > > > > > > > uint32_t version;
> > > > > > >
> > > > > > > Why version number? Across DPDK, we are using dynamic function
> > > > > > > versioning, I think, that would be sufficient for ABI
> > > > > > > versioning
> > > > > >
> > > > > > Function versioning is not ideal when the structure is accessed
> > > > > > in many places like many drivers and library functions.
> > > > > >
> > > > > > The idea of this version field (which can be a bitfield) is to
> > > > > > update it when some new features are added, so the users of the
> > > > > > struct can check if a feature is there before trying to use it.
> > > > > > It means a bit more code in the functions, but avoid duplicating
> > > > > > functions as in function versioning.
> > > > > >
> > > > > > Another approach was suggested by Bruce, and applied to dmadev.
> > > > > > It is assuming we only add new fields at the end (no removal),
> > > > > > and focus on the size of the struct.  By passing sizeof as an
> > > > > > extra parameter, the function knows which fields are OK to use.
> > > > > > Example:
> > > > > > http://code.dpdk.org/dpdk/v21.11/source/lib/dmadev/rte_dmadev.c#L476
> > > > >
> > > > > + @Richardson, Bruce Either approach is fine, No strong opinion.
> > > > > We can have one approach and use it across DPDK for consistency.
> > > > >
> > > >
> > > > In general I prefer the size-based approach, mainly because of its
> > > > simplicity. However, some other reasons why we may want to choose it:
> > > >
> > > > * It's completely hidden from the end user, and there is no need for
> > > > an extra struct field that needs to be filled in
> > > >
> > > > * Related to that, for the version-field approach, if the field is
> > > > present in a user-allocated struct, then you probably need to start
> > > > preventing user error via: - having the external struct not have the
> > > > field and use a separate internal struct to add in the version info
> > > > after the fact in the versioned function. Alternatively, - provide a
> > > > separate init function for each structure to fill in the version
> > > > field appropriately
> > > >
> > > > * In general, using the size-based approach like in the linked
> > > > example is more resilient since it's compiler-inserted, so there is
> > > > reduced chance of error.
> > > >
> > > > * A sizeof field allows simple-enough handling in the drivers -
> > > > especially since it does not allow removed fields. Each driver only
> > > > needs to check that the size passed in is greater than that expected,
> > > > thereby allowing us to have both updated and non-updated drivers
> > > > co-existing simultaneously.  [For a version field, the same scheme
> > > > could also work if we keep the no-delete rule, but for a bitmask
> > > > field, I believe things may get more complex in terms of checking]
> > > >
> > > > In terms of the limitations of using sizeof - requiring new fields to
> > > > always go on the end, and preventing shrinking the struct - I think
> > > > that the simplicity gains far outweigh the impact of these
> > > > strictions.
> > > >
> > > > * Adding fields to struct is far more common than wanting to remove
> > > > one
> > > >
> > > > * So long as the added field is at the end, even if the struct size
> > > > doesn't change the scheme can still work as the versioned function
> > > > for the old struct can ensure that the extra field is appropriately
> > > > zeroed (rather than random) on entry into any driver function
> > > >
> > >
> > > Zero can be a valid value so this is may result in an issue.
> > >
> >
> > In this instance, I was using zero as a neutral, default-option value. If
> > having zero as the default causes problems, we can always make the
> > structure size change to force a new size value.
> >
> > > > * If we do want to remove a field, the space simply needs to be
> > > > marked as reserved in the struct, until the next ABI break release,
> > > > when it can be compacted. Again, function versioning can take care of
> > > > appropriately zeroing this field on return, if necessary.
> > > >
> > >
> > > This means that PMD will have to change just for removal of a field I
> > > would say removal is not allowed.
> > >
> > > > My 2c from considering this for the implementation in dmadev. :-)
> > >
> > > Some concerns I have about your suggestion: 1. The size of the struct
> > > is dependent on the system, for example Assume this struct { Uint16_t
> > > a; Uint32_t b; Uint8_t c; Uint32_t d; } Incase of 32 bit machine the
> > > size will be 128 bytes, while in 64 machine it will be 96
> >
> > Actually, I believe that in just about every system we support it will be
> > 4x4B i.e. 16 bytes in size. How do you compute 96 or 128 byte sizes? In
> > any case, the actual size value doesn't matter in practice, since all
> > sizes should be computed by the compiler using sizeof, rather than
> > hard-coded.
> >
You are correct my mistake with the numbers.
I still think there might be some issue but I can't think of anything.
So dropping it.

> > >
> > > 2. ABI breakage, as far as I know changing size of a struct is ABI
> > > breakage, since if the application got the size from previous version
> > > and for example created array or allocated memory then using the new
> > > structure will result in memory override.
> > >
> > > I know that flags/version is not easy since it means creating new
> > > Structure for each change. I prefer to declare that size can change
> > > between DPDK releases is allowd but as long as we say ABI breakage is
> > > forbidden then I don't think your solution is valid.  And we must go
> > > with the version/flags and create new structure for each change.
> > >
> >
> > whatever approach is taken for this, I believe we will always need to
> > create a new structure for the changes. This is because only functions
> > can be versioned, not structures. The only question therefore becomes how
> > to pass ABI version information, and therefore by extension structure
> > version information across a library to driver boundary. This has to be
> > an extra field somewhere, either in a structure or as a function
> > parameter. I'd prefer not in the structure as it exposes it to the user.
> > In terms of the field value, it can either be explicit version info as
> > version number or version flags, or implicit versioning via "size". Based
> > off the "YAGNI" principle, I really would prefer just using sizes, as
> > it's far easier to manage and work with for all concerned, and requires
> > no additional documentation for the programmer or driver developer to
> > understand.
> >
> As a third alternative that I would find acceptable, we could also just
> take the approach of passing the ABI version explicitly across the function
> call i.e. 22 for DPDK_21.11. I'd find this ok too on the basis that it's
> largely self explanatory, and can be inserted automatically by the compiler
> - again reducing chances of errors. [However, I also believe that using
> sizes is still simpler again, which is why it's still my first choice! :-)]
> 

Just to make sure I fully understand your suggestion.
We will create new struct for each change.
The function will  stay the same
For example I had the following:

Struct base {
 Uint32_t x;
}

Function (struct base *input)
{
	Inner_func (input, sizeof(struct base))
}

Now I'm adding new member so it will look like this:
Struct new {
 Uint32_t x;
Uint32_t y;
}

When I want to call the function I need to cast
Function((struct base*) new) 

Right?

This means that in both cases the sizeof wil return the same value,
What am I missing?
 
> /Bruce

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-26  9:45  0%                   ` Ori Kam
@ 2022-01-26 10:52  4%                     ` Bruce Richardson
  2022-01-26 11:21  0%                       ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: Bruce Richardson @ 2022-01-26 10:52 UTC (permalink / raw)
  To: Ori Kam
  Cc: Jerin Jacob, NBU-Contact-Thomas Monjalon (EXTERNAL),
	Alexander Kozyrev, dpdk-dev, Ivan Malov, Andrew Rybchenko,
	Ferruh Yigit, mohammad.abdul.awal, Qi Zhang, Jerin Jacob,
	Ajit Khaparde, David Marchand, Olivier Matz, Stephen Hemminger

On Wed, Jan 26, 2022 at 09:45:18AM +0000, Ori Kam wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Tuesday, January 25, 2022 8:14 PM
> > To: Ori Kam <orika@nvidia.com>
> > Subject: Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
> > 
> > On Tue, Jan 25, 2022 at 06:09:42PM +0000, Bruce Richardson wrote:
> > > On Tue, Jan 25, 2022 at 03:58:45PM +0000, Ori Kam wrote:
> > > > Hi Bruce,
> > > >
> > > > > -----Original Message----- From: Bruce Richardson
> > > > > <bruce.richardson@intel.com> Sent: Monday, January 24, 2022 8:09 PM
> > > > > Subject: Re: [PATCH v2 01/10] ethdev: introduce flow
> > > > > pre-configuration hints
> > > > >
> > > > > On Mon, Jan 24, 2022 at 11:16:15PM +0530, Jerin Jacob wrote:
> > > > > > On Mon, Jan 24, 2022 at 11:05 PM Thomas Monjalon
> > > > > > <thomas@monjalon.net> wrote:
> > > > > > >
> > > > > > > 24/01/2022 15:36, Jerin Jacob:
> > > > > > > > On Tue, Jan 18, 2022 at 9:01 PM Alexander Kozyrev
> > > > > > > > <akozyrev@nvidia.com> wrote:
> > > > > > > > > +struct rte_flow_port_attr { +       /** +        * Version
> > > > > > > > > of the struct layout, should be 0.  +        */ +
> > > > > > > > > uint32_t version;
> > > > > > > >
> > > > > > > > Why version number? Across DPDK, we are using dynamic function
> > > > > > > > versioning, I think, that would be sufficient for ABI
> > > > > > > > versioning
> > > > > > >
> > > > > > > Function versioning is not ideal when the structure is accessed
> > > > > > > in many places like many drivers and library functions.
> > > > > > >
> > > > > > > The idea of this version field (which can be a bitfield) is to
> > > > > > > update it when some new features are added, so the users of the
> > > > > > > struct can check if a feature is there before trying to use it.
> > > > > > > It means a bit more code in the functions, but avoid duplicating
> > > > > > > functions as in function versioning.
> > > > > > >
> > > > > > > Another approach was suggested by Bruce, and applied to dmadev.
> > > > > > > It is assuming we only add new fields at the end (no removal),
> > > > > > > and focus on the size of the struct.  By passing sizeof as an
> > > > > > > extra parameter, the function knows which fields are OK to use.
> > > > > > > Example:
> > > > > > > http://code.dpdk.org/dpdk/v21.11/source/lib/dmadev/rte_dmadev.c#L476
> > > > > >
> > > > > > + @Richardson, Bruce Either approach is fine, No strong opinion.
> > > > > > We can have one approach and use it across DPDK for consistency.
> > > > > >
> > > > >
> > > > > In general I prefer the size-based approach, mainly because of its
> > > > > simplicity. However, some other reasons why we may want to choose it:
> > > > >
> > > > > * It's completely hidden from the end user, and there is no need for
> > > > > an extra struct field that needs to be filled in
> > > > >
> > > > > * Related to that, for the version-field approach, if the field is
> > > > > present in a user-allocated struct, then you probably need to start
> > > > > preventing user error via: - having the external struct not have the
> > > > > field and use a separate internal struct to add in the version info
> > > > > after the fact in the versioned function. Alternatively, - provide a
> > > > > separate init function for each structure to fill in the version
> > > > > field appropriately
> > > > >
> > > > > * In general, using the size-based approach like in the linked
> > > > > example is more resilient since it's compiler-inserted, so there is
> > > > > reduced chance of error.
> > > > >
> > > > > * A sizeof field allows simple-enough handling in the drivers -
> > > > > especially since it does not allow removed fields. Each driver only
> > > > > needs to check that the size passed in is greater than that expected,
> > > > > thereby allowing us to have both updated and non-updated drivers
> > > > > co-existing simultaneously.  [For a version field, the same scheme
> > > > > could also work if we keep the no-delete rule, but for a bitmask
> > > > > field, I believe things may get more complex in terms of checking]
> > > > >
> > > > > In terms of the limitations of using sizeof - requiring new fields to
> > > > > always go on the end, and preventing shrinking the struct - I think
> > > > > that the simplicity gains far outweigh the impact of these
> > > > > strictions.
> > > > >
> > > > > * Adding fields to struct is far more common than wanting to remove
> > > > > one
> > > > >
> > > > > * So long as the added field is at the end, even if the struct size
> > > > > doesn't change the scheme can still work as the versioned function
> > > > > for the old struct can ensure that the extra field is appropriately
> > > > > zeroed (rather than random) on entry into any driver function
> > > > >
> > > >
> > > > Zero can be a valid value so this is may result in an issue.
> > > >
> > >
> > > In this instance, I was using zero as a neutral, default-option value. If
> > > having zero as the default causes problems, we can always make the
> > > structure size change to force a new size value.
> > >
> > > > > * If we do want to remove a field, the space simply needs to be
> > > > > marked as reserved in the struct, until the next ABI break release,
> > > > > when it can be compacted. Again, function versioning can take care of
> > > > > appropriately zeroing this field on return, if necessary.
> > > > >
> > > >
> > > > This means that PMD will have to change just for removal of a field I
> > > > would say removal is not allowed.
> > > >
> > > > > My 2c from considering this for the implementation in dmadev. :-)
> > > >
> > > > Some concerns I have about your suggestion: 1. The size of the struct
> > > > is dependent on the system, for example Assume this struct { Uint16_t
> > > > a; Uint32_t b; Uint8_t c; Uint32_t d; } Incase of 32 bit machine the
> > > > size will be 128 bytes, while in 64 machine it will be 96
> > >
> > > Actually, I believe that in just about every system we support it will be
> > > 4x4B i.e. 16 bytes in size. How do you compute 96 or 128 byte sizes? In
> > > any case, the actual size value doesn't matter in practice, since all
> > > sizes should be computed by the compiler using sizeof, rather than
> > > hard-coded.
> > >
> You are correct my mistake with the numbers.
> I still think there might be some issue but I can't think of anything.
> So dropping it.
> 
> > > >
> > > > 2. ABI breakage, as far as I know changing size of a struct is ABI
> > > > breakage, since if the application got the size from previous version
> > > > and for example created array or allocated memory then using the new
> > > > structure will result in memory override.
> > > >
> > > > I know that flags/version is not easy since it means creating new
> > > > Structure for each change. I prefer to declare that size can change
> > > > between DPDK releases is allowd but as long as we say ABI breakage is
> > > > forbidden then I don't think your solution is valid.  And we must go
> > > > with the version/flags and create new structure for each change.
> > > >
> > >
> > > whatever approach is taken for this, I believe we will always need to
> > > create a new structure for the changes. This is because only functions
> > > can be versioned, not structures. The only question therefore becomes how
> > > to pass ABI version information, and therefore by extension structure
> > > version information across a library to driver boundary. This has to be
> > > an extra field somewhere, either in a structure or as a function
> > > parameter. I'd prefer not in the structure as it exposes it to the user.
> > > In terms of the field value, it can either be explicit version info as
> > > version number or version flags, or implicit versioning via "size". Based
> > > off the "YAGNI" principle, I really would prefer just using sizes, as
> > > it's far easier to manage and work with for all concerned, and requires
> > > no additional documentation for the programmer or driver developer to
> > > understand.
> > >
> > As a third alternative that I would find acceptable, we could also just
> > take the approach of passing the ABI version explicitly across the function
> > call i.e. 22 for DPDK_21.11. I'd find this ok too on the basis that it's
> > largely self explanatory, and can be inserted automatically by the compiler
> > - again reducing chances of errors. [However, I also believe that using
> > sizes is still simpler again, which is why it's still my first choice! :-)]
> > 
> 
> Just to make sure I fully understand your suggestion.
> We will create new struct for each change.
> The function will  stay the same
> For example I had the following:
> 
> Struct base {
>  Uint32_t x;
> }
> 
> Function (struct base *input)
> {
> 	Inner_func (input, sizeof(struct base))
> }
> 
> Now I'm adding new member so it will look like this:
> Struct new {
>  Uint32_t x;
> Uint32_t y;
> }
> 
> When I want to call the function I need to cast
> Function((struct base*) new) 
> 
> Right?
> 
> This means that in both cases the sizeof wil return the same value,
> What am I missing?
>

The scenario is as follows. Suppose we have the initial state as below:

struct x_dev_cfg {
   int x;
};

int
x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
{
   struct x_dev *dev = x_devs[id];
   // some setup/config may go here
   return dev->configure(cfg, sizeof(cfg)); // sizeof(cfg) == 4
}

Now, supposing we need to add in a new field into the config structure, a
very common occurance. This will indeed break the ABI, so we need to use
ABI versioning, to ensure that apps passing in the old structure, only call
a function which expects the old structure. Therefore, we need a copy of
the old structure, and a function to work on it. This gives this result:

struct x_dev_cfg {
	int x;
	bool flag; // new field;
};

struct x_dev_cfg_v22 { // needed for ABI-versioned function
	int x;
};

/* this function will only be called by *newly-linked* code, which uses
 * the new structure */
int
x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
{
   struct x_dev *dev = x_devs[id];
   // some setup/config may go here
   return dev->configure(cfg, sizeof(cfg)); // sizeof(cfg) is now 8
}

/* this function is called by apps linked against old version */
int
x_dev_cfg_v22(int dev_id, struct x_dev_cfg_v22 *cfg)
{
   struct x_dev *dev = x_devs[id];
   // some setup/config may go here
   return dev->configure((void *)cfg, sizeof(cfg)); // sizeof(cfg) is still 4
}

With the above library code, we have different functions using the
different structures, so ABI compatibility is preserved - apps passing in a
4-byte struct call a function using the 4-byte struct, while newer apps can
use the 8-byte version.

The final part of the puzzle is then how drivers react to this change.
Originally, all drivers only use "x" in the config structure because that
is all that there is. That will still continue to work fine in the above
case, as both 4-byte and 8-byte structs have the same x value at the same
offset. i.e. no driver updates for x_dev is needed.

On the other hand, if there are drivers that do want/need the new field,
they can also get to use it, but they do need to check for its presence
before they do so, i.e they would work as below:

	if (size_param > struct(x_dev_cfg_v22)) { // or "== struct(x_dev_cfg)"
		// use flags field
	}

Hope this is clear now.

/Bruce

^ permalink raw reply	[relevance 4%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-26 10:52  4%                     ` Bruce Richardson
@ 2022-01-26 11:21  0%                       ` Thomas Monjalon
  2022-01-26 12:19  0%                         ` Ori Kam
  0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-01-26 11:21 UTC (permalink / raw)
  To: Ori Kam, Bruce Richardson
  Cc: Jerin Jacob, Alexander Kozyrev, dpdk-dev, Ivan Malov,
	Andrew Rybchenko, Ferruh Yigit, mohammad.abdul.awal, Qi Zhang,
	Jerin Jacob, Ajit Khaparde, David Marchand, Olivier Matz,
	Stephen Hemminger

26/01/2022 11:52, Bruce Richardson:
> The scenario is as follows. Suppose we have the initial state as below:
> 
> struct x_dev_cfg {
>    int x;
> };
> 
> int
> x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
> {
>    struct x_dev *dev = x_devs[id];
>    // some setup/config may go here
>    return dev->configure(cfg, sizeof(cfg)); // sizeof(cfg) == 4
> }
> 
> Now, supposing we need to add in a new field into the config structure, a
> very common occurance. This will indeed break the ABI, so we need to use
> ABI versioning, to ensure that apps passing in the old structure, only call
> a function which expects the old structure. Therefore, we need a copy of
> the old structure, and a function to work on it. This gives this result:
> 
> struct x_dev_cfg {
> 	int x;
> 	bool flag; // new field;
> };
> 
> struct x_dev_cfg_v22 { // needed for ABI-versioned function
> 	int x;
> };
> 
> /* this function will only be called by *newly-linked* code, which uses
>  * the new structure */
> int
> x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
> {
>    struct x_dev *dev = x_devs[id];
>    // some setup/config may go here
>    return dev->configure(cfg, sizeof(cfg)); // sizeof(cfg) is now 8
> }
> 
> /* this function is called by apps linked against old version */
> int
> x_dev_cfg_v22(int dev_id, struct x_dev_cfg_v22 *cfg)
> {
>    struct x_dev *dev = x_devs[id];
>    // some setup/config may go here
>    return dev->configure((void *)cfg, sizeof(cfg)); // sizeof(cfg) is still 4
> }
> 
> With the above library code, we have different functions using the
> different structures, so ABI compatibility is preserved - apps passing in a
> 4-byte struct call a function using the 4-byte struct, while newer apps can
> use the 8-byte version.
> 
> The final part of the puzzle is then how drivers react to this change.
> Originally, all drivers only use "x" in the config structure because that
> is all that there is. That will still continue to work fine in the above
> case, as both 4-byte and 8-byte structs have the same x value at the same
> offset. i.e. no driver updates for x_dev is needed.
> 
> On the other hand, if there are drivers that do want/need the new field,
> they can also get to use it, but they do need to check for its presence
> before they do so, i.e they would work as below:
> 
> 	if (size_param > struct(x_dev_cfg_v22)) { // or "== struct(x_dev_cfg)"
> 		// use flags field
> 	}
> 
> Hope this is clear now.

Yes, this is the kind of explanation we need in our guideline doc.
Alternatives can be documented as well.
If we can list pros/cons in the doc, it will be easier to choose
the best approach and to explain the choice during code review.




^ permalink raw reply	[relevance 0%]

* RE: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-26 11:21  0%                       ` Thomas Monjalon
@ 2022-01-26 12:19  0%                         ` Ori Kam
  2022-01-26 13:41  0%                           ` Bruce Richardson
  0 siblings, 1 reply; 200+ results
From: Ori Kam @ 2022-01-26 12:19 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon (EXTERNAL), Bruce Richardson
  Cc: Jerin Jacob, Alexander Kozyrev, dpdk-dev, Ivan Malov,
	Andrew Rybchenko, Ferruh Yigit, mohammad.abdul.awal, Qi Zhang,
	Jerin Jacob, Ajit Khaparde, David Marchand, Olivier Matz,
	Stephen Hemminger



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, January 26, 2022 1:22 PM
> Subject: Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
> 
> 26/01/2022 11:52, Bruce Richardson:
> > The scenario is as follows. Suppose we have the initial state as below:
> >
> > struct x_dev_cfg {
> >    int x;
> > };
> >
> > int
> > x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
> > {
> >    struct x_dev *dev = x_devs[id];
> >    // some setup/config may go here
> >    return dev->configure(cfg, sizeof(cfg)); // sizeof(cfg) == 4
> > }
> >
> > Now, supposing we need to add in a new field into the config structure, a
> > very common occurance. This will indeed break the ABI, so we need to use
> > ABI versioning, to ensure that apps passing in the old structure, only call
> > a function which expects the old structure. Therefore, we need a copy of
> > the old structure, and a function to work on it. This gives this result:
> >
> > struct x_dev_cfg {
> > 	int x;
> > 	bool flag; // new field;
> > };
> >
> > struct x_dev_cfg_v22 { // needed for ABI-versioned function
> > 	int x;
> > };
> >
> > /* this function will only be called by *newly-linked* code, which uses
> >  * the new structure */
> > int
> > x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
> > {
> >    struct x_dev *dev = x_devs[id];
> >    // some setup/config may go here
> >    return dev->configure(cfg, sizeof(cfg)); // sizeof(cfg) is now 8
> > }
> >
> > /* this function is called by apps linked against old version */
> > int
> > x_dev_cfg_v22(int dev_id, struct x_dev_cfg_v22 *cfg)
> > {
> >    struct x_dev *dev = x_devs[id];
> >    // some setup/config may go here
> >    return dev->configure((void *)cfg, sizeof(cfg)); // sizeof(cfg) is still 4
> > }
> >
> > With the above library code, we have different functions using the
> > different structures, so ABI compatibility is preserved - apps passing in a
> > 4-byte struct call a function using the 4-byte struct, while newer apps can
> > use the 8-byte version.
> >
> > The final part of the puzzle is then how drivers react to this change.
> > Originally, all drivers only use "x" in the config structure because that
> > is all that there is. That will still continue to work fine in the above
> > case, as both 4-byte and 8-byte structs have the same x value at the same
> > offset. i.e. no driver updates for x_dev is needed.
> >
> > On the other hand, if there are drivers that do want/need the new field,
> > they can also get to use it, but they do need to check for its presence
> > before they do so, i.e they would work as below:
> >
> > 	if (size_param > struct(x_dev_cfg_v22)) { // or "== struct(x_dev_cfg)"
> > 		// use flags field
> > 	}
> >
> > Hope this is clear now.
> 
> Yes, this is the kind of explanation we need in our guideline doc.
> Alternatives can be documented as well.
> If we can list pros/cons in the doc, it will be easier to choose
> the best approach and to explain the choice during code review.
> 
> 
Thanks you very much for the clear explanation.

The draw back is that we need also to duplicate the functions.
Using the flags/version we only need to create new structures
and from application point of view it knows what exta fields it gets.
(I agree that application knowledge has downsides but also advantages)

In the case of flags/version your example will look like this (this is for the record and may other
developers are intrested):

struct x_dev_cfg {  //original struct
	int ver;
	int x;
};
 
struct x_dev_cfg_v2 { // new struct
	int ver;
 	int x;
	bool flag; // new field;
 };


The function is always the same function:
 x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
 {
    struct x_dev *dev = x_devs[id];
    // some setup/config may go here
    return dev->configure(cfg); 
 }

When calling this function with old struct:
X_dev_cfg(id, (struct x_dev_cfg *)cfg)

When calling this function with new struct:
X_dev_cfg(id, (struct x_dev_cfg *)cfg_v2)

In PMD:
If (cfg->ver >= 2)
	// version 2 logic
Else If (cfg->v >=0)
	// base version logic


When using flags it gives even more control since pmd can tell exactly what
features are required.

All options have prons/cons
I vote for the version one.

We can have a poll 😊
Or like Thomas said list pros and cons and each subsystem can
have it own selection.

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-26 12:19  0%                         ` Ori Kam
@ 2022-01-26 13:41  0%                           ` Bruce Richardson
  2022-01-26 15:12  0%                             ` Ori Kam
  0 siblings, 1 reply; 200+ results
From: Bruce Richardson @ 2022-01-26 13:41 UTC (permalink / raw)
  To: Ori Kam
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	Jerin Jacob, Alexander Kozyrev, dpdk-dev, Ivan Malov,
	Andrew Rybchenko, Ferruh Yigit, mohammad.abdul.awal, Qi Zhang,
	Jerin Jacob, Ajit Khaparde, David Marchand, Olivier Matz,
	Stephen Hemminger

On Wed, Jan 26, 2022 at 12:19:43PM +0000, Ori Kam wrote:
> 
> 
> > -----Original Message-----
> > From: Thomas Monjalon <thomas@monjalon.net>
> > Sent: Wednesday, January 26, 2022 1:22 PM
> > Subject: Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
> > 
> > 26/01/2022 11:52, Bruce Richardson:
> > > The scenario is as follows. Suppose we have the initial state as below:
> > >
> > > struct x_dev_cfg {
> > >    int x;
> > > };
> > >
> > > int
> > > x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
> > > {
> > >    struct x_dev *dev = x_devs[id];
> > >    // some setup/config may go here
> > >    return dev->configure(cfg, sizeof(cfg)); // sizeof(cfg) == 4
> > > }
> > >
> > > Now, supposing we need to add in a new field into the config structure, a
> > > very common occurance. This will indeed break the ABI, so we need to use
> > > ABI versioning, to ensure that apps passing in the old structure, only call
> > > a function which expects the old structure. Therefore, we need a copy of
> > > the old structure, and a function to work on it. This gives this result:
> > >
> > > struct x_dev_cfg {
> > > 	int x;
> > > 	bool flag; // new field;
> > > };
> > >
> > > struct x_dev_cfg_v22 { // needed for ABI-versioned function
> > > 	int x;
> > > };
> > >
> > > /* this function will only be called by *newly-linked* code, which uses
> > >  * the new structure */
> > > int
> > > x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
> > > {
> > >    struct x_dev *dev = x_devs[id];
> > >    // some setup/config may go here
> > >    return dev->configure(cfg, sizeof(cfg)); // sizeof(cfg) is now 8
> > > }
> > >
> > > /* this function is called by apps linked against old version */
> > > int
> > > x_dev_cfg_v22(int dev_id, struct x_dev_cfg_v22 *cfg)
> > > {
> > >    struct x_dev *dev = x_devs[id];
> > >    // some setup/config may go here
> > >    return dev->configure((void *)cfg, sizeof(cfg)); // sizeof(cfg) is still 4
> > > }
> > >
> > > With the above library code, we have different functions using the
> > > different structures, so ABI compatibility is preserved - apps passing in a
> > > 4-byte struct call a function using the 4-byte struct, while newer apps can
> > > use the 8-byte version.
> > >
> > > The final part of the puzzle is then how drivers react to this change.
> > > Originally, all drivers only use "x" in the config structure because that
> > > is all that there is. That will still continue to work fine in the above
> > > case, as both 4-byte and 8-byte structs have the same x value at the same
> > > offset. i.e. no driver updates for x_dev is needed.
> > >
> > > On the other hand, if there are drivers that do want/need the new field,
> > > they can also get to use it, but they do need to check for its presence
> > > before they do so, i.e they would work as below:
> > >
> > > 	if (size_param > struct(x_dev_cfg_v22)) { // or "== struct(x_dev_cfg)"
> > > 		// use flags field
> > > 	}
> > >
> > > Hope this is clear now.
> > 
> > Yes, this is the kind of explanation we need in our guideline doc.
> > Alternatives can be documented as well.
> > If we can list pros/cons in the doc, it will be easier to choose
> > the best approach and to explain the choice during code review.
> > 
> > 
> Thanks you very much for the clear explanation.
> 
> The draw back is that we need also to duplicate the functions.
> Using the flags/version we only need to create new structures
> and from application point of view it knows what exta fields it gets.
> (I agree that application knowledge has downsides but also advantages)
> 
> In the case of flags/version your example will look like this (this is for the record and may other
> developers are intrested):
> 
> struct x_dev_cfg {  //original struct
> 	int ver;
> 	int x;
> };
>  
> struct x_dev_cfg_v2 { // new struct
> 	int ver;
>  	int x;
> 	bool flag; // new field;
>  };
> 
> 
> The function is always the same function:
>  x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
>  {
>     struct x_dev *dev = x_devs[id];
>     // some setup/config may go here
>     return dev->configure(cfg); 
>  }
> 
> When calling this function with old struct:
> X_dev_cfg(id, (struct x_dev_cfg *)cfg)
> 
> When calling this function with new struct:
> X_dev_cfg(id, (struct x_dev_cfg *)cfg_v2)
> 
> In PMD:
> If (cfg->ver >= 2)
> 	// version 2 logic
> Else If (cfg->v >=0)
> 	// base version logic
> 
> 
> When using flags it gives even more control since pmd can tell exactly what
> features are required.
> 
> All options have prons/cons
> I vote for the version one.
> 
> We can have a poll 😊
> Or like Thomas said list pros and cons and each subsystem can
> have it own selection.

The biggest issue I have with this version approach is how is the user
meant to know what version number to put into the structure? When the user
upgrades from one version of DPDK to the next, are they manually to update
their version numbers in all their structures? If they don't, they then may
be mistified if they use the newer fields and find that they "don't work"
because they forgot that they need to update the version field to the newer
version at the same time. The reason I prefer the size field is that it is
impossible for the end user to mess things up, and the entirity of the
mechanism is internal, and hidden from the user.

Regards,
/Bruce

^ permalink raw reply	[relevance 0%]

* RE: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  2022-01-26 13:41  0%                           ` Bruce Richardson
@ 2022-01-26 15:12  0%                             ` Ori Kam
  0 siblings, 0 replies; 200+ results
From: Ori Kam @ 2022-01-26 15:12 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	Jerin Jacob, Alexander Kozyrev, dpdk-dev, Ivan Malov,
	Andrew Rybchenko, Ferruh Yigit, mohammad.abdul.awal, Qi Zhang,
	Jerin Jacob, Ajit Khaparde, David Marchand, Olivier Matz,
	Stephen Hemminger



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, January 26, 2022 3:41 PM
> To: Ori Kam <orika@nvidia.com>
> Subject: Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
> 
> On Wed, Jan 26, 2022 at 12:19:43PM +0000, Ori Kam wrote:
> >
> >
> > > -----Original Message-----
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > Sent: Wednesday, January 26, 2022 1:22 PM
> > > Subject: Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
> > >
> > > 26/01/2022 11:52, Bruce Richardson:
> > > > The scenario is as follows. Suppose we have the initial state as below:
> > > >
> > > > struct x_dev_cfg {
> > > >    int x;
> > > > };
> > > >
> > > > int
> > > > x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
> > > > {
> > > >    struct x_dev *dev = x_devs[id];
> > > >    // some setup/config may go here
> > > >    return dev->configure(cfg, sizeof(cfg)); // sizeof(cfg) == 4
> > > > }
> > > >
> > > > Now, supposing we need to add in a new field into the config structure, a
> > > > very common occurance. This will indeed break the ABI, so we need to use
> > > > ABI versioning, to ensure that apps passing in the old structure, only call
> > > > a function which expects the old structure. Therefore, we need a copy of
> > > > the old structure, and a function to work on it. This gives this result:
> > > >
> > > > struct x_dev_cfg {
> > > > 	int x;
> > > > 	bool flag; // new field;
> > > > };
> > > >
> > > > struct x_dev_cfg_v22 { // needed for ABI-versioned function
> > > > 	int x;
> > > > };
> > > >
> > > > /* this function will only be called by *newly-linked* code, which uses
> > > >  * the new structure */
> > > > int
> > > > x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
> > > > {
> > > >    struct x_dev *dev = x_devs[id];
> > > >    // some setup/config may go here
> > > >    return dev->configure(cfg, sizeof(cfg)); // sizeof(cfg) is now 8
> > > > }
> > > >
> > > > /* this function is called by apps linked against old version */
> > > > int
> > > > x_dev_cfg_v22(int dev_id, struct x_dev_cfg_v22 *cfg)
> > > > {
> > > >    struct x_dev *dev = x_devs[id];
> > > >    // some setup/config may go here
> > > >    return dev->configure((void *)cfg, sizeof(cfg)); // sizeof(cfg) is still 4
> > > > }
> > > >
> > > > With the above library code, we have different functions using the
> > > > different structures, so ABI compatibility is preserved - apps passing in a
> > > > 4-byte struct call a function using the 4-byte struct, while newer apps can
> > > > use the 8-byte version.
> > > >
> > > > The final part of the puzzle is then how drivers react to this change.
> > > > Originally, all drivers only use "x" in the config structure because that
> > > > is all that there is. That will still continue to work fine in the above
> > > > case, as both 4-byte and 8-byte structs have the same x value at the same
> > > > offset. i.e. no driver updates for x_dev is needed.
> > > >
> > > > On the other hand, if there are drivers that do want/need the new field,
> > > > they can also get to use it, but they do need to check for its presence
> > > > before they do so, i.e they would work as below:
> > > >
> > > > 	if (size_param > struct(x_dev_cfg_v22)) { // or "== struct(x_dev_cfg)"
> > > > 		// use flags field
> > > > 	}
> > > >
> > > > Hope this is clear now.
> > >
> > > Yes, this is the kind of explanation we need in our guideline doc.
> > > Alternatives can be documented as well.
> > > If we can list pros/cons in the doc, it will be easier to choose
> > > the best approach and to explain the choice during code review.
> > >
> > >
> > Thanks you very much for the clear explanation.
> >
> > The draw back is that we need also to duplicate the functions.
> > Using the flags/version we only need to create new structures
> > and from application point of view it knows what exta fields it gets.
> > (I agree that application knowledge has downsides but also advantages)
> >
> > In the case of flags/version your example will look like this (this is for the record and may other
> > developers are intrested):
> >
> > struct x_dev_cfg {  //original struct
> > 	int ver;
> > 	int x;
> > };
> >
> > struct x_dev_cfg_v2 { // new struct
> > 	int ver;
> >  	int x;
> > 	bool flag; // new field;
> >  };
> >
> >
> > The function is always the same function:
> >  x_dev_cfg(int dev_id, struct x_dev_cfg *cfg)
> >  {
> >     struct x_dev *dev = x_devs[id];
> >     // some setup/config may go here
> >     return dev->configure(cfg);
> >  }
> >
> > When calling this function with old struct:
> > X_dev_cfg(id, (struct x_dev_cfg *)cfg)
> >
> > When calling this function with new struct:
> > X_dev_cfg(id, (struct x_dev_cfg *)cfg_v2)
> >
> > In PMD:
> > If (cfg->ver >= 2)
> > 	// version 2 logic
> > Else If (cfg->v >=0)
> > 	// base version logic
> >
> >
> > When using flags it gives even more control since pmd can tell exactly what
> > features are required.
> >
> > All options have prons/cons
> > I vote for the version one.
> >
> > We can have a poll 😊
> > Or like Thomas said list pros and cons and each subsystem can
> > have it own selection.
> 
> The biggest issue I have with this version approach is how is the user
> meant to know what version number to put into the structure? When the user
> upgrades from one version of DPDK to the next, are they manually to update
> their version numbers in all their structures? If they don't, they then may
> be mistified if they use the newer fields and find that they "don't work"
> because they forgot that they need to update the version field to the newer
> version at the same time. The reason I prefer the size field is that it is
> impossible for the end user to mess things up, and the entirity of the
> mechanism is internal, and hidden from the user.
> 

The solution is simple when you define new struct in the struct you write what
should be the version number.
You can also define that 0 is the latest one, so application that are are writing code which
is size agnostic will just set 0 all the time.

 
> Regards,
> /Bruce

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints
  @ 2022-01-27  9:34  3%               ` Jerin Jacob
  0 siblings, 0 replies; 200+ results
From: Jerin Jacob @ 2022-01-27  9:34 UTC (permalink / raw)
  To: Alexander Kozyrev
  Cc: Ajit Khaparde, dpdk-dev, Ori Kam,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ivan Malov, Andrew Rybchenko, Ferruh Yigit, mohammad.abdul.awal,
	Qi Zhang, Jerin Jacob

On Thu, Jan 27, 2022 at 3:32 AM Alexander Kozyrev <akozyrev@nvidia.com> wrote:
>
> On Tuesday, January 25, 2022 13:44 Jerin Jacob <jerinjacobk@gmail.com> wrote:
> > On Tue, Jan 25, 2022 at 6:58 AM Alexander Kozyrev <akozyrev@nvidia.com>
> > wrote:
> > >
> > > On Monday, January 24, 2022 12:41 Ajit Khaparde
> > <ajit.khaparde@broadcom.com> wrote:
> > > > On Mon, Jan 24, 2022 at 6:37 AM Jerin Jacob <jerinjacobk@gmail.com>
> > > > wrote:
> > > > >
> >
> > > Ok, I'll adopt this wording in the v3.
> > >
> > > > > > + *
> > > > > > + * @param port_id
> > > > > > + *   Port identifier of Ethernet device.
> > > > > > + * @param[in] port_attr
> > > > > > + *   Port configuration attributes.
> > > > > > + * @param[out] error
> > > > > > + *   Perform verbose error reporting if not NULL.
> > > > > > + *   PMDs initialize this structure in case of error only.
> > > > > > + *
> > > > > > + * @return
> > > > > > + *   0 on success, a negative errno value otherwise and rte_errno is
> > set.
> > > > > > + */
> > > > > > +__rte_experimental
> > > > > > +int
> > > > > > +rte_flow_configure(uint16_t port_id,
> > > > >
> > > > > Should we couple, setting resource limit hint to configure function as
> > > > > if we add future items in
> > > > > configuration, we may pain to manage all state. Instead how about,
> > > > > rte_flow_resource_reserve_hint_set()?
> > > > +1
> > > Port attributes are the hints, PMD can safely ignore anything that is not
> > supported/deemed unreasonable.
> > > Having several functions to call instead of one configuration function seems
> > like a burden to me.
> >
> > If we add a lot of features which has different state it will be
> > difficult to manage.
> > Since it is the slow path and OPTIONAL API. IMO, it should be fine to
> > have a separate API for a specific purpose
> > to have a clean interface.
>
> This approach contradicts to the DPDK way of configuring devices.
> It you look at the rte_eth_dev_configure or rte_eth_rx_queue_setup API
> you will see that the configuration is propagated via config structures.
> I would like to conform to this approach with my new API as well.

There is a subtle difference,  those are mandatory APIs. i,e application must
call those API to use the subsequent APIs.

I am OK with introducing rte_flow_configure() for such use cases.
Probably, we can add these parameters in rte_flow_configure() for the
new features.
And make it mandatory API for the next ABI to avoid application breakage.

Also, please change git commit to the description for adding  the
configure state
for rte_flow API.

BTW: Your Queue patch[3/3] probably needs to add the nb_queue
parameter to configure.
So the driver knows, the number queue needed upfront like the ethdev API scheme.


>
> Another question is how to deal with interdependencies with separate hints?
> There could be some resources that requires other resources to be present.
> Or one resource shares the hardware registers with another one and needs to
> be accounted for. That is not easy to do with separate function calls.

I got the use case now.

>
> > >
> > > >
> > > > >
> > > > >
> > > > > > +                  const struct rte_flow_port_attr *port_attr,
> > > > > > +                  struct rte_flow_error *error);
> > > > >
> > > > > I think, we should have _get function to get those limit numbers
> > otherwise,
> > > > > we can not write portable applications as the return value is  kind of
> > > > > boolean now if
> > > > > don't define exact values for rte_errno for reasons.
> > > > +1
> > > We had this discussion in RFC. The limits will vary from NIC to NIC and from
> > system to
> > > system, depending on hardware capabilities and amount of free memory
> > for example.
> > > It is easier to reject a configuration with a clear error description as we do
> > for flow creation.
> >
> > In that case, we can return a "defined" return value or "defined"
> > errno to capture this case so that
> > the application can make forward progress to differentiate between API
> > failed vs dont having enough resources
> > and move on.
>
> I think you are right and it will be useful to provide some hardware capabilities.
> I'll add something like rte_flow_info_get() to obtain available flow rule resources.

Ack.

^ permalink raw reply	[relevance 3%]

* RE: [PATCH v3] mempool: fix put objects to mempool with cache
  2022-01-24 15:39  3%   ` Olivier Matz
@ 2022-01-28  9:37  0%     ` Morten Brørup
  0 siblings, 0 replies; 200+ results
From: Morten Brørup @ 2022-01-28  9:37 UTC (permalink / raw)
  To: Olivier Matz; +Cc: andrew.rybchenko, bruce.richardson, jerinjacobk, dev

> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Monday, 24 January 2022 16.39
> 
> Hi Morten,
> 
> On Wed, Jan 19, 2022 at 04:03:01PM +0100, Morten Brørup wrote:
> > mempool: fix put objects to mempool with cache
> >
> > This patch optimizes the rte_mempool_do_generic_put() caching
> algorithm,
> > and fixes a bug in it.
> 
> I think we should avoid grouping fixes and optimizations in one
> patch. The main reason is that fixes aims to be backported, which
> is not the case of optimizations.

OK. I'll separate them.

> 
> > The existing algorithm was:
> >  1. Add the objects to the cache
> >  2. Anything greater than the cache size (if it crosses the cache
> flush
> >     threshold) is flushed to the ring.
> >
> > Please note that the description in the source code said that it kept
> > "cache min value" objects after flushing, but the function actually
> kept
> > "size" objects, which is reflected in the above description.
> >
> > Now, the algorithm is:
> >  1. If the objects cannot be added to the cache without crossing the
> >     flush threshold, flush the cache to the ring.
> >  2. Add the objects to the cache.
> >
> > This patch changes these details:
> >
> > 1. Bug: The cache was still full after flushing.
> > In the opposite direction, i.e. when getting objects from the cache,
> the
> > cache is refilled to full level when it crosses the low watermark
> (which
> > happens to be zero).
> > Similarly, the cache should be flushed to empty level when it crosses
> > the high watermark (which happens to be 1.5 x the size of the cache).
> > The existing flushing behaviour was suboptimal for real applications,
> > because crossing the low or high watermark typically happens when the
> > application is in a state where the number of put/get events are out
> of
> > balance, e.g. when absorbing a burst of packets into a QoS queue
> > (getting more mbufs from the mempool), or when a burst of packets is
> > trickling out from the QoS queue (putting the mbufs back into the
> > mempool).
> > NB: When the application is in a state where put/get events are in
> > balance, the cache should remain within its low and high watermarks,
> and
> > the algorithms for refilling/flushing the cache should not come into
> > play.
> > Now, the mempool cache is completely flushed when crossing the flush
> > threshold, so only the newly put (hot) objects remain in the mempool
> > cache afterwards.
> 
> I'm not sure we should call this behavior a bug. What is the impact
> on applications, from a user perspective? Can it break a use-case, or
> have an important performance impact?

It doesn't break anything.

But it doesn't behave as intended (according to its description in the source code), so I do consider it a bug! Any professional tester, when seeing an implementation that doesn't do what is intended, would also flag the implementation as faulty.

It has a performance impact: It causes many more mempool cache flushes than was intended. I have elaborated by an example here: http://inbox.dpdk.org/dev/98CBD80474FA8B44BF855DF32C47DC35D86E54@smartserver.smartshare.dk/T/#t

> 
> 
> > 2. Minor bug: The flush threshold comparison has been corrected; it
> must
> > be "len > flushthresh", not "len >= flushthresh".
> > Reasoning: Consider a flush multiplier of 1 instead of 1.5; the cache
> > would be flushed already when reaching size elements, not when
> exceeding
> > size elements.
> > Now, flushing is triggered when the flush threshold is exceeded, not
> > when reached.
> 
> Same here, we should ask ourselves what is the impact before calling
> it a bug.

It's a classic off-by-one bug.

It only impacts performance, causing premature mempool cache flushing.

Referring to my example in the RFC discussion, this bug causes flushing every 3rd application put() instead of every 4th.

> 
> 
> > 3. Optimization: The most recent (hot) objects are flushed, leaving
> the
> > oldest (cold) objects in the mempool cache.
> > This is bad for CPUs with a small L1 cache, because when they get
> > objects from the mempool after the mempool cache has been flushed,
> they
> > get cold objects instead of hot objects.
> > Now, the existing (cold) objects in the mempool cache are flushed
> before
> > the new (hot) objects are added the to the mempool cache.
> >
> > 4. Optimization: Using the x86 variant of rte_memcpy() is inefficient
> > here, where n is relatively small and unknown at compile time.
> > Now, it has been replaced by an alternative copying method, optimized
> > for the fact that most Ethernet PMDs operate in bursts of 4 or 8
> mbufs
> > or multiples thereof.
> 
> For these optimizations, do you have an idea of what is the performance
> gain? Ideally (I understand it is not always possible), each
> optimization
> is done separately, and its impact is measured.

Regarding 3: I don't have access to hardware with a CPU with small L1 cache. But the algorithm was structurally wrong, so I think it should be fixed. Not working with such hardware ourselves, I labeled it an "optimization"... if the patch came from someone with affected hardware, it could reasonably had been labeled a "bug fix".

Regarding 4: I'll stick with rte_memcpy() in the "fix" patch, and provide a separate optimization patch with performance information.

> 
> 
> > v2 changes:
> >
> > - Not adding the new objects to the mempool cache before flushing it
> > also allows the memory allocated for the mempool cache to be reduced
> > from 3 x to 2 x RTE_MEMPOOL_CACHE_MAX_SIZE.
> > However, such this change would break the ABI, so it was removed in
> v2.
> >
> > - The mempool cache should be cache line aligned for the benefit of
> the
> > copying method, which on some CPU architectures performs worse on
> data
> > crossing a cache boundary.
> > However, such this change would break the ABI, so it was removed in
> v2;
> > and yet another alternative copying method replaced the rte_memcpy().
> 
> OK, we may want to keep this in mind for the next abi breakage.

Sounds good.

> 
> 
> >
> > v3 changes:
> >
> > - Actually remove my modifications of the rte_mempool_cache
> structure.
> >
> > Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> > ---
> >  lib/mempool/rte_mempool.h | 51 +++++++++++++++++++++++++++++--------
> --
> >  1 file changed, 38 insertions(+), 13 deletions(-)
> >
> > diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
> > index 1e7a3c1527..7b364cfc74 100644
> > --- a/lib/mempool/rte_mempool.h
> > +++ b/lib/mempool/rte_mempool.h
> > @@ -1334,6 +1334,7 @@ static __rte_always_inline void
> >  rte_mempool_do_generic_put(struct rte_mempool *mp, void * const
> *obj_table,
> >  			   unsigned int n, struct rte_mempool_cache *cache)
> >  {
> > +	uint32_t index;
> >  	void **cache_objs;
> >
> >  	/* increment stat now, adding in mempool always success */
> > @@ -1344,31 +1345,56 @@ rte_mempool_do_generic_put(struct rte_mempool
> *mp, void * const *obj_table,
> >  	if (unlikely(cache == NULL || n > RTE_MEMPOOL_CACHE_MAX_SIZE))
> >  		goto ring_enqueue;
> >
> > -	cache_objs = &cache->objs[cache->len];
> > +	/* If the request itself is too big for the cache */
> > +	if (unlikely(n > cache->flushthresh))
> > +		goto ring_enqueue;
> >
> >  	/*
> >  	 * The cache follows the following algorithm
> > -	 *   1. Add the objects to the cache
> > -	 *   2. Anything greater than the cache min value (if it crosses
> the
> > -	 *   cache flush threshold) is flushed to the ring.
> > +	 *   1. If the objects cannot be added to the cache without
> > +	 *   crossing the flush threshold, flush the cache to the ring.
> > +	 *   2. Add the objects to the cache.
> >  	 */
> >
> > -	/* Add elements back into the cache */
> > -	rte_memcpy(&cache_objs[0], obj_table, sizeof(void *) * n);
> > +	if (cache->len + n <= cache->flushthresh) {
> > +		cache_objs = &cache->objs[cache->len];
> >
> > -	cache->len += n;
> > +		cache->len += n;
> > +	} else {
> > +		cache_objs = cache->objs;
> >
> > -	if (cache->len >= cache->flushthresh) {
> > -		rte_mempool_ops_enqueue_bulk(mp, &cache->objs[cache->size],
> > -				cache->len - cache->size);
> > -		cache->len = cache->size;
> > +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
> > +		if (rte_mempool_ops_enqueue_bulk(mp, cache_objs, cache-
> >len) < 0)
> > +			rte_panic("cannot put objects in mempool\n");
> > +#else
> > +		rte_mempool_ops_enqueue_bulk(mp, cache_objs, cache->len);
> > +#endif
> > +		cache->len = n;
> > +	}
> > +
> > +	/* Add the objects to the cache. */
> > +	for (index = 0; index < (n & ~0x3); index += 4) {
> > +		cache_objs[index] = obj_table[index];
> > +		cache_objs[index + 1] = obj_table[index + 1];
> > +		cache_objs[index + 2] = obj_table[index + 2];
> > +		cache_objs[index + 3] = obj_table[index + 3];
> > +	}
> > +	switch (n & 0x3) {
> > +	case 3:
> > +		cache_objs[index] = obj_table[index];
> > +		index++; /* fallthrough */
> > +	case 2:
> > +		cache_objs[index] = obj_table[index];
> > +		index++; /* fallthrough */
> > +	case 1:
> > +		cache_objs[index] = obj_table[index];
> >  	}
> >
> >  	return;
> >
> >  ring_enqueue:
> >
> > -	/* push remaining objects in ring */
> > +	/* Put the objects into the ring */
> >  #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
> >  	if (rte_mempool_ops_enqueue_bulk(mp, obj_table, n) < 0)
> >  		rte_panic("cannot put objects in mempool\n");
> > @@ -1377,7 +1403,6 @@ rte_mempool_do_generic_put(struct rte_mempool
> *mp, void * const *obj_table,
> >  #endif
> >  }
> >
> > -
> >  /**
> >   * Put several objects back in the mempool.
> >   *
> > --
> > 2.17.1
> >


^ permalink raw reply	[relevance 0%]

* [PATCH v3 0/4] ethdev: introduce IP reassembly offload
  @ 2022-01-30 17:59  4% ` Akhil Goyal
                       ` (2 more replies)
  0 siblings, 3 replies; 200+ results
From: Akhil Goyal @ 2022-01-30 17:59 UTC (permalink / raw)
  To: dev
  Cc: anoobj, matan, konstantin.ananyev, thomas, ferruh.yigit,
	andrew.rybchenko, rosen.xu, jerinj, stephen, mdr, Akhil Goyal

As discussed in the RFC[1] sent in 21.11, a new offload is
introduced in ethdev for IP reassembly.

This patchset add the IP reassembly RX offload.
Currently, the offload is tested along with inline IPsec processing.
It can also be updated as a standalone offload without IPsec, if there
are some hardware available to test it.
The patchset is tested on cnxk platform. The driver implementation
and a test app are added as separate patchsets.

[1]: http://patches.dpdk.org/project/dpdk/patch/20210823100259.1619886-1-gakhil@marvell.com/

changes in v3:
- incorporated comments from Andrew and Stephen Hemminger

changes in v2:
- added abi ignore exceptions for modifications in reserved fields.
  Added a crude way to subside the rte_security and rte_ipsec ABI issue.
  Please suggest a better way.
- incorporated Konstantin's comment for extra checks in new API
  introduced.
- converted static mbuf ol_flag to mbuf dynflag (Konstantin)
- added a get API for reassembly configuration (Konstantin)
- Fixed checkpatch issues.
- Dynfield is NOT split into 2 parts as it would cause an extra fetch in
  case of IP reassembly failure.
- Application patches are split into a separate series.


Akhil Goyal (4):
  ethdev: introduce IP reassembly offload
  ethdev: add dev op to set/get IP reassembly configuration
  ethdev: add mbuf dynfield for incomplete IP reassembly
  security: add IPsec option for IP reassembly

 devtools/libabigail.abignore |  19 ++++++
 doc/guides/nics/features.rst |  12 ++++
 lib/ethdev/ethdev_driver.h   |  45 +++++++++++++++
 lib/ethdev/rte_ethdev.c      | 109 +++++++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev.h      | 100 +++++++++++++++++++++++++++++++-
 lib/ethdev/version.map       |   5 ++
 lib/security/rte_security.h  |  12 +++-
 7 files changed, 300 insertions(+), 2 deletions(-)

-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* [PATCH v5] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if.
  2022-01-23 21:20  8%     ` [PATCH v4] " Michael Barker
  2022-01-25 10:33  0%       ` Ray Kinsella
@ 2022-01-31  0:05  8%       ` Michael Barker
  2022-02-12 14:00  0%         ` Thomas Monjalon
  1 sibling, 1 reply; 200+ results
From: Michael Barker @ 2022-01-31  0:05 UTC (permalink / raw)
  To: dev; +Cc: Michael Barker, Ray Kinsella

When compiling with clang using -Wpedantic (or -Wgcc-compat) the use of
diagnose_if kicks up a warning:

.../include/rte_interrupts.h:623:1: error: 'diagnose_if' is a clang
extension [-Werror,-Wgcc-compat]
__rte_internal
^
.../include/rte_compat.h:36:16: note: expanded from macro '__rte_internal'
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \

This change ignores the '-Wgcc-compat' warning in the specific location
where the warning occurs.  It is safe to do in this circumstance as the
specific macro is only defined when using the clang compiler.

Signed-off-by: Michael Barker <mikeb01@gmail.com>
---
 lib/eal/include/rte_compat.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/eal/include/rte_compat.h b/lib/eal/include/rte_compat.h
index 2718612cce..9556bbf4d0 100644
--- a/lib/eal/include/rte_compat.h
+++ b/lib/eal/include/rte_compat.h
@@ -33,8 +33,11 @@ section(".text.internal")))
 #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */
 
 #define __rte_internal \
+_Pragma("GCC diagnostic push") \
+_Pragma("GCC diagnostic ignored \"-Wgcc-compat\"") \
 __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
-section(".text.internal")))
+section(".text.internal"))) \
+_Pragma("GCC diagnostic pop")
 
 #else
 
-- 
2.25.1


^ permalink raw reply	[relevance 8%]

* Minutes of tech-board meeting: 2022-01-26
@ 2022-02-01  9:18  3% Richardson, Bruce
  0 siblings, 0 replies; 200+ results
From: Richardson, Bruce @ 2022-02-01  9:18 UTC (permalink / raw)
  To: dev; +Cc: techboard

Tech Board Attendees:
    Bruce, Aaron, Ferruh, Jerin, Maxime, Thomas, Kevin, Konstantin, Olivier, Stephen, Honnappa, Hemant

Agenda Items
--------------
* Tech writer
    * No updates on this
    * Getting new program manager from LF - may need to remind on hiring Tech writer.
 
* UNH Statement of Work
   * Needs to be closed out for 2022
   * Final call for items list for UNH for coming weeks
   * After this week, going to gov board
   * For suggested items, either email to Aaron or add directly to doc.
   * There will be review - Techboard to review once doc is cleaned up a bit.
   * Current version: https://docs.google.com/document/d/1l38GZwaMuIu8hq3kMjoAHDU_LanXXTt-LYS4y7Sv4t8/edit

* GPL license files in DTS
    * Working on changing license headers for files in DTS (to SPDX tags)
    * Some files missing headers - will be added
    * 4 - 5 files missing GPL license. These files will not be linked into applications
    * Files should be reviewed and checked /approved for exceptions
    * Action: Create license directory/files in DTS which will be merged into main DPDK license files once merge of DTS and DPDK is done.
    * Action: For GPL scripts, refer through gov board for advice re python scripts included in other scripts.

* L3fwd in testpmd
  * Reviewed previous decision. 
  * Confirmed nothing to be done, not to be considered for this release. Patches deferred in patchwork.

* Events 
   - decisions on events no longer being planned by separate marketing committe
   - Tech board input is required in event planning from now on.
   - in-person event is planned for Europe (Userspace 2022).
   - provisionnally planned for Bordeaux, most likely in mid-September (2nd week)

* Traffic Gen 
   - previous discussion incomplete
   - consider revisiting next time if Harry can attend


Items Noted for Reference:
--------------------------
FYI: perf thread example is now removed from repository.
FYI: ICC support is broken on next-net. May need to drop support completely. Ferruh tracking.
FYI: Discussion on ABI versioning of structs passed from libs to drivers, e.g. ethdev to net drivers
  Ref: http://inbox.dpdk.org/dev/CALBAE1Po3-7KUN+WecJRDjbbYDi40mPRmVf8YTaFDyDPj-WnGQ@mail.gmail.com/T/#m2371800d0b6848b76c8666dd771de66544ebdd3a
  

^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  @ 2022-02-01 12:52  3%     ` Ferruh Yigit
  2022-02-02 11:44  0%       ` Ray Kinsella
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2022-02-01 12:52 UTC (permalink / raw)
  To: Kalesh A P, dev
  Cc: ajit.khaparde, asafp, David Marchand, Ray Kinsella,
	Thomas Monjalon, Andrew Rybchenko

On 1/28/2022 12:48 PM, Kalesh A P wrote:
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> 
> Adding support for the device reset and recovery events in the
> rte_eth_event framework. FW error and FW reset conditions would be
> managed internally by the PMD without needing application intervention.
> In such cases, PMD would need reset/recovery events to notify application
> that PMD is undergoing a reset.
> 
> While most of the recovery process is transparent to the application since
> most of the driver ensures recovery from FW reset or FW error conditions,
> the application will have to reprogram any flows which were offloaded to
> the underlying hardware.
> 
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>   doc/guides/prog_guide/poll_mode_drv.rst | 24 ++++++++++++++++++++++++
>   lib/ethdev/rte_ethdev.h                 | 18 ++++++++++++++++++
>   2 files changed, 42 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst
> index 6831289..9ecc0e4 100644
> --- a/doc/guides/prog_guide/poll_mode_drv.rst
> +++ b/doc/guides/prog_guide/poll_mode_drv.rst
> @@ -623,3 +623,27 @@ by application.
>   The PMD itself should not call rte_eth_dev_reset(). The PMD can trigger
>   the application to handle reset event. It is duty of application to
>   handle all synchronization before it calls rte_eth_dev_reset().
> +
> +Error recovery support
> +~~~~~~~~~~~~~~~~~~~~~~
> +
> +When the PMD detects a FW reset or error condition, it may try to recover
> +from the error without needing the application intervention. In such cases,
> +PMD would need events to notify the application that it is undergoing
> +an error recovery.
> +
> +The PMD should trigger RTE_ETH_EVENT_ERR_RECOVERING event to notify the
> +application that PMD detected a FW reset or FW error condition. PMD may
> +try to recover from the error by itself. Data path may be quiesced and
> +control path operations may fail during the recovery period. The application
> +should stop polling till it receives RTE_ETH_EVENT_RECOVERED event from the PMD.
> +
> +The PMD should trigger RTE_ETH_EVENT_RECOVERED event to notify the application
> +that the it has recovered from the error condition. PMD re-configures the port
> +to the state prior to the error condition. Control path and data path are up now.
> +Since the device has undergone a reset, flow rules offloaded prior to reset
> +may be lost and the application should recreate the rules again.
> +
> +The PMD should trigger RTE_ETH_EVENT_INTR_RMV event to notify the application
> +that it has failed to recover from the error condition. The device may not be
> +usable anymore.
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index 147cc1c..a46819f 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type {
>   	RTE_ETH_EVENT_DESTROY,  /**< port is released */
>   	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
>   	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
> +	RTE_ETH_EVENT_ERR_RECOVERING,
> +			/**< port recovering from an error
> +			 *
> +			 * PMD detected a FW reset or error condition.
> +			 * PMD will try to recover from the error.
> +			 * Data path may be quiesced and Control path operations
> +			 * may fail at this time.
> +			 */
> +	RTE_ETH_EVENT_RECOVERED,
> +			/**< port recovered from an error
> +			 *
> +			 * PMD has recovered from the error condition.
> +			 * Control path and Data path are up now.
> +			 * PMD re-configures the port to the state prior to the error.
> +			 * Since the device has undergone a reset, flow rules
> +			 * offloaded prior to reset may be lost and
> +			 * the application should recreate the rules again.
> +			 */
>   	RTE_ETH_EVENT_MAX       /**< max value of this enum */


Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people
to evaluate if it is a false positive:


1 function with some indirect sub-type change:
   [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes:
     parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes:
       underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed:
         in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)':
           parameter 2 of type 'enum rte_eth_event_type' has sub-type changes:
             type size hasn't changed
             2 enumerator insertions:
               'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11'
               'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12'
             1 enumerator change:
               'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v3 0/4] ethdev: introduce IP reassembly offload
  2022-01-30 17:59  4% ` [PATCH v3 " Akhil Goyal
  @ 2022-02-01 14:10  0%   ` Ferruh Yigit
  2022-02-04 22:13  4%   ` [PATCH v4 0/3] " Akhil Goyal
  2 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2022-02-01 14:10 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: anoobj, matan, konstantin.ananyev, thomas, andrew.rybchenko,
	rosen.xu, jerinj, stephen, mdr

On 1/30/2022 5:59 PM, Akhil Goyal wrote:
> As discussed in the RFC[1] sent in 21.11, a new offload is
> introduced in ethdev for IP reassembly.
> 
> This patchset add the IP reassembly RX offload.
> Currently, the offload is tested along with inline IPsec processing.
> It can also be updated as a standalone offload without IPsec, if there
> are some hardware available to test it.
> The patchset is tested on cnxk platform. The driver implementation
> and a test app are added as separate patchsets.> 

Can you please share the links of those sets?

> [1]: http://patches.dpdk.org/project/dpdk/patch/20210823100259.1619886-1-gakhil@marvell.com/
> 
> changes in v3:
> - incorporated comments from Andrew and Stephen Hemminger
> 
> changes in v2:
> - added abi ignore exceptions for modifications in reserved fields.
>    Added a crude way to subside the rte_security and rte_ipsec ABI issue.
>    Please suggest a better way.
> - incorporated Konstantin's comment for extra checks in new API
>    introduced.
> - converted static mbuf ol_flag to mbuf dynflag (Konstantin)
> - added a get API for reassembly configuration (Konstantin)
> - Fixed checkpatch issues.
> - Dynfield is NOT split into 2 parts as it would cause an extra fetch in
>    case of IP reassembly failure.
> - Application patches are split into a separate series.
> 
> 
> Akhil Goyal (4):
>    ethdev: introduce IP reassembly offload
>    ethdev: add dev op to set/get IP reassembly configuration
>    ethdev: add mbuf dynfield for incomplete IP reassembly
>    security: add IPsec option for IP reassembly
> 
>   devtools/libabigail.abignore |  19 ++++++
>   doc/guides/nics/features.rst |  12 ++++
>   lib/ethdev/ethdev_driver.h   |  45 +++++++++++++++
>   lib/ethdev/rte_ethdev.c      | 109 +++++++++++++++++++++++++++++++++++
>   lib/ethdev/rte_ethdev.h      | 100 +++++++++++++++++++++++++++++++-
>   lib/ethdev/version.map       |   5 ++
>   lib/security/rte_security.h  |  12 +++-
>   7 files changed, 300 insertions(+), 2 deletions(-)
> 


^ permalink raw reply	[relevance 0%]

* RE: [EXT] Re: [PATCH v3 4/4] security: add IPsec option for IP reassembly
  @ 2022-02-02  9:15  3%       ` Akhil Goyal
  2022-02-02 14:04  0%         ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2022-02-02  9:15 UTC (permalink / raw)
  To: Ferruh Yigit, dev, Radu Nicolau, mdr
  Cc: Anoob Joseph, matan, konstantin.ananyev, thomas,
	andrew.rybchenko, rosen.xu, Jerin Jacob Kollanukkaran, stephen

> On 1/30/2022 5:59 PM, Akhil Goyal wrote:
> > A new option is added in IPsec to enable and attempt reassembly
> > of inbound packets.
> >
> > Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> > ---
> >   devtools/libabigail.abignore | 14 ++++++++++++++
> >   lib/security/rte_security.h  | 12 +++++++++++-
> 
> 
> +Radu for review
> 
> >   2 files changed, 25 insertions(+), 1 deletion(-)
> >
> > diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> > index 90f449c43a..c6e304282f 100644
> > --- a/devtools/libabigail.abignore
> > +++ b/devtools/libabigail.abignore
> > @@ -16,3 +16,17 @@
> >   [suppress_type]
> >   	name = rte_eth_dev_info
> >   	has_data_member_inserted_between = {offset_of(reserved_64s), end}
> > +
> > +; Ignore fields inserted in place of reserved_opts of
> rte_security_ipsec_sa_options
> > +[suppress_type]
> > +       name = rte_ipsec_sa_prm
> > +       name = rte_security_ipsec_sa_options
> > +       has_data_member_inserted_between = {offset_of(reserved_opts), end}
> > +
> > +[suppress_type]
> > +       name = rte_security_capability
> > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> (offset_of(reserved_opts) + 18)}
> > +
> > +[suppress_type]
> > +       name = rte_security_session_conf
> > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> (offset_of(reserved_opts) + 18)}

Could not find any better way to suppress the ABI warning.
Any better idea?

> > diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> > index 1228b6c8b1..168b837a82 100644
> > --- a/lib/security/rte_security.h
> > +++ b/lib/security/rte_security.h
> > @@ -264,6 +264,16 @@ struct rte_security_ipsec_sa_options {
> >   	 */
> >   	uint32_t l4_csum_enable : 1;
> >
> > +	/** Enable reassembly on incoming packets.
> > +	 *
> > +	 * * 1: Enable driver to try reassembly of encrypted IP packets for
> > +	 *      this SA, if supported by the driver. This feature will work
> > +	 *      only if rx_offload RTE_ETH_RX_OFFLOAD_IP_REASSEMBLY is set in
> > +	 *      inline Ethernet device.
> > +	 * * 0: Disable reassembly of packets (default).
> > +	 */
> > +	uint32_t reass_en : 1;
> > +
> >   	/** Reserved bit fields for future extension
> >   	 *
> >   	 * User should ensure reserved_opts is cleared as it may change in
> > @@ -271,7 +281,7 @@ struct rte_security_ipsec_sa_options {
> >   	 *
> >   	 * Note: Reduce number of bits in reserved_opts for every new option.
> >   	 */
> > -	uint32_t reserved_opts : 18;
> > +	uint32_t reserved_opts : 17;
> >   };
> >
> >   /** IPSec security association direction */


^ permalink raw reply	[relevance 3%]

* [PATCH v4] mempool: fix mempool cache flushing algorithm
    @ 2022-02-02 10:33  3% ` Morten Brørup
  1 sibling, 0 replies; 200+ results
From: Morten Brørup @ 2022-02-02 10:33 UTC (permalink / raw)
  To: olivier.matz, andrew.rybchenko
  Cc: bruce.richardson, jerinjacobk, dev, Morten Brørup

This patch fixes the rte_mempool_do_generic_put() caching algorithm,
which was fundamentally wrong, causing multiple performance issues when
flushing.

Although the bugs do have serious performance implications when
flushing, the function did not fail when flushing (or otherwise).
Backporting could be considered optional.

The algorithm was:
 1. Add the objects to the cache
 2. Anything greater than the cache size (if it crosses the cache flush
    threshold) is flushed to the ring.

Please note that the description in the source code said that it kept
"cache min value" objects after flushing, but the function actually kept
the cache full after flushing, which the above description reflects.

Now, the algorithm is:
 1. If the objects cannot be added to the cache without crossing the
    flush threshold, flush the cache to the ring.
 2. Add the objects to the cache.

This patch fixes these bugs:

1. The cache was still full after flushing.
In the opposite direction, i.e. when getting objects from the cache, the
cache is refilled to full level when it crosses the low watermark (which
happens to be zero).
Similarly, the cache should be flushed to empty level when it crosses
the high watermark (which happens to be 1.5 x the size of the cache).
The existing flushing behaviour was suboptimal for real applications,
because crossing the low or high watermark typically happens when the
application is in a state where the number of put/get events are out of
balance, e.g. when absorbing a burst of packets into a QoS queue
(getting more mbufs from the mempool), or when a burst of packets is
trickling out from the QoS queue (putting the mbufs back into the
mempool).
Now, the mempool cache is completely flushed when crossing the flush
threshold, so only the newly put (hot) objects remain in the mempool
cache afterwards.

This bug degraded performance caused by too frequent flushing.

Consider this application scenario:

Either, an lcore thread in the application is in a state of balance,
where it uses the mempool cache within its flush/refill boundaries; in
this situation, the flush method is less important, and this fix is
irrelevant.

Or, an lcore thread in the application is out of balance (either
permanently or temporarily), and mostly gets or puts objects from/to the
mempool. If it mostly puts objects, not flushing all of the objects will
cause more frequent flushing. This is the scenario addressed by this
fix. E.g.:

Cache size=256, flushthresh=384 (1.5x size), initial len=256;
application burst len=32.

If there are "size" objects in the cache after flushing, the cache is
flushed at every 4th burst.

If the cache is flushed completely, the cache is only flushed at every
16th burst.

As you can see, this bug caused the cache to be flushed 4x too
frequently in this example.

And when/if the application thread breaks its pattern of continuously
putting objects, and suddenly starts to get objects instead, it will
either get objects already in the cache, or the get() function will
refill the cache.

The concept of not flushing the cache completely was probably based on
an assumption that it is more likely for an application's lcore thread
to get() after flushing than to put() after flushing.
I strongly disagree with this assumption! If an application thread is
continuously putting so much that it overflows the cache, it is much
more likely to keep putting than it is to start getting. If in doubt,
consider how CPU branch predictors work: When the application has done
something many times consecutively, the branch predictor will expect the
application to do the same again, rather than suddenly do something
else.

Also, if you consider the description of the algorithm in the source
code, and agree that "cache min value" cannot mean "cache size", the
function did not behave as intended. This in itself is a bug.

2. The flush threshold comparison was off by one.
It must be "len > flushthresh", not "len >= flushthresh".
Consider a flush multiplier of 1 instead of 1.5; the cache would be
flushed already when reaching size objecs, not when exceeding size
objects. In other words, the cache would not be able to hold "size"
objects, which is clearly a bug.
Now, flushing is triggered when the flush threshold is exceeded, not
when reached.

This bug degraded performance due to premature flushing. In my example
above, this bug caused flushing every 3rd burst instead of every 4th.

3. The most recent (hot) objects were flushed, leaving the oldest (cold)
objects in the mempool cache.
This bug degraded performance, because flushing prevented immediate
reuse of the (hot) objects already in the CPU cache.
Now, the existing (cold) objects in the mempool cache are flushed before
the new (hot) objects are added the to the mempool cache.

4. With RTE_LIBRTE_MEMPOOL_DEBUG defined, the return value of
rte_mempool_ops_enqueue_bulk() was not checked when flushing the cache.
Now, it is checked in both locations where used; and obviously still
only if RTE_LIBRTE_MEMPOOL_DEBUG is defined.

v2 changes:

- Not adding the new objects to the mempool cache before flushing it
also allows the memory allocated for the mempool cache to be reduced
from 3 x to 2 x RTE_MEMPOOL_CACHE_MAX_SIZE.
However, such this change would break the ABI, so it was removed in v2.

- The mempool cache should be cache line aligned for the benefit of the
copying method, which on some CPU architectures performs worse on data
crossing a cache boundary.
However, such this change would break the ABI, so it was removed in v2;
and yet another alternative copying method replaced the rte_memcpy().

v3 changes:

- Actually remove my modifications of the rte_mempool_cache structure.

v4 changes:

- Updated patch title to reflect that the scope of the patch is only
mempool cache flushing.

- Do not replace rte_memcpy() with alternative copying method. This was
a pure optimization, not a fix.

- Elaborate even more on the bugs fixed by the modifications.

- Added 4th bullet item to the patch description, regarding
rte_mempool_ops_enqueue_bulk() with RTE_LIBRTE_MEMPOOL_DEBUG.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
---
 lib/mempool/rte_mempool.h | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index 1e7a3c1527..e7e09e48fc 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -1344,31 +1344,41 @@ rte_mempool_do_generic_put(struct rte_mempool *mp, void * const *obj_table,
 	if (unlikely(cache == NULL || n > RTE_MEMPOOL_CACHE_MAX_SIZE))
 		goto ring_enqueue;
 
-	cache_objs = &cache->objs[cache->len];
+	/* If the request itself is too big for the cache */
+	if (unlikely(n > cache->flushthresh))
+		goto ring_enqueue;
 
 	/*
 	 * The cache follows the following algorithm
-	 *   1. Add the objects to the cache
-	 *   2. Anything greater than the cache min value (if it crosses the
-	 *   cache flush threshold) is flushed to the ring.
+	 *   1. If the objects cannot be added to the cache without
+	 *   crossing the flush threshold, flush the cache to the ring.
+	 *   2. Add the objects to the cache.
 	 */
 
-	/* Add elements back into the cache */
-	rte_memcpy(&cache_objs[0], obj_table, sizeof(void *) * n);
+	if (cache->len + n <= cache->flushthresh) {
+		cache_objs = &cache->objs[cache->len];
 
-	cache->len += n;
+		cache->len += n;
+	} else {
+		cache_objs = &cache->objs[0];
 
-	if (cache->len >= cache->flushthresh) {
-		rte_mempool_ops_enqueue_bulk(mp, &cache->objs[cache->size],
-				cache->len - cache->size);
-		cache->len = cache->size;
+#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
+		if (rte_mempool_ops_enqueue_bulk(mp, cache_objs, cache->len) < 0)
+			rte_panic("cannot put objects in mempool\n");
+#else
+		rte_mempool_ops_enqueue_bulk(mp, cache_objs, cache->len);
+#endif
+		cache->len = n;
 	}
 
+	/* Add the objects to the cache. */
+	rte_memcpy(cache_objs, obj_table, sizeof(void *) * n);
+
 	return;
 
 ring_enqueue:
 
-	/* push remaining objects in ring */
+	/* Put the objects into the ring */
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 	if (rte_mempool_ops_enqueue_bulk(mp, obj_table, n) < 0)
 		rte_panic("cannot put objects in mempool\n");
-- 
2.17.1


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-01 12:52  3%     ` Ferruh Yigit
@ 2022-02-02 11:44  0%       ` Ray Kinsella
  2022-02-10 22:16  3%         ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: Ray Kinsella @ 2022-02-02 11:44 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Kalesh A P, dev, ajit.khaparde, asafp, David Marchand,
	Thomas Monjalon, Andrew Rybchenko


Ferruh Yigit <ferruh.yigit@intel.com> writes:

> On 1/28/2022 12:48 PM, Kalesh A P wrote:
>> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>> Adding support for the device reset and recovery events in the
>> rte_eth_event framework. FW error and FW reset conditions would be
>> managed internally by the PMD without needing application intervention.
>> In such cases, PMD would need reset/recovery events to notify application
>> that PMD is undergoing a reset.
>> While most of the recovery process is transparent to the application since
>> most of the driver ensures recovery from FW reset or FW error conditions,
>> the application will have to reprogram any flows which were offloaded to
>> the underlying hardware.
>> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
>> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>> ---
>>   doc/guides/prog_guide/poll_mode_drv.rst | 24 ++++++++++++++++++++++++
>>   lib/ethdev/rte_ethdev.h                 | 18 ++++++++++++++++++
>>   2 files changed, 42 insertions(+)
>> diff --git a/doc/guides/prog_guide/poll_mode_drv.rst
>> b/doc/guides/prog_guide/poll_mode_drv.rst
>> index 6831289..9ecc0e4 100644
>> --- a/doc/guides/prog_guide/poll_mode_drv.rst
>> +++ b/doc/guides/prog_guide/poll_mode_drv.rst
>> @@ -623,3 +623,27 @@ by application.
>>   The PMD itself should not call rte_eth_dev_reset(). The PMD can trigger
>>   the application to handle reset event. It is duty of application to
>>   handle all synchronization before it calls rte_eth_dev_reset().
>> +
>> +Error recovery support
>> +~~~~~~~~~~~~~~~~~~~~~~
>> +
>> +When the PMD detects a FW reset or error condition, it may try to recover
>> +from the error without needing the application intervention. In such cases,
>> +PMD would need events to notify the application that it is undergoing
>> +an error recovery.
>> +
>> +The PMD should trigger RTE_ETH_EVENT_ERR_RECOVERING event to notify the
>> +application that PMD detected a FW reset or FW error condition. PMD may
>> +try to recover from the error by itself. Data path may be quiesced and
>> +control path operations may fail during the recovery period. The application
>> +should stop polling till it receives RTE_ETH_EVENT_RECOVERED event from the PMD.
>> +
>> +The PMD should trigger RTE_ETH_EVENT_RECOVERED event to notify the application
>> +that the it has recovered from the error condition. PMD re-configures the port
>> +to the state prior to the error condition. Control path and data path are up now.
>> +Since the device has undergone a reset, flow rules offloaded prior to reset
>> +may be lost and the application should recreate the rules again.
>> +
>> +The PMD should trigger RTE_ETH_EVENT_INTR_RMV event to notify the application
>> +that it has failed to recover from the error condition. The device may not be
>> +usable anymore.
>> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
>> index 147cc1c..a46819f 100644
>> --- a/lib/ethdev/rte_ethdev.h
>> +++ b/lib/ethdev/rte_ethdev.h
>> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type {
>>   	RTE_ETH_EVENT_DESTROY,  /**< port is released */
>>   	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
>>   	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
>> +	RTE_ETH_EVENT_ERR_RECOVERING,
>> +			/**< port recovering from an error
>> +			 *
>> +			 * PMD detected a FW reset or error condition.
>> +			 * PMD will try to recover from the error.
>> +			 * Data path may be quiesced and Control path operations
>> +			 * may fail at this time.
>> +			 */
>> +	RTE_ETH_EVENT_RECOVERED,
>> +			/**< port recovered from an error
>> +			 *
>> +			 * PMD has recovered from the error condition.
>> +			 * Control path and Data path are up now.
>> +			 * PMD re-configures the port to the state prior to the error.
>> +			 * Since the device has undergone a reset, flow rules
>> +			 * offloaded prior to reset may be lost and
>> +			 * the application should recreate the rules again.
>> +			 */
>>   	RTE_ETH_EVENT_MAX       /**< max value of this enum */
>
>
> Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people
> to evaluate if it is a false positive:
>
>
> 1 function with some indirect sub-type change:
>   [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes:
>     parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes:
>       underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed:
>         in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)':
>           parameter 2 of type 'enum rte_eth_event_type' has sub-type changes:
>             type size hasn't changed
>             2 enumerator insertions:
>               'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11'
>               'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12'
>             1 enumerator change:
>               'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1

I don't immediately see the problem that this would cause.
There are no array sizes etc dependent on the value of MAX for instance.

Looks safe?

-- 
Regards, Ray K

^ permalink raw reply	[relevance 0%]

* Re: [EXT] Re: [PATCH v3 4/4] security: add IPsec option for IP reassembly
  2022-02-02  9:15  3%       ` [EXT] " Akhil Goyal
@ 2022-02-02 14:04  0%         ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2022-02-02 14:04 UTC (permalink / raw)
  To: Akhil Goyal, dev, Radu Nicolau, mdr, David Marchand
  Cc: Anoob Joseph, matan, konstantin.ananyev, thomas,
	andrew.rybchenko, rosen.xu, Jerin Jacob Kollanukkaran, stephen

On 2/2/2022 9:15 AM, Akhil Goyal wrote:
>> On 1/30/2022 5:59 PM, Akhil Goyal wrote:
>>> A new option is added in IPsec to enable and attempt reassembly
>>> of inbound packets.
>>>
>>> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
>>> ---
>>>    devtools/libabigail.abignore | 14 ++++++++++++++
>>>    lib/security/rte_security.h  | 12 +++++++++++-
>>
>>
>> +Radu for review
>>
>>>    2 files changed, 25 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
>>> index 90f449c43a..c6e304282f 100644
>>> --- a/devtools/libabigail.abignore
>>> +++ b/devtools/libabigail.abignore
>>> @@ -16,3 +16,17 @@
>>>    [suppress_type]
>>>    	name = rte_eth_dev_info
>>>    	has_data_member_inserted_between = {offset_of(reserved_64s), end}
>>> +
>>> +; Ignore fields inserted in place of reserved_opts of
>> rte_security_ipsec_sa_options
>>> +[suppress_type]
>>> +       name = rte_ipsec_sa_prm
>>> +       name = rte_security_ipsec_sa_options
>>> +       has_data_member_inserted_between = {offset_of(reserved_opts), end}
>>> +
>>> +[suppress_type]
>>> +       name = rte_security_capability
>>> +       has_data_member_inserted_between = {offset_of(reserved_opts),
>> (offset_of(reserved_opts) + 18)}
>>> +
>>> +[suppress_type]
>>> +       name = rte_security_session_conf
>>> +       has_data_member_inserted_between = {offset_of(reserved_opts),
>> (offset_of(reserved_opts) + 18)}
> 
> Could not find any better way to suppress the ABI warning.
> Any better idea?
> 

+David for it, who knows abigail better.

>>> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
>>> index 1228b6c8b1..168b837a82 100644
>>> --- a/lib/security/rte_security.h
>>> +++ b/lib/security/rte_security.h
>>> @@ -264,6 +264,16 @@ struct rte_security_ipsec_sa_options {
>>>    	 */
>>>    	uint32_t l4_csum_enable : 1;
>>>
>>> +	/** Enable reassembly on incoming packets.
>>> +	 *
>>> +	 * * 1: Enable driver to try reassembly of encrypted IP packets for
>>> +	 *      this SA, if supported by the driver. This feature will work
>>> +	 *      only if rx_offload RTE_ETH_RX_OFFLOAD_IP_REASSEMBLY is set in
>>> +	 *      inline Ethernet device.
>>> +	 * * 0: Disable reassembly of packets (default).
>>> +	 */
>>> +	uint32_t reass_en : 1;
>>> +
>>>    	/** Reserved bit fields for future extension
>>>    	 *
>>>    	 * User should ensure reserved_opts is cleared as it may change in
>>> @@ -271,7 +281,7 @@ struct rte_security_ipsec_sa_options {
>>>    	 *
>>>    	 * Note: Reduce number of bits in reserved_opts for every new option.
>>>    	 */
>>> -	uint32_t reserved_opts : 18;
>>> +	uint32_t reserved_opts : 17;
>>>    };
>>>
>>>    /** IPSec security association direction */
> 


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v6 20/50] pdump: remove unneeded header includes
  @ 2022-02-02 16:00  3%       ` Bruce Richardson
  2022-02-02 16:45  0%         ` Morten Brørup
  0 siblings, 1 reply; 200+ results
From: Bruce Richardson @ 2022-02-02 16:00 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Sean Morrissey, Reshma Pattan, dev

On Wed, Feb 02, 2022 at 07:54:58AM -0800, Stephen Hemminger wrote:
> On Wed,  2 Feb 2022 09:47:32 +0000
> Sean Morrissey <sean.morrissey@intel.com> wrote:
> 
> > These header includes have been flagged by the iwyu_tool
> > and removed.
> > 
> > Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> > ---
> >  lib/pdump/rte_pdump.c | 1 -
> >  lib/pdump/rte_pdump.h | 2 --
> >  2 files changed, 3 deletions(-)
> > 
> > diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
> > index af450695ec..b3a62df591 100644
> > --- a/lib/pdump/rte_pdump.c
> > +++ b/lib/pdump/rte_pdump.c
> > @@ -2,7 +2,6 @@
> >   * Copyright(c) 2016-2018 Intel Corporation
> >   */
> >  
> > -#include <rte_memcpy.h>
> >  #include <rte_mbuf.h>
> >  #include <rte_ethdev.h>
> >  #include <rte_lcore.h>
> 
> Yes, this code doesn't use rte_memcpy so yes, remove it.
> 
> > diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
> > index 6efa0274f2..41c4b7800b 100644
> > --- a/lib/pdump/rte_pdump.h
> > +++ b/lib/pdump/rte_pdump.h
> > @@ -13,8 +13,6 @@
> >   */
> >  
> >  #include <stdint.h>
> > -#include <rte_mempool.h>
> > -#include <rte_ring.h>
> >  #include <rte_bpf.h>
> >  
> >  #ifdef __cplusplus
> 
> This header does use rte_mempool and rte_ring in rte_pdump_enable().
> Not sure why IWYU thinks they should be removed.

Because they are only used as pointer types, not as structures themselves.
Normally in cases like this, I would put in just "struct rte_mempool;" at
the top of the file rather than including a whole header just for one
structure.

> Since this is an API header, changing it here risks breaking an application.
>
Good point. Should we avoid removing headers from public headers in case of
application breakage? It's safer, but it means that we will likely still be
including far too many headers in multiple places. If we do remove them, it
would not be an ABI break, just an API one, of sorts.

/Bruce

^ permalink raw reply	[relevance 3%]

* RE: [PATCH v6 20/50] pdump: remove unneeded header includes
  2022-02-02 16:00  3%       ` Bruce Richardson
@ 2022-02-02 16:45  0%         ` Morten Brørup
  0 siblings, 0 replies; 200+ results
From: Morten Brørup @ 2022-02-02 16:45 UTC (permalink / raw)
  To: Bruce Richardson, Stephen Hemminger; +Cc: Sean Morrissey, Reshma Pattan, dev

> From: Bruce Richardson [mailto:bruce.richardson@intel.com]
> Sent: Wednesday, 2 February 2022 17.01
> 
> On Wed, Feb 02, 2022 at 07:54:58AM -0800, Stephen Hemminger wrote:
> > On Wed,  2 Feb 2022 09:47:32 +0000
> > Sean Morrissey <sean.morrissey@intel.com> wrote:
> >
> > > These header includes have been flagged by the iwyu_tool
> > > and removed.
> > >
> > > Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> > > ---

[...]

> >
> > > diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
> > > index 6efa0274f2..41c4b7800b 100644
> > > --- a/lib/pdump/rte_pdump.h
> > > +++ b/lib/pdump/rte_pdump.h
> > > @@ -13,8 +13,6 @@
> > >   */
> > >
> > >  #include <stdint.h>
> > > -#include <rte_mempool.h>
> > > -#include <rte_ring.h>
> > >  #include <rte_bpf.h>
> > >
> > >  #ifdef __cplusplus
> >
> > This header does use rte_mempool and rte_ring in rte_pdump_enable().
> > Not sure why IWYU thinks they should be removed.
> 
> Because they are only used as pointer types, not as structures
> themselves.
> Normally in cases like this, I would put in just "struct rte_mempool;"
> at
> the top of the file rather than including a whole header just for one
> structure.

I don't think we should introduce such a hack!
If a module uses something from a library, it makes sense to include the header file for the library.

Putting in "struct rte_mempool;" is essentially copy-pasting from the library, although only a structure. What happens if the type changes or disappears, or depends on some #ifdef? It could have one type in some cases and another type in other cases - e.g. the atomic counters in the mbuf once had different types, depending on compile time flags. The copy-pasted code would not get fixed if the type evolved over time.

If only using one function from a library, you probably wouldn't copy the function prototype instead of including the library header file.

Let's focus on the speed of compiled DPDK code, not the speed of compiling DPDK code. Code readability and lower probability of introducing bugs is far more important than compilation time!

Cleaning up code is also good, so the iwyu_tool initiative is still good.

> 
> > Since this is an API header, changing it here risks breaking an
> application.
> >
> Good point. Should we avoid removing headers from public headers in
> case of
> application breakage? It's safer, but it means that we will likely
> still be
> including far too many headers in multiple places. If we do remove
> them, it
> would not be an ABI break, just an API one, of sorts.

The application only breaks at compile time, and it should be easy for the application developer to see what is missing.

I vote for removing unused headers in public files too - not considering it an API breakage.


^ permalink raw reply	[relevance 0%]

* [PATCH v3 1/4] crypto: use single buffer for asymmetric session
  @ 2022-02-03 16:04  1% ` Ciara Power
  2022-02-03 16:04  2% ` [PATCH v3 4/4] crypto: modify return value for asym session create Ciara Power
  1 sibling, 0 replies; 200+ results
From: Ciara Power @ 2022-02-03 16:04 UTC (permalink / raw)
  To: dev
  Cc: roy.fan.zhang, gakhil, anoobj, mdr, Ciara Power, Declan Doherty,
	Ankur Dwivedi, Tejasree Kondoj, John Griffin, Fiona Trahe,
	Deepak Kumar Jain

Rather than using a session buffer that contains pointers to private
session data elsewhere, have a single session buffer.
This session is created for a driver ID, and the mempool element
contains space for the max session private data needed for any driver.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

---
v2:
  - Renamed function typedef from "free" to "clear" as session private
    data isn't being freed in that function.
  - Moved user data API to separate patch.
  - Minor fixes to comments, formatting, return values.
v3:
  - Corrected formatting of struct comments.
  - Increased size of max_priv_session_sz to uint16_t.
  - Removed trace for asym session init function that was
    previously removed.
  - Added documentation.
---
 app/test-crypto-perf/cperf_ops.c             |  14 +-
 app/test/test_cryptodev_asym.c               | 200 ++++---------------
 doc/guides/prog_guide/cryptodev_lib.rst      |  55 ++---
 doc/guides/rel_notes/release_22_03.rst       |   7 +
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c    |   6 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c     |   6 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c     |  11 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c  |  29 +--
 drivers/crypto/openssl/rte_openssl_pmd.c     |   5 +-
 drivers/crypto/openssl/rte_openssl_pmd_ops.c |  23 +--
 drivers/crypto/qat/qat_asym.c                |  53 ++---
 lib/cryptodev/cryptodev_pmd.h                |  17 +-
 lib/cryptodev/cryptodev_trace_points.c       |   6 +-
 lib/cryptodev/rte_cryptodev.c                | 167 ++++++++++------
 lib/cryptodev/rte_cryptodev.h                |  72 ++++---
 lib/cryptodev/rte_cryptodev_trace.h          |  21 +-
 lib/cryptodev/version.map                    |   5 +-
 17 files changed, 258 insertions(+), 439 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index d975ae1ab8..bdc5dc9544 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -735,7 +735,6 @@ cperf_create_session(struct rte_mempool *sess_mp,
 	struct rte_crypto_sym_xform aead_xform;
 	struct rte_cryptodev_sym_session *sess = NULL;
 	struct rte_crypto_asym_xform xform = {0};
-	int rc;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
 		xform.next = NULL;
@@ -745,19 +744,10 @@ cperf_create_session(struct rte_mempool *sess_mp,
 		xform.modex.exponent.data = perf_mod_e;
 		xform.modex.exponent.length = sizeof(perf_mod_e);
 
-		sess = (void *)rte_cryptodev_asym_session_create(sess_mp);
+		sess = (void *)rte_cryptodev_asym_session_create(sess_mp, dev_id, &xform);
 		if (sess == NULL)
 			return NULL;
-		rc = rte_cryptodev_asym_session_init(dev_id, (void *)sess,
-						     &xform, priv_mp);
-		if (rc < 0) {
-			if (sess != NULL) {
-				rte_cryptodev_asym_session_clear(dev_id,
-								 (void *)sess);
-				rte_cryptodev_asym_session_free((void *)sess);
-			}
-			return NULL;
-		}
+
 		return sess;
 	}
 #ifdef RTE_LIB_SECURITY
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 68f4d8e7a6..f7c2fd2588 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -450,7 +450,8 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (!sessionless) {
-		sess = rte_cryptodev_asym_session_create(ts_params->session_mpool);
+		sess = rte_cryptodev_asym_session_create(ts_params->session_mpool,
+				dev_id, &xform_tc);
 		if (!sess) {
 			snprintf(test_msg, ASYM_TEST_MSG_LEN,
 					"line %u "
@@ -460,15 +461,6 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 			goto error_exit;
 		}
 
-		if (rte_cryptodev_asym_session_init(dev_id, sess, &xform_tc,
-				ts_params->session_mpool) < 0) {
-			snprintf(test_msg, ASYM_TEST_MSG_LEN,
-					"line %u FAILED: %s",
-					__LINE__, "unabled to config sym session");
-			status = TEST_FAILED;
-			goto error_exit;
-		}
-
 		rte_crypto_op_attach_asym_session(op, sess);
 	} else {
 		asym_op->xform = &xform_tc;
@@ -667,18 +659,11 @@ test_rsa_sign_verify(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &rsa_xform);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"sign_verify\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -686,7 +671,6 @@ test_rsa_sign_verify(void)
 	status = queue_ops_rsa_sign_verify(sess);
 
 error_exit:
-
 	rte_cryptodev_asym_session_clear(dev_id, sess);
 	rte_cryptodev_asym_session_free(sess);
 
@@ -716,17 +700,10 @@ test_rsa_enc_dec(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &rsa_xform);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"enc_dec\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -763,22 +740,15 @@ test_rsa_sign_verify_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &rsa_xform_crt);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify_crt\n");
 		status = TEST_FAILED;
-		return status;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform_crt,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"sign_verify_crt\n");
-		status = TEST_FAILED;
 		goto error_exit;
 	}
+
 	status = queue_ops_rsa_sign_verify(sess);
 
 error_exit:
@@ -811,21 +781,15 @@ test_rsa_enc_dec_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &rsa_xform_crt);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"enc_dec_crt\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform_crt,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"enc_dec_crt\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
+
 	status = queue_ops_rsa_enc_dec(sess);
 
 error_exit:
@@ -924,7 +888,6 @@ testsuite_setup(void)
 	/* configure qp */
 	ts_params->qp_conf.nb_descriptors = DEFAULT_NUM_OPS_INFLIGHT;
 	ts_params->qp_conf.mp_session = ts_params->session_mpool;
-	ts_params->qp_conf.mp_session_private = ts_params->session_mpool;
 	for (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) {
 		TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
 			dev_id, qp_id, &ts_params->qp_conf,
@@ -933,21 +896,9 @@ testsuite_setup(void)
 			qp_id, dev_id);
 	}
 
-	/* setup asym session pool */
-	unsigned int session_size = RTE_MAX(
-		rte_cryptodev_asym_get_private_session_size(dev_id),
-		rte_cryptodev_asym_get_header_session_size());
-	/*
-	 * Create mempool with TEST_NUM_SESSIONS * 2,
-	 * to include the session headers
-	 */
-	ts_params->session_mpool = rte_mempool_create(
-				"test_asym_sess_mp",
-				TEST_NUM_SESSIONS * 2,
-				session_size,
-				0, 0, NULL, NULL, NULL,
-				NULL, SOCKET_ID_ANY,
-				0);
+	ts_params->session_mpool = rte_cryptodev_asym_session_pool_create(
+			"test_asym_sess_mp", TEST_NUM_SESSIONS * 2, 0,
+			SOCKET_ID_ANY);
 
 	TEST_ASSERT_NOT_NULL(ts_params->session_mpool,
 			"session mempool allocation failed");
@@ -1104,14 +1055,6 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_xform xform = *xfrm;
 	uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1134,11 +1077,11 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.shared_secret.data = output;
 	asym_op->dh.shared_secret.length = sizeof(output);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1196,14 +1139,6 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1222,11 +1157,11 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = output;
 	asym_op->dh.priv_key.length = sizeof(output);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1287,14 +1222,6 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1321,11 +1248,11 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 					0);
 	asym_op->dh.priv_key = dh_test_params.priv_key;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1388,15 +1315,6 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_xform pub_key_xform;
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1420,11 +1338,12 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.pub_key.length = sizeof(out_pub_key);
 	asym_op->dh.priv_key.data = out_prv_key;
 	asym_op->dh.priv_key.length = sizeof(out_prv_key);
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1511,7 +1430,7 @@ test_mod_inv(void)
 				return TEST_SKIPPED;
 		}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &modinv_xform);
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "line %u "
 				"FAILED: %s", __LINE__,
@@ -1520,15 +1439,6 @@ test_mod_inv(void)
 		goto error_exit;
 	}
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &modinv_xform,
-			sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* generate crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1646,7 +1556,7 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &modex_xform);
 	if (!sess) {
 		RTE_LOG(ERR, USER1,
 				 "line %u "
@@ -1656,15 +1566,6 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &modex_xform,
-			sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	asym_op = op->asym;
 	memcpy(input, base, sizeof(base));
 	asym_op->modex.base.data = input;
@@ -1768,7 +1669,7 @@ test_dsa_sign(void)
 	uint8_t s[TEST_DH_MOD_LEN];
 	uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &dsa_xform);
 	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				 "line %u FAILED: %s", __LINE__,
@@ -1797,15 +1698,6 @@ test_dsa_sign(void)
 	debug_hexdump(stdout, "priv_key: ", dsa_xform.dsa.x.data,
 			dsa_xform.dsa.x.length);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &dsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* attach asymmetric crypto session to crypto operations */
 	rte_crypto_op_attach_asym_session(op, sess);
 	asym_op->dsa.op_type = RTE_CRYPTO_ASYM_OP_SIGN;
@@ -1941,15 +1833,6 @@ test_ecdsa_sign_verify(enum curve curve_id)
 
 	rte_cryptodev_info_get(dev_id, &dev_info);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed\n");
-		status = TEST_FAILED;
-		goto exit;
-	}
-
 	/* Setup crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (op == NULL) {
@@ -1967,11 +1850,11 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
 	xform.ec.curve_id = input_params.curve;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-				sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
-				"Unable to config asym session\n");
+				"Session creation failed\n");
 		status = TEST_FAILED;
 		goto exit;
 	}
@@ -2154,15 +2037,6 @@ test_ecpm(enum curve curve_id)
 
 	rte_cryptodev_info_get(dev_id, &dev_info);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed\n");
-		status = TEST_FAILED;
-		goto exit;
-	}
-
 	/* Setup crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (op == NULL) {
@@ -2180,11 +2054,11 @@ test_ecpm(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
 	xform.ec.curve_id = input_params.curve;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-				sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
-				"Unable to config asym session\n");
+				"Session creation failed\n");
 		status = TEST_FAILED;
 		goto exit;
 	}
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 8766bc34a9..f8f8562f4c 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -1038,20 +1038,17 @@ It is the application's responsibility to create and manage the session mempools
 Application using both symmetric and asymmetric sessions should allocate and maintain
 different sessions pools for each type.
 
-An application can use ``rte_cryptodev_get_asym_session_private_size()`` to
-get the private size of asymmetric session on a given crypto device. This
-function would allow an application to calculate the max device asymmetric
-session size of all crypto devices to create a single session mempool.
-If instead an application creates multiple asymmetric session mempools,
-the Crypto device framework also provides ``rte_cryptodev_asym_get_header_session_size()`` to get
-the size of an uninitialized session.
+An application can use ``rte_cryptodev_asym_session_pool_create()`` to create a mempool
+with a specified number of elements. The element size will allow for the session header,
+and the max private session size.
+The max private session size is chosen based on available crypto devices,
+the biggest private session size is used. This means any of those devices can be used,
+and the mempool element will have available space for its private session data.
 
 Once the session mempools have been created, ``rte_cryptodev_asym_session_create()``
-is used to allocate an uninitialized asymmetric session from the given mempool.
-The session then must be initialized using ``rte_cryptodev_asym_session_init()``
-for each of the required crypto devices. An asymmetric transform chain
-is used to specify the operation and its parameters. See the section below for
-details on transforms.
+is used to allocate and initialize an asymmetric session from the given mempool.
+An asymmetric transform chain is used to specify the operation and its parameters.
+See the section below for details on transforms.
 
 When a session is no longer used, user must call ``rte_cryptodev_asym_session_clear()``
 for each of the crypto devices that are using the session, to free all driver
@@ -1162,21 +1159,14 @@ crypto operations is similar except change to respective op and xform setup).
 
     uint8_t cdev_id = rte_cryptodev_get_dev_id(crypto_name);
 
-    /* Get private asym session data size. */
-    asym_session_size = rte_cryptodev_get_asym_private_session_size(cdev_id);
-
     /*
-     * Create session mempool, with two objects per session,
-     * one for the session header and another one for the
-     * private asym session data for the crypto device.
+     * Create session mempool, this will create elements big enough
+     * to hold the generic session header,
+     * and the max private session size of the available devices.
      */
-    asym_session_pool = rte_mempool_create("asym_session_pool",
-                                    MAX_ASYM_SESSIONS * 2,
-                                    asym_session_size,
-                                    0,
-                                    0, NULL, NULL, NULL,
-                                    NULL, socket_id,
-                                    0);
+    asym_session_pool = rte_cryptodev_asym_session_pool_create(
+                        "asym_session_pool", MAX_ASYM_SESSIONS, 0, 0,
+                        socket_id);
 
     /* Configure the crypto device. */
     struct rte_cryptodev_config conf = {
@@ -1190,8 +1180,7 @@ crypto operations is similar except change to respective op and xform setup).
     if (rte_cryptodev_configure(cdev_id, &conf) < 0)
         rte_exit(EXIT_FAILURE, "Failed to configure cryptodev %u", cdev_id);
 
-    if (rte_cryptodev_queue_pair_setup(cdev_id, 0, &qp_conf,
-                            socket_id, asym_session_pool) < 0)
+    if (rte_cryptodev_queue_pair_setup(cdev_id, 0, &qp_conf, socket_id) < 0)
         rte_exit(EXIT_FAILURE, "Failed to setup queue pair\n");
 
     if (rte_cryptodev_start(cdev_id) < 0)
@@ -1226,15 +1215,11 @@ crypto operations is similar except change to respective op and xform setup).
     };
     /* Create asym crypto session and initialize it for the crypto device. */
     struct rte_cryptodev_asym_session *asym_session;
-    asym_session = rte_cryptodev_asym_session_create(asym_session_pool);
+    asym_session = rte_cryptodev_asym_session_create(asym_session_pool,
+            cdev_id, &modex_xform);
     if (asym_session == NULL)
         rte_exit(EXIT_FAILURE, "Session could not be created\n");
 
-    if (rte_cryptodev_asym_session_init(cdev_id, asym_session,
-                    &modex_xform, asym_session_pool) < 0)
-        rte_exit(EXIT_FAILURE, "Session could not be initialized "
-                    "for the crypto device\n");
-
     /* Get a burst of crypto operations. */
     struct rte_crypto_op *crypto_ops[1];
     if (rte_crypto_op_bulk_alloc(crypto_op_pool,
@@ -1245,11 +1230,11 @@ crypto operations is similar except change to respective op and xform setup).
     /* Set up the crypto operations. */
     struct rte_crypto_asym_op *asym_op = crypto_ops[0]->asym;
 
-	/* calculate mod exp of value 0xf8 */
+    /* calculate mod exp of value 0xf8 */
     static unsigned char base[] = {0xF8};
     asym_op->modex.base.data = base;
     asym_op->modex.base.length = sizeof(base);
-	asym_op->modex.base.iova = base;
+    asym_op->modex.base.iova = base;
 
     /* Attach the asym crypto session to the operation */
     rte_crypto_op_attach_asym_session(op, asym_session);
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 3bc0630c7c..de8d8ce4e9 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -100,6 +100,13 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* cryptodev: The asym session handling was modified to use a single buffer.
+  A ``rte_cryptodev_asym_session_pool_create`` function was added to
+  create a mempool with element size to hold the generic asym session header,
+  along with the max size for a device private session data.
+  ``rte_cryptodev_asym_session_init`` was removed as this initialisation is
+  now done by ``rte_cryptodev_asym_session_create``.
+
 
 ABI Changes
 -----------
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
index d217bbf383..7390f976c6 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
@@ -157,8 +157,7 @@ cn10k_cpt_fill_inst(struct cnxk_cpt_qp *qp, struct rte_crypto_op *ops[],
 
 		if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 			asym_op = op->asym;
-			ae_sess = get_asym_session_private_data(
-				asym_op->session, cn10k_cryptodev_driver_id);
+			ae_sess = get_asym_session_private_data(asym_op->session);
 			ret = cnxk_ae_enqueue(qp, op, infl_req, &inst[0],
 					      ae_sess);
 			if (unlikely(ret))
@@ -431,8 +430,7 @@ cn10k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp,
 			uintptr_t *mdata = infl_req->mdata;
 			struct cnxk_ae_sess *sess;
 
-			sess = get_asym_session_private_data(
-				op->session, cn10k_cryptodev_driver_id);
+			sess = get_asym_session_private_data(op->session);
 
 			cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
 		}
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
index ac1953b66d..59a06af30e 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
@@ -138,8 +138,7 @@ cn9k_cpt_inst_prep(struct cnxk_cpt_qp *qp, struct rte_crypto_op *op,
 
 		if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 			asym_op = op->asym;
-			sess = get_asym_session_private_data(
-				asym_op->session, cn9k_cryptodev_driver_id);
+			sess = get_asym_session_private_data(asym_op->session);
 			ret = cnxk_ae_enqueue(qp, op, infl_req, inst, sess);
 			inst->w7.u64 = sess->cpt_inst_w7;
 		} else {
@@ -453,8 +452,7 @@ cn9k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp, struct rte_crypto_op *cop,
 			uintptr_t *mdata = infl_req->mdata;
 			struct cnxk_ae_sess *sess;
 
-			sess = get_asym_session_private_data(
-				op->session, cn9k_cryptodev_driver_id);
+			sess = get_asym_session_private_data(op->session);
 
 			cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
 		}
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index 67a2d9b08e..0d561ba0f3 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -657,7 +657,7 @@ cnxk_ae_session_clear(struct rte_cryptodev *dev,
 	struct rte_mempool *sess_mp;
 	struct cnxk_ae_sess *priv;
 
-	priv = get_asym_session_private_data(sess, dev->driver_id);
+	priv = get_asym_session_private_data(sess);
 	if (priv == NULL)
 		return;
 
@@ -667,7 +667,6 @@ cnxk_ae_session_clear(struct rte_cryptodev *dev,
 	/* Reset and free object back to pool */
 	memset(priv, 0, cnxk_ae_session_size_get(dev));
 	sess_mp = rte_mempool_from_obj(priv);
-	set_asym_session_private_data(sess, dev->driver_id, NULL);
 	rte_mempool_put(sess_mp, priv);
 }
 
@@ -679,15 +678,10 @@ cnxk_ae_session_cfg(struct rte_cryptodev *dev,
 {
 	struct cnxk_cpt_vf *vf = dev->data->dev_private;
 	struct roc_cpt *roc_cpt = &vf->cpt;
-	struct cnxk_ae_sess *priv;
+	struct cnxk_ae_sess *priv = get_asym_session_private_data(sess);
 	union cpt_inst_w7 w7;
 	int ret;
 
-	if (rte_mempool_get(pool, (void **)&priv))
-		return -ENOMEM;
-
-	memset(priv, 0, sizeof(struct cnxk_ae_sess));
-
 	ret = cnxk_ae_fill_session_parameters(priv, xform);
 	if (ret) {
 		rte_mempool_put(pool, priv);
@@ -699,7 +693,6 @@ cnxk_ae_session_cfg(struct rte_cryptodev *dev,
 	priv->cpt_inst_w7 = w7.u64;
 	priv->cnxk_fpm_iova = vf->cnxk_fpm_iova;
 	priv->ec_grp = vf->ec_grp;
-	set_asym_session_private_data(sess, dev->driver_id, priv);
 
 	return 0;
 }
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index f7ca8a8a8e..22c54dde68 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -375,35 +375,24 @@ otx_cpt_asym_session_size_get(struct rte_cryptodev *dev __rte_unused)
 }
 
 static int
-otx_cpt_asym_session_cfg(struct rte_cryptodev *dev,
+otx_cpt_asym_session_cfg(struct rte_cryptodev *dev __rte_unused,
 			 struct rte_crypto_asym_xform *xform __rte_unused,
 			 struct rte_cryptodev_asym_session *sess,
-			 struct rte_mempool *pool)
+			 struct rte_mempool *pool __rte_unused)
 {
-	struct cpt_asym_sess_misc *priv;
+	struct cpt_asym_sess_misc *priv = get_asym_session_private_data(sess);
 	int ret;
 
 	CPT_PMD_INIT_FUNC_TRACE();
 
-	if (rte_mempool_get(pool, (void **)&priv)) {
-		CPT_LOG_ERR("Could not allocate session private data");
-		return -ENOMEM;
-	}
-
-	memset(priv, 0, sizeof(struct cpt_asym_sess_misc));
-
 	ret = cpt_fill_asym_session_parameters(priv, xform);
 	if (ret) {
 		CPT_LOG_ERR("Could not configure session parameters");
-
-		/* Return session to mempool */
-		rte_mempool_put(pool, priv);
 		return ret;
 	}
 
 	priv->cpt_inst_w7 = 0;
 
-	set_asym_session_private_data(sess, dev->driver_id, priv);
 	return 0;
 }
 
@@ -412,11 +401,10 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 			   struct rte_cryptodev_asym_session *sess)
 {
 	struct cpt_asym_sess_misc *priv;
-	struct rte_mempool *sess_mp;
 
 	CPT_PMD_INIT_FUNC_TRACE();
 
-	priv = get_asym_session_private_data(sess, dev->driver_id);
+	priv = get_asym_session_private_data(sess);
 
 	if (priv == NULL)
 		return;
@@ -424,9 +412,6 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 	/* Free resources allocated during session configure */
 	cpt_free_asym_session_parameters(priv);
 	memset(priv, 0, otx_cpt_asym_session_size_get(dev));
-	sess_mp = rte_mempool_from_obj(priv);
-	set_asym_session_private_data(sess, dev->driver_id, NULL);
-	rte_mempool_put(sess_mp, priv);
 }
 
 static __rte_always_inline void * __rte_hot
@@ -471,8 +456,7 @@ otx_cpt_enq_single_asym(struct cpt_instance *instance,
 		return NULL;
 	}
 
-	sess = get_asym_session_private_data(asym_op->session,
-					     otx_cryptodev_driver_id);
+	sess = get_asym_session_private_data(asym_op->session);
 
 	/* Store phys_addr of the mdata to meta_buf */
 	params.meta_buf = rte_mempool_virt2iova(mdata);
@@ -852,8 +836,7 @@ otx_cpt_asym_post_process(struct rte_crypto_op *cop,
 	struct rte_crypto_asym_op *op = cop->asym;
 	struct cpt_asym_sess_misc *sess;
 
-	sess = get_asym_session_private_data(op->session,
-					     otx_cryptodev_driver_id);
+	sess = get_asym_session_private_data(op->session);
 
 	switch (sess->xfrm_type) {
 	case RTE_CRYPTO_ASYM_XFORM_RSA:
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 5794ed8159..1e7e5f6849 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -747,10 +747,7 @@ get_session(struct openssl_qp *qp, struct rte_crypto_op *op)
 						cryptodev_driver_id);
 		} else {
 			if (likely(op->asym->session != NULL))
-				asym_sess = (struct openssl_asym_session *)
-						get_asym_session_private_data(
-						op->asym->session,
-						cryptodev_driver_id);
+				asym_sess = get_asym_session_private_data(op->asym->session);
 			if (asym_sess == NULL)
 				op->status =
 					RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 52715f86f8..061fdd2837 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -1120,7 +1120,7 @@ static int
 openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
 		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool)
+		struct rte_mempool *mempool __rte_unused)
 {
 	void *asym_sess_private_data;
 	int ret;
@@ -1130,25 +1130,14 @@ openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		return -EINVAL;
 	}
 
-	if (rte_mempool_get(mempool, &asym_sess_private_data)) {
-		CDEV_LOG_ERR(
-			"Couldn't get object from session mempool");
-		return -ENOMEM;
-	}
-
+	asym_sess_private_data = get_asym_session_private_data(sess);
 	ret = openssl_set_asym_session_parameters(asym_sess_private_data,
 			xform);
 	if (ret != 0) {
 		OPENSSL_LOG(ERR, "failed configure session parameters");
-
-		/* Return session to mempool */
-		rte_mempool_put(mempool, asym_sess_private_data);
 		return ret;
 	}
 
-	set_asym_session_private_data(sess, dev->driver_id,
-			asym_sess_private_data);
-
 	return 0;
 }
 
@@ -1206,19 +1195,15 @@ static void openssl_reset_asym_session(struct openssl_asym_session *sess)
  * so it doesn't leave key material behind
  */
 static void
-openssl_pmd_asym_session_clear(struct rte_cryptodev *dev,
+openssl_pmd_asym_session_clear(struct rte_cryptodev *dev __rte_unused,
 		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t index = dev->driver_id;
-	void *sess_priv = get_asym_session_private_data(sess, index);
+	void *sess_priv = get_asym_session_private_data(sess);
 
 	/* Zero out the whole structure */
 	if (sess_priv) {
 		openssl_reset_asym_session(sess_priv);
 		memset(sess_priv, 0, sizeof(struct openssl_asym_session));
-		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
-		set_asym_session_private_data(sess, index, NULL);
-		rte_mempool_put(sess_mp, sess_priv);
 	}
 }
 
diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index 09d8761c5f..32d3f01a18 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -491,9 +491,7 @@ qat_asym_build_request(void *in_op,
 
 	op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
 	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
-		ctx = (struct qat_asym_session *)
-			get_asym_session_private_data(
-			op->asym->session, qat_asym_driver_id);
+		ctx = get_asym_session_private_data(op->asym->session);
 		if (unlikely(ctx == NULL)) {
 			QAT_LOG(ERR, "Session has not been created for this device");
 			goto error;
@@ -711,8 +709,7 @@ qat_asym_process_response(void **op, uint8_t *resp,
 	}
 
 	if (rx_op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
-		ctx = (struct qat_asym_session *)get_asym_session_private_data(
-			rx_op->asym->session, qat_asym_driver_id);
+		ctx = get_asym_session_private_data(rx_op->asym->session);
 		qat_asym_collect_response(rx_op, cookie, ctx->xform);
 	} else if (rx_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
 		qat_asym_collect_response(rx_op, cookie, rx_op->asym->xform);
@@ -726,61 +723,43 @@ qat_asym_process_response(void **op, uint8_t *resp,
 }
 
 int
-qat_asym_session_configure(struct rte_cryptodev *dev,
+qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
 		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool)
+		struct rte_mempool *mempool __rte_unused)
 {
-	int err = 0;
-	void *sess_private_data;
 	struct qat_asym_session *session;
 
-	if (rte_mempool_get(mempool, &sess_private_data)) {
-		QAT_LOG(ERR,
-			"Couldn't get object from session mempool");
-		return -ENOMEM;
-	}
-
-	session = sess_private_data;
+	session = get_asym_session_private_data(sess);
 	if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODEX) {
 		if (xform->modex.exponent.length == 0 ||
 				xform->modex.modulus.length == 0) {
 			QAT_LOG(ERR, "Invalid mod exp input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODINV) {
 		if (xform->modinv.modulus.length == 0) {
 			QAT_LOG(ERR, "Invalid mod inv input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_RSA) {
 		if (xform->rsa.n.length == 0) {
 			QAT_LOG(ERR, "Invalid rsa input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type >= RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
 			|| xform->xform_type <= RTE_CRYPTO_ASYM_XFORM_NONE) {
 		QAT_LOG(ERR, "Invalid asymmetric crypto xform");
-		err = -EINVAL;
-		goto error;
+		return -EINVAL;
 	} else {
 		QAT_LOG(ERR, "Asymmetric crypto xform not implemented");
-		err = -EINVAL;
-		goto error;
+		return -EINVAL;
 	}
 
 	session->xform = xform;
-	qat_asym_build_req_tmpl(sess_private_data);
-	set_asym_session_private_data(sess, dev->driver_id,
-		sess_private_data);
+	qat_asym_build_req_tmpl(session);
 
 	return 0;
-error:
-	rte_mempool_put(mempool, sess_private_data);
-	return err;
 }
 
 unsigned int qat_asym_session_get_private_size(
@@ -793,15 +772,9 @@ void
 qat_asym_session_clear(struct rte_cryptodev *dev,
 		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t index = dev->driver_id;
-	void *sess_priv = get_asym_session_private_data(sess, index);
+	void *sess_priv = get_asym_session_private_data(sess);
 	struct qat_asym_session *s = (struct qat_asym_session *)sess_priv;
 
-	if (sess_priv) {
+	if (sess_priv)
 		memset(s, 0, qat_asym_session_get_private_size(dev));
-		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
-
-		set_asym_session_private_data(sess, index, NULL);
-		rte_mempool_put(sess_mp, sess_priv);
-	}
 }
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index b9146f652c..474d447496 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -340,12 +340,12 @@ typedef int (*cryptodev_asym_configure_session_t)(struct rte_cryptodev *dev,
 typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		struct rte_cryptodev_sym_session *sess);
 /**
- * Free asymmetric session private data.
+ * Clear asymmetric session private data.
  *
  * @param	dev		Crypto device pointer
  * @param	sess		Cryptodev session structure
  */
-typedef void (*cryptodev_asym_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_asym_clear_session_t)(struct rte_cryptodev *dev,
 		struct rte_cryptodev_asym_session *sess);
 /**
  * Perform actual crypto processing (encrypt/digest or auth/decrypt)
@@ -429,7 +429,7 @@ struct rte_cryptodev_ops {
 	/**< Configure asymmetric Crypto session. */
 	cryptodev_sym_free_session_t sym_session_clear;
 	/**< Clear a Crypto sessions private data. */
-	cryptodev_asym_free_session_t asym_session_clear;
+	cryptodev_asym_clear_session_t asym_session_clear;
 	/**< Clear a Crypto sessions private data. */
 	union {
 		cryptodev_sym_cpu_crypto_process_t sym_cpu_process;
@@ -628,16 +628,9 @@ set_sym_session_private_data(struct rte_cryptodev_sym_session *sess,
 }
 
 static inline void *
-get_asym_session_private_data(const struct rte_cryptodev_asym_session *sess,
-		uint8_t driver_id) {
-	return sess->sess_private_data[driver_id];
-}
-
-static inline void
-set_asym_session_private_data(struct rte_cryptodev_asym_session *sess,
-		uint8_t driver_id, void *private_data)
+get_asym_session_private_data(struct rte_cryptodev_asym_session *sess)
 {
-	sess->sess_private_data[driver_id] = private_data;
+	return sess->sess_private_data;
 }
 
 #endif /* _CRYPTODEV_PMD_H_ */
diff --git a/lib/cryptodev/cryptodev_trace_points.c b/lib/cryptodev/cryptodev_trace_points.c
index 5d58951fd5..d23b30edd8 100644
--- a/lib/cryptodev/cryptodev_trace_points.c
+++ b/lib/cryptodev/cryptodev_trace_points.c
@@ -24,6 +24,9 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_setup,
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_pool_create,
 	lib.cryptodev.sym.pool.create)
 
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_pool_create,
+	lib.cryptodev.asym.pool.create)
+
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_create,
 	lib.cryptodev.sym.create)
 
@@ -39,9 +42,6 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_free,
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_init,
 	lib.cryptodev.sym.init)
 
-RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_init,
-	lib.cryptodev.asym.init)
-
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_clear,
 	lib.cryptodev.sym.clear)
 
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index a40536c5ea..d260f79bbc 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -195,7 +195,7 @@ const char *rte_crypto_asym_op_strings[] = {
 };
 
 /**
- * The private data structure stored in the session mempool private data.
+ * The private data structure stored in the sym session mempool private data.
  */
 struct rte_cryptodev_sym_session_pool_private_data {
 	uint16_t nb_drivers;
@@ -204,6 +204,14 @@ struct rte_cryptodev_sym_session_pool_private_data {
 	/**< session user data will be placed after sess_data */
 };
 
+/**
+ * The private data structure stored in the asym session mempool private data.
+ */
+struct rte_cryptodev_asym_session_pool_private_data {
+	uint16_t max_priv_session_sz;
+	/**< Size of private session data used when creating mempool */
+};
+
 int
 rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum,
 		const char *algo_string)
@@ -1751,47 +1759,6 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 	return 0;
 }
 
-int
-rte_cryptodev_asym_session_init(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_crypto_asym_xform *xforms,
-		struct rte_mempool *mp)
-{
-	struct rte_cryptodev *dev;
-	uint8_t index;
-	int ret;
-
-	if (!rte_cryptodev_is_valid_dev(dev_id)) {
-		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_get_dev(dev_id);
-
-	if (sess == NULL || xforms == NULL || dev == NULL)
-		return -EINVAL;
-
-	index = dev->driver_id;
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure,
-				-ENOTSUP);
-
-	if (sess->sess_private_data[index] == NULL) {
-		ret = dev->dev_ops->asym_session_configure(dev,
-							xforms,
-							sess, mp);
-		if (ret < 0) {
-			CDEV_LOG_ERR(
-				"dev_id %d failed to configure session details",
-				dev_id);
-			return ret;
-		}
-	}
-
-	rte_cryptodev_trace_asym_session_init(dev_id, sess, xforms, mp);
-	return 0;
-}
-
 struct rte_mempool *
 rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	uint32_t elt_size, uint32_t cache_size, uint16_t user_data_size,
@@ -1834,6 +1801,53 @@ rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	return mp;
 }
 
+struct rte_mempool *
+rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
+	uint32_t cache_size, int socket_id)
+{
+	struct rte_mempool *mp;
+	struct rte_cryptodev_asym_session_pool_private_data *pool_priv;
+	uint32_t obj_sz, obj_sz_aligned;
+	uint8_t dev_id, priv_sz, max_priv_sz = 0;
+
+	for (dev_id = 0; dev_id < RTE_CRYPTO_MAX_DEVS; dev_id++)
+		if (rte_cryptodev_is_valid_dev(dev_id)) {
+			priv_sz = rte_cryptodev_asym_get_private_session_size(dev_id);
+			if (priv_sz > max_priv_sz)
+				max_priv_sz = priv_sz;
+		}
+	if (max_priv_sz == 0) {
+		CDEV_LOG_INFO("Could not set max private session size\n");
+		return NULL;
+	}
+
+	obj_sz = rte_cryptodev_asym_get_header_session_size() + max_priv_sz;
+	obj_sz_aligned =  RTE_ALIGN_CEIL(obj_sz, RTE_CACHE_LINE_SIZE);
+
+	mp = rte_mempool_create(name, nb_elts, obj_sz_aligned, cache_size,
+			(uint32_t)(sizeof(*pool_priv)),
+			NULL, NULL, NULL, NULL,
+			socket_id, 0);
+	if (mp == NULL) {
+		CDEV_LOG_ERR("%s(name=%s) failed, rte_errno=%d\n",
+			__func__, name, rte_errno);
+		return NULL;
+	}
+
+	pool_priv = rte_mempool_get_priv(mp);
+	if (!pool_priv) {
+		CDEV_LOG_ERR("%s(name=%s) failed to get private data\n",
+			__func__, name);
+		rte_mempool_free(mp);
+		return NULL;
+	}
+	pool_priv->max_priv_session_sz = max_priv_sz;
+
+	rte_cryptodev_trace_asym_session_pool_create(name, nb_elts,
+		cache_size, mp);
+	return mp;
+}
+
 static unsigned int
 rte_cryptodev_sym_session_data_size(struct rte_cryptodev_sym_session *sess)
 {
@@ -1895,19 +1909,43 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 }
 
 struct rte_cryptodev_asym_session *
-rte_cryptodev_asym_session_create(struct rte_mempool *mp)
+rte_cryptodev_asym_session_create(struct rte_mempool *mp, uint8_t dev_id,
+		struct rte_crypto_asym_xform *xforms)
 {
 	struct rte_cryptodev_asym_session *sess;
-	unsigned int session_size =
+	uint32_t session_priv_data_sz;
+	struct rte_cryptodev_asym_session_pool_private_data *pool_priv;
+	unsigned int session_header_size =
 			rte_cryptodev_asym_get_header_session_size();
+	struct rte_cryptodev *dev;
+	int ret;
+
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
+		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
+		return NULL;
+	}
+	session_priv_data_sz = rte_cryptodev_asym_get_private_session_size(
+			dev_id);
+	dev = rte_cryptodev_pmd_get_dev(dev_id);
+
+	if (dev == NULL)
+		return NULL;
 
 	if (!mp) {
 		CDEV_LOG_ERR("invalid mempool\n");
 		return NULL;
 	}
 
+	pool_priv = rte_mempool_get_priv(mp);
+
+	if (pool_priv->max_priv_session_sz < session_priv_data_sz) {
+		CDEV_LOG_DEBUG(
+			"The private session data size used when creating the mempool is smaller than this device's private session data.");
+		return NULL;
+	}
+
 	/* Verify if provided mempool can hold elements big enough. */
-	if (mp->elt_size < session_size) {
+	if (mp->elt_size < session_header_size + session_priv_data_sz) {
 		CDEV_LOG_ERR(
 			"mempool elements too small to hold session objects");
 		return NULL;
@@ -1919,10 +1957,27 @@ rte_cryptodev_asym_session_create(struct rte_mempool *mp)
 		return NULL;
 	}
 
+	sess->driver_id = dev->driver_id;
+	sess->max_priv_session_sz = pool_priv->max_priv_session_sz;
+
 	/* Clear device session pointer.
 	 * Include the flag indicating presence of private data
 	 */
-	memset(sess, 0, session_size);
+	memset(sess->sess_private_data, 0, session_priv_data_sz);
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, NULL);
+
+	if (sess->sess_private_data[0] == 0) {
+		ret = dev->dev_ops->asym_session_configure(dev,
+							xforms,
+							sess, mp);
+		if (ret < 0) {
+			CDEV_LOG_ERR(
+				"dev_id %d failed to configure session details",
+				dev_id);
+			return NULL;
+		}
+	}
 
 	rte_cryptodev_trace_asym_session_create(mp, sess);
 	return sess;
@@ -2009,20 +2064,11 @@ rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
 int
 rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t i;
-	void *sess_priv;
 	struct rte_mempool *sess_mp;
 
 	if (sess == NULL)
 		return -EINVAL;
 
-	/* Check that all device private data has been freed */
-	for (i = 0; i < nb_drivers; i++) {
-		sess_priv = get_asym_session_private_data(sess, i);
-		if (sess_priv != NULL)
-			return -EBUSY;
-	}
-
 	/* Return session to mempool */
 	sess_mp = rte_mempool_from_obj(sess);
 	rte_mempool_put(sess_mp, sess);
@@ -2061,12 +2107,7 @@ rte_cryptodev_sym_get_existing_header_session_size(
 unsigned int
 rte_cryptodev_asym_get_header_session_size(void)
 {
-	/*
-	 * Header contains pointers to the private data
-	 * of all registered drivers, and a flag which
-	 * indicates presence of private data
-	 */
-	return ((sizeof(void *) * nb_drivers) + sizeof(uint8_t));
+	return sizeof(struct rte_cryptodev_asym_session);
 }
 
 unsigned int
@@ -2092,7 +2133,6 @@ unsigned int
 rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
-	unsigned int header_size = sizeof(void *) * nb_drivers;
 	unsigned int priv_sess_size;
 
 	if (!rte_cryptodev_is_valid_dev(dev_id))
@@ -2104,11 +2144,8 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 		return 0;
 
 	priv_sess_size = (*dev->dev_ops->asym_session_get_size)(dev);
-	if (priv_sess_size < header_size)
-		return header_size;
 
 	return priv_sess_size;
-
 }
 
 int
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 59ea5a54df..8bd85f1575 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -919,9 +919,13 @@ struct rte_cryptodev_sym_session {
 };
 
 /** Cryptodev asymmetric crypto session */
-struct rte_cryptodev_asym_session {
-	__extension__ void *sess_private_data[0];
-	/**< Private asymmetric session material */
+__extension__ struct rte_cryptodev_asym_session {
+	uint8_t driver_id;
+	/**< Session driver ID. */
+	uint16_t max_priv_session_sz;
+	/**< Size of private session data used when creating mempool */
+	uint8_t padding[5];
+	uint8_t sess_private_data[0];
 };
 
 /**
@@ -956,6 +960,29 @@ rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	uint32_t elt_size, uint32_t cache_size, uint16_t priv_size,
 	int socket_id);
 
+/**
+ * Create an asymmetric session mempool.
+ *
+ * @param name
+ *   The unique mempool name.
+ * @param nb_elts
+ *   The number of elements in the mempool.
+ * @param cache_size
+ *   The number of per-lcore cache elements
+ * @param socket_id
+ *   The *socket_id* argument is the socket identifier in the case of
+ *   NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA
+ *   constraint for the reserved zone.
+ *
+ * @return
+ *  - On success return mempool
+ *  - On failure returns NULL
+ */
+__rte_experimental
+struct rte_mempool *
+rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
+	uint32_t cache_size, int socket_id);
+
 /**
  * Create symmetric crypto session header (generic with no private data)
  *
@@ -973,13 +1000,17 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mempool);
  *
  * @param   mempool    mempool to allocate asymmetric session
  *                     objects from
+ * @param   dev_id   ID of device that we want the session to be used on
+ * @param   xforms   Asymmetric crypto transform operations to apply on flow
+ *                   processed with this session
  * @return
  *  - On success return pointer to asym-session
  *  - On failure returns NULL
  */
 __rte_experimental
 struct rte_cryptodev_asym_session *
-rte_cryptodev_asym_session_create(struct rte_mempool *mempool);
+rte_cryptodev_asym_session_create(struct rte_mempool *mempool,
+		uint8_t dev_id, struct rte_crypto_asym_xform *xforms);
 
 /**
  * Frees symmetric crypto session header, after checking that all
@@ -997,8 +1028,7 @@ int
 rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess);
 
 /**
- * Frees asymmetric crypto session header, after checking that all
- * the device private data has been freed, returning it
+ * Frees asymmetric crypto session header, returning it
  * to its original mempool.
  *
  * @param   sess     Session header to be freed.
@@ -1006,7 +1036,6 @@ rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess);
  * @return
  *  - 0 if successful.
  *  - -EINVAL if session is NULL.
- *  - -EBUSY if not all device private data has been freed.
  */
 __rte_experimental
 int
@@ -1034,28 +1063,6 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 			struct rte_crypto_sym_xform *xforms,
 			struct rte_mempool *mempool);
 
-/**
- * Initialize asymmetric session on a device with specific asymmetric xform
- *
- * @param   dev_id   ID of device that we want the session to be used on
- * @param   sess     Session to be set up on a device
- * @param   xforms   Asymmetric crypto transform operations to apply on flow
- *                   processed with this session
- * @param   mempool  Mempool to be used for internal allocation.
- *
- * @return
- *  - On success, zero.
- *  - -EINVAL if input parameters are invalid.
- *  - -ENOTSUP if crypto device does not support the crypto transform.
- *  - -ENOMEM if the private session could not be allocated.
- */
-__rte_experimental
-int
-rte_cryptodev_asym_session_init(uint8_t dev_id,
-			struct rte_cryptodev_asym_session *sess,
-			struct rte_crypto_asym_xform *xforms,
-			struct rte_mempool *mempool);
-
 /**
  * Frees private data for the device id, based on its device type,
  * returning it to its mempool. It is the application's responsibility
@@ -1075,11 +1082,10 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id,
 			struct rte_cryptodev_sym_session *sess);
 
 /**
- * Frees resources held by asymmetric session during rte_cryptodev_session_init
+ * Clear private data held by asymmetric session.
  *
  * @param   dev_id   ID of device that uses the asymmetric session.
- * @param   sess     Asymmetric session setup on device using
- *					 rte_cryptodev_session_init
+ * @param   sess     Asymmetric session setup on device.
  * @return
  *  - 0 if successful.
  *  - -EINVAL if device is invalid or session is NULL.
@@ -1116,7 +1122,7 @@ rte_cryptodev_sym_get_existing_header_session_size(
 		struct rte_cryptodev_sym_session *sess);
 
 /**
- * Get the size of the asymmetric session header, for all registered drivers.
+ * Get the size of the asymmetric session header.
  *
  * @return
  *   Size of the asymmetric header session.
diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
index d1f4f069a3..befbaf7f44 100644
--- a/lib/cryptodev/rte_cryptodev_trace.h
+++ b/lib/cryptodev/rte_cryptodev_trace.h
@@ -83,6 +83,16 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_u16(sess->user_data_sz);
 )
 
+RTE_TRACE_POINT(
+	rte_cryptodev_trace_asym_session_pool_create,
+	RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts,
+		uint32_t cache_size, void *mempool),
+	rte_trace_point_emit_string(name);
+	rte_trace_point_emit_u32(nb_elts);
+	rte_trace_point_emit_u32(cache_size);
+	rte_trace_point_emit_ptr(mempool);
+)
+
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_create,
 	RTE_TRACE_POINT_ARGS(void *mempool,
@@ -117,17 +127,6 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_ptr(mempool);
 )
 
-RTE_TRACE_POINT(
-	rte_cryptodev_trace_asym_session_init,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess, void *xforms,
-		void *mempool),
-	rte_trace_point_emit_u8(dev_id);
-	rte_trace_point_emit_ptr(sess);
-	rte_trace_point_emit_ptr(xforms);
-	rte_trace_point_emit_ptr(mempool);
-)
-
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_sym_session_clear,
 	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index c50745fa8c..eaea976f21 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -58,7 +58,6 @@ EXPERIMENTAL {
 	rte_cryptodev_asym_session_clear;
 	rte_cryptodev_asym_session_create;
 	rte_cryptodev_asym_session_free;
-	rte_cryptodev_asym_session_init;
 	rte_cryptodev_asym_xform_capability_check_modlen;
 	rte_cryptodev_asym_xform_capability_check_optype;
 	rte_cryptodev_sym_cpu_crypto_process;
@@ -81,7 +80,6 @@ EXPERIMENTAL {
 	__rte_cryptodev_trace_sym_session_free;
 	__rte_cryptodev_trace_asym_session_free;
 	__rte_cryptodev_trace_sym_session_init;
-	__rte_cryptodev_trace_asym_session_init;
 	__rte_cryptodev_trace_sym_session_clear;
 	__rte_cryptodev_trace_asym_session_clear;
 	__rte_cryptodev_trace_dequeue_burst;
@@ -104,6 +102,9 @@ EXPERIMENTAL {
 	rte_cryptodev_remove_deq_callback;
 	rte_cryptodev_remove_enq_callback;
 
+	# added 22.03
+	rte_cryptodev_asym_session_pool_create;
+	__rte_cryptodev_trace_asym_session_pool_create;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 1%]

* [PATCH v3 4/4] crypto: modify return value for asym session create
    2022-02-03 16:04  1% ` [PATCH v3 1/4] crypto: use single buffer for asymmetric session Ciara Power
@ 2022-02-03 16:04  2% ` Ciara Power
  1 sibling, 0 replies; 200+ results
From: Ciara Power @ 2022-02-03 16:04 UTC (permalink / raw)
  To: dev; +Cc: roy.fan.zhang, gakhil, anoobj, mdr, Ciara Power, Declan Doherty

Rather than the asym session create function returning a session on
success, and a NULL value on error, it is modified to now return int
values - 0 on success or -EINVAL/-ENOTSUP/-ENOMEM on failure.
The session to be used is passed as input.

This adds clarity on the failure of the create function, which enables
treating the -ENOTSUP return as TEST_SKIPPED in test apps.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>

---
v3:
  - Fixed variable declarations, putting initialised variable last.
  - Made function comment for return value more generic.
  - Fixed log to include line break.
  - Added documentation.
---
 app/test-crypto-perf/cperf_ops.c        |  12 ++-
 app/test/test_cryptodev_asym.c          | 132 +++++++++++++-----------
 doc/guides/prog_guide/cryptodev_lib.rst |   6 +-
 doc/guides/rel_notes/release_22_03.rst  |   3 +-
 lib/cryptodev/rte_cryptodev.c           |  27 ++---
 lib/cryptodev/rte_cryptodev.h           |  11 +-
 6 files changed, 104 insertions(+), 87 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 948dc0f608..1486298931 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -734,7 +734,9 @@ cperf_create_session(struct rte_mempool *sess_mp,
 	struct rte_crypto_sym_xform auth_xform;
 	struct rte_crypto_sym_xform aead_xform;
 	struct rte_cryptodev_sym_session *sess = NULL;
+	void *asym_sess = NULL;
 	struct rte_crypto_asym_xform xform = {0};
+	int ret;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
 		xform.next = NULL;
@@ -744,11 +746,13 @@ cperf_create_session(struct rte_mempool *sess_mp,
 		xform.modex.exponent.data = perf_mod_e;
 		xform.modex.exponent.length = sizeof(perf_mod_e);
 
-		sess = (void *)rte_cryptodev_asym_session_create(sess_mp, dev_id, &xform);
-		if (sess == NULL)
+		ret = rte_cryptodev_asym_session_create(&asym_sess,
+				sess_mp, dev_id, &xform);
+		if (ret < 0) {
+			RTE_LOG(ERR, USER1, "Asym session create failed\n");
 			return NULL;
-
-		return sess;
+		}
+		return asym_sess;
 	}
 #ifdef RTE_LIB_SECURITY
 	/*
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index a81d6292f6..2edf8b5b42 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -315,7 +315,7 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	uint8_t input[TEST_DATA_SIZE] = {0};
 	uint8_t *result = NULL;
 
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	xform_tc.next = NULL;
 	xform_tc.xform_type = data_tc->modex.xform_type;
@@ -450,14 +450,14 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (!sessionless) {
-		sess = rte_cryptodev_asym_session_create(ts_params->session_mpool,
-				dev_id, &xform_tc);
-		if (!sess) {
+		ret = rte_cryptodev_asym_session_create(&sess,
+				ts_params->session_mpool, dev_id, &xform_tc);
+		if (ret < 0) {
 			snprintf(test_msg, ASYM_TEST_MSG_LEN,
 					"line %u "
 					"FAILED: %s", __LINE__,
 					"Session creation failed");
-			status = TEST_FAILED;
+			status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 			goto error_exit;
 		}
 
@@ -644,9 +644,9 @@ test_rsa_sign_verify(void)
 	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
-	void *sess;
+	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with exponent key only,
 	 * Check in PMD feature flag for RSA exponent key type support.
@@ -659,12 +659,12 @@ test_rsa_sign_verify(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &rsa_xform);
-
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &rsa_xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -685,9 +685,9 @@ test_rsa_enc_dec(void)
 	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
-	void *sess;
+	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with exponent key only,
 	 * Check in PMD feature flag for RSA exponent key type support.
@@ -700,11 +700,11 @@ test_rsa_enc_dec(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &rsa_xform);
-
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &rsa_xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -726,9 +726,9 @@ test_rsa_sign_verify_crt(void)
 	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
-	void *sess;
+	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with quintuple format key only,
 	 * Check im PMD feature flag for RSA quintuple key type support.
@@ -740,12 +740,12 @@ test_rsa_sign_verify_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &rsa_xform_crt);
-
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &rsa_xform_crt);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify_crt\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -767,9 +767,9 @@ test_rsa_enc_dec_crt(void)
 	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
-	void *sess;
+	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with quintuple format key only,
 	 * Check in PMD feature flag for RSA quintuple key type support.
@@ -781,12 +781,12 @@ test_rsa_enc_dec_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &rsa_xform_crt);
-
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &rsa_xform_crt);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"enc_dec_crt\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1050,7 +1050,7 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 	uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
@@ -1077,12 +1077,13 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.shared_secret.data = output;
 	asym_op->dh.shared_secret.length = sizeof(output);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1135,7 +1136,7 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
@@ -1157,12 +1158,13 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = output;
 	asym_op->dh.priv_key.length = sizeof(output);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1218,7 +1220,7 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
@@ -1248,12 +1250,13 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 					0);
 	asym_op->dh.priv_key = dh_test_params.priv_key;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1309,7 +1312,7 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t out_pub_key[TEST_DH_MOD_LEN];
 	uint8_t out_prv_key[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform pub_key_xform;
@@ -1339,12 +1342,13 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = out_prv_key;
 	asym_op->dh.priv_key.length = sizeof(out_prv_key);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1430,12 +1434,13 @@ test_mod_inv(void)
 				return TEST_SKIPPED;
 		}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &modinv_xform);
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &modinv_xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1556,13 +1561,14 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &modex_xform);
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &modex_xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				 "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1668,13 +1674,14 @@ test_dsa_sign(void)
 	uint8_t r[TEST_DH_MOD_LEN];
 	uint8_t s[TEST_DH_MOD_LEN];
 	uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
+	int ret;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &dsa_xform);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool, dev_id, &dsa_xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				 "line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 	/* set up crypto op data structure */
@@ -1805,7 +1812,7 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	struct rte_crypto_asym_op *asym_op;
 	struct rte_cryptodev_info dev_info;
 	struct rte_crypto_op *op = NULL;
-	int status = TEST_SUCCESS, ret;
+	int ret, status = TEST_SUCCESS;
 
 	switch (curve_id) {
 	case SECP192R1:
@@ -1850,12 +1857,13 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
 	xform.ec.curve_id = input_params.curve;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool,
+			dev_id, &xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto exit;
 	}
 
@@ -2009,7 +2017,7 @@ test_ecpm(enum curve curve_id)
 	struct rte_crypto_asym_op *asym_op;
 	struct rte_cryptodev_info dev_info;
 	struct rte_crypto_op *op = NULL;
-	int status = TEST_SUCCESS, ret;
+	int ret, status = TEST_SUCCESS;
 
 	switch (curve_id) {
 	case SECP192R1:
@@ -2054,12 +2062,12 @@ test_ecpm(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
 	xform.ec.curve_id = input_params.curve;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool, dev_id, &xform);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(&sess, sess_mpool, dev_id, &xform);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto exit;
 	}
 
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 62bd3577f5..8e16461dc6 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -1236,10 +1236,10 @@ crypto operations is similar except change to respective op and xform setup).
      * Create asym crypto session and initialize it for the crypto device.
      * The session structure is hidden from the app, so void * is used.
      */
-    void *asym_session;
-    asym_session = rte_cryptodev_asym_session_create(asym_session_pool,
+    void *asym_session = NULL;
+    ret = rte_cryptodev_asym_session_create(&asym_session, asym_session_pool,
             cdev_id, &modex_xform);
-    if (asym_session == NULL)
+    if (ret < 0)
         rte_exit(EXIT_FAILURE, "Session could not be created\n");
 
     /* Get a burst of crypto operations. */
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 1022f77828..195a7efdd5 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -110,7 +110,8 @@ API Changes
   create a mempool with element size to hold the generic asym session header,
   along with the max size for a device private session data, and user data size.
   ``rte_cryptodev_asym_session_init`` was removed as this initialisation is
-  now done by ``rte_cryptodev_asym_session_create``.
+  now done by ``rte_cryptodev_asym_session_create``, which was updated to
+  return an integer value to indicate initialisation errors.
 
 
 ABI Changes
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 0d816ed4a9..005f0e7952 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1912,9 +1912,9 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 	return sess;
 }
 
-void *
-rte_cryptodev_asym_session_create(struct rte_mempool *mp, uint8_t dev_id,
-		struct rte_crypto_asym_xform *xforms)
+int
+rte_cryptodev_asym_session_create(void **session, struct rte_mempool *mp,
+		uint8_t dev_id, struct rte_crypto_asym_xform *xforms)
 {
 	struct rte_cryptodev_asym_session *sess;
 	uint32_t session_priv_data_sz;
@@ -1926,18 +1926,18 @@ rte_cryptodev_asym_session_create(struct rte_mempool *mp, uint8_t dev_id,
 
 	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return NULL;
+		return -EINVAL;
 	}
 	session_priv_data_sz = rte_cryptodev_asym_get_private_session_size(
 			dev_id);
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
 
 	if (dev == NULL)
-		return NULL;
+		return -EINVAL;
 
 	if (!mp) {
 		CDEV_LOG_ERR("invalid mempool\n");
-		return NULL;
+		return -EINVAL;
 	}
 
 	pool_priv = rte_mempool_get_priv(mp);
@@ -1945,22 +1945,23 @@ rte_cryptodev_asym_session_create(struct rte_mempool *mp, uint8_t dev_id,
 	if (pool_priv->max_priv_session_sz < session_priv_data_sz) {
 		CDEV_LOG_DEBUG(
 			"The private session data size used when creating the mempool is smaller than this device's private session data.");
-		return NULL;
+		return -EINVAL;
 	}
 
 	/* Verify if provided mempool can hold elements big enough. */
 	if (mp->elt_size < session_header_size + session_priv_data_sz) {
 		CDEV_LOG_ERR(
 			"mempool elements too small to hold session objects");
-		return NULL;
+		return -EINVAL;
 	}
 
 	/* Allocate a session structure from the session pool */
-	if (rte_mempool_get(mp, (void **)&sess)) {
+	if (rte_mempool_get(mp, session)) {
 		CDEV_LOG_ERR("couldn't get object from session mempool");
-		return NULL;
+		return -ENOMEM;
 	}
 
+	sess = *session;
 	sess->driver_id = dev->driver_id;
 	sess->user_data_sz = pool_priv->user_data_sz;
 	sess->max_priv_session_sz = pool_priv->max_priv_session_sz;
@@ -1970,7 +1971,7 @@ rte_cryptodev_asym_session_create(struct rte_mempool *mp, uint8_t dev_id,
 	 */
 	memset(sess->sess_private_data, 0, session_priv_data_sz + sess->user_data_sz);
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, NULL);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, -ENOTSUP);
 
 	if (sess->sess_private_data[0] == 0) {
 		ret = dev->dev_ops->asym_session_configure(dev,
@@ -1980,12 +1981,12 @@ rte_cryptodev_asym_session_create(struct rte_mempool *mp, uint8_t dev_id,
 			CDEV_LOG_ERR(
 				"dev_id %d failed to configure session details",
 				dev_id);
-			return NULL;
+			return ret;
 		}
 	}
 
 	rte_cryptodev_trace_asym_session_create(mp, sess);
-	return sess;
+	return 0;
 }
 
 int
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 6a4d6d9934..9a75936963 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -990,18 +990,21 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mempool);
 /**
  * Create asymmetric crypto session header (generic with no private data)
  *
+ * @param   session    void ** for session to be used
  * @param   mempool    mempool to allocate asymmetric session
  *                     objects from
  * @param   dev_id   ID of device that we want the session to be used on
  * @param   xforms   Asymmetric crypto transform operations to apply on flow
  *                   processed with this session
  * @return
- *  - On success return pointer to asym-session
- *  - On failure returns NULL
+ *  - 0 on success.
+ *  - -EINVAL on invalid arguments.
+ *  - -ENOMEM on memory error for session allocation.
+ *  - -ENOTSUP if device doesn't support session configuration.
  */
 __rte_experimental
-void *
-rte_cryptodev_asym_session_create(struct rte_mempool *mempool,
+int
+rte_cryptodev_asym_session_create(void **session, struct rte_mempool *mempool,
 		uint8_t dev_id, struct rte_crypto_asym_xform *xforms);
 
 /**
-- 
2.25.1


^ permalink raw reply	[relevance 2%]

* Re: [PATCH v2 4/8] net/bonding: support enabling LACP short timeout
  @ 2022-02-04 14:46  4%     ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2022-02-04 14:46 UTC (permalink / raw)
  To: Robert Sanford, dev
  Cc: chas3, humin29, bruce.richardson, David Marchand, Ray Kinsella

On 12/21/2021 7:57 PM, Robert Sanford wrote:
> - Add support for enabling LACP short timeout, i.e., link partner can
>    use fast periodic time interval between transmits.
> 
> Signed-off-by: Robert Sanford <rsanford@akamai.com>
> ---
>   drivers/net/bonding/eth_bond_8023ad_private.h |  3 ++-
>   drivers/net/bonding/rte_eth_bond_8023ad.c     | 28 +++++++++++++++++++++++----
>   drivers/net/bonding/rte_eth_bond_8023ad.h     |  3 +++
>   3 files changed, 29 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/bonding/eth_bond_8023ad_private.h b/drivers/net/bonding/eth_bond_8023ad_private.h
> index 60db31e..bfde03c 100644
> --- a/drivers/net/bonding/eth_bond_8023ad_private.h
> +++ b/drivers/net/bonding/eth_bond_8023ad_private.h
> @@ -159,7 +159,6 @@ struct mode8023ad_private {
>   	uint64_t rx_marker_timeout;
>   	uint64_t update_timeout_us;
>   	rte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb;
> -	uint8_t external_sm;
>   	struct rte_ether_addr mac_addr;
>   
>   	struct rte_eth_link slave_link;
> @@ -178,6 +177,8 @@ struct mode8023ad_private {
>   		uint16_t tx_qid;
>   	} dedicated_queues;
>   	enum rte_bond_8023ad_agg_selection agg_selection;
> +	uint8_t short_timeout_enabled : 1;
> +	uint8_t short_timeout_updated : 1;
>   };
>   
>   /**
> diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
> index 9ed2a46..5c175e7 100644
> --- a/drivers/net/bonding/rte_eth_bond_8023ad.c
> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
> @@ -868,10 +868,10 @@ bond_mode_8023ad_periodic_cb(void *arg)
>   	struct rte_eth_link link_info;
>   	struct rte_ether_addr slave_addr;
>   	struct rte_mbuf *lacp_pkt = NULL;
> +	uint8_t short_timeout_updated = internals->mode4.short_timeout_updated;
>   	uint16_t slave_id;
>   	uint16_t i;
>   
> -
>   	/* Update link status on each port */
>   	for (i = 0; i < internals->active_slave_count; i++) {
>   		uint16_t key;
> @@ -916,6 +916,13 @@ bond_mode_8023ad_periodic_cb(void *arg)
>   		slave_id = internals->active_slaves[i];
>   		port = &bond_mode_8023ad_ports[slave_id];
>   
> +		if (short_timeout_updated) {
> +			if (internals->mode4.short_timeout_enabled)
> +				ACTOR_STATE_SET(port, LACP_SHORT_TIMEOUT);
> +			else
> +				ACTOR_STATE_CLR(port, LACP_SHORT_TIMEOUT);
> +		}
> +
>   		if ((port->actor.key &
>   				rte_cpu_to_be_16(BOND_LINK_FULL_DUPLEX_KEY)) == 0) {
>   
> @@ -960,6 +967,9 @@ bond_mode_8023ad_periodic_cb(void *arg)
>   		show_warnings(slave_id);
>   	}
>   
> +	if (short_timeout_updated)
> +		internals->mode4.short_timeout_updated = 0;
> +
>   	rte_eal_alarm_set(internals->mode4.update_timeout_us,
>   			bond_mode_8023ad_periodic_cb, arg);
>   }
> @@ -1054,7 +1064,6 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
>   	/* Given slave must not be in active list. */
>   	RTE_ASSERT(find_slave_by_id(internals->active_slaves,
>   	internals->active_slave_count, slave_id) == internals->active_slave_count);
> -	RTE_SET_USED(internals); /* used only for assert when enabled */
>   
>   	memcpy(&port->actor, &initial, sizeof(struct port_params));
>   	/* Standard requires that port ID must be greater than 0.
> @@ -1065,7 +1074,9 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
>   	memcpy(&port->partner_admin, &initial, sizeof(struct port_params));
>   
>   	/* default states */
> -	port->actor_state = STATE_AGGREGATION | STATE_LACP_ACTIVE | STATE_DEFAULTED;
> +	port->actor_state = STATE_AGGREGATION | STATE_LACP_ACTIVE |
> +		STATE_DEFAULTED | (internals->mode4.short_timeout_enabled ?
> +		STATE_LACP_SHORT_TIMEOUT : 0);
>   	port->partner_state = STATE_LACP_ACTIVE | STATE_AGGREGATION;
>   	port->sm_flags = SM_FLAGS_BEGIN;
>   
> @@ -1209,6 +1220,7 @@ bond_mode_8023ad_conf_get(struct rte_eth_dev *dev,
>   	struct mode8023ad_private *mode4 = &internals->mode4;
>   	uint64_t ms_ticks = rte_get_tsc_hz() / 1000;
>   
> +	memset(conf, 0, sizeof(*conf));
>   	conf->fast_periodic_ms = mode4->fast_periodic_timeout / ms_ticks;
>   	conf->slow_periodic_ms = mode4->slow_periodic_timeout / ms_ticks;
>   	conf->short_timeout_ms = mode4->short_timeout / ms_ticks;
> @@ -1219,6 +1231,7 @@ bond_mode_8023ad_conf_get(struct rte_eth_dev *dev,
>   	conf->rx_marker_period_ms = mode4->rx_marker_timeout / ms_ticks;
>   	conf->slowrx_cb = mode4->slowrx_cb;
>   	conf->agg_selection = mode4->agg_selection;
> +	conf->lacp_timeout_control = mode4->short_timeout_enabled;
>   }
>   
>   static void
> @@ -1234,6 +1247,7 @@ bond_mode_8023ad_conf_get_default(struct rte_eth_bond_8023ad_conf *conf)
>   	conf->update_timeout_ms = BOND_MODE_8023AX_UPDATE_TIMEOUT_MS;
>   	conf->slowrx_cb = NULL;
>   	conf->agg_selection = AGG_STABLE;
> +	conf->lacp_timeout_control = 0;
>   }
>   
>   static void
> @@ -1274,6 +1288,11 @@ bond_mode_8023ad_setup(struct rte_eth_dev *dev,
>   	mode4->slowrx_cb = conf->slowrx_cb;
>   	mode4->agg_selection = AGG_STABLE;
>   
> +	if (mode4->short_timeout_enabled != conf->lacp_timeout_control) {
> +		mode4->short_timeout_enabled = conf->lacp_timeout_control;
> +		mode4->short_timeout_updated = 1;
> +	}
> +
>   	if (dev->data->dev_started)
>   		bond_mode_8023ad_start(dev);
>   }
> @@ -1478,7 +1497,8 @@ bond_8023ad_setup_validate(uint16_t port_id,
>   				conf->aggregate_wait_timeout_ms == 0 ||
>   				conf->tx_period_ms == 0 ||
>   				conf->rx_marker_period_ms == 0 ||
> -				conf->update_timeout_ms == 0) {
> +				conf->update_timeout_ms == 0 ||
> +				conf->lacp_timeout_control > 1) {
>   			RTE_BOND_LOG(ERR, "given mode 4 configuration is invalid");
>   			return -EINVAL;
>   		}
> diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h
> index 7e9a018..87f6b2f 100644
> --- a/drivers/net/bonding/rte_eth_bond_8023ad.h
> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h
> @@ -139,6 +139,9 @@ struct rte_eth_bond_8023ad_conf {
>   	uint32_t update_timeout_ms;
>   	rte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb;
>   	enum rte_bond_8023ad_agg_selection agg_selection;
> +	uint8_t lacp_timeout_control;
> +	/**< LACPDU.Actor_State.LACP_Timeout flag: 0=Long 1=Short. */
> +	uint8_t reserved_8s[3];
>   };
>   
>   struct rte_eth_bond_8023ad_slave_info {

The changes gives ABI warning [1], it increases size of struct that is
parameter to the public API.

So old applications will send a smaller struct, but new DPDK library
will check beyond the size of the struct, most probably some unrelated
memory in the stack, this looks an ABI break to me.
@Ray can you please check if I am missing anything?



[1]
   [C] 'function int rte_eth_bond_8023ad_conf_get(uint16_t, rte_eth_bond_8023ad_conf*)' at rte_eth_bond_8023ad.c:1423:1 has some indirect sub-type changes:
     parameter 2 of type 'rte_eth_bond_8023ad_conf*' has sub-type changes:
       in pointed to type 'struct rte_eth_bond_8023ad_conf' at rte_eth_bond_8023ad.h:131:1:
Error: ABI issue reported for 'abidiff --suppr devtools/libabigail.abignore --no-added-syms --headers-dir1 reference/usr/local/include --headers-dir2 install/usr/local/include reference/dump/librte_net_bond.dump install/dump/librte_net_bond.dump'
ABIDIFF_ABI_CHANGE, this change requires a review (abidiff flagged this as a potential issue).
         type size hasn't changed
         2 data member insertions:
           'uint8_t rte_eth_bond_8023ad_conf::lacp_timeout_control', at offset 352 (in bits) at rte_eth_bond_8023ad.h:142:1
           'uint8_t rte_eth_bond_8023ad_conf::reserved_8s[3]', at offset 360 (in bits) at rte_eth_bond_8023ad.h:144:1

^ permalink raw reply	[relevance 4%]

* Re: [PATCH v2 8/8] net/bonding: add LACP short timeout tests
  @ 2022-02-04 14:49  4%     ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2022-02-04 14:49 UTC (permalink / raw)
  To: Robert Sanford, dev; +Cc: chas3, humin29, bruce.richardson

On 12/21/2021 7:57 PM, Robert Sanford wrote:
> - Add "set bonding lacp timeout_ctrl <port_id> on|off" to testpmd.
> - Add "test_mode4_lacp_timeout_control" to dpdk-test.
> - Remove call to rte_eth_dev_mac_addr_remove from add_slave,
>    as it always fails and prints an error.
> 
> Signed-off-by: Robert Sanford<rsanford@akamai.com>
> ---
>   app/test-pmd/cmdline.c             | 77 ++++++++++++++++++++++++++++++++++++++
>   app/test/test_link_bonding_mode4.c | 70 +++++++++++++++++++++++++++++++++-
>   2 files changed, 145 insertions(+), 2 deletions(-)

This patch depends on path 4/8, which cause an ABI error, so can't proceed
with this patch before ABI issue is resolved.

^ permalink raw reply	[relevance 4%]

* Re: [PATCH v2 0/8] net/bonding: fixes and LACP short timeout
      @ 2022-02-04 15:09  3%   ` Ferruh Yigit
  2 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2022-02-04 15:09 UTC (permalink / raw)
  To: Robert Sanford, dev; +Cc: chas3, humin29, bruce.richardson

On 12/21/2021 7:57 PM, Robert Sanford wrote:
> This patchset makes the following changes to net/bonding:
> - Clean up minor errors in spelling, whitespace, C++ wrappers, and
>    comments.
> - Replace directly overwriting of slave port's rte_eth_conf by copying
>    it, but only updating it via rte_eth_dev_configure().
> - Make minor changes to allocation of mbuf pool and rx/tx rings.
> - Add support for enabling LACP short timeout, i.e., link partner can
>    use fast periodic time interval between transmits.
> - Include bond_8023ad and bond_alb in doxygen.
> - Remove self from Timers maintainers.
> - Add API stubs to net/ring PMD.
> - Add LACP short timeout to tests.
> 
> V2 changes:
> - Additional typo and whitespace corrections.
> - Minor changes to LACP private rings creation.
> - Add net/ring API stubs patch.
> - Insert extra "bond_handshake" to LACP short timeout autotest.
> 
> Robert Sanford (8):
>    net/bonding: fix typos and whitespace
>    net/bonding: fix bonded dev configuring slave dev
>    net/bonding: change mbuf pool and ring creation
>    net/bonding: support enabling LACP short timeout
>    net/bonding: add bond_8023ad and bond_alb to doc
>    Remove self from Timers maintainers.
>    net/ring: add promiscuous and allmulticast API stubs
>    net/bonding: add LACP short timeout to tests
> 

Hi Robert,

There are some unrelated (and independent) patches in the set,
can you please make new version as multiple sets to help to manage them?

- 4/8 & 8/8 can be a separate set, since they have ABI concern they can
   be managed separately

- 6/8 can be separate

- rest can be various bonding fix set

Thanks,
ferruh

^ permalink raw reply	[relevance 3%]

* [PATCH v4 0/3] ethdev: introduce IP reassembly offload
  2022-01-30 17:59  4% ` [PATCH v3 " Akhil Goyal
    2022-02-01 14:10  0%   ` [PATCH v3 0/4] ethdev: introduce IP reassembly offload Ferruh Yigit
@ 2022-02-04 22:13  4%   ` Akhil Goyal
    2022-02-08 20:11  4%     ` [PATCH v5 0/3] ethdev: introduce IP reassembly offload Akhil Goyal
  2 siblings, 2 replies; 200+ results
From: Akhil Goyal @ 2022-02-04 22:13 UTC (permalink / raw)
  To: dev
  Cc: anoobj, matan, konstantin.ananyev, thomas, ferruh.yigit,
	andrew.rybchenko, rosen.xu, olivier.matz, david.marchand,
	radu.nicolau, jerinj, stephen, mdr, Akhil Goyal

As discussed in the RFC[1] sent in 21.11, a new offload is
introduced in ethdev for IP reassembly.

This patchset add the IP reassembly RX offload.
Currently, the offload is tested along with inline IPsec processing.
It can also be updated as a standalone offload without IPsec, if there
are some hardware available to test it.
The patchset is tested on cnxk platform. The driver implementation
and a test app are added as separate patchsets.[2][3]

[1]: http://patches.dpdk.org/project/dpdk/patch/20210823100259.1619886-1-gakhil@marvell.com/
[2]: APP: http://patches.dpdk.org/project/dpdk/list/?series=21284
[3]: PMD: http://patches.dpdk.org/project/dpdk/list/?series=21285
Newer versions of app and PMD will be sent once library changes are
acked.

Changes in v4:
- removed rte_eth_dev_info update for capability (Ferruh)
- removed Rx offload flag (Ferruh)
- added capability_get() (Ferruh)
- moved dynfield and dynflag namedefines in rte_mbuf_dyn.h (Ferruh)

changes in v3:
- incorporated comments from Andrew and Stephen Hemminger

changes in v2:
- added abi ignore exceptions for modifications in reserved fields.
  Added a crude way to subside the rte_security and rte_ipsec ABI issue.
  Please suggest a better way.
- incorporated Konstantin's comment for extra checks in new API
  introduced.
- converted static mbuf ol_flag to mbuf dynflag (Konstantin)
- added a get API for reassembly configuration (Konstantin)
- Fixed checkpatch issues.
- Dynfield is NOT split into 2 parts as it would cause an extra fetch in
  case of IP reassembly failure.
- Application patches are split into a separate series.



Akhil Goyal (3):
  ethdev: introduce IP reassembly offload
  ethdev: add mbuf dynfield for incomplete IP reassembly
  security: add IPsec option for IP reassembly

 devtools/libabigail.abignore |  14 ++++
 doc/guides/nics/features.rst |  13 ++++
 lib/ethdev/ethdev_driver.h   |  63 ++++++++++++++++++
 lib/ethdev/rte_ethdev.c      | 121 +++++++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev.h      | 108 +++++++++++++++++++++++++++++++
 lib/ethdev/version.map       |   6 ++
 lib/mbuf/rte_mbuf_dyn.h      |   9 +++
 lib/security/rte_security.h  |  12 +++-
 8 files changed, 345 insertions(+), 1 deletion(-)

-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* RE: [EXT] Re: [PATCH v4 3/3] security: add IPsec option for IP reassembly
  @ 2022-02-08  9:18  3%         ` Akhil Goyal
  2022-02-08  9:27  0%           ` David Marchand
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2022-02-08  9:18 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Anoob Joseph, Matan Azrad, Ananyev, Konstantin,
	Thomas Monjalon, Yigit, Ferruh, Andrew Rybchenko, Rosen Xu,
	Olivier Matz, Radu Nicolau, Jerin Jacob Kollanukkaran,
	Stephen Hemminger, Ray Kinsella, Dodji Seketeli

> Hello Akhil,
> 
> 
> On Fri, Feb 4, 2022 at 11:14 PM Akhil Goyal <gakhil@marvell.com> wrote:
> >
> > A new option is added in IPsec to enable and attempt reassembly
> > of inbound packets.
> 
> First, about extending this structure.
> 
> Copying the header:
> 
>         /** Reserved bit fields for future extension
>          *
>          * User should ensure reserved_opts is cleared as it may change in
>          * subsequent releases to support new options.
>          *
>          * Note: Reduce number of bits in reserved_opts for every new option.
>          */
>         uint32_t reserved_opts : 18;
> 
> I did not follow the introduction of the reserved_opts field, but
> writing this comment in the API only is weak.
> Why can't the rte_security API enforce reserved_opts == 0 (like in
> rte_security_session_create)?
> 
This was discussed here.
http://patches.dpdk.org/project/dpdk/patch/20211008204516.3497060-3-gakhil@marvell.com/
rte_security_ipsec_sa_options is being used at multiple places as listed below in abiignore.
Checking a particular field in each of the API does not make sense to me.

> 
> 
> >
> > Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> > Change-Id: I6f66f0b5a659550976a32629130594070cb16cb1
>   ^^^
>   Internal tag, please remove.
> 
Yes, missed that will remove.
> 
> > ---
> >  devtools/libabigail.abignore | 14 ++++++++++++++
> >  lib/security/rte_security.h  | 12 +++++++++++-
> >  2 files changed, 25 insertions(+), 1 deletion(-)
> >
> > diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> > index 4b676f317d..3bd39042e8 100644
> > --- a/devtools/libabigail.abignore
> > +++ b/devtools/libabigail.abignore
> > @@ -11,3 +11,17 @@
> >  ; Ignore generated PMD information strings
> >  [suppress_variable]
> >          name_regexp = _pmd_info$
> > +
> > +; Ignore fields inserted in place of reserved_opts of
> rte_security_ipsec_sa_options
> > +[suppress_type]
> > +       name = rte_ipsec_sa_prm
> > +       name = rte_security_ipsec_sa_options
> > +       has_data_member_inserted_between = {offset_of(reserved_opts), end}
> > +
> > +[suppress_type]
> > +       name = rte_security_capability
> > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> (offset_of(reserved_opts) + 18)}
> > +
> > +[suppress_type]
> > +       name = rte_security_session_conf
> > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> (offset_of(reserved_opts) + 18)}
> 
> Now, about the suppression rule, I don't understand the intention of
> those 3 rules.
> 
> I would simply suppress modifications (after reserved_opts) to the
> rte_security_ipsec_sa_options struct.
> Like:
> 
> ; Ignore fields inserted in place of reserved_opts of
> rte_security_ipsec_sa_options
> [suppress_type]
>        name = rte_security_ipsec_sa_options
>        has_data_member_inserted_between = {offset_of(reserved_opts), end}
> 
I tried this in the first place but abi check was complaining in other structures which included
rte_security_ipsec_sa_options. So I had to add suppression for those as well.
Can you try at your end?

^ permalink raw reply	[relevance 3%]

* Re: [EXT] Re: [PATCH v4 3/3] security: add IPsec option for IP reassembly
  2022-02-08  9:18  3%         ` [EXT] " Akhil Goyal
@ 2022-02-08  9:27  0%           ` David Marchand
  2022-02-08 10:45  0%             ` Akhil Goyal
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2022-02-08  9:27 UTC (permalink / raw)
  To: Akhil Goyal
  Cc: dev, Anoob Joseph, Matan Azrad, Ananyev, Konstantin,
	Thomas Monjalon, Yigit, Ferruh, Andrew Rybchenko, Rosen Xu,
	Olivier Matz, Radu Nicolau, Jerin Jacob Kollanukkaran,
	Stephen Hemminger, Ray Kinsella, Dodji Seketeli

On Tue, Feb 8, 2022 at 10:19 AM Akhil Goyal <gakhil@marvell.com> wrote:
>
> > Hello Akhil,
> >
> >
> > On Fri, Feb 4, 2022 at 11:14 PM Akhil Goyal <gakhil@marvell.com> wrote:
> > >
> > > A new option is added in IPsec to enable and attempt reassembly
> > > of inbound packets.
> >
> > First, about extending this structure.
> >
> > Copying the header:
> >
> >         /** Reserved bit fields for future extension
> >          *
> >          * User should ensure reserved_opts is cleared as it may change in
> >          * subsequent releases to support new options.
> >          *
> >          * Note: Reduce number of bits in reserved_opts for every new option.
> >          */
> >         uint32_t reserved_opts : 18;
> >
> > I did not follow the introduction of the reserved_opts field, but
> > writing this comment in the API only is weak.
> > Why can't the rte_security API enforce reserved_opts == 0 (like in
> > rte_security_session_create)?
> >
> This was discussed here.
> http://patches.dpdk.org/project/dpdk/patch/20211008204516.3497060-3-gakhil@marvell.com/
> rte_security_ipsec_sa_options is being used at multiple places as listed below in abiignore.
> Checking a particular field in each of the API does not make sense to me.

It's strange to me that a user may pass this structure as input in
multiple functions.
But if it's how the security lib works, ok.


>
> >
> >
> > >
> > > Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> > > Change-Id: I6f66f0b5a659550976a32629130594070cb16cb1
> >   ^^^
> >   Internal tag, please remove.
> >
> Yes, missed that will remove.
> >
> > > ---
> > >  devtools/libabigail.abignore | 14 ++++++++++++++
> > >  lib/security/rte_security.h  | 12 +++++++++++-
> > >  2 files changed, 25 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> > > index 4b676f317d..3bd39042e8 100644
> > > --- a/devtools/libabigail.abignore
> > > +++ b/devtools/libabigail.abignore
> > > @@ -11,3 +11,17 @@
> > >  ; Ignore generated PMD information strings
> > >  [suppress_variable]
> > >          name_regexp = _pmd_info$
> > > +
> > > +; Ignore fields inserted in place of reserved_opts of
> > rte_security_ipsec_sa_options
> > > +[suppress_type]
> > > +       name = rte_ipsec_sa_prm
> > > +       name = rte_security_ipsec_sa_options
> > > +       has_data_member_inserted_between = {offset_of(reserved_opts), end}
> > > +
> > > +[suppress_type]
> > > +       name = rte_security_capability
> > > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> > (offset_of(reserved_opts) + 18)}
> > > +
> > > +[suppress_type]
> > > +       name = rte_security_session_conf
> > > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> > (offset_of(reserved_opts) + 18)}
> >
> > Now, about the suppression rule, I don't understand the intention of
> > those 3 rules.
> >
> > I would simply suppress modifications (after reserved_opts) to the
> > rte_security_ipsec_sa_options struct.
> > Like:
> >
> > ; Ignore fields inserted in place of reserved_opts of
> > rte_security_ipsec_sa_options
> > [suppress_type]
> >        name = rte_security_ipsec_sa_options
> >        has_data_member_inserted_between = {offset_of(reserved_opts), end}
> >
> I tried this in the first place but abi check was complaining in other structures which included
> rte_security_ipsec_sa_options. So I had to add suppression for those as well.
> Can you try at your end?

I tried before suggesting, and it works with a single rule on this structure.

I'm using libabigail current master, which version are you using so I
can try with the same?


-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* RE: [EXT] Re: [PATCH v4 3/3] security: add IPsec option for IP reassembly
  2022-02-08  9:27  0%           ` David Marchand
@ 2022-02-08 10:45  0%             ` Akhil Goyal
  2022-02-08 13:19  0%               ` Akhil Goyal
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2022-02-08 10:45 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Anoob Joseph, Matan Azrad, Ananyev, Konstantin,
	Thomas Monjalon, Yigit, Ferruh, Andrew Rybchenko, Rosen Xu,
	Olivier Matz, Radu Nicolau, Jerin Jacob Kollanukkaran,
	Stephen Hemminger, Ray Kinsella, Dodji Seketeli

> > > > diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> > > > index 4b676f317d..3bd39042e8 100644
> > > > --- a/devtools/libabigail.abignore
> > > > +++ b/devtools/libabigail.abignore
> > > > @@ -11,3 +11,17 @@
> > > >  ; Ignore generated PMD information strings
> > > >  [suppress_variable]
> > > >          name_regexp = _pmd_info$
> > > > +
> > > > +; Ignore fields inserted in place of reserved_opts of
> > > rte_security_ipsec_sa_options
> > > > +[suppress_type]
> > > > +       name = rte_ipsec_sa_prm
> > > > +       name = rte_security_ipsec_sa_options
> > > > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> end}
> > > > +
> > > > +[suppress_type]
> > > > +       name = rte_security_capability
> > > > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> > > (offset_of(reserved_opts) + 18)}
> > > > +
> > > > +[suppress_type]
> > > > +       name = rte_security_session_conf
> > > > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> > > (offset_of(reserved_opts) + 18)}
> > >
> > > Now, about the suppression rule, I don't understand the intention of
> > > those 3 rules.
> > >
> > > I would simply suppress modifications (after reserved_opts) to the
> > > rte_security_ipsec_sa_options struct.
> > > Like:
> > >
> > > ; Ignore fields inserted in place of reserved_opts of
> > > rte_security_ipsec_sa_options
> > > [suppress_type]
> > >        name = rte_security_ipsec_sa_options
> > >        has_data_member_inserted_between = {offset_of(reserved_opts), end}
> > >
> > I tried this in the first place but abi check was complaining in other structures
> which included
> > rte_security_ipsec_sa_options. So I had to add suppression for those as well.
> > Can you try at your end?
> 
> I tried before suggesting, and it works with a single rule on this structure.
> 
> I'm using libabigail current master, which version are you using so I
> can try with the same?
> 
I am currently using 1.6 version. I will try with latest version.
$ abidiff --version
abidiff: 1.6.0

and I get following issue after removing the last two suppress rules.
Functions changes summary: 0 Removed, 1 Changed (8 filtered out), 0 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

1 function with some indirect sub-type change:

  [C]'function const rte_security_capability* rte_security_capabilities_get(rte_security_ctx*)' at rte_security.c:158:1 has some indirect sub-type changes:
    return type changed:
      in pointed to type 'const rte_security_capability':
        in unqualified underlying type 'struct rte_security_capability' at rte_security.h:808:1:
          type size hasn't changed
          1 data member change:

    parameter 1 of type 'rte_security_ctx*' has sub-type changes:
      in pointed to type 'struct rte_security_ctx' at rte_security.h:72:1:
        type size hasn't changed
        1 data member change:
         type of 'const rte_security_ops* rte_security_ctx::ops' changed:
           in pointed to type 'const rte_security_ops':
             in unqualified underlying type 'struct rte_security_ops' at rte_security_driver.h:140:1:
               type size hasn't changed
               1 data member changes (2 filtered):
                type of 'security_session_create_t rte_security_ops::session_create' changed:
                  underlying type 'int (void*, rte_security_session_conf*, rte_security_session*, rte_mempool*)*' changed:
                    in pointed to type 'function type int (void*, rte_security_session_conf*, rte_security_session*, rte_mempool*)':
                      parameter 2 of type 'rte_security_session_conf*' has sub-type changes:
                        in pointed to type 'struct rte_security_session_conf' at rte_security.h:502:1:
                          type size hasn't changed
                          1 data member change:


^ permalink raw reply	[relevance 0%]

* RE: [EXT] Re: [PATCH v4 3/3] security: add IPsec option for IP reassembly
  2022-02-08 10:45  0%             ` Akhil Goyal
@ 2022-02-08 13:19  0%               ` Akhil Goyal
  2022-02-08 19:55  0%                 ` David Marchand
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2022-02-08 13:19 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Anoob Joseph, Matan Azrad, Ananyev, Konstantin,
	Thomas Monjalon, Yigit, Ferruh, Andrew Rybchenko, Rosen Xu,
	Olivier Matz, Radu Nicolau, Jerin Jacob Kollanukkaran,
	Stephen Hemminger, Ray Kinsella, Dodji Seketeli

Hi David,

> > > > > diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> > > > > index 4b676f317d..3bd39042e8 100644
> > > > > --- a/devtools/libabigail.abignore
> > > > > +++ b/devtools/libabigail.abignore
> > > > > @@ -11,3 +11,17 @@
> > > > >  ; Ignore generated PMD information strings
> > > > >  [suppress_variable]
> > > > >          name_regexp = _pmd_info$
> > > > > +
> > > > > +; Ignore fields inserted in place of reserved_opts of
> > > > rte_security_ipsec_sa_options
> > > > > +[suppress_type]
> > > > > +       name = rte_ipsec_sa_prm
> > > > > +       name = rte_security_ipsec_sa_options
> > > > > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> > end}
> > > > > +
> > > > > +[suppress_type]
> > > > > +       name = rte_security_capability
> > > > > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> > > > (offset_of(reserved_opts) + 18)}
> > > > > +
> > > > > +[suppress_type]
> > > > > +       name = rte_security_session_conf
> > > > > +       has_data_member_inserted_between = {offset_of(reserved_opts),
> > > > (offset_of(reserved_opts) + 18)}
> > > >
> > > > Now, about the suppression rule, I don't understand the intention of
> > > > those 3 rules.
> > > >
> > > > I would simply suppress modifications (after reserved_opts) to the
> > > > rte_security_ipsec_sa_options struct.
> > > > Like:
> > > >
> > > > ; Ignore fields inserted in place of reserved_opts of
> > > > rte_security_ipsec_sa_options
> > > > [suppress_type]
> > > >        name = rte_security_ipsec_sa_options
> > > >        has_data_member_inserted_between = {offset_of(reserved_opts),
> end}
> > > >
> > > I tried this in the first place but abi check was complaining in other structures
> > which included
> > > rte_security_ipsec_sa_options. So I had to add suppression for those as well.
> > > Can you try at your end?
> >
> > I tried before suggesting, and it works with a single rule on this structure.
> >
> > I'm using libabigail current master, which version are you using so I
> > can try with the same?
> >
> I am currently using 1.6 version. I will try with latest version.
> $ abidiff --version
> abidiff: 1.6.0
> 
It seems the latest version 2.0 is not compatible with Ubuntu 20.04.
It is not getting compiled.
Can you check with 1.6.0 version?


^ permalink raw reply	[relevance 0%]

* [PATCH] ci: remove outdated default reference tag for ABI
@ 2022-02-08 13:47  4% Thomas Monjalon
  2022-02-08 15:08  7% ` Aaron Conole
  2022-03-01  9:56  9% ` [PATCH v2] ci: remove outdated default versions for ABI check Thomas Monjalon
  0 siblings, 2 replies; 200+ results
From: Thomas Monjalon @ 2022-02-08 13:47 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, Aaron Conole, Michael Santana

The variable REF_GIT_TAG is set in the CI configuration
like .travis.yml or .github/workflows/build.yml.
The default value is outdated and probably unused.
It is removed completely to avoid forgetting an update in future.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 .ci/linux-build.sh | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index c10c1a8ab5..25a7cae120 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -119,7 +119,6 @@ if [ "$ABI_CHECKS" = "true" ]; then
     export PATH=$(pwd)/libabigail/bin:$PATH
 
     REF_GIT_REPO=${REF_GIT_REPO:-https://dpdk.org/git/dpdk}
-    REF_GIT_TAG=${REF_GIT_TAG:-v19.11}
 
     if [ "$(cat reference/VERSION 2>/dev/null)" != "$REF_GIT_TAG" ]; then
         rm -rf reference
-- 
2.34.1


^ permalink raw reply	[relevance 4%]

* RE: [EXT] [PATCH v2 4/8] crypto/dpaa2_sec: support AES-GMAC
  2022-01-21 11:29  3%     ` [EXT] " Akhil Goyal
@ 2022-02-08 14:15  0%       ` Gagandeep Singh
  0 siblings, 0 replies; 200+ results
From: Gagandeep Singh @ 2022-02-08 14:15 UTC (permalink / raw)
  To: Akhil Goyal, dev; +Cc: Akhil Goyal



> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Friday, January 21, 2022 4:59 PM
> To: Gagandeep Singh <G.Singh@nxp.com>; dev@dpdk.org
> Cc: Akhil Goyal <akhil.goyal@nxp.com>
> Subject: RE: [EXT] [PATCH v2 4/8] crypto/dpaa2_sec: support AES-GMAC
> 
> > From: Akhil Goyal <akhil.goyal@nxp.com>
> >
> > This patch supports AES_GMAC algorithm for DPAA2
> > driver.
> >
> > Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> > Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> > ---
> >  doc/guides/cryptodevs/features/dpaa2_sec.ini |  1 +
> >  drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c  | 14 ++++++++-
> >  drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h    | 30 ++++++++++++++++++++
> >  lib/cryptodev/rte_crypto_sym.h               |  4 ++-
> >  4 files changed, 47 insertions(+), 2 deletions(-)
> 
> This patch should be split in two - cryptodev change should be separate patch.
> 
> > diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
> > index daa090b978..4644fa3e25 100644
> > --- a/lib/cryptodev/rte_crypto_sym.h
> > +++ b/lib/cryptodev/rte_crypto_sym.h
> > @@ -467,8 +467,10 @@ enum rte_crypto_aead_algorithm {
> >  	/**< AES algorithm in CCM mode. */
> >  	RTE_CRYPTO_AEAD_AES_GCM,
> >  	/**< AES algorithm in GCM mode. */
> > -	RTE_CRYPTO_AEAD_CHACHA20_POLY1305
> > +	RTE_CRYPTO_AEAD_CHACHA20_POLY1305,
> >  	/**< Chacha20 cipher with poly1305 authenticator */
> > +	RTE_CRYPTO_AEAD_AES_GMAC
> > +	/**< AES algorithm in GMAC mode. */
> >  };
> AES-GMAC is also defined as AUTH algo. It may be removed but that would be
> ABI break.
> Is it not possible to use AES-GMAC as auth algo?
There are some issues in this patch. I will send it later.


^ permalink raw reply	[relevance 0%]

* Re: [PATCH] ci: remove outdated default reference tag for ABI
  2022-02-08 13:47  4% [PATCH] ci: remove outdated default reference tag for ABI Thomas Monjalon
@ 2022-02-08 15:08  7% ` Aaron Conole
  2022-02-08 22:03  8%   ` Brandon Lo
  2022-02-09 13:37  4%   ` Thomas Monjalon
  2022-03-01  9:56  9% ` [PATCH v2] ci: remove outdated default versions for ABI check Thomas Monjalon
  1 sibling, 2 replies; 200+ results
From: Aaron Conole @ 2022-02-08 15:08 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, david.marchand, Michael Santana, Lincoln Lavoie, Owen Hilyard

Thomas Monjalon <thomas@monjalon.net> writes:

> The variable REF_GIT_TAG is set in the CI configuration
> like .travis.yml or .github/workflows/build.yml.
> The default value is outdated and probably unused.
> It is removed completely to avoid forgetting an update in future.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---

I think the default was there for labs that run the build script
manually.  Maybe there are no such users, though.  I believe the lab has
its own script for doing such ABI checks (but can't remember off the top
of my head).

CC'd Lincoln and Owen just to confirm.

Assuming the UNH/other lab doesn't use this feature of the linux build
script,

Acked-by: Aaron Conole <aconole@redhat.com>


^ permalink raw reply	[relevance 7%]

* Re: [EXT] Re: [PATCH v4 3/3] security: add IPsec option for IP reassembly
  2022-02-08 13:19  0%               ` Akhil Goyal
@ 2022-02-08 19:55  0%                 ` David Marchand
  2022-02-08 20:01  0%                   ` Akhil Goyal
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2022-02-08 19:55 UTC (permalink / raw)
  To: Akhil Goyal, Dodji Seketeli
  Cc: dev, Anoob Joseph, Matan Azrad, Ananyev, Konstantin,
	Thomas Monjalon, Yigit, Ferruh, Andrew Rybchenko, Rosen Xu,
	Olivier Matz, Radu Nicolau, Jerin Jacob Kollanukkaran,
	Stephen Hemminger, Ray Kinsella

On Tue, Feb 8, 2022 at 2:19 PM Akhil Goyal <gakhil@marvell.com> wrote:
> > > > I tried this in the first place but abi check was complaining in other structures
> > > which included
> > > > rte_security_ipsec_sa_options. So I had to add suppression for those as well.
> > > > Can you try at your end?
> > >
> > > I tried before suggesting, and it works with a single rule on this structure.
> > >
> > > I'm using libabigail current master, which version are you using so I
> > > can try with the same?
> > >
> > I am currently using 1.6 version. I will try with latest version.
> > $ abidiff --version
> > abidiff: 1.6.0
> >
> It seems the latest version 2.0 is not compatible with Ubuntu 20.04.
> It is not getting compiled.

I am using the HEAD of libabigail master branch, so maybe something
got fixed between 2.0 and the current master.


> Can you check with 1.6.0 version?

I tried 1.6 in GHA (Ubuntu 18.04), and I can reproduce the warnings
you reported.

But in the end, we use 1.8 in GHA:
https://git.dpdk.org/dpdk/tree/.github/workflows/build.yml#n23

The simplest rule (on rte_security_ipsec_sa_options only) passes fine
with this version of libabigail:
https://github.com/david-marchand/dpdk/runs/5109221298?check_suite_focus=true


-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* RE: [EXT] Re: [PATCH v4 3/3] security: add IPsec option for IP reassembly
  2022-02-08 19:55  0%                 ` David Marchand
@ 2022-02-08 20:01  0%                   ` Akhil Goyal
  0 siblings, 0 replies; 200+ results
From: Akhil Goyal @ 2022-02-08 20:01 UTC (permalink / raw)
  To: David Marchand, Dodji Seketeli
  Cc: dev, Anoob Joseph, Matan Azrad, Ananyev, Konstantin,
	Thomas Monjalon, Yigit, Ferruh, Andrew Rybchenko, Rosen Xu,
	Olivier Matz, Radu Nicolau, Jerin Jacob Kollanukkaran,
	Stephen Hemminger, Ray Kinsella

Hi David,
> On Tue, Feb 8, 2022 at 2:19 PM Akhil Goyal <gakhil@marvell.com> wrote:
> > > > > I tried this in the first place but abi check was complaining in other
> structures
> > > > which included
> > > > > rte_security_ipsec_sa_options. So I had to add suppression for those as
> well.
> > > > > Can you try at your end?
> > > >
> > > > I tried before suggesting, and it works with a single rule on this structure.
> > > >
> > > > I'm using libabigail current master, which version are you using so I
> > > > can try with the same?
> > > >
> > > I am currently using 1.6 version. I will try with latest version.
> > > $ abidiff --version
> > > abidiff: 1.6.0
> > >
> > It seems the latest version 2.0 is not compatible with Ubuntu 20.04.
> > It is not getting compiled.
> 
> I am using the HEAD of libabigail master branch, so maybe something
> got fixed between 2.0 and the current master.
> 
> 
> > Can you check with 1.6.0 version?
> 
> I tried 1.6 in GHA (Ubuntu 18.04), and I can reproduce the warnings
> you reported.
> 
> But in the end, we use 1.8 in GHA:
> https://git.dpdk.org/dpdk/tree/.github/workflows/build.yml#n23
> 
> The simplest rule (on rte_security_ipsec_sa_options only) passes fine
> with this version of libabigail:
> https://github.com/david-marchand/dpdk/runs/5109221298?check_suite_focus=true

Thanks for trying it out. I will remove the last two rules and send next version.

^ permalink raw reply	[relevance 0%]

* [PATCH v5 0/3] ethdev: introduce IP reassembly offload
  2022-02-04 22:13  4%   ` [PATCH v4 0/3] " Akhil Goyal
  @ 2022-02-08 20:11  4%     ` Akhil Goyal
  2022-02-08 22:20  4%       ` [PATCH v6 " Akhil Goyal
  1 sibling, 1 reply; 200+ results
From: Akhil Goyal @ 2022-02-08 20:11 UTC (permalink / raw)
  To: dev
  Cc: anoobj, matan, konstantin.ananyev, thomas, ferruh.yigit,
	andrew.rybchenko, rosen.xu, olivier.matz, david.marchand,
	radu.nicolau, jerinj, stephen, mdr, Akhil Goyal

As discussed in the RFC[1] sent in 21.11, a new offload is
introduced in ethdev for IP reassembly.

This patchset add the IP reassembly RX offload.
Currently, the offload is tested along with inline IPsec processing.
It can also be updated as a standalone offload without IPsec, if there
are some hardware available to test it.
The patchset is tested on cnxk platform. The driver implementation
and a test app are added as separate patchsets.[2][3]

[1]: http://patches.dpdk.org/project/dpdk/patch/20210823100259.1619886-1-gakhil@marvell.com/
[2]: APP: http://patches.dpdk.org/project/dpdk/list/?series=21284
[3]: PMD: http://patches.dpdk.org/project/dpdk/list/?series=21285
Newer versions of app and PMD will be sent once library changes are
acked.

Changes in v5:
- updated Doxygen comments.(Ferruh)
- Added release notes.
- updated libabigail suppress rules.(David)

Changes in v4:
- removed rte_eth_dev_info update for capability (Ferruh)
- removed Rx offload flag (Ferruh)
- added capability_get() (Ferruh)
- moved dynfield and dynflag namedefines in rte_mbuf_dyn.h (Ferruh)

changes in v3:
- incorporated comments from Andrew and Stephen Hemminger

changes in v2:
- added abi ignore exceptions for modifications in reserved fields.
  Added a crude way to subside the rte_security and rte_ipsec ABI issue.
  Please suggest a better way.
- incorporated Konstantin's comment for extra checks in new API
  introduced.
- converted static mbuf ol_flag to mbuf dynflag (Konstantin)
- added a get API for reassembly configuration (Konstantin)
- Fixed checkpatch issues.
- Dynfield is NOT split into 2 parts as it would cause an extra fetch in
  case of IP reassembly failure.
- Application patches are split into a separate series.


Akhil Goyal (3):
  ethdev: introduce IP reassembly offload
  ethdev: add mbuf dynfield for incomplete IP reassembly
  security: add IPsec option for IP reassembly

 devtools/libabigail.abignore           |   5 +
 doc/guides/nics/features.rst           |  13 +++
 doc/guides/nics/features/default.ini   |   1 +
 doc/guides/rel_notes/release_22_03.rst |   6 ++
 lib/ethdev/ethdev_driver.h             |  63 +++++++++++++
 lib/ethdev/rte_ethdev.c                | 124 ++++++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 126 +++++++++++++++++++++++++
 lib/ethdev/version.map                 |   6 ++
 lib/mbuf/rte_mbuf_dyn.h                |   9 ++
 lib/security/rte_security.h            |  15 ++-
 10 files changed, 367 insertions(+), 1 deletion(-)

-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* Re: [PATCH] ci: remove outdated default reference tag for ABI
  2022-02-08 15:08  7% ` Aaron Conole
@ 2022-02-08 22:03  8%   ` Brandon Lo
  2022-02-09 13:37  4%   ` Thomas Monjalon
  1 sibling, 0 replies; 200+ results
From: Brandon Lo @ 2022-02-08 22:03 UTC (permalink / raw)
  To: Aaron Conole
  Cc: Thomas Monjalon, dev, David Marchand, Michael Santana,
	Lincoln Lavoie, Owen Hilyard

On Tue, Feb 8, 2022 at 10:09 AM Aaron Conole <aconole@redhat.com> wrote:
> I think the default was there for labs that run the build script
> manually.  Maybe there are no such users, though.  I believe the lab has
> its own script for doing such ABI checks (but can't remember off the top
> of my head).

Just confirming: the UNH lab does use our own separate script (which
calls the devtools check-abi.sh and gen-abi.sh scripts).


-- 
Brandon Lo
UNH InterOperability Laboratory
21 Madbury Rd, Suite 100, Durham, NH 03824
blo@iol.unh.edu
www.iol.unh.edu

^ permalink raw reply	[relevance 8%]

* [PATCH v6 0/3] ethdev: introduce IP reassembly offload
  2022-02-08 20:11  4%     ` [PATCH v5 0/3] ethdev: introduce IP reassembly offload Akhil Goyal
@ 2022-02-08 22:20  4%       ` Akhil Goyal
  2022-02-10  8:54  0%         ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2022-02-08 22:20 UTC (permalink / raw)
  To: dev
  Cc: anoobj, matan, konstantin.ananyev, thomas, ferruh.yigit,
	andrew.rybchenko, rosen.xu, olivier.matz, david.marchand,
	radu.nicolau, jerinj, stephen, mdr, Akhil Goyal

As discussed in the RFC[1] sent in 21.11, a new offload is
introduced in ethdev for IP reassembly.

This patchset add the IP reassembly RX offload.
Currently, the offload is tested along with inline IPsec processing.
It can also be updated as a standalone offload without IPsec, if there
are some hardware available to test it.
The patchset is tested on cnxk platform. The driver implementation
and a test app are added as separate patchsets.[2][3]

[1]: http://patches.dpdk.org/project/dpdk/patch/20210823100259.1619886-1-gakhil@marvell.com/
[2]: APP: http://patches.dpdk.org/project/dpdk/list/?series=21284
[3]: PMD: http://patches.dpdk.org/project/dpdk/list/?series=21285
Newer versions of app and PMD will be sent once library changes are
acked.

Changes in v6:
- fix warnings.

Changes in v5:
- updated Doxygen comments.(Ferruh)
- Added release notes.
- updated libabigail suppress rules.(David)

Changes in v4:
- removed rte_eth_dev_info update for capability (Ferruh)
- removed Rx offload flag (Ferruh)
- added capability_get() (Ferruh)
- moved dynfield and dynflag namedefines in rte_mbuf_dyn.h (Ferruh)

changes in v3:
- incorporated comments from Andrew and Stephen Hemminger

changes in v2:
- added abi ignore exceptions for modifications in reserved fields.
  Added a crude way to subside the rte_security and rte_ipsec ABI issue.
  Please suggest a better way.
- incorporated Konstantin's comment for extra checks in new API
  introduced.
- converted static mbuf ol_flag to mbuf dynflag (Konstantin)
- added a get API for reassembly configuration (Konstantin)
- Fixed checkpatch issues.
- Dynfield is NOT split into 2 parts as it would cause an extra fetch in
  case of IP reassembly failure.
- Application patches are split into a separate series.


Akhil Goyal (3):
  ethdev: introduce IP reassembly offload
  ethdev: add mbuf dynfield for incomplete IP reassembly
  security: add IPsec option for IP reassembly

 devtools/libabigail.abignore           |   5 +
 doc/guides/nics/features.rst           |  13 +++
 doc/guides/nics/features/default.ini   |   1 +
 doc/guides/rel_notes/release_22_03.rst |   6 ++
 lib/ethdev/ethdev_driver.h             |  63 +++++++++++++
 lib/ethdev/rte_ethdev.c                | 124 ++++++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 126 +++++++++++++++++++++++++
 lib/ethdev/version.map                 |   6 ++
 lib/mbuf/rte_mbuf_dyn.h                |   9 ++
 lib/security/rte_security.h            |  15 ++-
 10 files changed, 367 insertions(+), 1 deletion(-)

-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* Re: [PATCH v18 8/8] eal: implement functions for mutex management
  @ 2022-02-09  2:47  3%   ` Narcisa Ana Maria Vasile
  2022-02-09 13:57  0%     ` Ananyev, Konstantin
  0 siblings, 1 reply; 200+ results
From: Narcisa Ana Maria Vasile @ 2022-02-09  2:47 UTC (permalink / raw)
  To: Ananyev, Konstantin
  Cc: Richardson, Bruce, david.marchand, dev, dmitry.kozliuk, dmitrym,
	khot, navasile, ocardona, Kadam, Pallavi, roretzla, talshn,
	thomas

On Tue, Feb 08, 2022 at 02:21:49AM +0000, Ananyev, Konstantin wrote:
> 
> 
> > > +
> > > +/**
> > > + * Thread mutex representation.
> > 
> 
> Actually, please scrap that comment.
> Obviously it wouldn't work for static variables, 
> and doesn't make much sense.
> Though few thoughts remain:
> for posix we probably don't need an indirection and
> rte_thread_mutex can be just typedef of pthread_mutex_t.
> also for posix we don't need RTE_INIT constructor for each
> static mutex initialization.
> Something like:
> #define RTE_STATIC_INITIALIZED_MUTEX(mx) \
> 	rte_thread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER
> should work, I think.
> Konstantin

Thank you for reviewing, Konstantin!
Some context for the current representation of mutex
can be found in v9, patch 7/10 of this patchset.

Originally we've typedef'ed the pthread_mutex_t on POSIX, just
like you are suggesting here.
However, on Windows there's no static initializer similar to the pthread
one. Still, we want ABI compatibility and same thread behavior between
platforms. The most elegant solution we found was the current representation,
as suggested by Dmitry K.

I will address your other comments on the other thread.

Link to v9: http://patchwork.dpdk.org/project/dpdk/patch/1622850274-6946-8-git-send-email-navasile@linux.microsoft.com/
> 
> 

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v5 1/2] eal: add API for bus close
  @ 2022-02-09 11:04  3%   ` David Marchand
  2022-02-09 13:20  3%     ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2022-02-09 11:04 UTC (permalink / raw)
  To: Rohit Raj
  Cc: Bruce Richardson, Ray Kinsella, Dmitry Kozlyuk,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam, dev,
	Nipun Gupta, Sachin Saxena, Hemant Agrawal

On Mon, Jan 10, 2022 at 6:26 AM <rohit.raj@nxp.com> wrote:
>
> From: Rohit Raj <rohit.raj@nxp.com>
>
> As per the current code we have API for bus probe, but the
> bus close API is missing. This breaks the multi process
> scenarios as objects are not cleaned while terminating the
> secondary processes.

After an application crash, how does this bus resets the associated resources?


>
> This patch adds a new API rte_bus_close() for cleanup of
> bus objects which were acquired during probe.

The patch in its current form breaks the ABI on rte_bus object.
This can be seen in GHA, or calling DPDK_ABI_REF_VERSION=v21.11
./devtools/test-meson-builds.sh.


[snip]

> diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
> index 6d99d1eaa9..7417606a2a 100644
> --- a/doc/guides/rel_notes/release_22_03.rst
> +++ b/doc/guides/rel_notes/release_22_03.rst
> @@ -55,6 +55,11 @@ New Features
>       Also, make sure to start the actual text at the margin.
>       =======================================================
>
> +    * **Added support to close bus.**
> +
> +      Added capability to allow a user to do cleanup of bus objects which
> +      were acquired during bus probe.
> +

Wrongly indented.


>
>  Removed Items
>  -------------
> @@ -84,6 +89,9 @@ API Changes
>     Also, make sure to start the actual text at the margin.
>     =======================================================
>
> +   * eal: Added new API ``rte_bus_close`` to perform cleanup bus objects which
> +     were acquired during bus probe.
> +
>
>  ABI Changes
>  -----------
> diff --git a/lib/eal/common/eal_common_bus.c b/lib/eal/common/eal_common_bus.c
> index baa5b532af..2c3c0a90d2 100644
> --- a/lib/eal/common/eal_common_bus.c
> +++ b/lib/eal/common/eal_common_bus.c
> @@ -1,5 +1,5 @@
>  /* SPDX-License-Identifier: BSD-3-Clause
> - * Copyright 2016 NXP
> + * Copyright 2016,2022 NXP
>   */
>
>  #include <stdio.h>
> @@ -85,6 +85,37 @@ rte_bus_probe(void)
>         return 0;
>  }
>
> +/* Close all devices of all buses */
> +int
> +rte_bus_close(void)
> +{
> +       int ret;
> +       struct rte_bus *bus, *vbus = NULL;
> +
> +       TAILQ_FOREACH(bus, &rte_bus_list, next) {
> +               if (!strcmp(bus->name, "vdev")) {
> +                       vbus = bus;
> +                       continue;
> +               }
> +
> +               if (bus->close) {
> +                       ret = bus->close();
> +                       if (ret)
> +                               RTE_LOG(ERR, EAL, "Bus (%s) close failed.\n",
> +                                       bus->name);
> +               }
> +       }
> +
> +       if (vbus && vbus->close) {
> +               ret = vbus->close();
> +               if (ret)
> +                       RTE_LOG(ERR, EAL, "Bus (%s) close failed.\n",
> +                               vbus->name);
> +       }

The vdev bus is special in that some drivers can reference objects
from other buses (see f4ce209a8ce5 ("eal: postpone vdev
initialization") and da76cc02342b ("eal: probe new virtual bus after
other bus devices")).
For this reason, I would expect that the vdev bus is closed before the
other buses.


> +
> +       return 0;
> +}
> +
>  /* Dump information of a single bus */
>  static int
>  bus_dump_one(FILE *f, struct rte_bus *bus)
> diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> index a1cd2462db..87d70c6898 100644
> --- a/lib/eal/freebsd/eal.c
> +++ b/lib/eal/freebsd/eal.c
> @@ -984,6 +984,7 @@ rte_eal_cleanup(void)
>  {
>         struct internal_config *internal_conf =
>                 eal_get_internal_configuration();
> +       rte_bus_close();
>         rte_service_finalize();
>         rte_mp_channel_cleanup();
>         /* after this point, any DPDK pointers will become dangling */
> diff --git a/lib/eal/include/rte_bus.h b/lib/eal/include/rte_bus.h
> index bbbb6efd28..c6211bbd95 100644
> --- a/lib/eal/include/rte_bus.h
> +++ b/lib/eal/include/rte_bus.h
> @@ -1,5 +1,5 @@
>  /* SPDX-License-Identifier: BSD-3-Clause
> - * Copyright 2016 NXP
> + * Copyright 2016,2022 NXP
>   */
>
>  #ifndef _RTE_BUS_H_
> @@ -66,6 +66,23 @@ typedef int (*rte_bus_scan_t)(void);
>   */
>  typedef int (*rte_bus_probe_t)(void);
>
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice
> + *
> + * Implementation specific close function which is responsible for resetting all
> + * detected devices on the bus to a default state, closing UIO nodes or VFIO
> + * groups and also freeing any memory allocated during rte_bus_probe like
> + * private resources for device list.
> + *
> + * This is called while iterating over each registered bus.
> + *
> + * @return
> + *     0 for successful close
> + *     !0 for any error while closing
> + */
> +typedef int (*rte_bus_close_t)(void);
> +
>  /**
>   * Device iterator to find a device on a bus.
>   *
> @@ -263,6 +280,7 @@ struct rte_bus {
>         const char *name;            /**< Name of the bus */
>         rte_bus_scan_t scan;         /**< Scan for devices attached to bus */
>         rte_bus_probe_t probe;       /**< Probe devices on bus */
> +       rte_bus_close_t close;       /**< Close devices on bus */
>         rte_bus_find_device_t find_device; /**< Find a device on the bus */
>         rte_bus_plug_t plug;         /**< Probe single device for drivers */
>         rte_bus_unplug_t unplug;     /**< Remove single device from driver */
> @@ -317,6 +335,16 @@ int rte_bus_scan(void);
>   */
>  int rte_bus_probe(void);
>
> +/**
> + * For each device on the buses, call the device specific close.
> + *
> + * @return
> + *      0 for successful close
> + *     !0 otherwise
> + */
> +__rte_experimental
> +int rte_bus_close(void);
> +
>  /**
>   * Dump information of all the buses registered with EAL.
>   *
> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
> index 60b4924838..5c60131e46 100644
> --- a/lib/eal/linux/eal.c
> +++ b/lib/eal/linux/eal.c
> @@ -1362,6 +1362,14 @@ rte_eal_cleanup(void)
>
>         if (rte_eal_process_type() == RTE_PROC_PRIMARY)
>                 rte_memseg_walk(mark_freeable, NULL);
> +
> +       /* Close all the buses and devices/drivers on them */
> +       if (rte_bus_close()) {
> +               rte_eal_init_alert("Cannot close devices");

You can't call rte_eal_*init*_alert in rte_eal_cleanup.

There is not much to do if the bus close fails, I'd rather leave the
cleanup continue.


> +               rte_errno = ENOTSUP;
> +               return -1;
> +       }
> +
>         rte_service_finalize();
>         rte_mp_channel_cleanup();
>         /* after this point, any DPDK pointers will become dangling */
> diff --git a/lib/eal/version.map b/lib/eal/version.map
> index ab28c22791..39882dbbd5 100644
> --- a/lib/eal/version.map
> +++ b/lib/eal/version.map
> @@ -420,6 +420,9 @@ EXPERIMENTAL {
>         rte_intr_instance_free;
>         rte_intr_type_get;
>         rte_intr_type_set;
> +
> +       # added in 22.03
> +       rte_bus_close;
>  };
>
>  INTERNAL {
> diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
> index 67db7f099a..5915ab6291 100644
> --- a/lib/eal/windows/eal.c
> +++ b/lib/eal/windows/eal.c
> @@ -260,6 +260,7 @@ rte_eal_cleanup(void)
>         struct internal_config *internal_conf =
>                 eal_get_internal_configuration();
>
> +       rte_bus_close();
>         eal_intr_thread_cancel();
>         eal_mem_virt2iova_cleanup();
>         /* after this point, any DPDK pointers will become dangling */
> --
> 2.17.1
>


-- 
David Marchand


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v5 1/2] eal: add API for bus close
  2022-02-09 11:04  3%   ` David Marchand
@ 2022-02-09 13:20  3%     ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-02-09 13:20 UTC (permalink / raw)
  To: Rohit Raj
  Cc: dev, Bruce Richardson, Ray Kinsella, Dmitry Kozlyuk,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam, dev,
	Nipun Gupta, Sachin Saxena, Hemant Agrawal, David Marchand

09/02/2022 12:04, David Marchand:
> On Mon, Jan 10, 2022 at 6:26 AM <rohit.raj@nxp.com> wrote:
> >
> > From: Rohit Raj <rohit.raj@nxp.com>
> >
> > As per the current code we have API for bus probe, but the
> > bus close API is missing. This breaks the multi process
> > scenarios as objects are not cleaned while terminating the
> > secondary processes.
> 
> After an application crash, how does this bus resets the associated resources?
> 
> > This patch adds a new API rte_bus_close() for cleanup of
> > bus objects which were acquired during probe.
> 
> The patch in its current form breaks the ABI on rte_bus object.
> This can be seen in GHA, or calling DPDK_ABI_REF_VERSION=v21.11
> ./devtools/test-meson-builds.sh.

[...]
> > +/* Close all devices of all buses */
> > +int
> > +rte_bus_close(void)
> > +{
> > +       int ret;
> > +       struct rte_bus *bus, *vbus = NULL;
> > +
> > +       TAILQ_FOREACH(bus, &rte_bus_list, next) {
> > +               if (!strcmp(bus->name, "vdev")) {

Please do an explicit comparison "== 0".

> > +                       vbus = bus;
> > +                       continue;
> > +               }
> > +
> > +               if (bus->close) {

Please do an explicit comparison with "!= NULL".
We can also completely remove this check and implement the callback
in all buses. It should loop in all remaining devices and remove them.

> > +                       ret = bus->close();
> > +                       if (ret)
> > +                               RTE_LOG(ERR, EAL, "Bus (%s) close failed.\n",
> > +                                       bus->name);
> > +               }
> > +       }
> > +
> > +       if (vbus && vbus->close) {
> > +               ret = vbus->close();
> > +               if (ret)
> > +                       RTE_LOG(ERR, EAL, "Bus (%s) close failed.\n",
> > +                               vbus->name);
> > +       }
> 
> The vdev bus is special in that some drivers can reference objects
> from other buses (see f4ce209a8ce5 ("eal: postpone vdev
> initialization") and da76cc02342b ("eal: probe new virtual bus after
> other bus devices")).
> For this reason, I would expect that the vdev bus is closed before the
> other buses.

Yes, good catch.

We don't have to expose this function as API.
This can be an internal function called only in rte_eal_cleanup().

Instead, it would be more useful to have a public function
to close a single bus by its name.

> > @@ -263,6 +280,7 @@ struct rte_bus {
> >         const char *name;            /**< Name of the bus */
> >         rte_bus_scan_t scan;         /**< Scan for devices attached to bus */
> >         rte_bus_probe_t probe;       /**< Probe devices on bus */
> > +       rte_bus_close_t close;       /**< Close devices on bus */

As David said, it is breaking the ABI.

[...]
> > @@ -1362,6 +1362,14 @@ rte_eal_cleanup(void)
> >
> >         if (rte_eal_process_type() == RTE_PROC_PRIMARY)
> >                 rte_memseg_walk(mark_freeable, NULL);
> > +
> > +       /* Close all the buses and devices/drivers on them */
> > +       if (rte_bus_close()) {
> > +               rte_eal_init_alert("Cannot close devices");
> 
> You can't call rte_eal_*init*_alert in rte_eal_cleanup.
> 
> There is not much to do if the bus close fails, I'd rather leave the
> cleanup continue.

+1, just log and save the error code for return at the end.



^ permalink raw reply	[relevance 3%]

* Re: [PATCH] ci: remove outdated default reference tag for ABI
  2022-02-08 15:08  7% ` Aaron Conole
  2022-02-08 22:03  8%   ` Brandon Lo
@ 2022-02-09 13:37  4%   ` Thomas Monjalon
  2022-02-09 14:04  4%     ` David Marchand
  1 sibling, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-02-09 13:37 UTC (permalink / raw)
  To: dev
  Cc: david.marchand, Michael Santana, Lincoln Lavoie, Owen Hilyard,
	Aaron Conole

08/02/2022 16:08, Aaron Conole:
> Thomas Monjalon <thomas@monjalon.net> writes:
> 
> > The variable REF_GIT_TAG is set in the CI configuration
> > like .travis.yml or .github/workflows/build.yml.
> > The default value is outdated and probably unused.
> > It is removed completely to avoid forgetting an update in future.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> 
> I think the default was there for labs that run the build script
> manually.  Maybe there are no such users, though.  I believe the lab has
> its own script for doing such ABI checks (but can't remember off the top
> of my head).
> 
> CC'd Lincoln and Owen just to confirm.
> 
> Assuming the UNH/other lab doesn't use this feature of the linux build
> script,
> 
> Acked-by: Aaron Conole <aconole@redhat.com>

I could also remove this variable:
LIBABIGAIL_VERSION=${LIBABIGAIL_VERSION:-libabigail-1.6}

It is confusing to see an old version here,
while we use the version 1.8.

If no objection, I'll send a v2.



^ permalink raw reply	[relevance 4%]

* RE: [PATCH v18 8/8] eal: implement functions for mutex management
  2022-02-09  2:47  3%   ` Narcisa Ana Maria Vasile
@ 2022-02-09 13:57  0%     ` Ananyev, Konstantin
  2022-02-20 21:56  4%       ` Dmitry Kozlyuk
  0 siblings, 1 reply; 200+ results
From: Ananyev, Konstantin @ 2022-02-09 13:57 UTC (permalink / raw)
  To: Narcisa Ana Maria Vasile
  Cc: Richardson, Bruce, david.marchand, dev, dmitry.kozliuk, dmitrym,
	khot, navasile, ocardona, Kadam, Pallavi, roretzla, talshn,
	thomas


> > Actually, please scrap that comment.
> > Obviously it wouldn't work for static variables,
> > and doesn't make much sense.
> > Though few thoughts remain:
> > for posix we probably don't need an indirection and
> > rte_thread_mutex can be just typedef of pthread_mutex_t.
> > also for posix we don't need RTE_INIT constructor for each
> > static mutex initialization.
> > Something like:
> > #define RTE_STATIC_INITIALIZED_MUTEX(mx) \
> > 	rte_thread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER
> > should work, I think.
> > Konstantin
> 
> Thank you for reviewing, Konstantin!
> Some context for the current representation of mutex
> can be found in v9, patch 7/10 of this patchset.
> 
> Originally we've typedef'ed the pthread_mutex_t on POSIX, just
> like you are suggesting here.
> However, on Windows there's no static initializer similar to the pthread
> one. Still, we want ABI compatibility and same thread behavior between
> platforms. The most elegant solution we found was the current representation,
> as suggested by Dmitry K.

Yes, I agree it is a problem with Windows for static initializer.
But why we can't have different structs typedef for mutex 
for posix and windows platforms?
On posix it would be:

typedef pthread_mutex_t rte_thread_mutex_t;
#define RTE_STATIC_INITIALIZED_MUTEX(mx)   rte_thread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER 

On windows it could be what Dimitry suggested:
 
typedef struct rte_thread_mutex {
        void *mutex_id;  /**< mutex identifier */
} rte_thread_mutex_t;

#define RTE_STATIC_INITIALIZED_MUTEX(private_lock)   \
rte_thread_mutex_t private_lock; \
RTE_INIT(__rte_ ## private_lock ## _init)\
{\
        RTE_VERIFY(rte_thread_mutex_init(&private_lock) == 0);\
}

API would remain the same, though it would be different underneath.
Yes, on Windows rte_thread_mutex still wouldn't work for MP,
but that's the same as with current design.
 
> I will address your other comments on the other thread.
> 
> Link to v9: http://patchwork.dpdk.org/project/dpdk/patch/1622850274-6946-8-git-send-email-navasile@linux.microsoft.com/





^ permalink raw reply	[relevance 0%]

* Re: [PATCH] ci: remove outdated default reference tag for ABI
  2022-02-09 13:37  4%   ` Thomas Monjalon
@ 2022-02-09 14:04  4%     ` David Marchand
  0 siblings, 0 replies; 200+ results
From: David Marchand @ 2022-02-09 14:04 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, Michael Santana, Lincoln Lavoie, Owen Hilyard, Aaron Conole

On Wed, Feb 9, 2022 at 2:38 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 08/02/2022 16:08, Aaron Conole:
> > Thomas Monjalon <thomas@monjalon.net> writes:
> >
> > > The variable REF_GIT_TAG is set in the CI configuration
> > > like .travis.yml or .github/workflows/build.yml.
> > > The default value is outdated and probably unused.
> > > It is removed completely to avoid forgetting an update in future.
> > >
> > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > > ---
> >
> > I think the default was there for labs that run the build script
> > manually.  Maybe there are no such users, though.  I believe the lab has
> > its own script for doing such ABI checks (but can't remember off the top
> > of my head).
> >
> > CC'd Lincoln and Owen just to confirm.
> >
> > Assuming the UNH/other lab doesn't use this feature of the linux build
> > script,
> >
> > Acked-by: Aaron Conole <aconole@redhat.com>
>
> I could also remove this variable:
> LIBABIGAIL_VERSION=${LIBABIGAIL_VERSION:-libabigail-1.6}
>
> It is confusing to see an old version here,
> while we use the version 1.8.
>
> If no objection, I'll send a v2.

+1.

-- 
David Marchand


^ permalink raw reply	[relevance 4%]

* [PATCH v4 2/5] crypto: use single buffer for asymmetric session
  @ 2022-02-09 15:38  1% ` Ciara Power
  2022-02-09 15:38  2% ` [PATCH v4 5/5] crypto: modify return value for asym session create Ciara Power
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Ciara Power @ 2022-02-09 15:38 UTC (permalink / raw)
  To: dev
  Cc: roy.fan.zhang, gakhil, anoobj, mdr, Ciara Power, Declan Doherty,
	Ankur Dwivedi, Tejasree Kondoj, John Griffin, Fiona Trahe,
	Deepak Kumar Jain

Rather than using a session buffer that contains pointers to private
session data elsewhere, have a single session buffer.
This session is created for a driver ID, and the mempool element
contains space for the max session private data needed for any driver.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

---
v4:
  - Merged asym crypto session clear and free functions.
  - Reordered some function parameters.
  - Updated trace function for asym crypto session create.
  - Fixed cnxk clear, the PMD no longer needs to put private data
    back into a mempool.
  - Renamed struct field for max private session size.
  - Replaced __extension__ with RTE_STD_C11.
  - Moved some parameter validity checks to before functional code.
  - Reworded release note.
  - Removed mempool parameter from session configure function.
  - Removed docs code additions, these are included due to patch 1
    changing sample doc to use literal includes.
v3:
  - Corrected formatting of struct comments.
  - Increased size of max_priv_session_sz to uint16_t.
  - Removed trace for asym session init function that was
    previously removed.
  - Added documentation.
v2:
  - Renamed function typedef from "free" to "clear" as session private
    data isn't being freed in that function.
  - Moved user data API to separate patch.
  - Minor fixes to comments, formatting, return values.
---
 app/test-crypto-perf/cperf_ops.c             |  14 +-
 app/test-crypto-perf/cperf_test_throughput.c |   8 +-
 app/test/test_cryptodev_asym.c               | 272 +++++--------------
 doc/guides/prog_guide/cryptodev_lib.rst      |  21 +-
 doc/guides/rel_notes/release_22_03.rst       |   7 +
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c    |   6 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c     |   6 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c     |  21 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.h     |   3 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c  |  30 +-
 drivers/crypto/openssl/rte_openssl_pmd.c     |   5 +-
 drivers/crypto/openssl/rte_openssl_pmd_ops.c |  24 +-
 drivers/crypto/qat/qat_asym.c                |  54 +---
 drivers/crypto/qat/qat_asym.h                |   5 +-
 lib/cryptodev/cryptodev_pmd.h                |  21 +-
 lib/cryptodev/cryptodev_trace_points.c       |   9 +-
 lib/cryptodev/rte_cryptodev.c                | 213 ++++++++-------
 lib/cryptodev/rte_cryptodev.h                |  94 +++----
 lib/cryptodev/rte_cryptodev_trace.h          |  38 ++-
 lib/cryptodev/version.map                    |   7 +-
 20 files changed, 308 insertions(+), 550 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index d975ae1ab8..b125c699de 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -735,7 +735,6 @@ cperf_create_session(struct rte_mempool *sess_mp,
 	struct rte_crypto_sym_xform aead_xform;
 	struct rte_cryptodev_sym_session *sess = NULL;
 	struct rte_crypto_asym_xform xform = {0};
-	int rc;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
 		xform.next = NULL;
@@ -745,19 +744,10 @@ cperf_create_session(struct rte_mempool *sess_mp,
 		xform.modex.exponent.data = perf_mod_e;
 		xform.modex.exponent.length = sizeof(perf_mod_e);
 
-		sess = (void *)rte_cryptodev_asym_session_create(sess_mp);
+		sess = (void *)rte_cryptodev_asym_session_create(dev_id, &xform, sess_mp);
 		if (sess == NULL)
 			return NULL;
-		rc = rte_cryptodev_asym_session_init(dev_id, (void *)sess,
-						     &xform, priv_mp);
-		if (rc < 0) {
-			if (sess != NULL) {
-				rte_cryptodev_asym_session_clear(dev_id,
-								 (void *)sess);
-				rte_cryptodev_asym_session_free((void *)sess);
-			}
-			return NULL;
-		}
+
 		return sess;
 	}
 #ifdef RTE_LIB_SECURITY
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index 51512af2ad..ee21ff27f7 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -35,11 +35,9 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx)
 	if (!ctx)
 		return;
 	if (ctx->sess) {
-		if (ctx->options->op_type == CPERF_ASYM_MODEX) {
-			rte_cryptodev_asym_session_clear(ctx->dev_id,
-							 (void *)ctx->sess);
-			rte_cryptodev_asym_session_free((void *)ctx->sess);
-		}
+		if (ctx->options->op_type == CPERF_ASYM_MODEX)
+			rte_cryptodev_asym_session_free(ctx->dev_id,
+					(void *)ctx->sess);
 #ifdef RTE_LIB_SECURITY
 		else if (ctx->options->op_type == CPERF_PDCP ||
 			 ctx->options->op_type == CPERF_DOCSIS ||
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 8d7290f9ed..3e27d93380 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -452,7 +452,8 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (!sessionless) {
-		sess = rte_cryptodev_asym_session_create(ts_params->session_mpool);
+		sess = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
+				ts_params->session_mpool);
 		if (!sess) {
 			snprintf(test_msg, ASYM_TEST_MSG_LEN,
 					"line %u "
@@ -462,15 +463,6 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 			goto error_exit;
 		}
 
-		if (rte_cryptodev_asym_session_init(dev_id, sess, &xform_tc,
-				ts_params->session_mpool) < 0) {
-			snprintf(test_msg, ASYM_TEST_MSG_LEN,
-					"line %u FAILED: %s",
-					__LINE__, "unabled to config sym session");
-			status = TEST_FAILED;
-			goto error_exit;
-		}
-
 		rte_crypto_op_attach_asym_session(op, sess);
 	} else {
 		asym_op->xform = &xform_tc;
@@ -512,10 +504,8 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 		snprintf(test_msg, ASYM_TEST_MSG_LEN, "SESSIONLESS PASS");
 
 error_exit:
-		if (sess != NULL) {
-			rte_cryptodev_asym_session_clear(dev_id, sess);
-			rte_cryptodev_asym_session_free(sess);
-		}
+		if (sess != NULL)
+			rte_cryptodev_asym_session_free(dev_id, sess);
 
 		if (op != NULL)
 			rte_crypto_op_free(op);
@@ -669,18 +659,11 @@ test_rsa_sign_verify(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"sign_verify\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -688,9 +671,7 @@ test_rsa_sign_verify(void)
 	status = queue_ops_rsa_sign_verify(sess);
 
 error_exit:
-
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -718,17 +699,10 @@ test_rsa_enc_dec(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"enc_dec\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -737,8 +711,7 @@ test_rsa_enc_dec(void)
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -765,28 +738,20 @@ test_rsa_sign_verify_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify_crt\n");
 		status = TEST_FAILED;
-		return status;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform_crt,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"sign_verify_crt\n");
-		status = TEST_FAILED;
 		goto error_exit;
 	}
+
 	status = queue_ops_rsa_sign_verify(sess);
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -813,27 +778,20 @@ test_rsa_enc_dec_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"enc_dec_crt\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform_crt,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"enc_dec_crt\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
+
 	status = queue_ops_rsa_enc_dec(sess);
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -927,7 +885,6 @@ testsuite_setup(void)
 	/* configure qp */
 	ts_params->qp_conf.nb_descriptors = DEFAULT_NUM_OPS_INFLIGHT;
 	ts_params->qp_conf.mp_session = ts_params->session_mpool;
-	ts_params->qp_conf.mp_session_private = ts_params->session_mpool;
 	for (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) {
 		TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
 			dev_id, qp_id, &ts_params->qp_conf,
@@ -936,21 +893,9 @@ testsuite_setup(void)
 			qp_id, dev_id);
 	}
 
-	/* setup asym session pool */
-	unsigned int session_size = RTE_MAX(
-		rte_cryptodev_asym_get_private_session_size(dev_id),
-		rte_cryptodev_asym_get_header_session_size());
-	/*
-	 * Create mempool with TEST_NUM_SESSIONS * 2,
-	 * to include the session headers
-	 */
-	ts_params->session_mpool = rte_mempool_create(
-				"test_asym_sess_mp",
-				TEST_NUM_SESSIONS * 2,
-				session_size,
-				0, 0, NULL, NULL, NULL,
-				NULL, SOCKET_ID_ANY,
-				0);
+	ts_params->session_mpool = rte_cryptodev_asym_session_pool_create(
+			"test_asym_sess_mp", TEST_NUM_SESSIONS * 2, 0,
+			SOCKET_ID_ANY);
 
 	TEST_ASSERT_NOT_NULL(ts_params->session_mpool,
 			"session mempool allocation failed");
@@ -1107,14 +1052,6 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_xform xform = *xfrm;
 	uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1137,11 +1074,11 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.shared_secret.data = output;
 	asym_op->dh.shared_secret.length = sizeof(output);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1176,10 +1113,8 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 			asym_op->dh.shared_secret.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -1199,14 +1134,6 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1225,11 +1152,11 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = output;
 	asym_op->dh.priv_key.length = sizeof(output);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1265,10 +1192,8 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1290,14 +1215,6 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1324,11 +1241,11 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 					0);
 	asym_op->dh.priv_key = dh_test_params.priv_key;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1365,10 +1282,8 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 			asym_op->dh.priv_key.data, asym_op->dh.priv_key.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1391,15 +1306,6 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_xform pub_key_xform;
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1423,11 +1329,12 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.pub_key.length = sizeof(out_pub_key);
 	asym_op->dh.priv_key.data = out_prv_key;
 	asym_op->dh.priv_key.length = sizeof(out_prv_key);
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1462,10 +1369,8 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 			out_pub_key, asym_op->dh.pub_key.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1514,7 +1419,7 @@ test_mod_inv(void)
 				return TEST_SKIPPED;
 		}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool);
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "line %u "
 				"FAILED: %s", __LINE__,
@@ -1523,15 +1428,6 @@ test_mod_inv(void)
 		goto error_exit;
 	}
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &modinv_xform,
-			sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* generate crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1583,10 +1479,8 @@ test_mod_inv(void)
 	}
 
 error_exit:
-	if (sess) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 
 	if (op)
 		rte_crypto_op_free(op);
@@ -1649,7 +1543,7 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool);
 	if (!sess) {
 		RTE_LOG(ERR, USER1,
 				 "line %u "
@@ -1659,15 +1553,6 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &modex_xform,
-			sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	asym_op = op->asym;
 	memcpy(input, base, sizeof(base));
 	asym_op->modex.base.data = input;
@@ -1706,10 +1591,8 @@ test_mod_exp(void)
 	}
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 
 	if (op != NULL)
 		rte_crypto_op_free(op);
@@ -1771,7 +1654,7 @@ test_dsa_sign(void)
 	uint8_t s[TEST_DH_MOD_LEN];
 	uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool);
 	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				 "line %u FAILED: %s", __LINE__,
@@ -1800,15 +1683,6 @@ test_dsa_sign(void)
 	debug_hexdump(stdout, "priv_key: ", dsa_xform.dsa.x.data,
 			dsa_xform.dsa.x.length);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &dsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* attach asymmetric crypto session to crypto operations */
 	rte_crypto_op_attach_asym_session(op, sess);
 	asym_op->dsa.op_type = RTE_CRYPTO_ASYM_OP_SIGN;
@@ -1882,10 +1756,8 @@ test_dsa_sign(void)
 		status = TEST_FAILED;
 	}
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -1944,15 +1816,6 @@ test_ecdsa_sign_verify(enum curve curve_id)
 
 	rte_cryptodev_info_get(dev_id, &dev_info);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed\n");
-		status = TEST_FAILED;
-		goto exit;
-	}
-
 	/* Setup crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (op == NULL) {
@@ -1970,11 +1833,11 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
 	xform.ec.curve_id = input_params.curve;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-				sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
-				"Unable to config asym session\n");
+				"Session creation failed\n");
 		status = TEST_FAILED;
 		goto exit;
 	}
@@ -2082,10 +1945,8 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	}
 
 exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -2157,15 +2018,6 @@ test_ecpm(enum curve curve_id)
 
 	rte_cryptodev_info_get(dev_id, &dev_info);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed\n");
-		status = TEST_FAILED;
-		goto exit;
-	}
-
 	/* Setup crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (op == NULL) {
@@ -2183,11 +2035,11 @@ test_ecpm(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
 	xform.ec.curve_id = input_params.curve;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-				sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
-				"Unable to config asym session\n");
+				"Session creation failed\n");
 		status = TEST_FAILED;
 		goto exit;
 	}
@@ -2255,10 +2107,8 @@ test_ecpm(enum curve curve_id)
 	}
 
 exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 9f33f7a177..b4dbd384bf 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -1038,20 +1038,17 @@ It is the application's responsibility to create and manage the session mempools
 Application using both symmetric and asymmetric sessions should allocate and maintain
 different sessions pools for each type.
 
-An application can use ``rte_cryptodev_get_asym_session_private_size()`` to
-get the private size of asymmetric session on a given crypto device. This
-function would allow an application to calculate the max device asymmetric
-session size of all crypto devices to create a single session mempool.
-If instead an application creates multiple asymmetric session mempools,
-the Crypto device framework also provides ``rte_cryptodev_asym_get_header_session_size()`` to get
-the size of an uninitialized session.
+An application can use ``rte_cryptodev_asym_session_pool_create()`` to create a mempool
+with a specified number of elements. The element size will allow for the session header,
+and the max private session size.
+The max private session size is chosen based on available crypto devices,
+the biggest private session size is used. This means any of those devices can be used,
+and the mempool element will have available space for its private session data.
 
 Once the session mempools have been created, ``rte_cryptodev_asym_session_create()``
-is used to allocate an uninitialized asymmetric session from the given mempool.
-The session then must be initialized using ``rte_cryptodev_asym_session_init()``
-for each of the required crypto devices. An asymmetric transform chain
-is used to specify the operation and its parameters. See the section below for
-details on transforms.
+is used to allocate and initialize an asymmetric session from the given mempool.
+An asymmetric transform chain is used to specify the operation and its parameters.
+See the section below for details on transforms.
 
 When a session is no longer used, user must call ``rte_cryptodev_asym_session_clear()``
 for each of the crypto devices that are using the session, to free all driver
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index a820cc5596..ea4c5309a0 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -112,6 +112,13 @@ API Changes
 * ethdev: Old public macros and enumeration constants without ``RTE_ETH_`` prefix,
   which are kept for backward compatibility, are marked as deprecated.
 
+* cryptodev: The asymmetric session handling was modified to use a single
+  mempool object. An API ``rte_cryptodev_asym_session_pool_create`` was added
+  to create a mempool with element size big enough to hold the generic asymmetric
+  session header and max size for a device private session data.
+  The API ``rte_cryptodev_asym_session_init`` was removed as the initialization
+  is now moved to ``rte_cryptodev_asym_session_create``.
+
 
 ABI Changes
 -----------
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
index d217bbf383..7390f976c6 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
@@ -157,8 +157,7 @@ cn10k_cpt_fill_inst(struct cnxk_cpt_qp *qp, struct rte_crypto_op *ops[],
 
 		if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 			asym_op = op->asym;
-			ae_sess = get_asym_session_private_data(
-				asym_op->session, cn10k_cryptodev_driver_id);
+			ae_sess = get_asym_session_private_data(asym_op->session);
 			ret = cnxk_ae_enqueue(qp, op, infl_req, &inst[0],
 					      ae_sess);
 			if (unlikely(ret))
@@ -431,8 +430,7 @@ cn10k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp,
 			uintptr_t *mdata = infl_req->mdata;
 			struct cnxk_ae_sess *sess;
 
-			sess = get_asym_session_private_data(
-				op->session, cn10k_cryptodev_driver_id);
+			sess = get_asym_session_private_data(op->session);
 
 			cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
 		}
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
index ac1953b66d..59a06af30e 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
@@ -138,8 +138,7 @@ cn9k_cpt_inst_prep(struct cnxk_cpt_qp *qp, struct rte_crypto_op *op,
 
 		if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 			asym_op = op->asym;
-			sess = get_asym_session_private_data(
-				asym_op->session, cn9k_cryptodev_driver_id);
+			sess = get_asym_session_private_data(asym_op->session);
 			ret = cnxk_ae_enqueue(qp, op, infl_req, inst, sess);
 			inst->w7.u64 = sess->cpt_inst_w7;
 		} else {
@@ -453,8 +452,7 @@ cn9k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp, struct rte_crypto_op *cop,
 			uintptr_t *mdata = infl_req->mdata;
 			struct cnxk_ae_sess *sess;
 
-			sess = get_asym_session_private_data(
-				op->session, cn9k_cryptodev_driver_id);
+			sess = get_asym_session_private_data(op->session);
 
 			cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
 		}
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index a5fb68da02..7bfac186f9 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -658,10 +658,9 @@ void
 cnxk_ae_session_clear(struct rte_cryptodev *dev,
 		      struct rte_cryptodev_asym_session *sess)
 {
-	struct rte_mempool *sess_mp;
 	struct cnxk_ae_sess *priv;
 
-	priv = get_asym_session_private_data(sess, dev->driver_id);
+	priv = get_asym_session_private_data(sess);
 	if (priv == NULL)
 		return;
 
@@ -670,40 +669,28 @@ cnxk_ae_session_clear(struct rte_cryptodev *dev,
 
 	/* Reset and free object back to pool */
 	memset(priv, 0, cnxk_ae_session_size_get(dev));
-	sess_mp = rte_mempool_from_obj(priv);
-	set_asym_session_private_data(sess, dev->driver_id, NULL);
-	rte_mempool_put(sess_mp, priv);
 }
 
 int
 cnxk_ae_session_cfg(struct rte_cryptodev *dev,
 		    struct rte_crypto_asym_xform *xform,
-		    struct rte_cryptodev_asym_session *sess,
-		    struct rte_mempool *pool)
+		    struct rte_cryptodev_asym_session *sess)
 {
 	struct cnxk_cpt_vf *vf = dev->data->dev_private;
 	struct roc_cpt *roc_cpt = &vf->cpt;
-	struct cnxk_ae_sess *priv;
+	struct cnxk_ae_sess *priv = get_asym_session_private_data(sess);
 	union cpt_inst_w7 w7;
 	int ret;
 
-	if (rte_mempool_get(pool, (void **)&priv))
-		return -ENOMEM;
-
-	memset(priv, 0, sizeof(struct cnxk_ae_sess));
-
 	ret = cnxk_ae_fill_session_parameters(priv, xform);
-	if (ret) {
-		rte_mempool_put(pool, priv);
+	if (ret)
 		return ret;
-	}
 
 	w7.u64 = 0;
 	w7.s.egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_AE];
 	priv->cpt_inst_w7 = w7.u64;
 	priv->cnxk_fpm_iova = vf->cnxk_fpm_iova;
 	priv->ec_grp = vf->ec_grp;
-	set_asym_session_private_data(sess, dev->driver_id, priv);
 
 	return 0;
 }
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
index 0656ba9675..ab0f00ee7c 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
@@ -122,8 +122,7 @@ void cnxk_ae_session_clear(struct rte_cryptodev *dev,
 			   struct rte_cryptodev_asym_session *sess);
 int cnxk_ae_session_cfg(struct rte_cryptodev *dev,
 			struct rte_crypto_asym_xform *xform,
-			struct rte_cryptodev_asym_session *sess,
-			struct rte_mempool *pool);
+			struct rte_cryptodev_asym_session *sess);
 void cnxk_cpt_dump_on_err(struct cnxk_cpt_qp *qp);
 
 static inline union rte_event_crypto_metadata *
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index f7ca8a8a8e..cf3947f1ab 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -375,35 +375,23 @@ otx_cpt_asym_session_size_get(struct rte_cryptodev *dev __rte_unused)
 }
 
 static int
-otx_cpt_asym_session_cfg(struct rte_cryptodev *dev,
+otx_cpt_asym_session_cfg(struct rte_cryptodev *dev __rte_unused,
 			 struct rte_crypto_asym_xform *xform __rte_unused,
-			 struct rte_cryptodev_asym_session *sess,
-			 struct rte_mempool *pool)
+			 struct rte_cryptodev_asym_session *sess)
 {
-	struct cpt_asym_sess_misc *priv;
+	struct cpt_asym_sess_misc *priv = get_asym_session_private_data(sess);
 	int ret;
 
 	CPT_PMD_INIT_FUNC_TRACE();
 
-	if (rte_mempool_get(pool, (void **)&priv)) {
-		CPT_LOG_ERR("Could not allocate session private data");
-		return -ENOMEM;
-	}
-
-	memset(priv, 0, sizeof(struct cpt_asym_sess_misc));
-
 	ret = cpt_fill_asym_session_parameters(priv, xform);
 	if (ret) {
 		CPT_LOG_ERR("Could not configure session parameters");
-
-		/* Return session to mempool */
-		rte_mempool_put(pool, priv);
 		return ret;
 	}
 
 	priv->cpt_inst_w7 = 0;
 
-	set_asym_session_private_data(sess, dev->driver_id, priv);
 	return 0;
 }
 
@@ -412,11 +400,10 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 			   struct rte_cryptodev_asym_session *sess)
 {
 	struct cpt_asym_sess_misc *priv;
-	struct rte_mempool *sess_mp;
 
 	CPT_PMD_INIT_FUNC_TRACE();
 
-	priv = get_asym_session_private_data(sess, dev->driver_id);
+	priv = get_asym_session_private_data(sess);
 
 	if (priv == NULL)
 		return;
@@ -424,9 +411,6 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 	/* Free resources allocated during session configure */
 	cpt_free_asym_session_parameters(priv);
 	memset(priv, 0, otx_cpt_asym_session_size_get(dev));
-	sess_mp = rte_mempool_from_obj(priv);
-	set_asym_session_private_data(sess, dev->driver_id, NULL);
-	rte_mempool_put(sess_mp, priv);
 }
 
 static __rte_always_inline void * __rte_hot
@@ -471,8 +455,7 @@ otx_cpt_enq_single_asym(struct cpt_instance *instance,
 		return NULL;
 	}
 
-	sess = get_asym_session_private_data(asym_op->session,
-					     otx_cryptodev_driver_id);
+	sess = get_asym_session_private_data(asym_op->session);
 
 	/* Store phys_addr of the mdata to meta_buf */
 	params.meta_buf = rte_mempool_virt2iova(mdata);
@@ -852,8 +835,7 @@ otx_cpt_asym_post_process(struct rte_crypto_op *cop,
 	struct rte_crypto_asym_op *op = cop->asym;
 	struct cpt_asym_sess_misc *sess;
 
-	sess = get_asym_session_private_data(op->session,
-					     otx_cryptodev_driver_id);
+	sess = get_asym_session_private_data(op->session);
 
 	switch (sess->xfrm_type) {
 	case RTE_CRYPTO_ASYM_XFORM_RSA:
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 5794ed8159..1e7e5f6849 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -747,10 +747,7 @@ get_session(struct openssl_qp *qp, struct rte_crypto_op *op)
 						cryptodev_driver_id);
 		} else {
 			if (likely(op->asym->session != NULL))
-				asym_sess = (struct openssl_asym_session *)
-						get_asym_session_private_data(
-						op->asym->session,
-						cryptodev_driver_id);
+				asym_sess = get_asym_session_private_data(op->asym->session);
 			if (asym_sess == NULL)
 				op->status =
 					RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 52715f86f8..92b9524bf3 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -1119,8 +1119,7 @@ static int openssl_set_asym_session_parameters(
 static int
 openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool)
+		struct rte_cryptodev_asym_session *sess)
 {
 	void *asym_sess_private_data;
 	int ret;
@@ -1130,25 +1129,14 @@ openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		return -EINVAL;
 	}
 
-	if (rte_mempool_get(mempool, &asym_sess_private_data)) {
-		CDEV_LOG_ERR(
-			"Couldn't get object from session mempool");
-		return -ENOMEM;
-	}
-
+	asym_sess_private_data = get_asym_session_private_data(sess);
 	ret = openssl_set_asym_session_parameters(asym_sess_private_data,
 			xform);
 	if (ret != 0) {
 		OPENSSL_LOG(ERR, "failed configure session parameters");
-
-		/* Return session to mempool */
-		rte_mempool_put(mempool, asym_sess_private_data);
 		return ret;
 	}
 
-	set_asym_session_private_data(sess, dev->driver_id,
-			asym_sess_private_data);
-
 	return 0;
 }
 
@@ -1206,19 +1194,15 @@ static void openssl_reset_asym_session(struct openssl_asym_session *sess)
  * so it doesn't leave key material behind
  */
 static void
-openssl_pmd_asym_session_clear(struct rte_cryptodev *dev,
+openssl_pmd_asym_session_clear(struct rte_cryptodev *dev __rte_unused,
 		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t index = dev->driver_id;
-	void *sess_priv = get_asym_session_private_data(sess, index);
+	void *sess_priv = get_asym_session_private_data(sess);
 
 	/* Zero out the whole structure */
 	if (sess_priv) {
 		openssl_reset_asym_session(sess_priv);
 		memset(sess_priv, 0, sizeof(struct openssl_asym_session));
-		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
-		set_asym_session_private_data(sess, index, NULL);
-		rte_mempool_put(sess_mp, sess_priv);
 	}
 }
 
diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index 09d8761c5f..6576e8c87c 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -491,9 +491,7 @@ qat_asym_build_request(void *in_op,
 
 	op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
 	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
-		ctx = (struct qat_asym_session *)
-			get_asym_session_private_data(
-			op->asym->session, qat_asym_driver_id);
+		ctx = get_asym_session_private_data(op->asym->session);
 		if (unlikely(ctx == NULL)) {
 			QAT_LOG(ERR, "Session has not been created for this device");
 			goto error;
@@ -711,8 +709,7 @@ qat_asym_process_response(void **op, uint8_t *resp,
 	}
 
 	if (rx_op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
-		ctx = (struct qat_asym_session *)get_asym_session_private_data(
-			rx_op->asym->session, qat_asym_driver_id);
+		ctx = get_asym_session_private_data(rx_op->asym->session);
 		qat_asym_collect_response(rx_op, cookie, ctx->xform);
 	} else if (rx_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
 		qat_asym_collect_response(rx_op, cookie, rx_op->asym->xform);
@@ -726,61 +723,42 @@ qat_asym_process_response(void **op, uint8_t *resp,
 }
 
 int
-qat_asym_session_configure(struct rte_cryptodev *dev,
+qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool)
+		struct rte_cryptodev_asym_session *sess)
 {
-	int err = 0;
-	void *sess_private_data;
 	struct qat_asym_session *session;
 
-	if (rte_mempool_get(mempool, &sess_private_data)) {
-		QAT_LOG(ERR,
-			"Couldn't get object from session mempool");
-		return -ENOMEM;
-	}
-
-	session = sess_private_data;
+	session = get_asym_session_private_data(sess);
 	if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODEX) {
 		if (xform->modex.exponent.length == 0 ||
 				xform->modex.modulus.length == 0) {
 			QAT_LOG(ERR, "Invalid mod exp input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODINV) {
 		if (xform->modinv.modulus.length == 0) {
 			QAT_LOG(ERR, "Invalid mod inv input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_RSA) {
 		if (xform->rsa.n.length == 0) {
 			QAT_LOG(ERR, "Invalid rsa input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type >= RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
 			|| xform->xform_type <= RTE_CRYPTO_ASYM_XFORM_NONE) {
 		QAT_LOG(ERR, "Invalid asymmetric crypto xform");
-		err = -EINVAL;
-		goto error;
+		return -EINVAL;
 	} else {
 		QAT_LOG(ERR, "Asymmetric crypto xform not implemented");
-		err = -EINVAL;
-		goto error;
+		return -EINVAL;
 	}
 
 	session->xform = xform;
-	qat_asym_build_req_tmpl(sess_private_data);
-	set_asym_session_private_data(sess, dev->driver_id,
-		sess_private_data);
+	qat_asym_build_req_tmpl(session);
 
 	return 0;
-error:
-	rte_mempool_put(mempool, sess_private_data);
-	return err;
 }
 
 unsigned int qat_asym_session_get_private_size(
@@ -793,15 +771,9 @@ void
 qat_asym_session_clear(struct rte_cryptodev *dev,
 		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t index = dev->driver_id;
-	void *sess_priv = get_asym_session_private_data(sess, index);
+	void *sess_priv = get_asym_session_private_data(sess);
 	struct qat_asym_session *s = (struct qat_asym_session *)sess_priv;
 
-	if (sess_priv) {
+	if (sess_priv)
 		memset(s, 0, qat_asym_session_get_private_size(dev));
-		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
-
-		set_asym_session_private_data(sess, index, NULL);
-		rte_mempool_put(sess_mp, sess_priv);
-	}
 }
diff --git a/drivers/crypto/qat/qat_asym.h b/drivers/crypto/qat/qat_asym.h
index 308b6b2e0b..c9242a12ca 100644
--- a/drivers/crypto/qat/qat_asym.h
+++ b/drivers/crypto/qat/qat_asym.h
@@ -46,10 +46,9 @@ struct qat_asym_session {
 };
 
 int
-qat_asym_session_configure(struct rte_cryptodev *dev,
+qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool);
+		struct rte_cryptodev_asym_session *sess);
 
 unsigned int
 qat_asym_session_get_private_size(struct rte_cryptodev *dev);
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index b9146f652c..aeaccfa611 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -319,7 +319,6 @@ typedef int (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
  * @param	dev		Crypto device pointer
  * @param	xform		Single or chain of crypto xforms
  * @param	session		Pointer to cryptodev's private session structure
- * @param	mp		Mempool where the private session is allocated
  *
  * @return
  *  - Returns 0 if private session structure have been created successfully.
@@ -329,8 +328,7 @@ typedef int (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
  */
 typedef int (*cryptodev_asym_configure_session_t)(struct rte_cryptodev *dev,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *session,
-		struct rte_mempool *mp);
+		struct rte_cryptodev_asym_session *session);
 /**
  * Free driver private session data.
  *
@@ -340,12 +338,12 @@ typedef int (*cryptodev_asym_configure_session_t)(struct rte_cryptodev *dev,
 typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		struct rte_cryptodev_sym_session *sess);
 /**
- * Free asymmetric session private data.
+ * Clear asymmetric session private data.
  *
  * @param	dev		Crypto device pointer
  * @param	sess		Cryptodev session structure
  */
-typedef void (*cryptodev_asym_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_asym_clear_session_t)(struct rte_cryptodev *dev,
 		struct rte_cryptodev_asym_session *sess);
 /**
  * Perform actual crypto processing (encrypt/digest or auth/decrypt)
@@ -429,7 +427,7 @@ struct rte_cryptodev_ops {
 	/**< Configure asymmetric Crypto session. */
 	cryptodev_sym_free_session_t sym_session_clear;
 	/**< Clear a Crypto sessions private data. */
-	cryptodev_asym_free_session_t asym_session_clear;
+	cryptodev_asym_clear_session_t asym_session_clear;
 	/**< Clear a Crypto sessions private data. */
 	union {
 		cryptodev_sym_cpu_crypto_process_t sym_cpu_process;
@@ -628,16 +626,9 @@ set_sym_session_private_data(struct rte_cryptodev_sym_session *sess,
 }
 
 static inline void *
-get_asym_session_private_data(const struct rte_cryptodev_asym_session *sess,
-		uint8_t driver_id) {
-	return sess->sess_private_data[driver_id];
-}
-
-static inline void
-set_asym_session_private_data(struct rte_cryptodev_asym_session *sess,
-		uint8_t driver_id, void *private_data)
+get_asym_session_private_data(struct rte_cryptodev_asym_session *sess)
 {
-	sess->sess_private_data[driver_id] = private_data;
+	return sess->sess_private_data;
 }
 
 #endif /* _CRYPTODEV_PMD_H_ */
diff --git a/lib/cryptodev/cryptodev_trace_points.c b/lib/cryptodev/cryptodev_trace_points.c
index 5d58951fd5..c5bfe08b79 100644
--- a/lib/cryptodev/cryptodev_trace_points.c
+++ b/lib/cryptodev/cryptodev_trace_points.c
@@ -24,6 +24,9 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_setup,
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_pool_create,
 	lib.cryptodev.sym.pool.create)
 
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_pool_create,
+	lib.cryptodev.asym.pool.create)
+
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_create,
 	lib.cryptodev.sym.create)
 
@@ -39,15 +42,9 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_free,
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_init,
 	lib.cryptodev.sym.init)
 
-RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_init,
-	lib.cryptodev.asym.init)
-
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_clear,
 	lib.cryptodev.sym.clear)
 
-RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_clear,
-	lib.cryptodev.asym.clear)
-
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_enqueue_burst,
 	lib.cryptodev.enq.burst)
 
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index a40536c5ea..d4cdc56912 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -195,7 +195,7 @@ const char *rte_crypto_asym_op_strings[] = {
 };
 
 /**
- * The private data structure stored in the session mempool private data.
+ * The private data structure stored in the sym session mempool private data.
  */
 struct rte_cryptodev_sym_session_pool_private_data {
 	uint16_t nb_drivers;
@@ -204,6 +204,14 @@ struct rte_cryptodev_sym_session_pool_private_data {
 	/**< session user data will be placed after sess_data */
 };
 
+/**
+ * The private data structure stored in the asym session mempool private data.
+ */
+struct rte_cryptodev_asym_session_pool_private_data {
+	uint16_t max_priv_session_sz;
+	/**< Size of private session data used when creating mempool */
+};
+
 int
 rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum,
 		const char *algo_string)
@@ -1751,47 +1759,6 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 	return 0;
 }
 
-int
-rte_cryptodev_asym_session_init(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_crypto_asym_xform *xforms,
-		struct rte_mempool *mp)
-{
-	struct rte_cryptodev *dev;
-	uint8_t index;
-	int ret;
-
-	if (!rte_cryptodev_is_valid_dev(dev_id)) {
-		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_get_dev(dev_id);
-
-	if (sess == NULL || xforms == NULL || dev == NULL)
-		return -EINVAL;
-
-	index = dev->driver_id;
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure,
-				-ENOTSUP);
-
-	if (sess->sess_private_data[index] == NULL) {
-		ret = dev->dev_ops->asym_session_configure(dev,
-							xforms,
-							sess, mp);
-		if (ret < 0) {
-			CDEV_LOG_ERR(
-				"dev_id %d failed to configure session details",
-				dev_id);
-			return ret;
-		}
-	}
-
-	rte_cryptodev_trace_asym_session_init(dev_id, sess, xforms, mp);
-	return 0;
-}
-
 struct rte_mempool *
 rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	uint32_t elt_size, uint32_t cache_size, uint16_t user_data_size,
@@ -1834,6 +1801,53 @@ rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	return mp;
 }
 
+struct rte_mempool *
+rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
+	uint32_t cache_size, int socket_id)
+{
+	struct rte_mempool *mp;
+	struct rte_cryptodev_asym_session_pool_private_data *pool_priv;
+	uint32_t obj_sz, obj_sz_aligned;
+	uint8_t dev_id, priv_sz, max_priv_sz = 0;
+
+	for (dev_id = 0; dev_id < RTE_CRYPTO_MAX_DEVS; dev_id++)
+		if (rte_cryptodev_is_valid_dev(dev_id)) {
+			priv_sz = rte_cryptodev_asym_get_private_session_size(dev_id);
+			if (priv_sz > max_priv_sz)
+				max_priv_sz = priv_sz;
+		}
+	if (max_priv_sz == 0) {
+		CDEV_LOG_INFO("Could not set max private session size\n");
+		return NULL;
+	}
+
+	obj_sz = rte_cryptodev_asym_get_header_session_size() + max_priv_sz;
+	obj_sz_aligned =  RTE_ALIGN_CEIL(obj_sz, RTE_CACHE_LINE_SIZE);
+
+	mp = rte_mempool_create(name, nb_elts, obj_sz_aligned, cache_size,
+			(uint32_t)(sizeof(*pool_priv)),
+			NULL, NULL, NULL, NULL,
+			socket_id, 0);
+	if (mp == NULL) {
+		CDEV_LOG_ERR("%s(name=%s) failed, rte_errno=%d\n",
+			__func__, name, rte_errno);
+		return NULL;
+	}
+
+	pool_priv = rte_mempool_get_priv(mp);
+	if (!pool_priv) {
+		CDEV_LOG_ERR("%s(name=%s) failed to get private data\n",
+			__func__, name);
+		rte_mempool_free(mp);
+		return NULL;
+	}
+	pool_priv->max_priv_session_sz = max_priv_sz;
+
+	rte_cryptodev_trace_asym_session_pool_create(name, nb_elts,
+		cache_size, mp);
+	return mp;
+}
+
 static unsigned int
 rte_cryptodev_sym_session_data_size(struct rte_cryptodev_sym_session *sess)
 {
@@ -1895,19 +1909,44 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 }
 
 struct rte_cryptodev_asym_session *
-rte_cryptodev_asym_session_create(struct rte_mempool *mp)
+rte_cryptodev_asym_session_create(uint8_t dev_id,
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp)
 {
 	struct rte_cryptodev_asym_session *sess;
-	unsigned int session_size =
+	uint32_t session_priv_data_sz;
+	struct rte_cryptodev_asym_session_pool_private_data *pool_priv;
+	unsigned int session_header_size =
 			rte_cryptodev_asym_get_header_session_size();
+	struct rte_cryptodev *dev;
+	int ret;
+
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
+		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
+		return NULL;
+	}
+
+	dev = rte_cryptodev_pmd_get_dev(dev_id);
+
+	if (dev == NULL)
+		return NULL;
 
 	if (!mp) {
 		CDEV_LOG_ERR("invalid mempool\n");
 		return NULL;
 	}
 
+	session_priv_data_sz = rte_cryptodev_asym_get_private_session_size(
+			dev_id);
+	pool_priv = rte_mempool_get_priv(mp);
+
+	if (pool_priv->max_priv_session_sz < session_priv_data_sz) {
+		CDEV_LOG_DEBUG(
+			"The private session data size used when creating the mempool is smaller than this device's private session data.");
+		return NULL;
+	}
+
 	/* Verify if provided mempool can hold elements big enough. */
-	if (mp->elt_size < session_size) {
+	if (mp->elt_size < session_header_size + session_priv_data_sz) {
 		CDEV_LOG_ERR(
 			"mempool elements too small to hold session objects");
 		return NULL;
@@ -1919,12 +1958,25 @@ rte_cryptodev_asym_session_create(struct rte_mempool *mp)
 		return NULL;
 	}
 
-	/* Clear device session pointer.
-	 * Include the flag indicating presence of private data
-	 */
-	memset(sess, 0, session_size);
+	sess->driver_id = dev->driver_id;
+	sess->max_priv_data_sz = pool_priv->max_priv_session_sz;
+
+	/* Clear device session pointer.*/
+	memset(sess->sess_private_data, 0, session_priv_data_sz);
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, NULL);
 
-	rte_cryptodev_trace_asym_session_create(mp, sess);
+	if (sess->sess_private_data[0] == 0) {
+		ret = dev->dev_ops->asym_session_configure(dev, xforms, sess);
+		if (ret < 0) {
+			CDEV_LOG_ERR(
+				"dev_id %d failed to configure session details",
+				dev_id);
+			return NULL;
+		}
+	}
+
+	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp, sess);
 	return sess;
 }
 
@@ -1959,30 +2011,6 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id,
 	return 0;
 }
 
-int
-rte_cryptodev_asym_session_clear(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess)
-{
-	struct rte_cryptodev *dev;
-
-	if (!rte_cryptodev_is_valid_dev(dev_id)) {
-		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_get_dev(dev_id);
-
-	if (dev == NULL || sess == NULL)
-		return -EINVAL;
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_clear, -ENOTSUP);
-
-	dev->dev_ops->asym_session_clear(dev, sess);
-
-	rte_cryptodev_trace_sym_session_clear(dev_id, sess);
-	return 0;
-}
-
 int
 rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
 {
@@ -2007,27 +2035,31 @@ rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
 }
 
 int
-rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess)
+rte_cryptodev_asym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t i;
-	void *sess_priv;
 	struct rte_mempool *sess_mp;
+	struct rte_cryptodev *dev;
 
-	if (sess == NULL)
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
+		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
-
-	/* Check that all device private data has been freed */
-	for (i = 0; i < nb_drivers; i++) {
-		sess_priv = get_asym_session_private_data(sess, i);
-		if (sess_priv != NULL)
-			return -EBUSY;
 	}
 
+	dev = rte_cryptodev_pmd_get_dev(dev_id);
+
+	if (dev == NULL || sess == NULL)
+		return -EINVAL;
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_clear, -ENOTSUP);
+
+	dev->dev_ops->asym_session_clear(dev, sess);
+
 	/* Return session to mempool */
 	sess_mp = rte_mempool_from_obj(sess);
 	rte_mempool_put(sess_mp, sess);
 
-	rte_cryptodev_trace_asym_session_free(sess);
+	rte_cryptodev_trace_asym_session_free(dev_id, sess);
 	return 0;
 }
 
@@ -2061,12 +2093,7 @@ rte_cryptodev_sym_get_existing_header_session_size(
 unsigned int
 rte_cryptodev_asym_get_header_session_size(void)
 {
-	/*
-	 * Header contains pointers to the private data
-	 * of all registered drivers, and a flag which
-	 * indicates presence of private data
-	 */
-	return ((sizeof(void *) * nb_drivers) + sizeof(uint8_t));
+	return sizeof(struct rte_cryptodev_asym_session);
 }
 
 unsigned int
@@ -2092,7 +2119,6 @@ unsigned int
 rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
-	unsigned int header_size = sizeof(void *) * nb_drivers;
 	unsigned int priv_sess_size;
 
 	if (!rte_cryptodev_is_valid_dev(dev_id))
@@ -2104,11 +2130,8 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 		return 0;
 
 	priv_sess_size = (*dev->dev_ops->asym_session_get_size)(dev);
-	if (priv_sess_size < header_size)
-		return header_size;
 
 	return priv_sess_size;
-
 }
 
 int
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 59ea5a54df..a0ac81eaa0 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -919,9 +919,13 @@ struct rte_cryptodev_sym_session {
 };
 
 /** Cryptodev asymmetric crypto session */
-struct rte_cryptodev_asym_session {
-	__extension__ void *sess_private_data[0];
-	/**< Private asymmetric session material */
+RTE_STD_C11 struct rte_cryptodev_asym_session {
+	uint8_t driver_id;
+	/**< Session driver ID. */
+	uint16_t max_priv_data_sz;
+	/**< Size of private data used when creating mempool */
+	uint8_t padding[5];
+	uint8_t sess_private_data[0];
 };
 
 /**
@@ -956,6 +960,29 @@ rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	uint32_t elt_size, uint32_t cache_size, uint16_t priv_size,
 	int socket_id);
 
+/**
+ * Create an asymmetric session mempool.
+ *
+ * @param name
+ *   The unique mempool name.
+ * @param nb_elts
+ *   The number of elements in the mempool.
+ * @param cache_size
+ *   The number of per-lcore cache elements
+ * @param socket_id
+ *   The *socket_id* argument is the socket identifier in the case of
+ *   NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA
+ *   constraint for the reserved zone.
+ *
+ * @return
+ *  - On success return mempool
+ *  - On failure returns NULL
+ */
+__rte_experimental
+struct rte_mempool *
+rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
+	uint32_t cache_size, int socket_id);
+
 /**
  * Create symmetric crypto session header (generic with no private data)
  *
@@ -971,15 +998,19 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mempool);
 /**
  * Create asymmetric crypto session header (generic with no private data)
  *
- * @param   mempool    mempool to allocate asymmetric session
- *                     objects from
+ * @param   dev_id   ID of device that we want the session to be used on
+ * @param   xforms   Asymmetric crypto transform operations to apply on flow
+ *                   processed with this session
+ * @param   mp       mempool to allocate asymmetric session
+ *                   objects from
  * @return
  *  - On success return pointer to asym-session
  *  - On failure returns NULL
  */
 __rte_experimental
 struct rte_cryptodev_asym_session *
-rte_cryptodev_asym_session_create(struct rte_mempool *mempool);
+rte_cryptodev_asym_session_create(uint8_t dev_id,
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp);
 
 /**
  * Frees symmetric crypto session header, after checking that all
@@ -997,20 +1028,20 @@ int
 rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess);
 
 /**
- * Frees asymmetric crypto session header, after checking that all
- * the device private data has been freed, returning it
- * to its original mempool.
+ * Clears and frees asymmetric crypto session header and private data,
+ * returning it to its original mempool.
  *
+ * @param   dev_id   ID of device that uses the asymmetric session.
  * @param   sess     Session header to be freed.
  *
  * @return
  *  - 0 if successful.
- *  - -EINVAL if session is NULL.
- *  - -EBUSY if not all device private data has been freed.
+ *  - -EINVAL if device is invalid or session is NULL.
  */
 __rte_experimental
 int
-rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess);
+rte_cryptodev_asym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess);
 
 /**
  * Fill out private data for the device id, based on its device type.
@@ -1034,28 +1065,6 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 			struct rte_crypto_sym_xform *xforms,
 			struct rte_mempool *mempool);
 
-/**
- * Initialize asymmetric session on a device with specific asymmetric xform
- *
- * @param   dev_id   ID of device that we want the session to be used on
- * @param   sess     Session to be set up on a device
- * @param   xforms   Asymmetric crypto transform operations to apply on flow
- *                   processed with this session
- * @param   mempool  Mempool to be used for internal allocation.
- *
- * @return
- *  - On success, zero.
- *  - -EINVAL if input parameters are invalid.
- *  - -ENOTSUP if crypto device does not support the crypto transform.
- *  - -ENOMEM if the private session could not be allocated.
- */
-__rte_experimental
-int
-rte_cryptodev_asym_session_init(uint8_t dev_id,
-			struct rte_cryptodev_asym_session *sess,
-			struct rte_crypto_asym_xform *xforms,
-			struct rte_mempool *mempool);
-
 /**
  * Frees private data for the device id, based on its device type,
  * returning it to its mempool. It is the application's responsibility
@@ -1074,21 +1083,6 @@ int
 rte_cryptodev_sym_session_clear(uint8_t dev_id,
 			struct rte_cryptodev_sym_session *sess);
 
-/**
- * Frees resources held by asymmetric session during rte_cryptodev_session_init
- *
- * @param   dev_id   ID of device that uses the asymmetric session.
- * @param   sess     Asymmetric session setup on device using
- *					 rte_cryptodev_session_init
- * @return
- *  - 0 if successful.
- *  - -EINVAL if device is invalid or session is NULL.
- */
-__rte_experimental
-int
-rte_cryptodev_asym_session_clear(uint8_t dev_id,
-			struct rte_cryptodev_asym_session *sess);
-
 /**
  * Get the size of the header session, for all registered drivers excluding
  * the user data size.
@@ -1116,7 +1110,7 @@ rte_cryptodev_sym_get_existing_header_session_size(
 		struct rte_cryptodev_sym_session *sess);
 
 /**
- * Get the size of the asymmetric session header, for all registered drivers.
+ * Get the size of the asymmetric session header.
  *
  * @return
  *   Size of the asymmetric header session.
diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
index d1f4f069a3..f4e1c870df 100644
--- a/lib/cryptodev/rte_cryptodev_trace.h
+++ b/lib/cryptodev/rte_cryptodev_trace.h
@@ -83,10 +83,22 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_u16(sess->user_data_sz);
 )
 
+RTE_TRACE_POINT(
+	rte_cryptodev_trace_asym_session_pool_create,
+	RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts,
+		uint32_t cache_size, void *mempool),
+	rte_trace_point_emit_string(name);
+	rte_trace_point_emit_u32(nb_elts);
+	rte_trace_point_emit_u32(cache_size);
+	rte_trace_point_emit_ptr(mempool);
+)
+
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_create,
-	RTE_TRACE_POINT_ARGS(void *mempool,
-		struct rte_cryptodev_asym_session *sess),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms,
+		void *mempool, struct rte_cryptodev_asym_session *sess),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_ptr(xforms);
 	rte_trace_point_emit_ptr(mempool);
 	rte_trace_point_emit_ptr(sess);
 )
@@ -99,7 +111,9 @@ RTE_TRACE_POINT(
 
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_free,
-	RTE_TRACE_POINT_ARGS(struct rte_cryptodev_asym_session *sess),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess),
+	rte_trace_point_emit_u8(dev_id);
 	rte_trace_point_emit_ptr(sess);
 )
 
@@ -117,17 +131,6 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_ptr(mempool);
 )
 
-RTE_TRACE_POINT(
-	rte_cryptodev_trace_asym_session_init,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess, void *xforms,
-		void *mempool),
-	rte_trace_point_emit_u8(dev_id);
-	rte_trace_point_emit_ptr(sess);
-	rte_trace_point_emit_ptr(xforms);
-	rte_trace_point_emit_ptr(mempool);
-)
-
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_sym_session_clear,
 	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
@@ -135,13 +138,6 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_ptr(sess);
 )
 
-RTE_TRACE_POINT(
-	rte_cryptodev_trace_asym_session_clear,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
-	rte_trace_point_emit_u8(dev_id);
-	rte_trace_point_emit_ptr(sess);
-)
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index c50745fa8c..44d1aff0e2 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -55,10 +55,8 @@ EXPERIMENTAL {
 	rte_cryptodev_asym_get_header_session_size;
 	rte_cryptodev_asym_get_private_session_size;
 	rte_cryptodev_asym_get_xform_enum;
-	rte_cryptodev_asym_session_clear;
 	rte_cryptodev_asym_session_create;
 	rte_cryptodev_asym_session_free;
-	rte_cryptodev_asym_session_init;
 	rte_cryptodev_asym_xform_capability_check_modlen;
 	rte_cryptodev_asym_xform_capability_check_optype;
 	rte_cryptodev_sym_cpu_crypto_process;
@@ -81,9 +79,7 @@ EXPERIMENTAL {
 	__rte_cryptodev_trace_sym_session_free;
 	__rte_cryptodev_trace_asym_session_free;
 	__rte_cryptodev_trace_sym_session_init;
-	__rte_cryptodev_trace_asym_session_init;
 	__rte_cryptodev_trace_sym_session_clear;
-	__rte_cryptodev_trace_asym_session_clear;
 	__rte_cryptodev_trace_dequeue_burst;
 	__rte_cryptodev_trace_enqueue_burst;
 
@@ -104,6 +100,9 @@ EXPERIMENTAL {
 	rte_cryptodev_remove_deq_callback;
 	rte_cryptodev_remove_enq_callback;
 
+	# added 22.03
+	rte_cryptodev_asym_session_pool_create;
+	__rte_cryptodev_trace_asym_session_pool_create;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 1%]

* [PATCH v4 5/5] crypto: modify return value for asym session create
    2022-02-09 15:38  1% ` [PATCH v4 2/5] crypto: use single buffer for asymmetric session Ciara Power
@ 2022-02-09 15:38  2% ` Ciara Power
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Ciara Power @ 2022-02-09 15:38 UTC (permalink / raw)
  To: dev; +Cc: roy.fan.zhang, gakhil, anoobj, mdr, Ciara Power, Declan Doherty

Rather than the asym session create function returning a session on
success, and a NULL value on error, it is modified to now return int
values - 0 on success or -EINVAL/-ENOTSUP/-ENOMEM on failure.
The session to be used is passed as input.

This adds clarity on the failure of the create function, which enables
treating the -ENOTSUP return as TEST_SKIPPED in test apps.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>

---
v4:
  - Reordered function parameters.
  - Removed docs code additions, these are included due to patch 1
    changing sample doc to use literal includes.
v3:
  - Fixed variable declarations, putting initialised variable last.
  - Made function comment for return value more generic.
  - Fixed log to include line break.
  - Added documentation.
---
 app/test-crypto-perf/cperf_ops.c       |  12 ++-
 app/test/test_cryptodev_asym.c         | 109 +++++++++++++------------
 doc/guides/rel_notes/release_22_03.rst |   3 +-
 lib/cryptodev/rte_cryptodev.c          |  26 +++---
 lib/cryptodev/rte_cryptodev.h          |  13 ++-
 5 files changed, 88 insertions(+), 75 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index b8f590b397..479c40eead 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -734,7 +734,9 @@ cperf_create_session(struct rte_mempool *sess_mp,
 	struct rte_crypto_sym_xform auth_xform;
 	struct rte_crypto_sym_xform aead_xform;
 	struct rte_cryptodev_sym_session *sess = NULL;
+	void *asym_sess = NULL;
 	struct rte_crypto_asym_xform xform = {0};
+	int ret;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
 		xform.next = NULL;
@@ -744,11 +746,13 @@ cperf_create_session(struct rte_mempool *sess_mp,
 		xform.modex.exponent.data = perf_mod_e;
 		xform.modex.exponent.length = sizeof(perf_mod_e);
 
-		sess = (void *)rte_cryptodev_asym_session_create(dev_id, &xform, sess_mp);
-		if (sess == NULL)
+		ret = rte_cryptodev_asym_session_create(dev_id, &xform,
+				sess_mp, &asym_sess);
+		if (ret < 0) {
+			RTE_LOG(ERR, USER1, "Asym session create failed\n");
 			return NULL;
-
-		return sess;
+		}
+		return asym_sess;
 	}
 #ifdef RTE_LIB_SECURITY
 	/*
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index f9691fe281..1bddcb013e 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -317,7 +317,7 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	uint8_t input[TEST_DATA_SIZE] = {0};
 	uint8_t *result = NULL;
 
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	xform_tc.next = NULL;
 	xform_tc.xform_type = data_tc->modex.xform_type;
@@ -452,14 +452,14 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (!sessionless) {
-		sess = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
-				ts_params->session_mpool);
-		if (!sess) {
+		ret = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
+				ts_params->session_mpool, &sess);
+		if (ret < 0) {
 			snprintf(test_msg, ASYM_TEST_MSG_LEN,
 					"line %u "
 					"FAILED: %s", __LINE__,
 					"Session creation failed");
-			status = TEST_FAILED;
+			status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 			goto error_exit;
 		}
 
@@ -646,7 +646,7 @@ test_rsa_sign_verify(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with exponent key only,
 	 * Check in PMD feature flag for RSA exponent key type support.
@@ -659,12 +659,12 @@ test_rsa_sign_verify(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -686,7 +686,7 @@ test_rsa_enc_dec(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with exponent key only,
 	 * Check in PMD feature flag for RSA exponent key type support.
@@ -699,11 +699,11 @@ test_rsa_enc_dec(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -726,7 +726,7 @@ test_rsa_sign_verify_crt(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with quintuple format key only,
 	 * Check im PMD feature flag for RSA quintuple key type support.
@@ -738,12 +738,12 @@ test_rsa_sign_verify_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify_crt\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -766,7 +766,7 @@ test_rsa_enc_dec_crt(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with quintuple format key only,
 	 * Check in PMD feature flag for RSA quintuple key type support.
@@ -778,12 +778,12 @@ test_rsa_enc_dec_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"enc_dec_crt\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1047,7 +1047,7 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 	uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
@@ -1074,12 +1074,12 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.shared_secret.data = output;
 	asym_op->dh.shared_secret.length = sizeof(output);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1130,7 +1130,7 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
@@ -1152,12 +1152,12 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = output;
 	asym_op->dh.priv_key.length = sizeof(output);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1211,7 +1211,7 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
@@ -1241,12 +1241,12 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 					0);
 	asym_op->dh.priv_key = dh_test_params.priv_key;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1300,7 +1300,7 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t out_pub_key[TEST_DH_MOD_LEN];
 	uint8_t out_prv_key[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform pub_key_xform;
@@ -1330,12 +1330,12 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = out_prv_key;
 	asym_op->dh.priv_key.length = sizeof(out_prv_key);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1419,12 +1419,12 @@ test_mod_inv(void)
 				return TEST_SKIPPED;
 		}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool);
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1543,13 +1543,13 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool);
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				 "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1653,13 +1653,14 @@ test_dsa_sign(void)
 	uint8_t r[TEST_DH_MOD_LEN];
 	uint8_t s[TEST_DH_MOD_LEN];
 	uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
+	int ret;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				 "line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 	/* set up crypto op data structure */
@@ -1788,7 +1789,7 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	struct rte_crypto_asym_op *asym_op;
 	struct rte_cryptodev_info dev_info;
 	struct rte_crypto_op *op = NULL;
-	int status = TEST_SUCCESS, ret;
+	int ret, status = TEST_SUCCESS;
 
 	switch (curve_id) {
 	case SECP192R1:
@@ -1833,12 +1834,12 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
 	xform.ec.curve_id = input_params.curve;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto exit;
 	}
 
@@ -1990,7 +1991,7 @@ test_ecpm(enum curve curve_id)
 	struct rte_crypto_asym_op *asym_op;
 	struct rte_cryptodev_info dev_info;
 	struct rte_crypto_op *op = NULL;
-	int status = TEST_SUCCESS, ret;
+	int ret, status = TEST_SUCCESS;
 
 	switch (curve_id) {
 	case SECP192R1:
@@ -2035,12 +2036,12 @@ test_ecpm(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
 	xform.ec.curve_id = input_params.curve;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto exit;
 	}
 
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index a930cbbad6..640691c3ef 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -123,7 +123,8 @@ API Changes
   The session structure was moved to ``cryptodev_pmd.h``,
   hiding it from applications.
   The API ``rte_cryptodev_asym_session_init`` was removed as the initialization
-  is now moved to ``rte_cryptodev_asym_session_create``.
+  is now moved to ``rte_cryptodev_asym_session_create``, which was updated to
+  return an integer value to indicate initialisation errors.
 
 
 ABI Changes
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 916dbb6709..727d271fb9 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1912,9 +1912,10 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 	return sess;
 }
 
-void *
+int
 rte_cryptodev_asym_session_create(uint8_t dev_id,
-		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp)
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
+		void **session)
 {
 	struct rte_cryptodev_asym_session *sess;
 	uint32_t session_priv_data_sz;
@@ -1926,17 +1927,17 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 
 	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return NULL;
+		return -EINVAL;
 	}
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
 
 	if (dev == NULL)
-		return NULL;
+		return -EINVAL;
 
 	if (!mp) {
 		CDEV_LOG_ERR("invalid mempool\n");
-		return NULL;
+		return -EINVAL;
 	}
 
 	session_priv_data_sz = rte_cryptodev_asym_get_private_session_size(
@@ -1946,22 +1947,23 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 	if (pool_priv->max_priv_session_sz < session_priv_data_sz) {
 		CDEV_LOG_DEBUG(
 			"The private session data size used when creating the mempool is smaller than this device's private session data.");
-		return NULL;
+		return -EINVAL;
 	}
 
 	/* Verify if provided mempool can hold elements big enough. */
 	if (mp->elt_size < session_header_size + session_priv_data_sz) {
 		CDEV_LOG_ERR(
 			"mempool elements too small to hold session objects");
-		return NULL;
+		return -EINVAL;
 	}
 
 	/* Allocate a session structure from the session pool */
-	if (rte_mempool_get(mp, (void **)&sess)) {
+	if (rte_mempool_get(mp, session)) {
 		CDEV_LOG_ERR("couldn't get object from session mempool");
-		return NULL;
+		return -ENOMEM;
 	}
 
+	sess = *session;
 	sess->driver_id = dev->driver_id;
 	sess->user_data_sz = pool_priv->user_data_sz;
 	sess->max_priv_data_sz = pool_priv->max_priv_session_sz;
@@ -1969,7 +1971,7 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 	/* Clear device session pointer.*/
 	memset(sess->sess_private_data, 0, session_priv_data_sz + sess->user_data_sz);
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, NULL);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, -ENOTSUP);
 
 	if (sess->sess_private_data[0] == 0) {
 		ret = dev->dev_ops->asym_session_configure(dev, xforms, sess);
@@ -1977,12 +1979,12 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 			CDEV_LOG_ERR(
 				"dev_id %d failed to configure session details",
 				dev_id);
-			return NULL;
+			return ret;
 		}
 	}
 
 	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp, sess);
-	return sess;
+	return 0;
 }
 
 int
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 91110b08da..dba982e919 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -995,14 +995,19 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mempool);
  *                   processed with this session
  * @param   mp       mempool to allocate asymmetric session
  *                   objects from
+ * @param   session  void ** for session to be used
+ *
  * @return
- *  - On success return pointer to asym-session
- *  - On failure returns NULL
+ *  - 0 on success.
+ *  - -EINVAL on invalid arguments.
+ *  - -ENOMEM on memory error for session allocation.
+ *  - -ENOTSUP if device doesn't support session configuration.
  */
 __rte_experimental
-void *
+int
 rte_cryptodev_asym_session_create(uint8_t dev_id,
-		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp);
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
+		void **session);
 
 /**
  * Frees symmetric crypto session header, after checking that all
-- 
2.25.1


^ permalink raw reply	[relevance 2%]

* Re: [PATCH v6 0/3] ethdev: introduce IP reassembly offload
  2022-02-08 22:20  4%       ` [PATCH v6 " Akhil Goyal
@ 2022-02-10  8:54  0%         ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2022-02-10  8:54 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: anoobj, matan, konstantin.ananyev, thomas, andrew.rybchenko,
	rosen.xu, olivier.matz, david.marchand, radu.nicolau, jerinj,
	stephen, mdr

On 2/8/2022 10:20 PM, Akhil Goyal wrote:
> As discussed in the RFC[1] sent in 21.11, a new offload is
> introduced in ethdev for IP reassembly.
> 
> This patchset add the IP reassembly RX offload.
> Currently, the offload is tested along with inline IPsec processing.
> It can also be updated as a standalone offload without IPsec, if there
> are some hardware available to test it.
> The patchset is tested on cnxk platform. The driver implementation
> and a test app are added as separate patchsets.[2][3]
> 
> [1]: http://patches.dpdk.org/project/dpdk/patch/20210823100259.1619886-1-gakhil@marvell.com/
> [2]: APP: http://patches.dpdk.org/project/dpdk/list/?series=21284
> [3]: PMD: http://patches.dpdk.org/project/dpdk/list/?series=21285
> Newer versions of app and PMD will be sent once library changes are
> acked.
> 
> Changes in v6:
> - fix warnings.
> 
> Changes in v5:
> - updated Doxygen comments.(Ferruh)
> - Added release notes.
> - updated libabigail suppress rules.(David)
> 
> Changes in v4:
> - removed rte_eth_dev_info update for capability (Ferruh)
> - removed Rx offload flag (Ferruh)
> - added capability_get() (Ferruh)
> - moved dynfield and dynflag namedefines in rte_mbuf_dyn.h (Ferruh)
> 
> changes in v3:
> - incorporated comments from Andrew and Stephen Hemminger
> 
> changes in v2:
> - added abi ignore exceptions for modifications in reserved fields.
>    Added a crude way to subside the rte_security and rte_ipsec ABI issue.
>    Please suggest a better way.
> - incorporated Konstantin's comment for extra checks in new API
>    introduced.
> - converted static mbuf ol_flag to mbuf dynflag (Konstantin)
> - added a get API for reassembly configuration (Konstantin)
> - Fixed checkpatch issues.
> - Dynfield is NOT split into 2 parts as it would cause an extra fetch in
>    case of IP reassembly failure.
> - Application patches are split into a separate series.
> 
> 
> Akhil Goyal (3):
>    ethdev: introduce IP reassembly offload
>    ethdev: add mbuf dynfield for incomplete IP reassembly
>    security: add IPsec option for IP reassembly
> 

Series applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[relevance 0%]

* RE: [EXT] [PATCH v2 4/4] crypto: reorganize endianness comments, add crypto uint
  @ 2022-02-10 10:17  3%   ` Akhil Goyal
  2022-02-10 16:38  0%     ` Zhang, Roy Fan
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2022-02-10 10:17 UTC (permalink / raw)
  To: Arek Kusztal, dev; +Cc: roy.fan.zhang, Ramkumar Balu

> This patch adds crypto uint typedef so adding comment
> about byte-order becomes unnecessary.
> 
> It makes API comments more tidy, and more consistent
> with other asymmetric crypto APIs.
> 
> Additionally it reorganizes code that enums, externs
> and forward declarations are moved to the top of the
> header file making code more readable.
> 
> It removes also comments like co-prime constraint
> from mod inv as it is natural mathematical constraint,
> not PMD constraint.
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
CI is reporting abi issues in this set. Can you check?
http://mails.dpdk.org/archives/test-report/2022-February/257403.html


^ permalink raw reply	[relevance 3%]

* [PATCH v5 2/5] crypto: use single buffer for asymmetric session
  @ 2022-02-10 14:01  1%   ` Ciara Power
  2022-02-10 14:01  2%   ` [PATCH v5 5/5] crypto: modify return value for asym session create Ciara Power
  1 sibling, 0 replies; 200+ results
From: Ciara Power @ 2022-02-10 14:01 UTC (permalink / raw)
  To: dev
  Cc: roy.fan.zhang, gakhil, anoobj, mdr, Ciara Power, Declan Doherty,
	Ankur Dwivedi, Tejasree Kondoj, John Griffin, Fiona Trahe,
	Deepak Kumar Jain

Rather than using a session buffer that contains pointers to private
session data elsewhere, have a single session buffer.
This session is created for a driver ID, and the mempool element
contains space for the max session private data needed for any driver.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

---
v5:
  - Removed get API for session private data, can be accessed directly.
  - Modified test application to create a session mempool for
    TEST_NUM_SESSIONS rather than TEST_NUM_SESSIONS * 2.
  - Reworded create session function description.
  - Removed sess parameter from create session trace,
    to be added in a later patch.
v4:
  - Merged asym crypto session clear and free functions.
  - Reordered some function parameters.
  - Updated trace function for asym crypto session create.
  - Fixed cnxk clear, the PMD no longer needs to put private data
    back into a mempool.
  - Renamed struct field for max private session size.
  - Replaced __extension__ with RTE_STD_C11.
  - Moved some parameter validity checks to before functional code.
  - Reworded release note.
  - Removed mempool parameter from session configure function.
  - Removed docs code additions, these are included due to patch 1
    changing sample doc to use literal includes.
v3:
  - Corrected formatting of struct comments.
  - Increased size of max_priv_session_sz to uint16_t.
  - Removed trace for asym session init function that was
    previously removed.
  - Added documentation.
v2:
  - Renamed function typedef from "free" to "clear" as session private
    data isn't being freed in that function.
  - Moved user data API to separate patch.
  - Minor fixes to comments, formatting, return values.
---
 app/test-crypto-perf/cperf_ops.c             |  14 +-
 app/test-crypto-perf/cperf_test_throughput.c |   8 +-
 app/test/test_cryptodev_asym.c               | 272 +++++--------------
 doc/guides/prog_guide/cryptodev_lib.rst      |  21 +-
 doc/guides/rel_notes/release_22_03.rst       |   7 +
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c    |   8 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c     |   8 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c     |  22 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.h     |   3 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c  |  32 +--
 drivers/crypto/openssl/rte_openssl_pmd.c     |   4 +-
 drivers/crypto/openssl/rte_openssl_pmd_ops.c |  24 +-
 drivers/crypto/qat/qat_asym.c                |  54 +---
 drivers/crypto/qat/qat_asym.h                |   5 +-
 lib/cryptodev/cryptodev_pmd.h                |  23 +-
 lib/cryptodev/cryptodev_trace_points.c       |   9 +-
 lib/cryptodev/rte_cryptodev.c                | 213 ++++++++-------
 lib/cryptodev/rte_cryptodev.h                |  97 ++++---
 lib/cryptodev/rte_cryptodev_trace.h          |  38 ++-
 lib/cryptodev/version.map                    |   7 +-
 20 files changed, 315 insertions(+), 554 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index d975ae1ab8..b125c699de 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -735,7 +735,6 @@ cperf_create_session(struct rte_mempool *sess_mp,
 	struct rte_crypto_sym_xform aead_xform;
 	struct rte_cryptodev_sym_session *sess = NULL;
 	struct rte_crypto_asym_xform xform = {0};
-	int rc;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
 		xform.next = NULL;
@@ -745,19 +744,10 @@ cperf_create_session(struct rte_mempool *sess_mp,
 		xform.modex.exponent.data = perf_mod_e;
 		xform.modex.exponent.length = sizeof(perf_mod_e);
 
-		sess = (void *)rte_cryptodev_asym_session_create(sess_mp);
+		sess = (void *)rte_cryptodev_asym_session_create(dev_id, &xform, sess_mp);
 		if (sess == NULL)
 			return NULL;
-		rc = rte_cryptodev_asym_session_init(dev_id, (void *)sess,
-						     &xform, priv_mp);
-		if (rc < 0) {
-			if (sess != NULL) {
-				rte_cryptodev_asym_session_clear(dev_id,
-								 (void *)sess);
-				rte_cryptodev_asym_session_free((void *)sess);
-			}
-			return NULL;
-		}
+
 		return sess;
 	}
 #ifdef RTE_LIB_SECURITY
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index 51512af2ad..ee21ff27f7 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -35,11 +35,9 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx)
 	if (!ctx)
 		return;
 	if (ctx->sess) {
-		if (ctx->options->op_type == CPERF_ASYM_MODEX) {
-			rte_cryptodev_asym_session_clear(ctx->dev_id,
-							 (void *)ctx->sess);
-			rte_cryptodev_asym_session_free((void *)ctx->sess);
-		}
+		if (ctx->options->op_type == CPERF_ASYM_MODEX)
+			rte_cryptodev_asym_session_free(ctx->dev_id,
+					(void *)ctx->sess);
 #ifdef RTE_LIB_SECURITY
 		else if (ctx->options->op_type == CPERF_PDCP ||
 			 ctx->options->op_type == CPERF_DOCSIS ||
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 8d7290f9ed..88433faf1c 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -452,7 +452,8 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (!sessionless) {
-		sess = rte_cryptodev_asym_session_create(ts_params->session_mpool);
+		sess = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
+				ts_params->session_mpool);
 		if (!sess) {
 			snprintf(test_msg, ASYM_TEST_MSG_LEN,
 					"line %u "
@@ -462,15 +463,6 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 			goto error_exit;
 		}
 
-		if (rte_cryptodev_asym_session_init(dev_id, sess, &xform_tc,
-				ts_params->session_mpool) < 0) {
-			snprintf(test_msg, ASYM_TEST_MSG_LEN,
-					"line %u FAILED: %s",
-					__LINE__, "unabled to config sym session");
-			status = TEST_FAILED;
-			goto error_exit;
-		}
-
 		rte_crypto_op_attach_asym_session(op, sess);
 	} else {
 		asym_op->xform = &xform_tc;
@@ -512,10 +504,8 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 		snprintf(test_msg, ASYM_TEST_MSG_LEN, "SESSIONLESS PASS");
 
 error_exit:
-		if (sess != NULL) {
-			rte_cryptodev_asym_session_clear(dev_id, sess);
-			rte_cryptodev_asym_session_free(sess);
-		}
+		if (sess != NULL)
+			rte_cryptodev_asym_session_free(dev_id, sess);
 
 		if (op != NULL)
 			rte_crypto_op_free(op);
@@ -669,18 +659,11 @@ test_rsa_sign_verify(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"sign_verify\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -688,9 +671,7 @@ test_rsa_sign_verify(void)
 	status = queue_ops_rsa_sign_verify(sess);
 
 error_exit:
-
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -718,17 +699,10 @@ test_rsa_enc_dec(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"enc_dec\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -737,8 +711,7 @@ test_rsa_enc_dec(void)
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -765,28 +738,20 @@ test_rsa_sign_verify_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify_crt\n");
 		status = TEST_FAILED;
-		return status;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform_crt,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"sign_verify_crt\n");
-		status = TEST_FAILED;
 		goto error_exit;
 	}
+
 	status = queue_ops_rsa_sign_verify(sess);
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -813,27 +778,20 @@ test_rsa_enc_dec_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"enc_dec_crt\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform_crt,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"enc_dec_crt\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
+
 	status = queue_ops_rsa_enc_dec(sess);
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -927,7 +885,6 @@ testsuite_setup(void)
 	/* configure qp */
 	ts_params->qp_conf.nb_descriptors = DEFAULT_NUM_OPS_INFLIGHT;
 	ts_params->qp_conf.mp_session = ts_params->session_mpool;
-	ts_params->qp_conf.mp_session_private = ts_params->session_mpool;
 	for (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) {
 		TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
 			dev_id, qp_id, &ts_params->qp_conf,
@@ -936,21 +893,9 @@ testsuite_setup(void)
 			qp_id, dev_id);
 	}
 
-	/* setup asym session pool */
-	unsigned int session_size = RTE_MAX(
-		rte_cryptodev_asym_get_private_session_size(dev_id),
-		rte_cryptodev_asym_get_header_session_size());
-	/*
-	 * Create mempool with TEST_NUM_SESSIONS * 2,
-	 * to include the session headers
-	 */
-	ts_params->session_mpool = rte_mempool_create(
-				"test_asym_sess_mp",
-				TEST_NUM_SESSIONS * 2,
-				session_size,
-				0, 0, NULL, NULL, NULL,
-				NULL, SOCKET_ID_ANY,
-				0);
+	ts_params->session_mpool = rte_cryptodev_asym_session_pool_create(
+			"test_asym_sess_mp", TEST_NUM_SESSIONS, 0,
+			SOCKET_ID_ANY);
 
 	TEST_ASSERT_NOT_NULL(ts_params->session_mpool,
 			"session mempool allocation failed");
@@ -1107,14 +1052,6 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_xform xform = *xfrm;
 	uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1137,11 +1074,11 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.shared_secret.data = output;
 	asym_op->dh.shared_secret.length = sizeof(output);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1176,10 +1113,8 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 			asym_op->dh.shared_secret.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -1199,14 +1134,6 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1225,11 +1152,11 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = output;
 	asym_op->dh.priv_key.length = sizeof(output);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1265,10 +1192,8 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1290,14 +1215,6 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1324,11 +1241,11 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 					0);
 	asym_op->dh.priv_key = dh_test_params.priv_key;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1365,10 +1282,8 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 			asym_op->dh.priv_key.data, asym_op->dh.priv_key.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1391,15 +1306,6 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_xform pub_key_xform;
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1423,11 +1329,12 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.pub_key.length = sizeof(out_pub_key);
 	asym_op->dh.priv_key.data = out_prv_key;
 	asym_op->dh.priv_key.length = sizeof(out_prv_key);
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1462,10 +1369,8 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 			out_pub_key, asym_op->dh.pub_key.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1514,7 +1419,7 @@ test_mod_inv(void)
 				return TEST_SKIPPED;
 		}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool);
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "line %u "
 				"FAILED: %s", __LINE__,
@@ -1523,15 +1428,6 @@ test_mod_inv(void)
 		goto error_exit;
 	}
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &modinv_xform,
-			sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* generate crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1583,10 +1479,8 @@ test_mod_inv(void)
 	}
 
 error_exit:
-	if (sess) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 
 	if (op)
 		rte_crypto_op_free(op);
@@ -1649,7 +1543,7 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool);
 	if (!sess) {
 		RTE_LOG(ERR, USER1,
 				 "line %u "
@@ -1659,15 +1553,6 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &modex_xform,
-			sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	asym_op = op->asym;
 	memcpy(input, base, sizeof(base));
 	asym_op->modex.base.data = input;
@@ -1706,10 +1591,8 @@ test_mod_exp(void)
 	}
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 
 	if (op != NULL)
 		rte_crypto_op_free(op);
@@ -1771,7 +1654,7 @@ test_dsa_sign(void)
 	uint8_t s[TEST_DH_MOD_LEN];
 	uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool);
 	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				 "line %u FAILED: %s", __LINE__,
@@ -1800,15 +1683,6 @@ test_dsa_sign(void)
 	debug_hexdump(stdout, "priv_key: ", dsa_xform.dsa.x.data,
 			dsa_xform.dsa.x.length);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &dsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* attach asymmetric crypto session to crypto operations */
 	rte_crypto_op_attach_asym_session(op, sess);
 	asym_op->dsa.op_type = RTE_CRYPTO_ASYM_OP_SIGN;
@@ -1882,10 +1756,8 @@ test_dsa_sign(void)
 		status = TEST_FAILED;
 	}
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -1944,15 +1816,6 @@ test_ecdsa_sign_verify(enum curve curve_id)
 
 	rte_cryptodev_info_get(dev_id, &dev_info);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed\n");
-		status = TEST_FAILED;
-		goto exit;
-	}
-
 	/* Setup crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (op == NULL) {
@@ -1970,11 +1833,11 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
 	xform.ec.curve_id = input_params.curve;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-				sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
-				"Unable to config asym session\n");
+				"Session creation failed\n");
 		status = TEST_FAILED;
 		goto exit;
 	}
@@ -2082,10 +1945,8 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	}
 
 exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -2157,15 +2018,6 @@ test_ecpm(enum curve curve_id)
 
 	rte_cryptodev_info_get(dev_id, &dev_info);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed\n");
-		status = TEST_FAILED;
-		goto exit;
-	}
-
 	/* Setup crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (op == NULL) {
@@ -2183,11 +2035,11 @@ test_ecpm(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
 	xform.ec.curve_id = input_params.curve;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-				sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
-				"Unable to config asym session\n");
+				"Session creation failed\n");
 		status = TEST_FAILED;
 		goto exit;
 	}
@@ -2255,10 +2107,8 @@ test_ecpm(enum curve curve_id)
 	}
 
 exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 9f33f7a177..b4dbd384bf 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -1038,20 +1038,17 @@ It is the application's responsibility to create and manage the session mempools
 Application using both symmetric and asymmetric sessions should allocate and maintain
 different sessions pools for each type.
 
-An application can use ``rte_cryptodev_get_asym_session_private_size()`` to
-get the private size of asymmetric session on a given crypto device. This
-function would allow an application to calculate the max device asymmetric
-session size of all crypto devices to create a single session mempool.
-If instead an application creates multiple asymmetric session mempools,
-the Crypto device framework also provides ``rte_cryptodev_asym_get_header_session_size()`` to get
-the size of an uninitialized session.
+An application can use ``rte_cryptodev_asym_session_pool_create()`` to create a mempool
+with a specified number of elements. The element size will allow for the session header,
+and the max private session size.
+The max private session size is chosen based on available crypto devices,
+the biggest private session size is used. This means any of those devices can be used,
+and the mempool element will have available space for its private session data.
 
 Once the session mempools have been created, ``rte_cryptodev_asym_session_create()``
-is used to allocate an uninitialized asymmetric session from the given mempool.
-The session then must be initialized using ``rte_cryptodev_asym_session_init()``
-for each of the required crypto devices. An asymmetric transform chain
-is used to specify the operation and its parameters. See the section below for
-details on transforms.
+is used to allocate and initialize an asymmetric session from the given mempool.
+An asymmetric transform chain is used to specify the operation and its parameters.
+See the section below for details on transforms.
 
 When a session is no longer used, user must call ``rte_cryptodev_asym_session_clear()``
 for each of the crypto devices that are using the session, to free all driver
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index a820cc5596..ea4c5309a0 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -112,6 +112,13 @@ API Changes
 * ethdev: Old public macros and enumeration constants without ``RTE_ETH_`` prefix,
   which are kept for backward compatibility, are marked as deprecated.
 
+* cryptodev: The asymmetric session handling was modified to use a single
+  mempool object. An API ``rte_cryptodev_asym_session_pool_create`` was added
+  to create a mempool with element size big enough to hold the generic asymmetric
+  session header and max size for a device private session data.
+  The API ``rte_cryptodev_asym_session_init`` was removed as the initialization
+  is now moved to ``rte_cryptodev_asym_session_create``.
+
 
 ABI Changes
 -----------
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
index d217bbf383..c4d5d039ec 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
@@ -157,8 +157,8 @@ cn10k_cpt_fill_inst(struct cnxk_cpt_qp *qp, struct rte_crypto_op *ops[],
 
 		if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 			asym_op = op->asym;
-			ae_sess = get_asym_session_private_data(
-				asym_op->session, cn10k_cryptodev_driver_id);
+			ae_sess = (struct cnxk_ae_sess *)
+					asym_op->session->sess_private_data;
 			ret = cnxk_ae_enqueue(qp, op, infl_req, &inst[0],
 					      ae_sess);
 			if (unlikely(ret))
@@ -431,8 +431,8 @@ cn10k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp,
 			uintptr_t *mdata = infl_req->mdata;
 			struct cnxk_ae_sess *sess;
 
-			sess = get_asym_session_private_data(
-				op->session, cn10k_cryptodev_driver_id);
+			sess = (struct cnxk_ae_sess *)
+					op->session->sess_private_data;
 
 			cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
 		}
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
index ac1953b66d..b8ad4bf211 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
@@ -138,8 +138,8 @@ cn9k_cpt_inst_prep(struct cnxk_cpt_qp *qp, struct rte_crypto_op *op,
 
 		if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 			asym_op = op->asym;
-			sess = get_asym_session_private_data(
-				asym_op->session, cn9k_cryptodev_driver_id);
+			sess = (struct cnxk_ae_sess *)
+					asym_op->session->sess_private_data;
 			ret = cnxk_ae_enqueue(qp, op, infl_req, inst, sess);
 			inst->w7.u64 = sess->cpt_inst_w7;
 		} else {
@@ -453,8 +453,8 @@ cn9k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp, struct rte_crypto_op *cop,
 			uintptr_t *mdata = infl_req->mdata;
 			struct cnxk_ae_sess *sess;
 
-			sess = get_asym_session_private_data(
-				op->session, cn9k_cryptodev_driver_id);
+			sess = (struct cnxk_ae_sess *)
+					op->session->sess_private_data;
 
 			cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
 		}
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index a5fb68da02..72f5f1a6fe 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -658,10 +658,9 @@ void
 cnxk_ae_session_clear(struct rte_cryptodev *dev,
 		      struct rte_cryptodev_asym_session *sess)
 {
-	struct rte_mempool *sess_mp;
 	struct cnxk_ae_sess *priv;
 
-	priv = get_asym_session_private_data(sess, dev->driver_id);
+	priv = (struct cnxk_ae_sess *) sess->sess_private_data;
 	if (priv == NULL)
 		return;
 
@@ -670,40 +669,29 @@ cnxk_ae_session_clear(struct rte_cryptodev *dev,
 
 	/* Reset and free object back to pool */
 	memset(priv, 0, cnxk_ae_session_size_get(dev));
-	sess_mp = rte_mempool_from_obj(priv);
-	set_asym_session_private_data(sess, dev->driver_id, NULL);
-	rte_mempool_put(sess_mp, priv);
 }
 
 int
 cnxk_ae_session_cfg(struct rte_cryptodev *dev,
 		    struct rte_crypto_asym_xform *xform,
-		    struct rte_cryptodev_asym_session *sess,
-		    struct rte_mempool *pool)
+		    struct rte_cryptodev_asym_session *sess)
 {
 	struct cnxk_cpt_vf *vf = dev->data->dev_private;
 	struct roc_cpt *roc_cpt = &vf->cpt;
-	struct cnxk_ae_sess *priv;
+	struct cnxk_ae_sess *priv =
+			(struct cnxk_ae_sess *) sess->sess_private_data;
 	union cpt_inst_w7 w7;
 	int ret;
 
-	if (rte_mempool_get(pool, (void **)&priv))
-		return -ENOMEM;
-
-	memset(priv, 0, sizeof(struct cnxk_ae_sess));
-
 	ret = cnxk_ae_fill_session_parameters(priv, xform);
-	if (ret) {
-		rte_mempool_put(pool, priv);
+	if (ret)
 		return ret;
-	}
 
 	w7.u64 = 0;
 	w7.s.egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_AE];
 	priv->cpt_inst_w7 = w7.u64;
 	priv->cnxk_fpm_iova = vf->cnxk_fpm_iova;
 	priv->ec_grp = vf->ec_grp;
-	set_asym_session_private_data(sess, dev->driver_id, priv);
 
 	return 0;
 }
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
index 0656ba9675..ab0f00ee7c 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
@@ -122,8 +122,7 @@ void cnxk_ae_session_clear(struct rte_cryptodev *dev,
 			   struct rte_cryptodev_asym_session *sess);
 int cnxk_ae_session_cfg(struct rte_cryptodev *dev,
 			struct rte_crypto_asym_xform *xform,
-			struct rte_cryptodev_asym_session *sess,
-			struct rte_mempool *pool);
+			struct rte_cryptodev_asym_session *sess);
 void cnxk_cpt_dump_on_err(struct cnxk_cpt_qp *qp);
 
 static inline union rte_event_crypto_metadata *
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index f7ca8a8a8e..0cb6dbb38c 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -375,35 +375,24 @@ otx_cpt_asym_session_size_get(struct rte_cryptodev *dev __rte_unused)
 }
 
 static int
-otx_cpt_asym_session_cfg(struct rte_cryptodev *dev,
+otx_cpt_asym_session_cfg(struct rte_cryptodev *dev __rte_unused,
 			 struct rte_crypto_asym_xform *xform __rte_unused,
-			 struct rte_cryptodev_asym_session *sess,
-			 struct rte_mempool *pool)
+			 struct rte_cryptodev_asym_session *sess)
 {
-	struct cpt_asym_sess_misc *priv;
+	struct cpt_asym_sess_misc *priv = (struct cpt_asym_sess_misc *)
+			sess->sess_private_data;
 	int ret;
 
 	CPT_PMD_INIT_FUNC_TRACE();
 
-	if (rte_mempool_get(pool, (void **)&priv)) {
-		CPT_LOG_ERR("Could not allocate session private data");
-		return -ENOMEM;
-	}
-
-	memset(priv, 0, sizeof(struct cpt_asym_sess_misc));
-
 	ret = cpt_fill_asym_session_parameters(priv, xform);
 	if (ret) {
 		CPT_LOG_ERR("Could not configure session parameters");
-
-		/* Return session to mempool */
-		rte_mempool_put(pool, priv);
 		return ret;
 	}
 
 	priv->cpt_inst_w7 = 0;
 
-	set_asym_session_private_data(sess, dev->driver_id, priv);
 	return 0;
 }
 
@@ -412,11 +401,10 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 			   struct rte_cryptodev_asym_session *sess)
 {
 	struct cpt_asym_sess_misc *priv;
-	struct rte_mempool *sess_mp;
 
 	CPT_PMD_INIT_FUNC_TRACE();
 
-	priv = get_asym_session_private_data(sess, dev->driver_id);
+	priv = (struct cpt_asym_sess_misc *) sess->sess_private_data;
 
 	if (priv == NULL)
 		return;
@@ -424,9 +412,6 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 	/* Free resources allocated during session configure */
 	cpt_free_asym_session_parameters(priv);
 	memset(priv, 0, otx_cpt_asym_session_size_get(dev));
-	sess_mp = rte_mempool_from_obj(priv);
-	set_asym_session_private_data(sess, dev->driver_id, NULL);
-	rte_mempool_put(sess_mp, priv);
 }
 
 static __rte_always_inline void * __rte_hot
@@ -471,8 +456,8 @@ otx_cpt_enq_single_asym(struct cpt_instance *instance,
 		return NULL;
 	}
 
-	sess = get_asym_session_private_data(asym_op->session,
-					     otx_cryptodev_driver_id);
+	sess = (struct cpt_asym_sess_misc *)
+			asym_op->session->sess_private_data;
 
 	/* Store phys_addr of the mdata to meta_buf */
 	params.meta_buf = rte_mempool_virt2iova(mdata);
@@ -852,8 +837,7 @@ otx_cpt_asym_post_process(struct rte_crypto_op *cop,
 	struct rte_crypto_asym_op *op = cop->asym;
 	struct cpt_asym_sess_misc *sess;
 
-	sess = get_asym_session_private_data(op->session,
-					     otx_cryptodev_driver_id);
+	sess = (struct cpt_asym_sess_misc *) op->session->sess_private_data;
 
 	switch (sess->xfrm_type) {
 	case RTE_CRYPTO_ASYM_XFORM_RSA:
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 5794ed8159..d80e1052e2 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -748,9 +748,7 @@ get_session(struct openssl_qp *qp, struct rte_crypto_op *op)
 		} else {
 			if (likely(op->asym->session != NULL))
 				asym_sess = (struct openssl_asym_session *)
-						get_asym_session_private_data(
-						op->asym->session,
-						cryptodev_driver_id);
+						op->asym->session->sess_private_data;
 			if (asym_sess == NULL)
 				op->status =
 					RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 52715f86f8..556fd226ed 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -1119,8 +1119,7 @@ static int openssl_set_asym_session_parameters(
 static int
 openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool)
+		struct rte_cryptodev_asym_session *sess)
 {
 	void *asym_sess_private_data;
 	int ret;
@@ -1130,25 +1129,14 @@ openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		return -EINVAL;
 	}
 
-	if (rte_mempool_get(mempool, &asym_sess_private_data)) {
-		CDEV_LOG_ERR(
-			"Couldn't get object from session mempool");
-		return -ENOMEM;
-	}
-
+	asym_sess_private_data = sess->sess_private_data;
 	ret = openssl_set_asym_session_parameters(asym_sess_private_data,
 			xform);
 	if (ret != 0) {
 		OPENSSL_LOG(ERR, "failed configure session parameters");
-
-		/* Return session to mempool */
-		rte_mempool_put(mempool, asym_sess_private_data);
 		return ret;
 	}
 
-	set_asym_session_private_data(sess, dev->driver_id,
-			asym_sess_private_data);
-
 	return 0;
 }
 
@@ -1206,19 +1194,15 @@ static void openssl_reset_asym_session(struct openssl_asym_session *sess)
  * so it doesn't leave key material behind
  */
 static void
-openssl_pmd_asym_session_clear(struct rte_cryptodev *dev,
+openssl_pmd_asym_session_clear(struct rte_cryptodev *dev __rte_unused,
 		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t index = dev->driver_id;
-	void *sess_priv = get_asym_session_private_data(sess, index);
+	void *sess_priv = sess->sess_private_data;
 
 	/* Zero out the whole structure */
 	if (sess_priv) {
 		openssl_reset_asym_session(sess_priv);
 		memset(sess_priv, 0, sizeof(struct openssl_asym_session));
-		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
-		set_asym_session_private_data(sess, index, NULL);
-		rte_mempool_put(sess_mp, sess_priv);
 	}
 }
 
diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index 09d8761c5f..f46eefd4b3 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -492,8 +492,7 @@ qat_asym_build_request(void *in_op,
 	op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
 	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 		ctx = (struct qat_asym_session *)
-			get_asym_session_private_data(
-			op->asym->session, qat_asym_driver_id);
+				op->asym->session->sess_private_data;
 		if (unlikely(ctx == NULL)) {
 			QAT_LOG(ERR, "Session has not been created for this device");
 			goto error;
@@ -711,8 +710,8 @@ qat_asym_process_response(void **op, uint8_t *resp,
 	}
 
 	if (rx_op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
-		ctx = (struct qat_asym_session *)get_asym_session_private_data(
-			rx_op->asym->session, qat_asym_driver_id);
+		ctx = (struct qat_asym_session *)
+				rx_op->asym->session->sess_private_data;
 		qat_asym_collect_response(rx_op, cookie, ctx->xform);
 	} else if (rx_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
 		qat_asym_collect_response(rx_op, cookie, rx_op->asym->xform);
@@ -726,61 +725,42 @@ qat_asym_process_response(void **op, uint8_t *resp,
 }
 
 int
-qat_asym_session_configure(struct rte_cryptodev *dev,
+qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool)
+		struct rte_cryptodev_asym_session *sess)
 {
-	int err = 0;
-	void *sess_private_data;
 	struct qat_asym_session *session;
 
-	if (rte_mempool_get(mempool, &sess_private_data)) {
-		QAT_LOG(ERR,
-			"Couldn't get object from session mempool");
-		return -ENOMEM;
-	}
-
-	session = sess_private_data;
+	session = (struct qat_asym_session *) sess->sess_private_data;
 	if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODEX) {
 		if (xform->modex.exponent.length == 0 ||
 				xform->modex.modulus.length == 0) {
 			QAT_LOG(ERR, "Invalid mod exp input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODINV) {
 		if (xform->modinv.modulus.length == 0) {
 			QAT_LOG(ERR, "Invalid mod inv input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_RSA) {
 		if (xform->rsa.n.length == 0) {
 			QAT_LOG(ERR, "Invalid rsa input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type >= RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
 			|| xform->xform_type <= RTE_CRYPTO_ASYM_XFORM_NONE) {
 		QAT_LOG(ERR, "Invalid asymmetric crypto xform");
-		err = -EINVAL;
-		goto error;
+		return -EINVAL;
 	} else {
 		QAT_LOG(ERR, "Asymmetric crypto xform not implemented");
-		err = -EINVAL;
-		goto error;
+		return -EINVAL;
 	}
 
 	session->xform = xform;
-	qat_asym_build_req_tmpl(sess_private_data);
-	set_asym_session_private_data(sess, dev->driver_id,
-		sess_private_data);
+	qat_asym_build_req_tmpl(session);
 
 	return 0;
-error:
-	rte_mempool_put(mempool, sess_private_data);
-	return err;
 }
 
 unsigned int qat_asym_session_get_private_size(
@@ -793,15 +773,9 @@ void
 qat_asym_session_clear(struct rte_cryptodev *dev,
 		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t index = dev->driver_id;
-	void *sess_priv = get_asym_session_private_data(sess, index);
+	void *sess_priv = sess->sess_private_data;
 	struct qat_asym_session *s = (struct qat_asym_session *)sess_priv;
 
-	if (sess_priv) {
+	if (sess_priv)
 		memset(s, 0, qat_asym_session_get_private_size(dev));
-		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
-
-		set_asym_session_private_data(sess, index, NULL);
-		rte_mempool_put(sess_mp, sess_priv);
-	}
 }
diff --git a/drivers/crypto/qat/qat_asym.h b/drivers/crypto/qat/qat_asym.h
index 308b6b2e0b..c9242a12ca 100644
--- a/drivers/crypto/qat/qat_asym.h
+++ b/drivers/crypto/qat/qat_asym.h
@@ -46,10 +46,9 @@ struct qat_asym_session {
 };
 
 int
-qat_asym_session_configure(struct rte_cryptodev *dev,
+qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool);
+		struct rte_cryptodev_asym_session *sess);
 
 unsigned int
 qat_asym_session_get_private_size(struct rte_cryptodev *dev);
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index b9146f652c..142bfb7c66 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -319,7 +319,6 @@ typedef int (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
  * @param	dev		Crypto device pointer
  * @param	xform		Single or chain of crypto xforms
  * @param	session		Pointer to cryptodev's private session structure
- * @param	mp		Mempool where the private session is allocated
  *
  * @return
  *  - Returns 0 if private session structure have been created successfully.
@@ -329,8 +328,7 @@ typedef int (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
  */
 typedef int (*cryptodev_asym_configure_session_t)(struct rte_cryptodev *dev,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *session,
-		struct rte_mempool *mp);
+		struct rte_cryptodev_asym_session *session);
 /**
  * Free driver private session data.
  *
@@ -340,12 +338,12 @@ typedef int (*cryptodev_asym_configure_session_t)(struct rte_cryptodev *dev,
 typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		struct rte_cryptodev_sym_session *sess);
 /**
- * Free asymmetric session private data.
+ * Clear asymmetric session private data.
  *
  * @param	dev		Crypto device pointer
  * @param	sess		Cryptodev session structure
  */
-typedef void (*cryptodev_asym_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_asym_clear_session_t)(struct rte_cryptodev *dev,
 		struct rte_cryptodev_asym_session *sess);
 /**
  * Perform actual crypto processing (encrypt/digest or auth/decrypt)
@@ -429,7 +427,7 @@ struct rte_cryptodev_ops {
 	/**< Configure asymmetric Crypto session. */
 	cryptodev_sym_free_session_t sym_session_clear;
 	/**< Clear a Crypto sessions private data. */
-	cryptodev_asym_free_session_t asym_session_clear;
+	cryptodev_asym_clear_session_t asym_session_clear;
 	/**< Clear a Crypto sessions private data. */
 	union {
 		cryptodev_sym_cpu_crypto_process_t sym_cpu_process;
@@ -627,17 +625,4 @@ set_sym_session_private_data(struct rte_cryptodev_sym_session *sess,
 	sess->sess_data[driver_id].data = private_data;
 }
 
-static inline void *
-get_asym_session_private_data(const struct rte_cryptodev_asym_session *sess,
-		uint8_t driver_id) {
-	return sess->sess_private_data[driver_id];
-}
-
-static inline void
-set_asym_session_private_data(struct rte_cryptodev_asym_session *sess,
-		uint8_t driver_id, void *private_data)
-{
-	sess->sess_private_data[driver_id] = private_data;
-}
-
 #endif /* _CRYPTODEV_PMD_H_ */
diff --git a/lib/cryptodev/cryptodev_trace_points.c b/lib/cryptodev/cryptodev_trace_points.c
index 5d58951fd5..c5bfe08b79 100644
--- a/lib/cryptodev/cryptodev_trace_points.c
+++ b/lib/cryptodev/cryptodev_trace_points.c
@@ -24,6 +24,9 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_setup,
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_pool_create,
 	lib.cryptodev.sym.pool.create)
 
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_pool_create,
+	lib.cryptodev.asym.pool.create)
+
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_create,
 	lib.cryptodev.sym.create)
 
@@ -39,15 +42,9 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_free,
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_init,
 	lib.cryptodev.sym.init)
 
-RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_init,
-	lib.cryptodev.asym.init)
-
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_clear,
 	lib.cryptodev.sym.clear)
 
-RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_clear,
-	lib.cryptodev.asym.clear)
-
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_enqueue_burst,
 	lib.cryptodev.enq.burst)
 
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index a40536c5ea..b056d88ac2 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -195,7 +195,7 @@ const char *rte_crypto_asym_op_strings[] = {
 };
 
 /**
- * The private data structure stored in the session mempool private data.
+ * The private data structure stored in the sym session mempool private data.
  */
 struct rte_cryptodev_sym_session_pool_private_data {
 	uint16_t nb_drivers;
@@ -204,6 +204,14 @@ struct rte_cryptodev_sym_session_pool_private_data {
 	/**< session user data will be placed after sess_data */
 };
 
+/**
+ * The private data structure stored in the asym session mempool private data.
+ */
+struct rte_cryptodev_asym_session_pool_private_data {
+	uint16_t max_priv_session_sz;
+	/**< Size of private session data used when creating mempool */
+};
+
 int
 rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum,
 		const char *algo_string)
@@ -1751,47 +1759,6 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 	return 0;
 }
 
-int
-rte_cryptodev_asym_session_init(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_crypto_asym_xform *xforms,
-		struct rte_mempool *mp)
-{
-	struct rte_cryptodev *dev;
-	uint8_t index;
-	int ret;
-
-	if (!rte_cryptodev_is_valid_dev(dev_id)) {
-		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_get_dev(dev_id);
-
-	if (sess == NULL || xforms == NULL || dev == NULL)
-		return -EINVAL;
-
-	index = dev->driver_id;
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure,
-				-ENOTSUP);
-
-	if (sess->sess_private_data[index] == NULL) {
-		ret = dev->dev_ops->asym_session_configure(dev,
-							xforms,
-							sess, mp);
-		if (ret < 0) {
-			CDEV_LOG_ERR(
-				"dev_id %d failed to configure session details",
-				dev_id);
-			return ret;
-		}
-	}
-
-	rte_cryptodev_trace_asym_session_init(dev_id, sess, xforms, mp);
-	return 0;
-}
-
 struct rte_mempool *
 rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	uint32_t elt_size, uint32_t cache_size, uint16_t user_data_size,
@@ -1834,6 +1801,53 @@ rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	return mp;
 }
 
+struct rte_mempool *
+rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
+	uint32_t cache_size, int socket_id)
+{
+	struct rte_mempool *mp;
+	struct rte_cryptodev_asym_session_pool_private_data *pool_priv;
+	uint32_t obj_sz, obj_sz_aligned;
+	uint8_t dev_id, priv_sz, max_priv_sz = 0;
+
+	for (dev_id = 0; dev_id < RTE_CRYPTO_MAX_DEVS; dev_id++)
+		if (rte_cryptodev_is_valid_dev(dev_id)) {
+			priv_sz = rte_cryptodev_asym_get_private_session_size(dev_id);
+			if (priv_sz > max_priv_sz)
+				max_priv_sz = priv_sz;
+		}
+	if (max_priv_sz == 0) {
+		CDEV_LOG_INFO("Could not set max private session size\n");
+		return NULL;
+	}
+
+	obj_sz = rte_cryptodev_asym_get_header_session_size() + max_priv_sz;
+	obj_sz_aligned =  RTE_ALIGN_CEIL(obj_sz, RTE_CACHE_LINE_SIZE);
+
+	mp = rte_mempool_create(name, nb_elts, obj_sz_aligned, cache_size,
+			(uint32_t)(sizeof(*pool_priv)),
+			NULL, NULL, NULL, NULL,
+			socket_id, 0);
+	if (mp == NULL) {
+		CDEV_LOG_ERR("%s(name=%s) failed, rte_errno=%d\n",
+			__func__, name, rte_errno);
+		return NULL;
+	}
+
+	pool_priv = rte_mempool_get_priv(mp);
+	if (!pool_priv) {
+		CDEV_LOG_ERR("%s(name=%s) failed to get private data\n",
+			__func__, name);
+		rte_mempool_free(mp);
+		return NULL;
+	}
+	pool_priv->max_priv_session_sz = max_priv_sz;
+
+	rte_cryptodev_trace_asym_session_pool_create(name, nb_elts,
+		cache_size, mp);
+	return mp;
+}
+
 static unsigned int
 rte_cryptodev_sym_session_data_size(struct rte_cryptodev_sym_session *sess)
 {
@@ -1895,19 +1909,44 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 }
 
 struct rte_cryptodev_asym_session *
-rte_cryptodev_asym_session_create(struct rte_mempool *mp)
+rte_cryptodev_asym_session_create(uint8_t dev_id,
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp)
 {
 	struct rte_cryptodev_asym_session *sess;
-	unsigned int session_size =
+	uint32_t session_priv_data_sz;
+	struct rte_cryptodev_asym_session_pool_private_data *pool_priv;
+	unsigned int session_header_size =
 			rte_cryptodev_asym_get_header_session_size();
+	struct rte_cryptodev *dev;
+	int ret;
+
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
+		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
+		return NULL;
+	}
+
+	dev = rte_cryptodev_pmd_get_dev(dev_id);
+
+	if (dev == NULL)
+		return NULL;
 
 	if (!mp) {
 		CDEV_LOG_ERR("invalid mempool\n");
 		return NULL;
 	}
 
+	session_priv_data_sz = rte_cryptodev_asym_get_private_session_size(
+			dev_id);
+	pool_priv = rte_mempool_get_priv(mp);
+
+	if (pool_priv->max_priv_session_sz < session_priv_data_sz) {
+		CDEV_LOG_DEBUG(
+			"The private session data size used when creating the mempool is smaller than this device's private session data.");
+		return NULL;
+	}
+
 	/* Verify if provided mempool can hold elements big enough. */
-	if (mp->elt_size < session_size) {
+	if (mp->elt_size < session_header_size + session_priv_data_sz) {
 		CDEV_LOG_ERR(
 			"mempool elements too small to hold session objects");
 		return NULL;
@@ -1919,12 +1958,25 @@ rte_cryptodev_asym_session_create(struct rte_mempool *mp)
 		return NULL;
 	}
 
-	/* Clear device session pointer.
-	 * Include the flag indicating presence of private data
-	 */
-	memset(sess, 0, session_size);
+	sess->driver_id = dev->driver_id;
+	sess->max_priv_data_sz = pool_priv->max_priv_session_sz;
+
+	/* Clear device session pointer.*/
+	memset(sess->sess_private_data, 0, session_priv_data_sz);
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, NULL);
 
-	rte_cryptodev_trace_asym_session_create(mp, sess);
+	if (sess->sess_private_data[0] == 0) {
+		ret = dev->dev_ops->asym_session_configure(dev, xforms, sess);
+		if (ret < 0) {
+			CDEV_LOG_ERR(
+				"dev_id %d failed to configure session details",
+				dev_id);
+			return NULL;
+		}
+	}
+
+	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp);
 	return sess;
 }
 
@@ -1959,30 +2011,6 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id,
 	return 0;
 }
 
-int
-rte_cryptodev_asym_session_clear(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess)
-{
-	struct rte_cryptodev *dev;
-
-	if (!rte_cryptodev_is_valid_dev(dev_id)) {
-		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_get_dev(dev_id);
-
-	if (dev == NULL || sess == NULL)
-		return -EINVAL;
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_clear, -ENOTSUP);
-
-	dev->dev_ops->asym_session_clear(dev, sess);
-
-	rte_cryptodev_trace_sym_session_clear(dev_id, sess);
-	return 0;
-}
-
 int
 rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
 {
@@ -2007,27 +2035,31 @@ rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
 }
 
 int
-rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess)
+rte_cryptodev_asym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t i;
-	void *sess_priv;
 	struct rte_mempool *sess_mp;
+	struct rte_cryptodev *dev;
 
-	if (sess == NULL)
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
+		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
-
-	/* Check that all device private data has been freed */
-	for (i = 0; i < nb_drivers; i++) {
-		sess_priv = get_asym_session_private_data(sess, i);
-		if (sess_priv != NULL)
-			return -EBUSY;
 	}
 
+	dev = rte_cryptodev_pmd_get_dev(dev_id);
+
+	if (dev == NULL || sess == NULL)
+		return -EINVAL;
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_clear, -ENOTSUP);
+
+	dev->dev_ops->asym_session_clear(dev, sess);
+
 	/* Return session to mempool */
 	sess_mp = rte_mempool_from_obj(sess);
 	rte_mempool_put(sess_mp, sess);
 
-	rte_cryptodev_trace_asym_session_free(sess);
+	rte_cryptodev_trace_asym_session_free(dev_id, sess);
 	return 0;
 }
 
@@ -2061,12 +2093,7 @@ rte_cryptodev_sym_get_existing_header_session_size(
 unsigned int
 rte_cryptodev_asym_get_header_session_size(void)
 {
-	/*
-	 * Header contains pointers to the private data
-	 * of all registered drivers, and a flag which
-	 * indicates presence of private data
-	 */
-	return ((sizeof(void *) * nb_drivers) + sizeof(uint8_t));
+	return sizeof(struct rte_cryptodev_asym_session);
 }
 
 unsigned int
@@ -2092,7 +2119,6 @@ unsigned int
 rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
-	unsigned int header_size = sizeof(void *) * nb_drivers;
 	unsigned int priv_sess_size;
 
 	if (!rte_cryptodev_is_valid_dev(dev_id))
@@ -2104,11 +2130,8 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 		return 0;
 
 	priv_sess_size = (*dev->dev_ops->asym_session_get_size)(dev);
-	if (priv_sess_size < header_size)
-		return header_size;
 
 	return priv_sess_size;
-
 }
 
 int
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 59ea5a54df..90e764017d 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -919,9 +919,13 @@ struct rte_cryptodev_sym_session {
 };
 
 /** Cryptodev asymmetric crypto session */
-struct rte_cryptodev_asym_session {
-	__extension__ void *sess_private_data[0];
-	/**< Private asymmetric session material */
+RTE_STD_C11 struct rte_cryptodev_asym_session {
+	uint8_t driver_id;
+	/**< Session driver ID. */
+	uint16_t max_priv_data_sz;
+	/**< Size of private data used when creating mempool */
+	uint8_t padding[5];
+	uint8_t sess_private_data[0];
 };
 
 /**
@@ -956,6 +960,29 @@ rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	uint32_t elt_size, uint32_t cache_size, uint16_t priv_size,
 	int socket_id);
 
+/**
+ * Create an asymmetric session mempool.
+ *
+ * @param name
+ *   The unique mempool name.
+ * @param nb_elts
+ *   The number of elements in the mempool.
+ * @param cache_size
+ *   The number of per-lcore cache elements
+ * @param socket_id
+ *   The *socket_id* argument is the socket identifier in the case of
+ *   NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA
+ *   constraint for the reserved zone.
+ *
+ * @return
+ *  - On success return mempool
+ *  - On failure returns NULL
+ */
+__rte_experimental
+struct rte_mempool *
+rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
+	uint32_t cache_size, int socket_id);
+
 /**
  * Create symmetric crypto session header (generic with no private data)
  *
@@ -969,17 +996,22 @@ struct rte_cryptodev_sym_session *
 rte_cryptodev_sym_session_create(struct rte_mempool *mempool);
 
 /**
- * Create asymmetric crypto session header (generic with no private data)
+ * Create and initialise an asymmetric crypto session structure.
+ * Calls the PMD to configure the private session data.
  *
- * @param   mempool    mempool to allocate asymmetric session
- *                     objects from
+ * @param   dev_id   ID of device that we want the session to be used on
+ * @param   xforms   Asymmetric crypto transform operations to apply on flow
+ *                   processed with this session
+ * @param   mp       mempool to allocate asymmetric session
+ *                   objects from
  * @return
  *  - On success return pointer to asym-session
  *  - On failure returns NULL
  */
 __rte_experimental
 struct rte_cryptodev_asym_session *
-rte_cryptodev_asym_session_create(struct rte_mempool *mempool);
+rte_cryptodev_asym_session_create(uint8_t dev_id,
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp);
 
 /**
  * Frees symmetric crypto session header, after checking that all
@@ -997,20 +1029,20 @@ int
 rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess);
 
 /**
- * Frees asymmetric crypto session header, after checking that all
- * the device private data has been freed, returning it
- * to its original mempool.
+ * Clears and frees asymmetric crypto session header and private data,
+ * returning it to its original mempool.
  *
+ * @param   dev_id   ID of device that uses the asymmetric session.
  * @param   sess     Session header to be freed.
  *
  * @return
  *  - 0 if successful.
- *  - -EINVAL if session is NULL.
- *  - -EBUSY if not all device private data has been freed.
+ *  - -EINVAL if device is invalid or session is NULL.
  */
 __rte_experimental
 int
-rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess);
+rte_cryptodev_asym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess);
 
 /**
  * Fill out private data for the device id, based on its device type.
@@ -1034,28 +1066,6 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 			struct rte_crypto_sym_xform *xforms,
 			struct rte_mempool *mempool);
 
-/**
- * Initialize asymmetric session on a device with specific asymmetric xform
- *
- * @param   dev_id   ID of device that we want the session to be used on
- * @param   sess     Session to be set up on a device
- * @param   xforms   Asymmetric crypto transform operations to apply on flow
- *                   processed with this session
- * @param   mempool  Mempool to be used for internal allocation.
- *
- * @return
- *  - On success, zero.
- *  - -EINVAL if input parameters are invalid.
- *  - -ENOTSUP if crypto device does not support the crypto transform.
- *  - -ENOMEM if the private session could not be allocated.
- */
-__rte_experimental
-int
-rte_cryptodev_asym_session_init(uint8_t dev_id,
-			struct rte_cryptodev_asym_session *sess,
-			struct rte_crypto_asym_xform *xforms,
-			struct rte_mempool *mempool);
-
 /**
  * Frees private data for the device id, based on its device type,
  * returning it to its mempool. It is the application's responsibility
@@ -1074,21 +1084,6 @@ int
 rte_cryptodev_sym_session_clear(uint8_t dev_id,
 			struct rte_cryptodev_sym_session *sess);
 
-/**
- * Frees resources held by asymmetric session during rte_cryptodev_session_init
- *
- * @param   dev_id   ID of device that uses the asymmetric session.
- * @param   sess     Asymmetric session setup on device using
- *					 rte_cryptodev_session_init
- * @return
- *  - 0 if successful.
- *  - -EINVAL if device is invalid or session is NULL.
- */
-__rte_experimental
-int
-rte_cryptodev_asym_session_clear(uint8_t dev_id,
-			struct rte_cryptodev_asym_session *sess);
-
 /**
  * Get the size of the header session, for all registered drivers excluding
  * the user data size.
@@ -1116,7 +1111,7 @@ rte_cryptodev_sym_get_existing_header_session_size(
 		struct rte_cryptodev_sym_session *sess);
 
 /**
- * Get the size of the asymmetric session header, for all registered drivers.
+ * Get the size of the asymmetric session header.
  *
  * @return
  *   Size of the asymmetric header session.
diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
index d1f4f069a3..a4fa9e8c7e 100644
--- a/lib/cryptodev/rte_cryptodev_trace.h
+++ b/lib/cryptodev/rte_cryptodev_trace.h
@@ -83,12 +83,22 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_u16(sess->user_data_sz);
 )
 
+RTE_TRACE_POINT(
+	rte_cryptodev_trace_asym_session_pool_create,
+	RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts,
+		uint32_t cache_size, void *mempool),
+	rte_trace_point_emit_string(name);
+	rte_trace_point_emit_u32(nb_elts);
+	rte_trace_point_emit_u32(cache_size);
+	rte_trace_point_emit_ptr(mempool);
+)
+
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_create,
-	RTE_TRACE_POINT_ARGS(void *mempool,
-		struct rte_cryptodev_asym_session *sess),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms, void *mempool),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_ptr(xforms);
 	rte_trace_point_emit_ptr(mempool);
-	rte_trace_point_emit_ptr(sess);
 )
 
 RTE_TRACE_POINT(
@@ -99,7 +109,9 @@ RTE_TRACE_POINT(
 
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_free,
-	RTE_TRACE_POINT_ARGS(struct rte_cryptodev_asym_session *sess),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess),
+	rte_trace_point_emit_u8(dev_id);
 	rte_trace_point_emit_ptr(sess);
 )
 
@@ -117,17 +129,6 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_ptr(mempool);
 )
 
-RTE_TRACE_POINT(
-	rte_cryptodev_trace_asym_session_init,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess, void *xforms,
-		void *mempool),
-	rte_trace_point_emit_u8(dev_id);
-	rte_trace_point_emit_ptr(sess);
-	rte_trace_point_emit_ptr(xforms);
-	rte_trace_point_emit_ptr(mempool);
-)
-
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_sym_session_clear,
 	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
@@ -135,13 +136,6 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_ptr(sess);
 )
 
-RTE_TRACE_POINT(
-	rte_cryptodev_trace_asym_session_clear,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
-	rte_trace_point_emit_u8(dev_id);
-	rte_trace_point_emit_ptr(sess);
-)
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index c50745fa8c..44d1aff0e2 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -55,10 +55,8 @@ EXPERIMENTAL {
 	rte_cryptodev_asym_get_header_session_size;
 	rte_cryptodev_asym_get_private_session_size;
 	rte_cryptodev_asym_get_xform_enum;
-	rte_cryptodev_asym_session_clear;
 	rte_cryptodev_asym_session_create;
 	rte_cryptodev_asym_session_free;
-	rte_cryptodev_asym_session_init;
 	rte_cryptodev_asym_xform_capability_check_modlen;
 	rte_cryptodev_asym_xform_capability_check_optype;
 	rte_cryptodev_sym_cpu_crypto_process;
@@ -81,9 +79,7 @@ EXPERIMENTAL {
 	__rte_cryptodev_trace_sym_session_free;
 	__rte_cryptodev_trace_asym_session_free;
 	__rte_cryptodev_trace_sym_session_init;
-	__rte_cryptodev_trace_asym_session_init;
 	__rte_cryptodev_trace_sym_session_clear;
-	__rte_cryptodev_trace_asym_session_clear;
 	__rte_cryptodev_trace_dequeue_burst;
 	__rte_cryptodev_trace_enqueue_burst;
 
@@ -104,6 +100,9 @@ EXPERIMENTAL {
 	rte_cryptodev_remove_deq_callback;
 	rte_cryptodev_remove_enq_callback;
 
+	# added 22.03
+	rte_cryptodev_asym_session_pool_create;
+	__rte_cryptodev_trace_asym_session_pool_create;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 1%]

* [PATCH v5 5/5] crypto: modify return value for asym session create
    2022-02-10 14:01  1%   ` [PATCH v5 2/5] crypto: use single buffer for asymmetric session Ciara Power
@ 2022-02-10 14:01  2%   ` Ciara Power
  1 sibling, 0 replies; 200+ results
From: Ciara Power @ 2022-02-10 14:01 UTC (permalink / raw)
  To: dev; +Cc: roy.fan.zhang, gakhil, anoobj, mdr, Ciara Power, Declan Doherty

Rather than the asym session create function returning a session on
success, and a NULL value on error, it is modified to now return int
values - 0 on success or -EINVAL/-ENOTSUP/-ENOMEM on failure.
The session to be used is passed as input.

This adds clarity on the failure of the create function, which enables
treating the -ENOTSUP return as TEST_SKIPPED in test apps.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

---
v5: Added session parameter to create session trace.
v4:
  - Reordered function parameters.
  - Removed docs code additions, these are included due to patch 1
    changing sample doc to use literal includes.
v3:
  - Fixed variable declarations, putting initialised variable last.
  - Made function comment for return value more generic.
  - Fixed log to include line break.
  - Added documentation.
---
 app/test-crypto-perf/cperf_ops.c       |  12 ++-
 app/test/test_cryptodev_asym.c         | 109 +++++++++++++------------
 doc/guides/rel_notes/release_22_03.rst |   3 +-
 lib/cryptodev/rte_cryptodev.c          |  28 ++++---
 lib/cryptodev/rte_cryptodev.h          |  13 ++-
 lib/cryptodev/rte_cryptodev_trace.h    |   4 +-
 6 files changed, 92 insertions(+), 77 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index b8f590b397..479c40eead 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -734,7 +734,9 @@ cperf_create_session(struct rte_mempool *sess_mp,
 	struct rte_crypto_sym_xform auth_xform;
 	struct rte_crypto_sym_xform aead_xform;
 	struct rte_cryptodev_sym_session *sess = NULL;
+	void *asym_sess = NULL;
 	struct rte_crypto_asym_xform xform = {0};
+	int ret;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
 		xform.next = NULL;
@@ -744,11 +746,13 @@ cperf_create_session(struct rte_mempool *sess_mp,
 		xform.modex.exponent.data = perf_mod_e;
 		xform.modex.exponent.length = sizeof(perf_mod_e);
 
-		sess = (void *)rte_cryptodev_asym_session_create(dev_id, &xform, sess_mp);
-		if (sess == NULL)
+		ret = rte_cryptodev_asym_session_create(dev_id, &xform,
+				sess_mp, &asym_sess);
+		if (ret < 0) {
+			RTE_LOG(ERR, USER1, "Asym session create failed\n");
 			return NULL;
-
-		return sess;
+		}
+		return asym_sess;
 	}
 #ifdef RTE_LIB_SECURITY
 	/*
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index f0cb839a49..c2e1b4dafd 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -317,7 +317,7 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	uint8_t input[TEST_DATA_SIZE] = {0};
 	uint8_t *result = NULL;
 
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	xform_tc.next = NULL;
 	xform_tc.xform_type = data_tc->modex.xform_type;
@@ -452,14 +452,14 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (!sessionless) {
-		sess = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
-				ts_params->session_mpool);
-		if (!sess) {
+		ret = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
+				ts_params->session_mpool, &sess);
+		if (ret < 0) {
 			snprintf(test_msg, ASYM_TEST_MSG_LEN,
 					"line %u "
 					"FAILED: %s", __LINE__,
 					"Session creation failed");
-			status = TEST_FAILED;
+			status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 			goto error_exit;
 		}
 
@@ -646,7 +646,7 @@ test_rsa_sign_verify(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with exponent key only,
 	 * Check in PMD feature flag for RSA exponent key type support.
@@ -659,12 +659,12 @@ test_rsa_sign_verify(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -686,7 +686,7 @@ test_rsa_enc_dec(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with exponent key only,
 	 * Check in PMD feature flag for RSA exponent key type support.
@@ -699,11 +699,11 @@ test_rsa_enc_dec(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -726,7 +726,7 @@ test_rsa_sign_verify_crt(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with quintuple format key only,
 	 * Check im PMD feature flag for RSA quintuple key type support.
@@ -738,12 +738,12 @@ test_rsa_sign_verify_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify_crt\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -766,7 +766,7 @@ test_rsa_enc_dec_crt(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with quintuple format key only,
 	 * Check in PMD feature flag for RSA quintuple key type support.
@@ -778,12 +778,12 @@ test_rsa_enc_dec_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"enc_dec_crt\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1047,7 +1047,7 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 	uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
@@ -1074,12 +1074,12 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.shared_secret.data = output;
 	asym_op->dh.shared_secret.length = sizeof(output);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1130,7 +1130,7 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
@@ -1152,12 +1152,12 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = output;
 	asym_op->dh.priv_key.length = sizeof(output);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1211,7 +1211,7 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
@@ -1241,12 +1241,12 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 					0);
 	asym_op->dh.priv_key = dh_test_params.priv_key;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1300,7 +1300,7 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t out_pub_key[TEST_DH_MOD_LEN];
 	uint8_t out_prv_key[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform pub_key_xform;
@@ -1330,12 +1330,12 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = out_prv_key;
 	asym_op->dh.priv_key.length = sizeof(out_prv_key);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1419,12 +1419,12 @@ test_mod_inv(void)
 				return TEST_SKIPPED;
 		}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool);
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1543,13 +1543,13 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool);
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				 "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1653,13 +1653,14 @@ test_dsa_sign(void)
 	uint8_t r[TEST_DH_MOD_LEN];
 	uint8_t s[TEST_DH_MOD_LEN];
 	uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
+	int ret;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				 "line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 	/* set up crypto op data structure */
@@ -1788,7 +1789,7 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	struct rte_crypto_asym_op *asym_op;
 	struct rte_cryptodev_info dev_info;
 	struct rte_crypto_op *op = NULL;
-	int status = TEST_SUCCESS, ret;
+	int ret, status = TEST_SUCCESS;
 
 	switch (curve_id) {
 	case SECP192R1:
@@ -1833,12 +1834,12 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
 	xform.ec.curve_id = input_params.curve;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto exit;
 	}
 
@@ -1990,7 +1991,7 @@ test_ecpm(enum curve curve_id)
 	struct rte_crypto_asym_op *asym_op;
 	struct rte_cryptodev_info dev_info;
 	struct rte_crypto_op *op = NULL;
-	int status = TEST_SUCCESS, ret;
+	int ret, status = TEST_SUCCESS;
 
 	switch (curve_id) {
 	case SECP192R1:
@@ -2035,12 +2036,12 @@ test_ecpm(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
 	xform.ec.curve_id = input_params.curve;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto exit;
 	}
 
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index a930cbbad6..640691c3ef 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -123,7 +123,8 @@ API Changes
   The session structure was moved to ``cryptodev_pmd.h``,
   hiding it from applications.
   The API ``rte_cryptodev_asym_session_init`` was removed as the initialization
-  is now moved to ``rte_cryptodev_asym_session_create``.
+  is now moved to ``rte_cryptodev_asym_session_create``, which was updated to
+  return an integer value to indicate initialisation errors.
 
 
 ABI Changes
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 91d48d5886..727d271fb9 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1912,9 +1912,10 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 	return sess;
 }
 
-void *
+int
 rte_cryptodev_asym_session_create(uint8_t dev_id,
-		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp)
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
+		void **session)
 {
 	struct rte_cryptodev_asym_session *sess;
 	uint32_t session_priv_data_sz;
@@ -1926,17 +1927,17 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 
 	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return NULL;
+		return -EINVAL;
 	}
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
 
 	if (dev == NULL)
-		return NULL;
+		return -EINVAL;
 
 	if (!mp) {
 		CDEV_LOG_ERR("invalid mempool\n");
-		return NULL;
+		return -EINVAL;
 	}
 
 	session_priv_data_sz = rte_cryptodev_asym_get_private_session_size(
@@ -1946,22 +1947,23 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 	if (pool_priv->max_priv_session_sz < session_priv_data_sz) {
 		CDEV_LOG_DEBUG(
 			"The private session data size used when creating the mempool is smaller than this device's private session data.");
-		return NULL;
+		return -EINVAL;
 	}
 
 	/* Verify if provided mempool can hold elements big enough. */
 	if (mp->elt_size < session_header_size + session_priv_data_sz) {
 		CDEV_LOG_ERR(
 			"mempool elements too small to hold session objects");
-		return NULL;
+		return -EINVAL;
 	}
 
 	/* Allocate a session structure from the session pool */
-	if (rte_mempool_get(mp, (void **)&sess)) {
+	if (rte_mempool_get(mp, session)) {
 		CDEV_LOG_ERR("couldn't get object from session mempool");
-		return NULL;
+		return -ENOMEM;
 	}
 
+	sess = *session;
 	sess->driver_id = dev->driver_id;
 	sess->user_data_sz = pool_priv->user_data_sz;
 	sess->max_priv_data_sz = pool_priv->max_priv_session_sz;
@@ -1969,7 +1971,7 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 	/* Clear device session pointer.*/
 	memset(sess->sess_private_data, 0, session_priv_data_sz + sess->user_data_sz);
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, NULL);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, -ENOTSUP);
 
 	if (sess->sess_private_data[0] == 0) {
 		ret = dev->dev_ops->asym_session_configure(dev, xforms, sess);
@@ -1977,12 +1979,12 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 			CDEV_LOG_ERR(
 				"dev_id %d failed to configure session details",
 				dev_id);
-			return NULL;
+			return ret;
 		}
 	}
 
-	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp);
-	return sess;
+	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp, sess);
+	return 0;
 }
 
 int
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 1d7bd07680..19e2e70287 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -996,14 +996,19 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mempool);
  *                   processed with this session
  * @param   mp       mempool to allocate asymmetric session
  *                   objects from
+ * @param   session  void ** for session to be used
+ *
  * @return
- *  - On success return pointer to asym-session
- *  - On failure returns NULL
+ *  - 0 on success.
+ *  - -EINVAL on invalid arguments.
+ *  - -ENOMEM on memory error for session allocation.
+ *  - -ENOTSUP if device doesn't support session configuration.
  */
 __rte_experimental
-void *
+int
 rte_cryptodev_asym_session_create(uint8_t dev_id,
-		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp);
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
+		void **session);
 
 /**
  * Frees symmetric crypto session header, after checking that all
diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
index 005a4fe38b..a3f6048e7d 100644
--- a/lib/cryptodev/rte_cryptodev_trace.h
+++ b/lib/cryptodev/rte_cryptodev_trace.h
@@ -96,10 +96,12 @@ RTE_TRACE_POINT(
 
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_create,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms, void *mempool),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms, void *mempool,
+			void *sess),
 	rte_trace_point_emit_u8(dev_id);
 	rte_trace_point_emit_ptr(xforms);
 	rte_trace_point_emit_ptr(mempool);
+	rte_trace_point_emit_ptr(sess);
 )
 
 RTE_TRACE_POINT(
-- 
2.25.1


^ permalink raw reply	[relevance 2%]

* [PATCH v4 7/7] buildtools/chkincs: test headers for C++ compatibility
  @ 2022-02-10 15:42 11%   ` Bruce Richardson
  0 siblings, 0 replies; 200+ results
From: Bruce Richardson @ 2022-02-10 15:42 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Aaron Conole, Michael Santana

Add support for checking each of our headers for issues when included in
a C++ file.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 .ci/linux-build.sh             |  1 +
 .github/workflows/build.yml    |  2 +-
 buildtools/chkincs/main.cpp    |  4 ++++
 buildtools/chkincs/meson.build | 20 ++++++++++++++++++++
 devtools/test-meson-builds.sh  |  3 ++-
 5 files changed, 28 insertions(+), 2 deletions(-)
 create mode 100644 buildtools/chkincs/main.cpp

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index c10c1a8ab5..67d68535e0 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -74,6 +74,7 @@ fi
 
 if [ "$BUILD_32BIT" = "true" ]; then
     OPTS="$OPTS -Dc_args=-m32 -Dc_link_args=-m32"
+    OPTS="$OPTS -Dcpp_args=-m32 -Dcpp_link_args=-m32"
     export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig"
 fi
 
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6cf997d6ee..d30cfd08d7 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -116,7 +116,7 @@ jobs:
           libdw-dev
     - name: Install i386 cross compiling packages
       if: env.BUILD_32BIT == 'true'
-      run: sudo apt install -y gcc-multilib
+      run: sudo apt install -y gcc-multilib g++-multilib
     - name: Install aarch64 cross compiling packages
       if: env.AARCH64 == 'true'
       run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
diff --git a/buildtools/chkincs/main.cpp b/buildtools/chkincs/main.cpp
new file mode 100644
index 0000000000..d25bb8852a
--- /dev/null
+++ b/buildtools/chkincs/main.cpp
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2021 Intel Corporation
+ */
+int main(void) { return 0; }
diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build
index 5ffca89761..beabcd55d8 100644
--- a/buildtools/chkincs/meson.build
+++ b/buildtools/chkincs/meson.build
@@ -28,3 +28,23 @@ executable('chkincs', sources,
         dependencies: deps,
         link_whole: dpdk_static_libraries + dpdk_drivers,
         install: false)
+
+# run tests for c++ builds also
+if not add_languages('cpp', required: false)
+    subdir_done()
+endif
+
+gen_cpp_files = generator(gen_c_file_for_header,
+        output: '@BASENAME@.cpp',
+        arguments: ['@INPUT@', '@OUTPUT@'])
+
+cpp_sources = files('main.cpp')
+cpp_sources += gen_cpp_files.process(dpdk_chkinc_headers)
+
+executable('chkincs-cpp', cpp_sources,
+        cpp_args: ['-include', 'rte_config.h', cflags],
+        link_args: dpdk_extra_ldflags,
+        include_directories: includes,
+        dependencies: deps,
+        link_whole: dpdk_static_libraries + dpdk_drivers,
+        install: false)
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 4ed61328b9..c07fd16fdc 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -246,7 +246,8 @@ if check_cc_flags '-m32' ; then
 		export PKG_CONFIG_LIBDIR='/usr/lib/pkgconfig'
 	fi
 	target_override='i386-pc-linux-gnu'
-	build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32'
+	build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32' \
+			-Dcpp_args='-m32' -Dcpp_link_args='-m32'
 	target_override=
 	unset PKG_CONFIG_LIBDIR
 fi
-- 
2.32.0


^ permalink raw reply	[relevance 11%]

* [PATCH v6 2/5] crypto: use single buffer for asymmetric session
  @ 2022-02-10 15:54  1%   ` Ciara Power
  2022-02-10 15:54  2%   ` [PATCH v6 5/5] crypto: modify return value for asym session create Ciara Power
  1 sibling, 0 replies; 200+ results
From: Ciara Power @ 2022-02-10 15:54 UTC (permalink / raw)
  To: dev
  Cc: roy.fan.zhang, gakhil, anoobj, mdr, Ciara Power, Declan Doherty,
	Ankur Dwivedi, Tejasree Kondoj, John Griffin, Fiona Trahe,
	Deepak Kumar Jain

Rather than using a session buffer that contains pointers to private
session data elsewhere, have a single session buffer.
This session is created for a driver ID, and the mempool element
contains space for the max session private data needed for any driver.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>

---
v6:
  - Reordered variable declarations to follow cnxk file format.
  - Added fix for crypto perf app asymmetric modex operation, there
    is no longer a need for private mempool, and the
    rte_cryptodev_asym_session_pool_create API should be used.
v5:
  - Removed get API for session private data, can be accessed directly.
  - Modified test application to create a session mempool for
    TEST_NUM_SESSIONS rather than TEST_NUM_SESSIONS * 2.
  - Reworded create session function description.
  - Removed sess parameter from create session trace,
    to be added in a later patch.
v4:
  - Merged asym crypto session clear and free functions.
  - Reordered some function parameters.
  - Updated trace function for asym crypto session create.
  - Fixed cnxk clear, the PMD no longer needs to put private data
    back into a mempool.
  - Renamed struct field for max private session size.
  - Replaced __extension__ with RTE_STD_C11.
  - Moved some parameter validity checks to before functional code.
  - Reworded release note.
  - Removed mempool parameter from session configure function.
  - Removed docs code additions, these are included due to patch 1
    changing sample doc to use literal includes.
v3:
  - Corrected formatting of struct comments.
  - Increased size of max_priv_session_sz to uint16_t.
  - Removed trace for asym session init function that was
    previously removed.
  - Added documentation.
v2:
  - Renamed function typedef from "free" to "clear" as session private
    data isn't being freed in that function.
  - Moved user data API to separate patch.
  - Minor fixes to comments, formatting, return values.
---
 app/test-crypto-perf/cperf_ops.c             |  14 +-
 app/test-crypto-perf/cperf_test_throughput.c |   8 +-
 app/test-crypto-perf/main.c                  |  26 +-
 app/test/test_cryptodev_asym.c               | 272 +++++--------------
 doc/guides/prog_guide/cryptodev_lib.rst      |  21 +-
 doc/guides/rel_notes/release_22_03.rst       |   7 +
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c    |   8 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c     |   8 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c     |  22 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.h     |   3 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c  |  32 +--
 drivers/crypto/openssl/rte_openssl_pmd.c     |   4 +-
 drivers/crypto/openssl/rte_openssl_pmd_ops.c |  24 +-
 drivers/crypto/qat/qat_asym.c                |  54 +---
 drivers/crypto/qat/qat_asym.h                |   5 +-
 lib/cryptodev/cryptodev_pmd.h                |  23 +-
 lib/cryptodev/cryptodev_trace_points.c       |   9 +-
 lib/cryptodev/rte_cryptodev.c                | 213 ++++++++-------
 lib/cryptodev/rte_cryptodev.h                |  97 ++++---
 lib/cryptodev/rte_cryptodev_trace.h          |  38 ++-
 lib/cryptodev/version.map                    |   7 +-
 21 files changed, 317 insertions(+), 578 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index d975ae1ab8..b125c699de 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -735,7 +735,6 @@ cperf_create_session(struct rte_mempool *sess_mp,
 	struct rte_crypto_sym_xform aead_xform;
 	struct rte_cryptodev_sym_session *sess = NULL;
 	struct rte_crypto_asym_xform xform = {0};
-	int rc;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
 		xform.next = NULL;
@@ -745,19 +744,10 @@ cperf_create_session(struct rte_mempool *sess_mp,
 		xform.modex.exponent.data = perf_mod_e;
 		xform.modex.exponent.length = sizeof(perf_mod_e);
 
-		sess = (void *)rte_cryptodev_asym_session_create(sess_mp);
+		sess = (void *)rte_cryptodev_asym_session_create(dev_id, &xform, sess_mp);
 		if (sess == NULL)
 			return NULL;
-		rc = rte_cryptodev_asym_session_init(dev_id, (void *)sess,
-						     &xform, priv_mp);
-		if (rc < 0) {
-			if (sess != NULL) {
-				rte_cryptodev_asym_session_clear(dev_id,
-								 (void *)sess);
-				rte_cryptodev_asym_session_free((void *)sess);
-			}
-			return NULL;
-		}
+
 		return sess;
 	}
 #ifdef RTE_LIB_SECURITY
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index 51512af2ad..ee21ff27f7 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -35,11 +35,9 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx)
 	if (!ctx)
 		return;
 	if (ctx->sess) {
-		if (ctx->options->op_type == CPERF_ASYM_MODEX) {
-			rte_cryptodev_asym_session_clear(ctx->dev_id,
-							 (void *)ctx->sess);
-			rte_cryptodev_asym_session_free((void *)ctx->sess);
-		}
+		if (ctx->options->op_type == CPERF_ASYM_MODEX)
+			rte_cryptodev_asym_session_free(ctx->dev_id,
+					(void *)ctx->sess);
 #ifdef RTE_LIB_SECURITY
 		else if (ctx->options->op_type == CPERF_PDCP ||
 			 ctx->options->op_type == CPERF_DOCSIS ||
diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 6fdb92fb7c..115bf923f8 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -74,34 +74,12 @@ create_asym_op_pool_socket(uint8_t dev_id, int32_t socket_id,
 {
 	char mp_name[RTE_MEMPOOL_NAMESIZE];
 	struct rte_mempool *mpool = NULL;
-	unsigned int session_size =
-		RTE_MAX(rte_cryptodev_asym_get_private_session_size(dev_id),
-			rte_cryptodev_asym_get_header_session_size());
-
-	if (session_pool_socket[socket_id].priv_mp == NULL) {
-		snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_priv_pool%u",
-			 socket_id);
-
-		mpool = rte_mempool_create(mp_name, nb_sessions, session_size,
-					   0, 0, NULL, NULL, NULL, NULL,
-					   socket_id, 0);
-		if (mpool == NULL) {
-			printf("Cannot create pool \"%s\" on socket %d\n",
-			       mp_name, socket_id);
-			return -ENOMEM;
-		}
-		printf("Allocated pool \"%s\" on socket %d\n", mp_name,
-		       socket_id);
-		session_pool_socket[socket_id].priv_mp = mpool;
-	}
 
 	if (session_pool_socket[socket_id].sess_mp == NULL) {
-
 		snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_sess_pool%u",
 			 socket_id);
-		mpool = rte_mempool_create(mp_name, nb_sessions,
-					   session_size, 0, 0, NULL, NULL, NULL,
-					   NULL, socket_id, 0);
+		mpool = rte_cryptodev_asym_session_pool_create(mp_name,
+				nb_sessions, 0, socket_id);
 		if (mpool == NULL) {
 			printf("Cannot create pool \"%s\" on socket %d\n",
 			       mp_name, socket_id);
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 8d7290f9ed..88433faf1c 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -452,7 +452,8 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (!sessionless) {
-		sess = rte_cryptodev_asym_session_create(ts_params->session_mpool);
+		sess = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
+				ts_params->session_mpool);
 		if (!sess) {
 			snprintf(test_msg, ASYM_TEST_MSG_LEN,
 					"line %u "
@@ -462,15 +463,6 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 			goto error_exit;
 		}
 
-		if (rte_cryptodev_asym_session_init(dev_id, sess, &xform_tc,
-				ts_params->session_mpool) < 0) {
-			snprintf(test_msg, ASYM_TEST_MSG_LEN,
-					"line %u FAILED: %s",
-					__LINE__, "unabled to config sym session");
-			status = TEST_FAILED;
-			goto error_exit;
-		}
-
 		rte_crypto_op_attach_asym_session(op, sess);
 	} else {
 		asym_op->xform = &xform_tc;
@@ -512,10 +504,8 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 		snprintf(test_msg, ASYM_TEST_MSG_LEN, "SESSIONLESS PASS");
 
 error_exit:
-		if (sess != NULL) {
-			rte_cryptodev_asym_session_clear(dev_id, sess);
-			rte_cryptodev_asym_session_free(sess);
-		}
+		if (sess != NULL)
+			rte_cryptodev_asym_session_free(dev_id, sess);
 
 		if (op != NULL)
 			rte_crypto_op_free(op);
@@ -669,18 +659,11 @@ test_rsa_sign_verify(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"sign_verify\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -688,9 +671,7 @@ test_rsa_sign_verify(void)
 	status = queue_ops_rsa_sign_verify(sess);
 
 error_exit:
-
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -718,17 +699,10 @@ test_rsa_enc_dec(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"enc_dec\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -737,8 +711,7 @@ test_rsa_enc_dec(void)
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -765,28 +738,20 @@ test_rsa_sign_verify_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify_crt\n");
 		status = TEST_FAILED;
-		return status;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform_crt,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"sign_verify_crt\n");
-		status = TEST_FAILED;
 		goto error_exit;
 	}
+
 	status = queue_ops_rsa_sign_verify(sess);
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -813,27 +778,20 @@ test_rsa_enc_dec_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"enc_dec_crt\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform_crt,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"enc_dec_crt\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
+
 	status = queue_ops_rsa_enc_dec(sess);
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -927,7 +885,6 @@ testsuite_setup(void)
 	/* configure qp */
 	ts_params->qp_conf.nb_descriptors = DEFAULT_NUM_OPS_INFLIGHT;
 	ts_params->qp_conf.mp_session = ts_params->session_mpool;
-	ts_params->qp_conf.mp_session_private = ts_params->session_mpool;
 	for (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) {
 		TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
 			dev_id, qp_id, &ts_params->qp_conf,
@@ -936,21 +893,9 @@ testsuite_setup(void)
 			qp_id, dev_id);
 	}
 
-	/* setup asym session pool */
-	unsigned int session_size = RTE_MAX(
-		rte_cryptodev_asym_get_private_session_size(dev_id),
-		rte_cryptodev_asym_get_header_session_size());
-	/*
-	 * Create mempool with TEST_NUM_SESSIONS * 2,
-	 * to include the session headers
-	 */
-	ts_params->session_mpool = rte_mempool_create(
-				"test_asym_sess_mp",
-				TEST_NUM_SESSIONS * 2,
-				session_size,
-				0, 0, NULL, NULL, NULL,
-				NULL, SOCKET_ID_ANY,
-				0);
+	ts_params->session_mpool = rte_cryptodev_asym_session_pool_create(
+			"test_asym_sess_mp", TEST_NUM_SESSIONS, 0,
+			SOCKET_ID_ANY);
 
 	TEST_ASSERT_NOT_NULL(ts_params->session_mpool,
 			"session mempool allocation failed");
@@ -1107,14 +1052,6 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_xform xform = *xfrm;
 	uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1137,11 +1074,11 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.shared_secret.data = output;
 	asym_op->dh.shared_secret.length = sizeof(output);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1176,10 +1113,8 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 			asym_op->dh.shared_secret.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -1199,14 +1134,6 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1225,11 +1152,11 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = output;
 	asym_op->dh.priv_key.length = sizeof(output);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1265,10 +1192,8 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1290,14 +1215,6 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1324,11 +1241,11 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 					0);
 	asym_op->dh.priv_key = dh_test_params.priv_key;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1365,10 +1282,8 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 			asym_op->dh.priv_key.data, asym_op->dh.priv_key.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1391,15 +1306,6 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_xform pub_key_xform;
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1423,11 +1329,12 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.pub_key.length = sizeof(out_pub_key);
 	asym_op->dh.priv_key.data = out_prv_key;
 	asym_op->dh.priv_key.length = sizeof(out_prv_key);
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1462,10 +1369,8 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 			out_pub_key, asym_op->dh.pub_key.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1514,7 +1419,7 @@ test_mod_inv(void)
 				return TEST_SKIPPED;
 		}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool);
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "line %u "
 				"FAILED: %s", __LINE__,
@@ -1523,15 +1428,6 @@ test_mod_inv(void)
 		goto error_exit;
 	}
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &modinv_xform,
-			sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* generate crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1583,10 +1479,8 @@ test_mod_inv(void)
 	}
 
 error_exit:
-	if (sess) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 
 	if (op)
 		rte_crypto_op_free(op);
@@ -1649,7 +1543,7 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool);
 	if (!sess) {
 		RTE_LOG(ERR, USER1,
 				 "line %u "
@@ -1659,15 +1553,6 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &modex_xform,
-			sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	asym_op = op->asym;
 	memcpy(input, base, sizeof(base));
 	asym_op->modex.base.data = input;
@@ -1706,10 +1591,8 @@ test_mod_exp(void)
 	}
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 
 	if (op != NULL)
 		rte_crypto_op_free(op);
@@ -1771,7 +1654,7 @@ test_dsa_sign(void)
 	uint8_t s[TEST_DH_MOD_LEN];
 	uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool);
 	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				 "line %u FAILED: %s", __LINE__,
@@ -1800,15 +1683,6 @@ test_dsa_sign(void)
 	debug_hexdump(stdout, "priv_key: ", dsa_xform.dsa.x.data,
 			dsa_xform.dsa.x.length);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &dsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* attach asymmetric crypto session to crypto operations */
 	rte_crypto_op_attach_asym_session(op, sess);
 	asym_op->dsa.op_type = RTE_CRYPTO_ASYM_OP_SIGN;
@@ -1882,10 +1756,8 @@ test_dsa_sign(void)
 		status = TEST_FAILED;
 	}
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -1944,15 +1816,6 @@ test_ecdsa_sign_verify(enum curve curve_id)
 
 	rte_cryptodev_info_get(dev_id, &dev_info);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed\n");
-		status = TEST_FAILED;
-		goto exit;
-	}
-
 	/* Setup crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (op == NULL) {
@@ -1970,11 +1833,11 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
 	xform.ec.curve_id = input_params.curve;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-				sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
-				"Unable to config asym session\n");
+				"Session creation failed\n");
 		status = TEST_FAILED;
 		goto exit;
 	}
@@ -2082,10 +1945,8 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	}
 
 exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -2157,15 +2018,6 @@ test_ecpm(enum curve curve_id)
 
 	rte_cryptodev_info_get(dev_id, &dev_info);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed\n");
-		status = TEST_FAILED;
-		goto exit;
-	}
-
 	/* Setup crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (op == NULL) {
@@ -2183,11 +2035,11 @@ test_ecpm(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
 	xform.ec.curve_id = input_params.curve;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-				sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
-				"Unable to config asym session\n");
+				"Session creation failed\n");
 		status = TEST_FAILED;
 		goto exit;
 	}
@@ -2255,10 +2107,8 @@ test_ecpm(enum curve curve_id)
 	}
 
 exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 9f33f7a177..b4dbd384bf 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -1038,20 +1038,17 @@ It is the application's responsibility to create and manage the session mempools
 Application using both symmetric and asymmetric sessions should allocate and maintain
 different sessions pools for each type.
 
-An application can use ``rte_cryptodev_get_asym_session_private_size()`` to
-get the private size of asymmetric session on a given crypto device. This
-function would allow an application to calculate the max device asymmetric
-session size of all crypto devices to create a single session mempool.
-If instead an application creates multiple asymmetric session mempools,
-the Crypto device framework also provides ``rte_cryptodev_asym_get_header_session_size()`` to get
-the size of an uninitialized session.
+An application can use ``rte_cryptodev_asym_session_pool_create()`` to create a mempool
+with a specified number of elements. The element size will allow for the session header,
+and the max private session size.
+The max private session size is chosen based on available crypto devices,
+the biggest private session size is used. This means any of those devices can be used,
+and the mempool element will have available space for its private session data.
 
 Once the session mempools have been created, ``rte_cryptodev_asym_session_create()``
-is used to allocate an uninitialized asymmetric session from the given mempool.
-The session then must be initialized using ``rte_cryptodev_asym_session_init()``
-for each of the required crypto devices. An asymmetric transform chain
-is used to specify the operation and its parameters. See the section below for
-details on transforms.
+is used to allocate and initialize an asymmetric session from the given mempool.
+An asymmetric transform chain is used to specify the operation and its parameters.
+See the section below for details on transforms.
 
 When a session is no longer used, user must call ``rte_cryptodev_asym_session_clear()``
 for each of the crypto devices that are using the session, to free all driver
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index a820cc5596..ea4c5309a0 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -112,6 +112,13 @@ API Changes
 * ethdev: Old public macros and enumeration constants without ``RTE_ETH_`` prefix,
   which are kept for backward compatibility, are marked as deprecated.
 
+* cryptodev: The asymmetric session handling was modified to use a single
+  mempool object. An API ``rte_cryptodev_asym_session_pool_create`` was added
+  to create a mempool with element size big enough to hold the generic asymmetric
+  session header and max size for a device private session data.
+  The API ``rte_cryptodev_asym_session_init`` was removed as the initialization
+  is now moved to ``rte_cryptodev_asym_session_create``.
+
 
 ABI Changes
 -----------
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
index d217bbf383..c4d5d039ec 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
@@ -157,8 +157,8 @@ cn10k_cpt_fill_inst(struct cnxk_cpt_qp *qp, struct rte_crypto_op *ops[],
 
 		if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 			asym_op = op->asym;
-			ae_sess = get_asym_session_private_data(
-				asym_op->session, cn10k_cryptodev_driver_id);
+			ae_sess = (struct cnxk_ae_sess *)
+					asym_op->session->sess_private_data;
 			ret = cnxk_ae_enqueue(qp, op, infl_req, &inst[0],
 					      ae_sess);
 			if (unlikely(ret))
@@ -431,8 +431,8 @@ cn10k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp,
 			uintptr_t *mdata = infl_req->mdata;
 			struct cnxk_ae_sess *sess;
 
-			sess = get_asym_session_private_data(
-				op->session, cn10k_cryptodev_driver_id);
+			sess = (struct cnxk_ae_sess *)
+					op->session->sess_private_data;
 
 			cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
 		}
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
index ac1953b66d..b8ad4bf211 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
@@ -138,8 +138,8 @@ cn9k_cpt_inst_prep(struct cnxk_cpt_qp *qp, struct rte_crypto_op *op,
 
 		if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 			asym_op = op->asym;
-			sess = get_asym_session_private_data(
-				asym_op->session, cn9k_cryptodev_driver_id);
+			sess = (struct cnxk_ae_sess *)
+					asym_op->session->sess_private_data;
 			ret = cnxk_ae_enqueue(qp, op, infl_req, inst, sess);
 			inst->w7.u64 = sess->cpt_inst_w7;
 		} else {
@@ -453,8 +453,8 @@ cn9k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp, struct rte_crypto_op *cop,
 			uintptr_t *mdata = infl_req->mdata;
 			struct cnxk_ae_sess *sess;
 
-			sess = get_asym_session_private_data(
-				op->session, cn9k_cryptodev_driver_id);
+			sess = (struct cnxk_ae_sess *)
+					op->session->sess_private_data;
 
 			cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
 		}
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index a5fb68da02..7237dacb48 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -658,10 +658,9 @@ void
 cnxk_ae_session_clear(struct rte_cryptodev *dev,
 		      struct rte_cryptodev_asym_session *sess)
 {
-	struct rte_mempool *sess_mp;
 	struct cnxk_ae_sess *priv;
 
-	priv = get_asym_session_private_data(sess, dev->driver_id);
+	priv = (struct cnxk_ae_sess *) sess->sess_private_data;
 	if (priv == NULL)
 		return;
 
@@ -670,40 +669,29 @@ cnxk_ae_session_clear(struct rte_cryptodev *dev,
 
 	/* Reset and free object back to pool */
 	memset(priv, 0, cnxk_ae_session_size_get(dev));
-	sess_mp = rte_mempool_from_obj(priv);
-	set_asym_session_private_data(sess, dev->driver_id, NULL);
-	rte_mempool_put(sess_mp, priv);
 }
 
 int
 cnxk_ae_session_cfg(struct rte_cryptodev *dev,
 		    struct rte_crypto_asym_xform *xform,
-		    struct rte_cryptodev_asym_session *sess,
-		    struct rte_mempool *pool)
+		    struct rte_cryptodev_asym_session *sess)
 {
+	struct cnxk_ae_sess *priv =
+			(struct cnxk_ae_sess *) sess->sess_private_data;
 	struct cnxk_cpt_vf *vf = dev->data->dev_private;
 	struct roc_cpt *roc_cpt = &vf->cpt;
-	struct cnxk_ae_sess *priv;
 	union cpt_inst_w7 w7;
 	int ret;
 
-	if (rte_mempool_get(pool, (void **)&priv))
-		return -ENOMEM;
-
-	memset(priv, 0, sizeof(struct cnxk_ae_sess));
-
 	ret = cnxk_ae_fill_session_parameters(priv, xform);
-	if (ret) {
-		rte_mempool_put(pool, priv);
+	if (ret)
 		return ret;
-	}
 
 	w7.u64 = 0;
 	w7.s.egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_AE];
 	priv->cpt_inst_w7 = w7.u64;
 	priv->cnxk_fpm_iova = vf->cnxk_fpm_iova;
 	priv->ec_grp = vf->ec_grp;
-	set_asym_session_private_data(sess, dev->driver_id, priv);
 
 	return 0;
 }
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
index 0656ba9675..ab0f00ee7c 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
@@ -122,8 +122,7 @@ void cnxk_ae_session_clear(struct rte_cryptodev *dev,
 			   struct rte_cryptodev_asym_session *sess);
 int cnxk_ae_session_cfg(struct rte_cryptodev *dev,
 			struct rte_crypto_asym_xform *xform,
-			struct rte_cryptodev_asym_session *sess,
-			struct rte_mempool *pool);
+			struct rte_cryptodev_asym_session *sess);
 void cnxk_cpt_dump_on_err(struct cnxk_cpt_qp *qp);
 
 static inline union rte_event_crypto_metadata *
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index f7ca8a8a8e..0cb6dbb38c 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -375,35 +375,24 @@ otx_cpt_asym_session_size_get(struct rte_cryptodev *dev __rte_unused)
 }
 
 static int
-otx_cpt_asym_session_cfg(struct rte_cryptodev *dev,
+otx_cpt_asym_session_cfg(struct rte_cryptodev *dev __rte_unused,
 			 struct rte_crypto_asym_xform *xform __rte_unused,
-			 struct rte_cryptodev_asym_session *sess,
-			 struct rte_mempool *pool)
+			 struct rte_cryptodev_asym_session *sess)
 {
-	struct cpt_asym_sess_misc *priv;
+	struct cpt_asym_sess_misc *priv = (struct cpt_asym_sess_misc *)
+			sess->sess_private_data;
 	int ret;
 
 	CPT_PMD_INIT_FUNC_TRACE();
 
-	if (rte_mempool_get(pool, (void **)&priv)) {
-		CPT_LOG_ERR("Could not allocate session private data");
-		return -ENOMEM;
-	}
-
-	memset(priv, 0, sizeof(struct cpt_asym_sess_misc));
-
 	ret = cpt_fill_asym_session_parameters(priv, xform);
 	if (ret) {
 		CPT_LOG_ERR("Could not configure session parameters");
-
-		/* Return session to mempool */
-		rte_mempool_put(pool, priv);
 		return ret;
 	}
 
 	priv->cpt_inst_w7 = 0;
 
-	set_asym_session_private_data(sess, dev->driver_id, priv);
 	return 0;
 }
 
@@ -412,11 +401,10 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 			   struct rte_cryptodev_asym_session *sess)
 {
 	struct cpt_asym_sess_misc *priv;
-	struct rte_mempool *sess_mp;
 
 	CPT_PMD_INIT_FUNC_TRACE();
 
-	priv = get_asym_session_private_data(sess, dev->driver_id);
+	priv = (struct cpt_asym_sess_misc *) sess->sess_private_data;
 
 	if (priv == NULL)
 		return;
@@ -424,9 +412,6 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 	/* Free resources allocated during session configure */
 	cpt_free_asym_session_parameters(priv);
 	memset(priv, 0, otx_cpt_asym_session_size_get(dev));
-	sess_mp = rte_mempool_from_obj(priv);
-	set_asym_session_private_data(sess, dev->driver_id, NULL);
-	rte_mempool_put(sess_mp, priv);
 }
 
 static __rte_always_inline void * __rte_hot
@@ -471,8 +456,8 @@ otx_cpt_enq_single_asym(struct cpt_instance *instance,
 		return NULL;
 	}
 
-	sess = get_asym_session_private_data(asym_op->session,
-					     otx_cryptodev_driver_id);
+	sess = (struct cpt_asym_sess_misc *)
+			asym_op->session->sess_private_data;
 
 	/* Store phys_addr of the mdata to meta_buf */
 	params.meta_buf = rte_mempool_virt2iova(mdata);
@@ -852,8 +837,7 @@ otx_cpt_asym_post_process(struct rte_crypto_op *cop,
 	struct rte_crypto_asym_op *op = cop->asym;
 	struct cpt_asym_sess_misc *sess;
 
-	sess = get_asym_session_private_data(op->session,
-					     otx_cryptodev_driver_id);
+	sess = (struct cpt_asym_sess_misc *) op->session->sess_private_data;
 
 	switch (sess->xfrm_type) {
 	case RTE_CRYPTO_ASYM_XFORM_RSA:
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 5794ed8159..d80e1052e2 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -748,9 +748,7 @@ get_session(struct openssl_qp *qp, struct rte_crypto_op *op)
 		} else {
 			if (likely(op->asym->session != NULL))
 				asym_sess = (struct openssl_asym_session *)
-						get_asym_session_private_data(
-						op->asym->session,
-						cryptodev_driver_id);
+						op->asym->session->sess_private_data;
 			if (asym_sess == NULL)
 				op->status =
 					RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 52715f86f8..556fd226ed 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -1119,8 +1119,7 @@ static int openssl_set_asym_session_parameters(
 static int
 openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool)
+		struct rte_cryptodev_asym_session *sess)
 {
 	void *asym_sess_private_data;
 	int ret;
@@ -1130,25 +1129,14 @@ openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		return -EINVAL;
 	}
 
-	if (rte_mempool_get(mempool, &asym_sess_private_data)) {
-		CDEV_LOG_ERR(
-			"Couldn't get object from session mempool");
-		return -ENOMEM;
-	}
-
+	asym_sess_private_data = sess->sess_private_data;
 	ret = openssl_set_asym_session_parameters(asym_sess_private_data,
 			xform);
 	if (ret != 0) {
 		OPENSSL_LOG(ERR, "failed configure session parameters");
-
-		/* Return session to mempool */
-		rte_mempool_put(mempool, asym_sess_private_data);
 		return ret;
 	}
 
-	set_asym_session_private_data(sess, dev->driver_id,
-			asym_sess_private_data);
-
 	return 0;
 }
 
@@ -1206,19 +1194,15 @@ static void openssl_reset_asym_session(struct openssl_asym_session *sess)
  * so it doesn't leave key material behind
  */
 static void
-openssl_pmd_asym_session_clear(struct rte_cryptodev *dev,
+openssl_pmd_asym_session_clear(struct rte_cryptodev *dev __rte_unused,
 		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t index = dev->driver_id;
-	void *sess_priv = get_asym_session_private_data(sess, index);
+	void *sess_priv = sess->sess_private_data;
 
 	/* Zero out the whole structure */
 	if (sess_priv) {
 		openssl_reset_asym_session(sess_priv);
 		memset(sess_priv, 0, sizeof(struct openssl_asym_session));
-		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
-		set_asym_session_private_data(sess, index, NULL);
-		rte_mempool_put(sess_mp, sess_priv);
 	}
 }
 
diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index 09d8761c5f..f46eefd4b3 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -492,8 +492,7 @@ qat_asym_build_request(void *in_op,
 	op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
 	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 		ctx = (struct qat_asym_session *)
-			get_asym_session_private_data(
-			op->asym->session, qat_asym_driver_id);
+				op->asym->session->sess_private_data;
 		if (unlikely(ctx == NULL)) {
 			QAT_LOG(ERR, "Session has not been created for this device");
 			goto error;
@@ -711,8 +710,8 @@ qat_asym_process_response(void **op, uint8_t *resp,
 	}
 
 	if (rx_op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
-		ctx = (struct qat_asym_session *)get_asym_session_private_data(
-			rx_op->asym->session, qat_asym_driver_id);
+		ctx = (struct qat_asym_session *)
+				rx_op->asym->session->sess_private_data;
 		qat_asym_collect_response(rx_op, cookie, ctx->xform);
 	} else if (rx_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
 		qat_asym_collect_response(rx_op, cookie, rx_op->asym->xform);
@@ -726,61 +725,42 @@ qat_asym_process_response(void **op, uint8_t *resp,
 }
 
 int
-qat_asym_session_configure(struct rte_cryptodev *dev,
+qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool)
+		struct rte_cryptodev_asym_session *sess)
 {
-	int err = 0;
-	void *sess_private_data;
 	struct qat_asym_session *session;
 
-	if (rte_mempool_get(mempool, &sess_private_data)) {
-		QAT_LOG(ERR,
-			"Couldn't get object from session mempool");
-		return -ENOMEM;
-	}
-
-	session = sess_private_data;
+	session = (struct qat_asym_session *) sess->sess_private_data;
 	if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODEX) {
 		if (xform->modex.exponent.length == 0 ||
 				xform->modex.modulus.length == 0) {
 			QAT_LOG(ERR, "Invalid mod exp input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODINV) {
 		if (xform->modinv.modulus.length == 0) {
 			QAT_LOG(ERR, "Invalid mod inv input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_RSA) {
 		if (xform->rsa.n.length == 0) {
 			QAT_LOG(ERR, "Invalid rsa input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type >= RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
 			|| xform->xform_type <= RTE_CRYPTO_ASYM_XFORM_NONE) {
 		QAT_LOG(ERR, "Invalid asymmetric crypto xform");
-		err = -EINVAL;
-		goto error;
+		return -EINVAL;
 	} else {
 		QAT_LOG(ERR, "Asymmetric crypto xform not implemented");
-		err = -EINVAL;
-		goto error;
+		return -EINVAL;
 	}
 
 	session->xform = xform;
-	qat_asym_build_req_tmpl(sess_private_data);
-	set_asym_session_private_data(sess, dev->driver_id,
-		sess_private_data);
+	qat_asym_build_req_tmpl(session);
 
 	return 0;
-error:
-	rte_mempool_put(mempool, sess_private_data);
-	return err;
 }
 
 unsigned int qat_asym_session_get_private_size(
@@ -793,15 +773,9 @@ void
 qat_asym_session_clear(struct rte_cryptodev *dev,
 		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t index = dev->driver_id;
-	void *sess_priv = get_asym_session_private_data(sess, index);
+	void *sess_priv = sess->sess_private_data;
 	struct qat_asym_session *s = (struct qat_asym_session *)sess_priv;
 
-	if (sess_priv) {
+	if (sess_priv)
 		memset(s, 0, qat_asym_session_get_private_size(dev));
-		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
-
-		set_asym_session_private_data(sess, index, NULL);
-		rte_mempool_put(sess_mp, sess_priv);
-	}
 }
diff --git a/drivers/crypto/qat/qat_asym.h b/drivers/crypto/qat/qat_asym.h
index 308b6b2e0b..c9242a12ca 100644
--- a/drivers/crypto/qat/qat_asym.h
+++ b/drivers/crypto/qat/qat_asym.h
@@ -46,10 +46,9 @@ struct qat_asym_session {
 };
 
 int
-qat_asym_session_configure(struct rte_cryptodev *dev,
+qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool);
+		struct rte_cryptodev_asym_session *sess);
 
 unsigned int
 qat_asym_session_get_private_size(struct rte_cryptodev *dev);
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index b9146f652c..142bfb7c66 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -319,7 +319,6 @@ typedef int (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
  * @param	dev		Crypto device pointer
  * @param	xform		Single or chain of crypto xforms
  * @param	session		Pointer to cryptodev's private session structure
- * @param	mp		Mempool where the private session is allocated
  *
  * @return
  *  - Returns 0 if private session structure have been created successfully.
@@ -329,8 +328,7 @@ typedef int (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
  */
 typedef int (*cryptodev_asym_configure_session_t)(struct rte_cryptodev *dev,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *session,
-		struct rte_mempool *mp);
+		struct rte_cryptodev_asym_session *session);
 /**
  * Free driver private session data.
  *
@@ -340,12 +338,12 @@ typedef int (*cryptodev_asym_configure_session_t)(struct rte_cryptodev *dev,
 typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		struct rte_cryptodev_sym_session *sess);
 /**
- * Free asymmetric session private data.
+ * Clear asymmetric session private data.
  *
  * @param	dev		Crypto device pointer
  * @param	sess		Cryptodev session structure
  */
-typedef void (*cryptodev_asym_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_asym_clear_session_t)(struct rte_cryptodev *dev,
 		struct rte_cryptodev_asym_session *sess);
 /**
  * Perform actual crypto processing (encrypt/digest or auth/decrypt)
@@ -429,7 +427,7 @@ struct rte_cryptodev_ops {
 	/**< Configure asymmetric Crypto session. */
 	cryptodev_sym_free_session_t sym_session_clear;
 	/**< Clear a Crypto sessions private data. */
-	cryptodev_asym_free_session_t asym_session_clear;
+	cryptodev_asym_clear_session_t asym_session_clear;
 	/**< Clear a Crypto sessions private data. */
 	union {
 		cryptodev_sym_cpu_crypto_process_t sym_cpu_process;
@@ -627,17 +625,4 @@ set_sym_session_private_data(struct rte_cryptodev_sym_session *sess,
 	sess->sess_data[driver_id].data = private_data;
 }
 
-static inline void *
-get_asym_session_private_data(const struct rte_cryptodev_asym_session *sess,
-		uint8_t driver_id) {
-	return sess->sess_private_data[driver_id];
-}
-
-static inline void
-set_asym_session_private_data(struct rte_cryptodev_asym_session *sess,
-		uint8_t driver_id, void *private_data)
-{
-	sess->sess_private_data[driver_id] = private_data;
-}
-
 #endif /* _CRYPTODEV_PMD_H_ */
diff --git a/lib/cryptodev/cryptodev_trace_points.c b/lib/cryptodev/cryptodev_trace_points.c
index 5d58951fd5..c5bfe08b79 100644
--- a/lib/cryptodev/cryptodev_trace_points.c
+++ b/lib/cryptodev/cryptodev_trace_points.c
@@ -24,6 +24,9 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_setup,
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_pool_create,
 	lib.cryptodev.sym.pool.create)
 
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_pool_create,
+	lib.cryptodev.asym.pool.create)
+
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_create,
 	lib.cryptodev.sym.create)
 
@@ -39,15 +42,9 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_free,
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_init,
 	lib.cryptodev.sym.init)
 
-RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_init,
-	lib.cryptodev.asym.init)
-
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_clear,
 	lib.cryptodev.sym.clear)
 
-RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_clear,
-	lib.cryptodev.asym.clear)
-
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_enqueue_burst,
 	lib.cryptodev.enq.burst)
 
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index a40536c5ea..b056d88ac2 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -195,7 +195,7 @@ const char *rte_crypto_asym_op_strings[] = {
 };
 
 /**
- * The private data structure stored in the session mempool private data.
+ * The private data structure stored in the sym session mempool private data.
  */
 struct rte_cryptodev_sym_session_pool_private_data {
 	uint16_t nb_drivers;
@@ -204,6 +204,14 @@ struct rte_cryptodev_sym_session_pool_private_data {
 	/**< session user data will be placed after sess_data */
 };
 
+/**
+ * The private data structure stored in the asym session mempool private data.
+ */
+struct rte_cryptodev_asym_session_pool_private_data {
+	uint16_t max_priv_session_sz;
+	/**< Size of private session data used when creating mempool */
+};
+
 int
 rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum,
 		const char *algo_string)
@@ -1751,47 +1759,6 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 	return 0;
 }
 
-int
-rte_cryptodev_asym_session_init(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_crypto_asym_xform *xforms,
-		struct rte_mempool *mp)
-{
-	struct rte_cryptodev *dev;
-	uint8_t index;
-	int ret;
-
-	if (!rte_cryptodev_is_valid_dev(dev_id)) {
-		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_get_dev(dev_id);
-
-	if (sess == NULL || xforms == NULL || dev == NULL)
-		return -EINVAL;
-
-	index = dev->driver_id;
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure,
-				-ENOTSUP);
-
-	if (sess->sess_private_data[index] == NULL) {
-		ret = dev->dev_ops->asym_session_configure(dev,
-							xforms,
-							sess, mp);
-		if (ret < 0) {
-			CDEV_LOG_ERR(
-				"dev_id %d failed to configure session details",
-				dev_id);
-			return ret;
-		}
-	}
-
-	rte_cryptodev_trace_asym_session_init(dev_id, sess, xforms, mp);
-	return 0;
-}
-
 struct rte_mempool *
 rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	uint32_t elt_size, uint32_t cache_size, uint16_t user_data_size,
@@ -1834,6 +1801,53 @@ rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	return mp;
 }
 
+struct rte_mempool *
+rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
+	uint32_t cache_size, int socket_id)
+{
+	struct rte_mempool *mp;
+	struct rte_cryptodev_asym_session_pool_private_data *pool_priv;
+	uint32_t obj_sz, obj_sz_aligned;
+	uint8_t dev_id, priv_sz, max_priv_sz = 0;
+
+	for (dev_id = 0; dev_id < RTE_CRYPTO_MAX_DEVS; dev_id++)
+		if (rte_cryptodev_is_valid_dev(dev_id)) {
+			priv_sz = rte_cryptodev_asym_get_private_session_size(dev_id);
+			if (priv_sz > max_priv_sz)
+				max_priv_sz = priv_sz;
+		}
+	if (max_priv_sz == 0) {
+		CDEV_LOG_INFO("Could not set max private session size\n");
+		return NULL;
+	}
+
+	obj_sz = rte_cryptodev_asym_get_header_session_size() + max_priv_sz;
+	obj_sz_aligned =  RTE_ALIGN_CEIL(obj_sz, RTE_CACHE_LINE_SIZE);
+
+	mp = rte_mempool_create(name, nb_elts, obj_sz_aligned, cache_size,
+			(uint32_t)(sizeof(*pool_priv)),
+			NULL, NULL, NULL, NULL,
+			socket_id, 0);
+	if (mp == NULL) {
+		CDEV_LOG_ERR("%s(name=%s) failed, rte_errno=%d\n",
+			__func__, name, rte_errno);
+		return NULL;
+	}
+
+	pool_priv = rte_mempool_get_priv(mp);
+	if (!pool_priv) {
+		CDEV_LOG_ERR("%s(name=%s) failed to get private data\n",
+			__func__, name);
+		rte_mempool_free(mp);
+		return NULL;
+	}
+	pool_priv->max_priv_session_sz = max_priv_sz;
+
+	rte_cryptodev_trace_asym_session_pool_create(name, nb_elts,
+		cache_size, mp);
+	return mp;
+}
+
 static unsigned int
 rte_cryptodev_sym_session_data_size(struct rte_cryptodev_sym_session *sess)
 {
@@ -1895,19 +1909,44 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 }
 
 struct rte_cryptodev_asym_session *
-rte_cryptodev_asym_session_create(struct rte_mempool *mp)
+rte_cryptodev_asym_session_create(uint8_t dev_id,
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp)
 {
 	struct rte_cryptodev_asym_session *sess;
-	unsigned int session_size =
+	uint32_t session_priv_data_sz;
+	struct rte_cryptodev_asym_session_pool_private_data *pool_priv;
+	unsigned int session_header_size =
 			rte_cryptodev_asym_get_header_session_size();
+	struct rte_cryptodev *dev;
+	int ret;
+
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
+		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
+		return NULL;
+	}
+
+	dev = rte_cryptodev_pmd_get_dev(dev_id);
+
+	if (dev == NULL)
+		return NULL;
 
 	if (!mp) {
 		CDEV_LOG_ERR("invalid mempool\n");
 		return NULL;
 	}
 
+	session_priv_data_sz = rte_cryptodev_asym_get_private_session_size(
+			dev_id);
+	pool_priv = rte_mempool_get_priv(mp);
+
+	if (pool_priv->max_priv_session_sz < session_priv_data_sz) {
+		CDEV_LOG_DEBUG(
+			"The private session data size used when creating the mempool is smaller than this device's private session data.");
+		return NULL;
+	}
+
 	/* Verify if provided mempool can hold elements big enough. */
-	if (mp->elt_size < session_size) {
+	if (mp->elt_size < session_header_size + session_priv_data_sz) {
 		CDEV_LOG_ERR(
 			"mempool elements too small to hold session objects");
 		return NULL;
@@ -1919,12 +1958,25 @@ rte_cryptodev_asym_session_create(struct rte_mempool *mp)
 		return NULL;
 	}
 
-	/* Clear device session pointer.
-	 * Include the flag indicating presence of private data
-	 */
-	memset(sess, 0, session_size);
+	sess->driver_id = dev->driver_id;
+	sess->max_priv_data_sz = pool_priv->max_priv_session_sz;
+
+	/* Clear device session pointer.*/
+	memset(sess->sess_private_data, 0, session_priv_data_sz);
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, NULL);
 
-	rte_cryptodev_trace_asym_session_create(mp, sess);
+	if (sess->sess_private_data[0] == 0) {
+		ret = dev->dev_ops->asym_session_configure(dev, xforms, sess);
+		if (ret < 0) {
+			CDEV_LOG_ERR(
+				"dev_id %d failed to configure session details",
+				dev_id);
+			return NULL;
+		}
+	}
+
+	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp);
 	return sess;
 }
 
@@ -1959,30 +2011,6 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id,
 	return 0;
 }
 
-int
-rte_cryptodev_asym_session_clear(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess)
-{
-	struct rte_cryptodev *dev;
-
-	if (!rte_cryptodev_is_valid_dev(dev_id)) {
-		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_get_dev(dev_id);
-
-	if (dev == NULL || sess == NULL)
-		return -EINVAL;
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_clear, -ENOTSUP);
-
-	dev->dev_ops->asym_session_clear(dev, sess);
-
-	rte_cryptodev_trace_sym_session_clear(dev_id, sess);
-	return 0;
-}
-
 int
 rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
 {
@@ -2007,27 +2035,31 @@ rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
 }
 
 int
-rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess)
+rte_cryptodev_asym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t i;
-	void *sess_priv;
 	struct rte_mempool *sess_mp;
+	struct rte_cryptodev *dev;
 
-	if (sess == NULL)
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
+		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
-
-	/* Check that all device private data has been freed */
-	for (i = 0; i < nb_drivers; i++) {
-		sess_priv = get_asym_session_private_data(sess, i);
-		if (sess_priv != NULL)
-			return -EBUSY;
 	}
 
+	dev = rte_cryptodev_pmd_get_dev(dev_id);
+
+	if (dev == NULL || sess == NULL)
+		return -EINVAL;
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_clear, -ENOTSUP);
+
+	dev->dev_ops->asym_session_clear(dev, sess);
+
 	/* Return session to mempool */
 	sess_mp = rte_mempool_from_obj(sess);
 	rte_mempool_put(sess_mp, sess);
 
-	rte_cryptodev_trace_asym_session_free(sess);
+	rte_cryptodev_trace_asym_session_free(dev_id, sess);
 	return 0;
 }
 
@@ -2061,12 +2093,7 @@ rte_cryptodev_sym_get_existing_header_session_size(
 unsigned int
 rte_cryptodev_asym_get_header_session_size(void)
 {
-	/*
-	 * Header contains pointers to the private data
-	 * of all registered drivers, and a flag which
-	 * indicates presence of private data
-	 */
-	return ((sizeof(void *) * nb_drivers) + sizeof(uint8_t));
+	return sizeof(struct rte_cryptodev_asym_session);
 }
 
 unsigned int
@@ -2092,7 +2119,6 @@ unsigned int
 rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
-	unsigned int header_size = sizeof(void *) * nb_drivers;
 	unsigned int priv_sess_size;
 
 	if (!rte_cryptodev_is_valid_dev(dev_id))
@@ -2104,11 +2130,8 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 		return 0;
 
 	priv_sess_size = (*dev->dev_ops->asym_session_get_size)(dev);
-	if (priv_sess_size < header_size)
-		return header_size;
 
 	return priv_sess_size;
-
 }
 
 int
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 59ea5a54df..90e764017d 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -919,9 +919,13 @@ struct rte_cryptodev_sym_session {
 };
 
 /** Cryptodev asymmetric crypto session */
-struct rte_cryptodev_asym_session {
-	__extension__ void *sess_private_data[0];
-	/**< Private asymmetric session material */
+RTE_STD_C11 struct rte_cryptodev_asym_session {
+	uint8_t driver_id;
+	/**< Session driver ID. */
+	uint16_t max_priv_data_sz;
+	/**< Size of private data used when creating mempool */
+	uint8_t padding[5];
+	uint8_t sess_private_data[0];
 };
 
 /**
@@ -956,6 +960,29 @@ rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	uint32_t elt_size, uint32_t cache_size, uint16_t priv_size,
 	int socket_id);
 
+/**
+ * Create an asymmetric session mempool.
+ *
+ * @param name
+ *   The unique mempool name.
+ * @param nb_elts
+ *   The number of elements in the mempool.
+ * @param cache_size
+ *   The number of per-lcore cache elements
+ * @param socket_id
+ *   The *socket_id* argument is the socket identifier in the case of
+ *   NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA
+ *   constraint for the reserved zone.
+ *
+ * @return
+ *  - On success return mempool
+ *  - On failure returns NULL
+ */
+__rte_experimental
+struct rte_mempool *
+rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
+	uint32_t cache_size, int socket_id);
+
 /**
  * Create symmetric crypto session header (generic with no private data)
  *
@@ -969,17 +996,22 @@ struct rte_cryptodev_sym_session *
 rte_cryptodev_sym_session_create(struct rte_mempool *mempool);
 
 /**
- * Create asymmetric crypto session header (generic with no private data)
+ * Create and initialise an asymmetric crypto session structure.
+ * Calls the PMD to configure the private session data.
  *
- * @param   mempool    mempool to allocate asymmetric session
- *                     objects from
+ * @param   dev_id   ID of device that we want the session to be used on
+ * @param   xforms   Asymmetric crypto transform operations to apply on flow
+ *                   processed with this session
+ * @param   mp       mempool to allocate asymmetric session
+ *                   objects from
  * @return
  *  - On success return pointer to asym-session
  *  - On failure returns NULL
  */
 __rte_experimental
 struct rte_cryptodev_asym_session *
-rte_cryptodev_asym_session_create(struct rte_mempool *mempool);
+rte_cryptodev_asym_session_create(uint8_t dev_id,
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp);
 
 /**
  * Frees symmetric crypto session header, after checking that all
@@ -997,20 +1029,20 @@ int
 rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess);
 
 /**
- * Frees asymmetric crypto session header, after checking that all
- * the device private data has been freed, returning it
- * to its original mempool.
+ * Clears and frees asymmetric crypto session header and private data,
+ * returning it to its original mempool.
  *
+ * @param   dev_id   ID of device that uses the asymmetric session.
  * @param   sess     Session header to be freed.
  *
  * @return
  *  - 0 if successful.
- *  - -EINVAL if session is NULL.
- *  - -EBUSY if not all device private data has been freed.
+ *  - -EINVAL if device is invalid or session is NULL.
  */
 __rte_experimental
 int
-rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess);
+rte_cryptodev_asym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess);
 
 /**
  * Fill out private data for the device id, based on its device type.
@@ -1034,28 +1066,6 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 			struct rte_crypto_sym_xform *xforms,
 			struct rte_mempool *mempool);
 
-/**
- * Initialize asymmetric session on a device with specific asymmetric xform
- *
- * @param   dev_id   ID of device that we want the session to be used on
- * @param   sess     Session to be set up on a device
- * @param   xforms   Asymmetric crypto transform operations to apply on flow
- *                   processed with this session
- * @param   mempool  Mempool to be used for internal allocation.
- *
- * @return
- *  - On success, zero.
- *  - -EINVAL if input parameters are invalid.
- *  - -ENOTSUP if crypto device does not support the crypto transform.
- *  - -ENOMEM if the private session could not be allocated.
- */
-__rte_experimental
-int
-rte_cryptodev_asym_session_init(uint8_t dev_id,
-			struct rte_cryptodev_asym_session *sess,
-			struct rte_crypto_asym_xform *xforms,
-			struct rte_mempool *mempool);
-
 /**
  * Frees private data for the device id, based on its device type,
  * returning it to its mempool. It is the application's responsibility
@@ -1074,21 +1084,6 @@ int
 rte_cryptodev_sym_session_clear(uint8_t dev_id,
 			struct rte_cryptodev_sym_session *sess);
 
-/**
- * Frees resources held by asymmetric session during rte_cryptodev_session_init
- *
- * @param   dev_id   ID of device that uses the asymmetric session.
- * @param   sess     Asymmetric session setup on device using
- *					 rte_cryptodev_session_init
- * @return
- *  - 0 if successful.
- *  - -EINVAL if device is invalid or session is NULL.
- */
-__rte_experimental
-int
-rte_cryptodev_asym_session_clear(uint8_t dev_id,
-			struct rte_cryptodev_asym_session *sess);
-
 /**
  * Get the size of the header session, for all registered drivers excluding
  * the user data size.
@@ -1116,7 +1111,7 @@ rte_cryptodev_sym_get_existing_header_session_size(
 		struct rte_cryptodev_sym_session *sess);
 
 /**
- * Get the size of the asymmetric session header, for all registered drivers.
+ * Get the size of the asymmetric session header.
  *
  * @return
  *   Size of the asymmetric header session.
diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
index d1f4f069a3..a4fa9e8c7e 100644
--- a/lib/cryptodev/rte_cryptodev_trace.h
+++ b/lib/cryptodev/rte_cryptodev_trace.h
@@ -83,12 +83,22 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_u16(sess->user_data_sz);
 )
 
+RTE_TRACE_POINT(
+	rte_cryptodev_trace_asym_session_pool_create,
+	RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts,
+		uint32_t cache_size, void *mempool),
+	rte_trace_point_emit_string(name);
+	rte_trace_point_emit_u32(nb_elts);
+	rte_trace_point_emit_u32(cache_size);
+	rte_trace_point_emit_ptr(mempool);
+)
+
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_create,
-	RTE_TRACE_POINT_ARGS(void *mempool,
-		struct rte_cryptodev_asym_session *sess),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms, void *mempool),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_ptr(xforms);
 	rte_trace_point_emit_ptr(mempool);
-	rte_trace_point_emit_ptr(sess);
 )
 
 RTE_TRACE_POINT(
@@ -99,7 +109,9 @@ RTE_TRACE_POINT(
 
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_free,
-	RTE_TRACE_POINT_ARGS(struct rte_cryptodev_asym_session *sess),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess),
+	rte_trace_point_emit_u8(dev_id);
 	rte_trace_point_emit_ptr(sess);
 )
 
@@ -117,17 +129,6 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_ptr(mempool);
 )
 
-RTE_TRACE_POINT(
-	rte_cryptodev_trace_asym_session_init,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess, void *xforms,
-		void *mempool),
-	rte_trace_point_emit_u8(dev_id);
-	rte_trace_point_emit_ptr(sess);
-	rte_trace_point_emit_ptr(xforms);
-	rte_trace_point_emit_ptr(mempool);
-)
-
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_sym_session_clear,
 	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
@@ -135,13 +136,6 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_ptr(sess);
 )
 
-RTE_TRACE_POINT(
-	rte_cryptodev_trace_asym_session_clear,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
-	rte_trace_point_emit_u8(dev_id);
-	rte_trace_point_emit_ptr(sess);
-)
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index c50745fa8c..44d1aff0e2 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -55,10 +55,8 @@ EXPERIMENTAL {
 	rte_cryptodev_asym_get_header_session_size;
 	rte_cryptodev_asym_get_private_session_size;
 	rte_cryptodev_asym_get_xform_enum;
-	rte_cryptodev_asym_session_clear;
 	rte_cryptodev_asym_session_create;
 	rte_cryptodev_asym_session_free;
-	rte_cryptodev_asym_session_init;
 	rte_cryptodev_asym_xform_capability_check_modlen;
 	rte_cryptodev_asym_xform_capability_check_optype;
 	rte_cryptodev_sym_cpu_crypto_process;
@@ -81,9 +79,7 @@ EXPERIMENTAL {
 	__rte_cryptodev_trace_sym_session_free;
 	__rte_cryptodev_trace_asym_session_free;
 	__rte_cryptodev_trace_sym_session_init;
-	__rte_cryptodev_trace_asym_session_init;
 	__rte_cryptodev_trace_sym_session_clear;
-	__rte_cryptodev_trace_asym_session_clear;
 	__rte_cryptodev_trace_dequeue_burst;
 	__rte_cryptodev_trace_enqueue_burst;
 
@@ -104,6 +100,9 @@ EXPERIMENTAL {
 	rte_cryptodev_remove_deq_callback;
 	rte_cryptodev_remove_enq_callback;
 
+	# added 22.03
+	rte_cryptodev_asym_session_pool_create;
+	__rte_cryptodev_trace_asym_session_pool_create;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 1%]

* [PATCH v6 5/5] crypto: modify return value for asym session create
    2022-02-10 15:54  1%   ` [PATCH v6 2/5] crypto: use single buffer for asymmetric session Ciara Power
@ 2022-02-10 15:54  2%   ` Ciara Power
  1 sibling, 0 replies; 200+ results
From: Ciara Power @ 2022-02-10 15:54 UTC (permalink / raw)
  To: dev; +Cc: roy.fan.zhang, gakhil, anoobj, mdr, Ciara Power, Declan Doherty

Rather than the asym session create function returning a session on
success, and a NULL value on error, it is modified to now return int
values - 0 on success or -EINVAL/-ENOTSUP/-ENOMEM on failure.
The session to be used is passed as input.

This adds clarity on the failure of the create function, which enables
treating the -ENOTSUP return as TEST_SKIPPED in test apps.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

---
v5: Added session parameter to create session trace.
v4:
  - Reordered function parameters.
  - Removed docs code additions, these are included due to patch 1
    changing sample doc to use literal includes.
v3:
  - Fixed variable declarations, putting initialised variable last.
  - Made function comment for return value more generic.
  - Fixed log to include line break.
  - Added documentation.
---
 app/test-crypto-perf/cperf_ops.c       |  12 ++-
 app/test/test_cryptodev_asym.c         | 109 +++++++++++++------------
 doc/guides/rel_notes/release_22_03.rst |   3 +-
 lib/cryptodev/rte_cryptodev.c          |  28 ++++---
 lib/cryptodev/rte_cryptodev.h          |  13 ++-
 lib/cryptodev/rte_cryptodev_trace.h    |   4 +-
 6 files changed, 92 insertions(+), 77 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index b8f590b397..479c40eead 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -734,7 +734,9 @@ cperf_create_session(struct rte_mempool *sess_mp,
 	struct rte_crypto_sym_xform auth_xform;
 	struct rte_crypto_sym_xform aead_xform;
 	struct rte_cryptodev_sym_session *sess = NULL;
+	void *asym_sess = NULL;
 	struct rte_crypto_asym_xform xform = {0};
+	int ret;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
 		xform.next = NULL;
@@ -744,11 +746,13 @@ cperf_create_session(struct rte_mempool *sess_mp,
 		xform.modex.exponent.data = perf_mod_e;
 		xform.modex.exponent.length = sizeof(perf_mod_e);
 
-		sess = (void *)rte_cryptodev_asym_session_create(dev_id, &xform, sess_mp);
-		if (sess == NULL)
+		ret = rte_cryptodev_asym_session_create(dev_id, &xform,
+				sess_mp, &asym_sess);
+		if (ret < 0) {
+			RTE_LOG(ERR, USER1, "Asym session create failed\n");
 			return NULL;
-
-		return sess;
+		}
+		return asym_sess;
 	}
 #ifdef RTE_LIB_SECURITY
 	/*
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index f0cb839a49..c2e1b4dafd 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -317,7 +317,7 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	uint8_t input[TEST_DATA_SIZE] = {0};
 	uint8_t *result = NULL;
 
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	xform_tc.next = NULL;
 	xform_tc.xform_type = data_tc->modex.xform_type;
@@ -452,14 +452,14 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (!sessionless) {
-		sess = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
-				ts_params->session_mpool);
-		if (!sess) {
+		ret = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
+				ts_params->session_mpool, &sess);
+		if (ret < 0) {
 			snprintf(test_msg, ASYM_TEST_MSG_LEN,
 					"line %u "
 					"FAILED: %s", __LINE__,
 					"Session creation failed");
-			status = TEST_FAILED;
+			status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 			goto error_exit;
 		}
 
@@ -646,7 +646,7 @@ test_rsa_sign_verify(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with exponent key only,
 	 * Check in PMD feature flag for RSA exponent key type support.
@@ -659,12 +659,12 @@ test_rsa_sign_verify(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -686,7 +686,7 @@ test_rsa_enc_dec(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with exponent key only,
 	 * Check in PMD feature flag for RSA exponent key type support.
@@ -699,11 +699,11 @@ test_rsa_enc_dec(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -726,7 +726,7 @@ test_rsa_sign_verify_crt(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with quintuple format key only,
 	 * Check im PMD feature flag for RSA quintuple key type support.
@@ -738,12 +738,12 @@ test_rsa_sign_verify_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify_crt\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -766,7 +766,7 @@ test_rsa_enc_dec_crt(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with quintuple format key only,
 	 * Check in PMD feature flag for RSA quintuple key type support.
@@ -778,12 +778,12 @@ test_rsa_enc_dec_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"enc_dec_crt\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1047,7 +1047,7 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 	uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
@@ -1074,12 +1074,12 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.shared_secret.data = output;
 	asym_op->dh.shared_secret.length = sizeof(output);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1130,7 +1130,7 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
@@ -1152,12 +1152,12 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = output;
 	asym_op->dh.priv_key.length = sizeof(output);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1211,7 +1211,7 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
@@ -1241,12 +1241,12 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 					0);
 	asym_op->dh.priv_key = dh_test_params.priv_key;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1300,7 +1300,7 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t out_pub_key[TEST_DH_MOD_LEN];
 	uint8_t out_prv_key[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform pub_key_xform;
@@ -1330,12 +1330,12 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = out_prv_key;
 	asym_op->dh.priv_key.length = sizeof(out_prv_key);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1419,12 +1419,12 @@ test_mod_inv(void)
 				return TEST_SKIPPED;
 		}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool);
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1543,13 +1543,13 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool);
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				 "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1653,13 +1653,14 @@ test_dsa_sign(void)
 	uint8_t r[TEST_DH_MOD_LEN];
 	uint8_t s[TEST_DH_MOD_LEN];
 	uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
+	int ret;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				 "line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 	/* set up crypto op data structure */
@@ -1788,7 +1789,7 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	struct rte_crypto_asym_op *asym_op;
 	struct rte_cryptodev_info dev_info;
 	struct rte_crypto_op *op = NULL;
-	int status = TEST_SUCCESS, ret;
+	int ret, status = TEST_SUCCESS;
 
 	switch (curve_id) {
 	case SECP192R1:
@@ -1833,12 +1834,12 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
 	xform.ec.curve_id = input_params.curve;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto exit;
 	}
 
@@ -1990,7 +1991,7 @@ test_ecpm(enum curve curve_id)
 	struct rte_crypto_asym_op *asym_op;
 	struct rte_cryptodev_info dev_info;
 	struct rte_crypto_op *op = NULL;
-	int status = TEST_SUCCESS, ret;
+	int ret, status = TEST_SUCCESS;
 
 	switch (curve_id) {
 	case SECP192R1:
@@ -2035,12 +2036,12 @@ test_ecpm(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
 	xform.ec.curve_id = input_params.curve;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto exit;
 	}
 
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index a930cbbad6..640691c3ef 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -123,7 +123,8 @@ API Changes
   The session structure was moved to ``cryptodev_pmd.h``,
   hiding it from applications.
   The API ``rte_cryptodev_asym_session_init`` was removed as the initialization
-  is now moved to ``rte_cryptodev_asym_session_create``.
+  is now moved to ``rte_cryptodev_asym_session_create``, which was updated to
+  return an integer value to indicate initialisation errors.
 
 
 ABI Changes
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 91d48d5886..727d271fb9 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1912,9 +1912,10 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 	return sess;
 }
 
-void *
+int
 rte_cryptodev_asym_session_create(uint8_t dev_id,
-		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp)
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
+		void **session)
 {
 	struct rte_cryptodev_asym_session *sess;
 	uint32_t session_priv_data_sz;
@@ -1926,17 +1927,17 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 
 	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return NULL;
+		return -EINVAL;
 	}
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
 
 	if (dev == NULL)
-		return NULL;
+		return -EINVAL;
 
 	if (!mp) {
 		CDEV_LOG_ERR("invalid mempool\n");
-		return NULL;
+		return -EINVAL;
 	}
 
 	session_priv_data_sz = rte_cryptodev_asym_get_private_session_size(
@@ -1946,22 +1947,23 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 	if (pool_priv->max_priv_session_sz < session_priv_data_sz) {
 		CDEV_LOG_DEBUG(
 			"The private session data size used when creating the mempool is smaller than this device's private session data.");
-		return NULL;
+		return -EINVAL;
 	}
 
 	/* Verify if provided mempool can hold elements big enough. */
 	if (mp->elt_size < session_header_size + session_priv_data_sz) {
 		CDEV_LOG_ERR(
 			"mempool elements too small to hold session objects");
-		return NULL;
+		return -EINVAL;
 	}
 
 	/* Allocate a session structure from the session pool */
-	if (rte_mempool_get(mp, (void **)&sess)) {
+	if (rte_mempool_get(mp, session)) {
 		CDEV_LOG_ERR("couldn't get object from session mempool");
-		return NULL;
+		return -ENOMEM;
 	}
 
+	sess = *session;
 	sess->driver_id = dev->driver_id;
 	sess->user_data_sz = pool_priv->user_data_sz;
 	sess->max_priv_data_sz = pool_priv->max_priv_session_sz;
@@ -1969,7 +1971,7 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 	/* Clear device session pointer.*/
 	memset(sess->sess_private_data, 0, session_priv_data_sz + sess->user_data_sz);
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, NULL);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, -ENOTSUP);
 
 	if (sess->sess_private_data[0] == 0) {
 		ret = dev->dev_ops->asym_session_configure(dev, xforms, sess);
@@ -1977,12 +1979,12 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 			CDEV_LOG_ERR(
 				"dev_id %d failed to configure session details",
 				dev_id);
-			return NULL;
+			return ret;
 		}
 	}
 
-	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp);
-	return sess;
+	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp, sess);
+	return 0;
 }
 
 int
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 1d7bd07680..19e2e70287 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -996,14 +996,19 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mempool);
  *                   processed with this session
  * @param   mp       mempool to allocate asymmetric session
  *                   objects from
+ * @param   session  void ** for session to be used
+ *
  * @return
- *  - On success return pointer to asym-session
- *  - On failure returns NULL
+ *  - 0 on success.
+ *  - -EINVAL on invalid arguments.
+ *  - -ENOMEM on memory error for session allocation.
+ *  - -ENOTSUP if device doesn't support session configuration.
  */
 __rte_experimental
-void *
+int
 rte_cryptodev_asym_session_create(uint8_t dev_id,
-		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp);
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
+		void **session);
 
 /**
  * Frees symmetric crypto session header, after checking that all
diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
index 005a4fe38b..a3f6048e7d 100644
--- a/lib/cryptodev/rte_cryptodev_trace.h
+++ b/lib/cryptodev/rte_cryptodev_trace.h
@@ -96,10 +96,12 @@ RTE_TRACE_POINT(
 
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_create,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms, void *mempool),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms, void *mempool,
+			void *sess),
 	rte_trace_point_emit_u8(dev_id);
 	rte_trace_point_emit_ptr(xforms);
 	rte_trace_point_emit_ptr(mempool);
+	rte_trace_point_emit_ptr(sess);
 )
 
 RTE_TRACE_POINT(
-- 
2.25.1


^ permalink raw reply	[relevance 2%]

* RE: [EXT] [PATCH v2 4/4] crypto: reorganize endianness comments, add crypto uint
  2022-02-10 10:17  3%   ` [EXT] " Akhil Goyal
@ 2022-02-10 16:38  0%     ` Zhang, Roy Fan
  2022-02-10 21:08  4%       ` Akhil Goyal
  0 siblings, 1 reply; 200+ results
From: Zhang, Roy Fan @ 2022-02-10 16:38 UTC (permalink / raw)
  To: Akhil Goyal, Kusztal, ArkadiuszX, dev; +Cc: Ramkumar Balu

Hi Akhil,

I assume everything in asym crypto is under experimental tag at the moment right?
The goal is to have them updated and fixed before DPDK 22.11 so the experimental tag can be removed.

Regards,
Fan

> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Thursday, February 10, 2022 10:17 AM
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
> Cc: Zhang, Roy Fan <roy.fan.zhang@intel.com>; Ramkumar Balu
> <rbalu@marvell.com>
> Subject: RE: [EXT] [PATCH v2 4/4] crypto: reorganize endianness comments,
> add crypto uint
> 
> > This patch adds crypto uint typedef so adding comment
> > about byte-order becomes unnecessary.
> >
> > It makes API comments more tidy, and more consistent
> > with other asymmetric crypto APIs.
> >
> > Additionally it reorganizes code that enums, externs
> > and forward declarations are moved to the top of the
> > header file making code more readable.
> >
> > It removes also comments like co-prime constraint
> > from mod inv as it is natural mathematical constraint,
> > not PMD constraint.
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> > ---
> CI is reporting abi issues in this set. Can you check?
> http://mails.dpdk.org/archives/test-report/2022-February/257403.html


^ permalink raw reply	[relevance 0%]

* RE: [EXT] [PATCH v2 4/4] crypto: reorganize endianness comments, add crypto uint
  2022-02-10 16:38  0%     ` Zhang, Roy Fan
@ 2022-02-10 21:08  4%       ` Akhil Goyal
  2022-02-11 10:54  0%         ` Ray Kinsella
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2022-02-10 21:08 UTC (permalink / raw)
  To: Zhang, Roy Fan, Kusztal, ArkadiuszX, dev, David Marchand, ray.kinsella
  Cc: Ramkumar Balu

Hi Fan,
> Hi Akhil,
> 
> I assume everything in asym crypto is under experimental tag at the moment
> right?
> The goal is to have them updated and fixed before DPDK 22.11 so the
> experimental tag can be removed.
> 
Asymmetric crypto APIs are marked as experimental, but the structures are not
explicitly marked experimental.
rte_crypto_asym_op is part of  union in rte_crypto_op which is definitely not experimental.
So a change in asym_op will result in ABI issues in rte_crypto_op.

David/Ray: Can you review the patch 1/4 of this series from ABI compatibility  point of view.
http://patches.dpdk.org/project/dpdk/patch/20220207113555.8431-2-arkadiuszx.kusztal@intel.com/
IMO, as per current experimental tags, we cannot change parameters inside rte_crypto_asym_op
and subsequently in struct rte_crypto_dsa_op_param. What do you suggest?
However, I remember, some exception was added to ignore ABI issues related to asymmetric
crypto. Could you please check why that exception is not working in this case?

Regards,
Akhil

^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-02 11:44  0%       ` Ray Kinsella
@ 2022-02-10 22:16  3%         ` Thomas Monjalon
  2022-02-11 10:09  5%           ` Ray Kinsella
  0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-02-10 22:16 UTC (permalink / raw)
  To: Ferruh Yigit, Kalesh A P, Ray Kinsella
  Cc: dev, dev, ajit.khaparde, asafp, David Marchand, Andrew Rybchenko

02/02/2022 12:44, Ray Kinsella:
> Ferruh Yigit <ferruh.yigit@intel.com> writes:
> > On 1/28/2022 12:48 PM, Kalesh A P wrote:
> >> --- a/lib/ethdev/rte_ethdev.h
> >> +++ b/lib/ethdev/rte_ethdev.h
> >> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type {
> >>   	RTE_ETH_EVENT_DESTROY,  /**< port is released */
> >>   	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
> >>   	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
> >> +	RTE_ETH_EVENT_ERR_RECOVERING,
> >> +			/**< port recovering from an error
> >> +			 *
> >> +			 * PMD detected a FW reset or error condition.
> >> +			 * PMD will try to recover from the error.
> >> +			 * Data path may be quiesced and Control path operations
> >> +			 * may fail at this time.
> >> +			 */
> >> +	RTE_ETH_EVENT_RECOVERED,
> >> +			/**< port recovered from an error
> >> +			 *
> >> +			 * PMD has recovered from the error condition.
> >> +			 * Control path and Data path are up now.
> >> +			 * PMD re-configures the port to the state prior to the error.
> >> +			 * Since the device has undergone a reset, flow rules
> >> +			 * offloaded prior to reset may be lost and
> >> +			 * the application should recreate the rules again.
> >> +			 */
> >>   	RTE_ETH_EVENT_MAX       /**< max value of this enum */
> >
> >
> > Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people
> > to evaluate if it is a false positive:
> >
> >
> > 1 function with some indirect sub-type change:
> >   [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes:
> >     parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes:
> >       underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed:
> >         in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)':
> >           parameter 2 of type 'enum rte_eth_event_type' has sub-type changes:
> >             type size hasn't changed
> >             2 enumerator insertions:
> >               'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11'
> >               'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12'
> >             1 enumerator change:
> >               'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1
> 
> I don't immediately see the problem that this would cause.
> There are no array sizes etc dependent on the value of MAX for instance.
> 
> Looks safe?

We never know how this enum will be used by the application.
The max value may be used for the size of an event array.
It looks a real ABI issue unfortunately.

PS: I am not Cc'ed in this patchset,
so copying what I said on v6 (more than a year ago):
Please use the option --cc-cmd devtools/get-maintainer.sh



^ permalink raw reply	[relevance 3%]

* [PATCH v7 2/5] crypto: use single buffer for asymmetric session
  @ 2022-02-11  9:29  1%   ` Ciara Power
  2022-02-11  9:29  2%   ` [PATCH v7 5/5] crypto: modify return value for asym session create Ciara Power
  1 sibling, 0 replies; 200+ results
From: Ciara Power @ 2022-02-11  9:29 UTC (permalink / raw)
  To: dev
  Cc: roy.fan.zhang, gakhil, anoobj, mdr, Ciara Power, Declan Doherty,
	Ankur Dwivedi, Tejasree Kondoj, John Griffin, Fiona Trahe,
	Deepak Kumar Jain

Rather than using a session buffer that contains pointers to private
session data elsewhere, have a single session buffer.
This session is created for a driver ID, and the mempool element
contains space for the max session private data needed for any driver.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>

---
v7: Fixed compilation warning for unused parameter.
v6:
  - Reordered variable declarations to follow cnxk file format.
  - Added fix for crypto perf app asymmetric modex operation, there
    is no longer a need for private mempool, and the
    rte_cryptodev_asym_session_pool_create API should be used.
v5:
  - Removed get API for session private data, can be accessed directly.
  - Modified test application to create a session mempool for
    TEST_NUM_SESSIONS rather than TEST_NUM_SESSIONS * 2.
  - Reworded create session function description.
  - Removed sess parameter from create session trace,
    to be added in a later patch.
v4:
  - Merged asym crypto session clear and free functions.
  - Reordered some function parameters.
  - Updated trace function for asym crypto session create.
  - Fixed cnxk clear, the PMD no longer needs to put private data
    back into a mempool.
  - Renamed struct field for max private session size.
  - Replaced __extension__ with RTE_STD_C11.
  - Moved some parameter validity checks to before functional code.
  - Reworded release note.
  - Removed mempool parameter from session configure function.
  - Removed docs code additions, these are included due to patch 1
    changing sample doc to use literal includes.
v3:
  - Corrected formatting of struct comments.
  - Increased size of max_priv_session_sz to uint16_t.
  - Removed trace for asym session init function that was
    previously removed.
  - Added documentation.
v2:
  - Renamed function typedef from "free" to "clear" as session private
    data isn't being freed in that function.
  - Moved user data API to separate patch.
  - Minor fixes to comments, formatting, return values.
---
 app/test-crypto-perf/cperf_ops.c             |  14 +-
 app/test-crypto-perf/cperf_test_throughput.c |   8 +-
 app/test-crypto-perf/main.c                  |  31 +--
 app/test/test_cryptodev_asym.c               | 272 +++++--------------
 doc/guides/prog_guide/cryptodev_lib.rst      |  21 +-
 doc/guides/rel_notes/release_22_03.rst       |   7 +
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c    |   8 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c     |   8 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c     |  22 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.h     |   3 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c  |  32 +--
 drivers/crypto/openssl/rte_openssl_pmd.c     |   4 +-
 drivers/crypto/openssl/rte_openssl_pmd_ops.c |  24 +-
 drivers/crypto/qat/qat_asym.c                |  54 +---
 drivers/crypto/qat/qat_asym.h                |   5 +-
 lib/cryptodev/cryptodev_pmd.h                |  23 +-
 lib/cryptodev/cryptodev_trace_points.c       |   9 +-
 lib/cryptodev/rte_cryptodev.c                | 213 ++++++++-------
 lib/cryptodev/rte_cryptodev.h                |  97 ++++---
 lib/cryptodev/rte_cryptodev_trace.h          |  38 ++-
 lib/cryptodev/version.map                    |   7 +-
 21 files changed, 319 insertions(+), 581 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index d975ae1ab8..b125c699de 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -735,7 +735,6 @@ cperf_create_session(struct rte_mempool *sess_mp,
 	struct rte_crypto_sym_xform aead_xform;
 	struct rte_cryptodev_sym_session *sess = NULL;
 	struct rte_crypto_asym_xform xform = {0};
-	int rc;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
 		xform.next = NULL;
@@ -745,19 +744,10 @@ cperf_create_session(struct rte_mempool *sess_mp,
 		xform.modex.exponent.data = perf_mod_e;
 		xform.modex.exponent.length = sizeof(perf_mod_e);
 
-		sess = (void *)rte_cryptodev_asym_session_create(sess_mp);
+		sess = (void *)rte_cryptodev_asym_session_create(dev_id, &xform, sess_mp);
 		if (sess == NULL)
 			return NULL;
-		rc = rte_cryptodev_asym_session_init(dev_id, (void *)sess,
-						     &xform, priv_mp);
-		if (rc < 0) {
-			if (sess != NULL) {
-				rte_cryptodev_asym_session_clear(dev_id,
-								 (void *)sess);
-				rte_cryptodev_asym_session_free((void *)sess);
-			}
-			return NULL;
-		}
+
 		return sess;
 	}
 #ifdef RTE_LIB_SECURITY
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index 51512af2ad..ee21ff27f7 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -35,11 +35,9 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx)
 	if (!ctx)
 		return;
 	if (ctx->sess) {
-		if (ctx->options->op_type == CPERF_ASYM_MODEX) {
-			rte_cryptodev_asym_session_clear(ctx->dev_id,
-							 (void *)ctx->sess);
-			rte_cryptodev_asym_session_free((void *)ctx->sess);
-		}
+		if (ctx->options->op_type == CPERF_ASYM_MODEX)
+			rte_cryptodev_asym_session_free(ctx->dev_id,
+					(void *)ctx->sess);
 #ifdef RTE_LIB_SECURITY
 		else if (ctx->options->op_type == CPERF_PDCP ||
 			 ctx->options->op_type == CPERF_DOCSIS ||
diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 6fdb92fb7c..2531de43a2 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -69,39 +69,16 @@ const struct cperf_test cperf_testmap[] = {
 };
 
 static int
-create_asym_op_pool_socket(uint8_t dev_id, int32_t socket_id,
-			   uint32_t nb_sessions)
+create_asym_op_pool_socket(int32_t socket_id, uint32_t nb_sessions)
 {
 	char mp_name[RTE_MEMPOOL_NAMESIZE];
 	struct rte_mempool *mpool = NULL;
-	unsigned int session_size =
-		RTE_MAX(rte_cryptodev_asym_get_private_session_size(dev_id),
-			rte_cryptodev_asym_get_header_session_size());
-
-	if (session_pool_socket[socket_id].priv_mp == NULL) {
-		snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_priv_pool%u",
-			 socket_id);
-
-		mpool = rte_mempool_create(mp_name, nb_sessions, session_size,
-					   0, 0, NULL, NULL, NULL, NULL,
-					   socket_id, 0);
-		if (mpool == NULL) {
-			printf("Cannot create pool \"%s\" on socket %d\n",
-			       mp_name, socket_id);
-			return -ENOMEM;
-		}
-		printf("Allocated pool \"%s\" on socket %d\n", mp_name,
-		       socket_id);
-		session_pool_socket[socket_id].priv_mp = mpool;
-	}
 
 	if (session_pool_socket[socket_id].sess_mp == NULL) {
-
 		snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_sess_pool%u",
 			 socket_id);
-		mpool = rte_mempool_create(mp_name, nb_sessions,
-					   session_size, 0, 0, NULL, NULL, NULL,
-					   NULL, socket_id, 0);
+		mpool = rte_cryptodev_asym_session_pool_create(mp_name,
+				nb_sessions, 0, socket_id);
 		if (mpool == NULL) {
 			printf("Cannot create pool \"%s\" on socket %d\n",
 			       mp_name, socket_id);
@@ -336,7 +313,7 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs)
 		}
 
 		if (opts->op_type == CPERF_ASYM_MODEX)
-			ret = create_asym_op_pool_socket(cdev_id, socket_id,
+			ret = create_asym_op_pool_socket(socket_id,
 							 sessions_needed);
 		else
 			ret = fill_session_pool_socket(socket_id, max_sess_size,
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 8d7290f9ed..88433faf1c 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -452,7 +452,8 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (!sessionless) {
-		sess = rte_cryptodev_asym_session_create(ts_params->session_mpool);
+		sess = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
+				ts_params->session_mpool);
 		if (!sess) {
 			snprintf(test_msg, ASYM_TEST_MSG_LEN,
 					"line %u "
@@ -462,15 +463,6 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 			goto error_exit;
 		}
 
-		if (rte_cryptodev_asym_session_init(dev_id, sess, &xform_tc,
-				ts_params->session_mpool) < 0) {
-			snprintf(test_msg, ASYM_TEST_MSG_LEN,
-					"line %u FAILED: %s",
-					__LINE__, "unabled to config sym session");
-			status = TEST_FAILED;
-			goto error_exit;
-		}
-
 		rte_crypto_op_attach_asym_session(op, sess);
 	} else {
 		asym_op->xform = &xform_tc;
@@ -512,10 +504,8 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 		snprintf(test_msg, ASYM_TEST_MSG_LEN, "SESSIONLESS PASS");
 
 error_exit:
-		if (sess != NULL) {
-			rte_cryptodev_asym_session_clear(dev_id, sess);
-			rte_cryptodev_asym_session_free(sess);
-		}
+		if (sess != NULL)
+			rte_cryptodev_asym_session_free(dev_id, sess);
 
 		if (op != NULL)
 			rte_crypto_op_free(op);
@@ -669,18 +659,11 @@ test_rsa_sign_verify(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"sign_verify\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -688,9 +671,7 @@ test_rsa_sign_verify(void)
 	status = queue_ops_rsa_sign_verify(sess);
 
 error_exit:
-
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -718,17 +699,10 @@ test_rsa_enc_dec(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"enc_dec\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -737,8 +711,7 @@ test_rsa_enc_dec(void)
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -765,28 +738,20 @@ test_rsa_sign_verify_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify_crt\n");
 		status = TEST_FAILED;
-		return status;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform_crt,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"sign_verify_crt\n");
-		status = TEST_FAILED;
 		goto error_exit;
 	}
+
 	status = queue_ops_rsa_sign_verify(sess);
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -813,27 +778,20 @@ test_rsa_enc_dec_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
 
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"enc_dec_crt\n");
-		return TEST_FAILED;
-	}
-
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &rsa_xform_crt,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1, "Unable to config asym session for "
-			"enc_dec_crt\n");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
+
 	status = queue_ops_rsa_enc_dec(sess);
 
 error_exit:
 
-	rte_cryptodev_asym_session_clear(dev_id, sess);
-	rte_cryptodev_asym_session_free(sess);
+	rte_cryptodev_asym_session_free(dev_id, sess);
 
 	TEST_ASSERT_EQUAL(status, 0, "Test failed");
 
@@ -927,7 +885,6 @@ testsuite_setup(void)
 	/* configure qp */
 	ts_params->qp_conf.nb_descriptors = DEFAULT_NUM_OPS_INFLIGHT;
 	ts_params->qp_conf.mp_session = ts_params->session_mpool;
-	ts_params->qp_conf.mp_session_private = ts_params->session_mpool;
 	for (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) {
 		TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
 			dev_id, qp_id, &ts_params->qp_conf,
@@ -936,21 +893,9 @@ testsuite_setup(void)
 			qp_id, dev_id);
 	}
 
-	/* setup asym session pool */
-	unsigned int session_size = RTE_MAX(
-		rte_cryptodev_asym_get_private_session_size(dev_id),
-		rte_cryptodev_asym_get_header_session_size());
-	/*
-	 * Create mempool with TEST_NUM_SESSIONS * 2,
-	 * to include the session headers
-	 */
-	ts_params->session_mpool = rte_mempool_create(
-				"test_asym_sess_mp",
-				TEST_NUM_SESSIONS * 2,
-				session_size,
-				0, 0, NULL, NULL, NULL,
-				NULL, SOCKET_ID_ANY,
-				0);
+	ts_params->session_mpool = rte_cryptodev_asym_session_pool_create(
+			"test_asym_sess_mp", TEST_NUM_SESSIONS, 0,
+			SOCKET_ID_ANY);
 
 	TEST_ASSERT_NOT_NULL(ts_params->session_mpool,
 			"session mempool allocation failed");
@@ -1107,14 +1052,6 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_xform xform = *xfrm;
 	uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1137,11 +1074,11 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.shared_secret.data = output;
 	asym_op->dh.shared_secret.length = sizeof(output);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1176,10 +1113,8 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 			asym_op->dh.shared_secret.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -1199,14 +1134,6 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1225,11 +1152,11 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = output;
 	asym_op->dh.priv_key.length = sizeof(output);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1265,10 +1192,8 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1290,14 +1215,6 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1324,11 +1241,11 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 					0);
 	asym_op->dh.priv_key = dh_test_params.priv_key;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1365,10 +1282,8 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 			asym_op->dh.priv_key.data, asym_op->dh.priv_key.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1391,15 +1306,6 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_xform pub_key_xform;
 	struct rte_crypto_asym_xform xform = *xfrm;
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				 "line %u FAILED: %s", __LINE__,
-				"Session creation failed");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* set up crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1423,11 +1329,12 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.pub_key.length = sizeof(out_pub_key);
 	asym_op->dh.priv_key.data = out_prv_key;
 	asym_op->dh.priv_key.length = sizeof(out_prv_key);
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-			sess_mpool) < 0) {
+
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
+				"line %u FAILED: %s", __LINE__,
+				"Session creation failed");
 		status = TEST_FAILED;
 		goto error_exit;
 	}
@@ -1462,10 +1369,8 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 			out_pub_key, asym_op->dh.pub_key.length);
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 
@@ -1514,7 +1419,7 @@ test_mod_inv(void)
 				return TEST_SKIPPED;
 		}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool);
 	if (!sess) {
 		RTE_LOG(ERR, USER1, "line %u "
 				"FAILED: %s", __LINE__,
@@ -1523,15 +1428,6 @@ test_mod_inv(void)
 		goto error_exit;
 	}
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &modinv_xform,
-			sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* generate crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (!op) {
@@ -1583,10 +1479,8 @@ test_mod_inv(void)
 	}
 
 error_exit:
-	if (sess) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 
 	if (op)
 		rte_crypto_op_free(op);
@@ -1649,7 +1543,7 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool);
 	if (!sess) {
 		RTE_LOG(ERR, USER1,
 				 "line %u "
@@ -1659,15 +1553,6 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &modex_xform,
-			sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	asym_op = op->asym;
 	memcpy(input, base, sizeof(base));
 	asym_op->modex.base.data = input;
@@ -1706,10 +1591,8 @@ test_mod_exp(void)
 	}
 
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 
 	if (op != NULL)
 		rte_crypto_op_free(op);
@@ -1771,7 +1654,7 @@ test_dsa_sign(void)
 	uint8_t s[TEST_DH_MOD_LEN];
 	uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
+	sess = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool);
 	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				 "line %u FAILED: %s", __LINE__,
@@ -1800,15 +1683,6 @@ test_dsa_sign(void)
 	debug_hexdump(stdout, "priv_key: ", dsa_xform.dsa.x.data,
 			dsa_xform.dsa.x.length);
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &dsa_xform,
-				sess_mpool) < 0) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s",
-				__LINE__, "unabled to config sym session");
-		status = TEST_FAILED;
-		goto error_exit;
-	}
-
 	/* attach asymmetric crypto session to crypto operations */
 	rte_crypto_op_attach_asym_session(op, sess);
 	asym_op->dsa.op_type = RTE_CRYPTO_ASYM_OP_SIGN;
@@ -1882,10 +1756,8 @@ test_dsa_sign(void)
 		status = TEST_FAILED;
 	}
 error_exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -1944,15 +1816,6 @@ test_ecdsa_sign_verify(enum curve curve_id)
 
 	rte_cryptodev_info_get(dev_id, &dev_info);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed\n");
-		status = TEST_FAILED;
-		goto exit;
-	}
-
 	/* Setup crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (op == NULL) {
@@ -1970,11 +1833,11 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
 	xform.ec.curve_id = input_params.curve;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-				sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
-				"Unable to config asym session\n");
+				"Session creation failed\n");
 		status = TEST_FAILED;
 		goto exit;
 	}
@@ -2082,10 +1945,8 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	}
 
 exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
@@ -2157,15 +2018,6 @@ test_ecpm(enum curve curve_id)
 
 	rte_cryptodev_info_get(dev_id, &dev_info);
 
-	sess = rte_cryptodev_asym_session_create(sess_mpool);
-	if (sess == NULL) {
-		RTE_LOG(ERR, USER1,
-				"line %u FAILED: %s", __LINE__,
-				"Session creation failed\n");
-		status = TEST_FAILED;
-		goto exit;
-	}
-
 	/* Setup crypto op data structure */
 	op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
 	if (op == NULL) {
@@ -2183,11 +2035,11 @@ test_ecpm(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
 	xform.ec.curve_id = input_params.curve;
 
-	if (rte_cryptodev_asym_session_init(dev_id, sess, &xform,
-				sess_mpool) < 0) {
+	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
+	if (sess == NULL) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
-				"Unable to config asym session\n");
+				"Session creation failed\n");
 		status = TEST_FAILED;
 		goto exit;
 	}
@@ -2255,10 +2107,8 @@ test_ecpm(enum curve curve_id)
 	}
 
 exit:
-	if (sess != NULL) {
-		rte_cryptodev_asym_session_clear(dev_id, sess);
-		rte_cryptodev_asym_session_free(sess);
-	}
+	if (sess != NULL)
+		rte_cryptodev_asym_session_free(dev_id, sess);
 	if (op != NULL)
 		rte_crypto_op_free(op);
 	return status;
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 9f33f7a177..b4dbd384bf 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -1038,20 +1038,17 @@ It is the application's responsibility to create and manage the session mempools
 Application using both symmetric and asymmetric sessions should allocate and maintain
 different sessions pools for each type.
 
-An application can use ``rte_cryptodev_get_asym_session_private_size()`` to
-get the private size of asymmetric session on a given crypto device. This
-function would allow an application to calculate the max device asymmetric
-session size of all crypto devices to create a single session mempool.
-If instead an application creates multiple asymmetric session mempools,
-the Crypto device framework also provides ``rte_cryptodev_asym_get_header_session_size()`` to get
-the size of an uninitialized session.
+An application can use ``rte_cryptodev_asym_session_pool_create()`` to create a mempool
+with a specified number of elements. The element size will allow for the session header,
+and the max private session size.
+The max private session size is chosen based on available crypto devices,
+the biggest private session size is used. This means any of those devices can be used,
+and the mempool element will have available space for its private session data.
 
 Once the session mempools have been created, ``rte_cryptodev_asym_session_create()``
-is used to allocate an uninitialized asymmetric session from the given mempool.
-The session then must be initialized using ``rte_cryptodev_asym_session_init()``
-for each of the required crypto devices. An asymmetric transform chain
-is used to specify the operation and its parameters. See the section below for
-details on transforms.
+is used to allocate and initialize an asymmetric session from the given mempool.
+An asymmetric transform chain is used to specify the operation and its parameters.
+See the section below for details on transforms.
 
 When a session is no longer used, user must call ``rte_cryptodev_asym_session_clear()``
 for each of the crypto devices that are using the session, to free all driver
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index a820cc5596..ea4c5309a0 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -112,6 +112,13 @@ API Changes
 * ethdev: Old public macros and enumeration constants without ``RTE_ETH_`` prefix,
   which are kept for backward compatibility, are marked as deprecated.
 
+* cryptodev: The asymmetric session handling was modified to use a single
+  mempool object. An API ``rte_cryptodev_asym_session_pool_create`` was added
+  to create a mempool with element size big enough to hold the generic asymmetric
+  session header and max size for a device private session data.
+  The API ``rte_cryptodev_asym_session_init`` was removed as the initialization
+  is now moved to ``rte_cryptodev_asym_session_create``.
+
 
 ABI Changes
 -----------
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
index d217bbf383..c4d5d039ec 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
@@ -157,8 +157,8 @@ cn10k_cpt_fill_inst(struct cnxk_cpt_qp *qp, struct rte_crypto_op *ops[],
 
 		if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 			asym_op = op->asym;
-			ae_sess = get_asym_session_private_data(
-				asym_op->session, cn10k_cryptodev_driver_id);
+			ae_sess = (struct cnxk_ae_sess *)
+					asym_op->session->sess_private_data;
 			ret = cnxk_ae_enqueue(qp, op, infl_req, &inst[0],
 					      ae_sess);
 			if (unlikely(ret))
@@ -431,8 +431,8 @@ cn10k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp,
 			uintptr_t *mdata = infl_req->mdata;
 			struct cnxk_ae_sess *sess;
 
-			sess = get_asym_session_private_data(
-				op->session, cn10k_cryptodev_driver_id);
+			sess = (struct cnxk_ae_sess *)
+					op->session->sess_private_data;
 
 			cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
 		}
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
index ac1953b66d..b8ad4bf211 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
@@ -138,8 +138,8 @@ cn9k_cpt_inst_prep(struct cnxk_cpt_qp *qp, struct rte_crypto_op *op,
 
 		if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 			asym_op = op->asym;
-			sess = get_asym_session_private_data(
-				asym_op->session, cn9k_cryptodev_driver_id);
+			sess = (struct cnxk_ae_sess *)
+					asym_op->session->sess_private_data;
 			ret = cnxk_ae_enqueue(qp, op, infl_req, inst, sess);
 			inst->w7.u64 = sess->cpt_inst_w7;
 		} else {
@@ -453,8 +453,8 @@ cn9k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp, struct rte_crypto_op *cop,
 			uintptr_t *mdata = infl_req->mdata;
 			struct cnxk_ae_sess *sess;
 
-			sess = get_asym_session_private_data(
-				op->session, cn9k_cryptodev_driver_id);
+			sess = (struct cnxk_ae_sess *)
+					op->session->sess_private_data;
 
 			cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
 		}
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index a5fb68da02..7237dacb48 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -658,10 +658,9 @@ void
 cnxk_ae_session_clear(struct rte_cryptodev *dev,
 		      struct rte_cryptodev_asym_session *sess)
 {
-	struct rte_mempool *sess_mp;
 	struct cnxk_ae_sess *priv;
 
-	priv = get_asym_session_private_data(sess, dev->driver_id);
+	priv = (struct cnxk_ae_sess *) sess->sess_private_data;
 	if (priv == NULL)
 		return;
 
@@ -670,40 +669,29 @@ cnxk_ae_session_clear(struct rte_cryptodev *dev,
 
 	/* Reset and free object back to pool */
 	memset(priv, 0, cnxk_ae_session_size_get(dev));
-	sess_mp = rte_mempool_from_obj(priv);
-	set_asym_session_private_data(sess, dev->driver_id, NULL);
-	rte_mempool_put(sess_mp, priv);
 }
 
 int
 cnxk_ae_session_cfg(struct rte_cryptodev *dev,
 		    struct rte_crypto_asym_xform *xform,
-		    struct rte_cryptodev_asym_session *sess,
-		    struct rte_mempool *pool)
+		    struct rte_cryptodev_asym_session *sess)
 {
+	struct cnxk_ae_sess *priv =
+			(struct cnxk_ae_sess *) sess->sess_private_data;
 	struct cnxk_cpt_vf *vf = dev->data->dev_private;
 	struct roc_cpt *roc_cpt = &vf->cpt;
-	struct cnxk_ae_sess *priv;
 	union cpt_inst_w7 w7;
 	int ret;
 
-	if (rte_mempool_get(pool, (void **)&priv))
-		return -ENOMEM;
-
-	memset(priv, 0, sizeof(struct cnxk_ae_sess));
-
 	ret = cnxk_ae_fill_session_parameters(priv, xform);
-	if (ret) {
-		rte_mempool_put(pool, priv);
+	if (ret)
 		return ret;
-	}
 
 	w7.u64 = 0;
 	w7.s.egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_AE];
 	priv->cpt_inst_w7 = w7.u64;
 	priv->cnxk_fpm_iova = vf->cnxk_fpm_iova;
 	priv->ec_grp = vf->ec_grp;
-	set_asym_session_private_data(sess, dev->driver_id, priv);
 
 	return 0;
 }
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
index 0656ba9675..ab0f00ee7c 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
@@ -122,8 +122,7 @@ void cnxk_ae_session_clear(struct rte_cryptodev *dev,
 			   struct rte_cryptodev_asym_session *sess);
 int cnxk_ae_session_cfg(struct rte_cryptodev *dev,
 			struct rte_crypto_asym_xform *xform,
-			struct rte_cryptodev_asym_session *sess,
-			struct rte_mempool *pool);
+			struct rte_cryptodev_asym_session *sess);
 void cnxk_cpt_dump_on_err(struct cnxk_cpt_qp *qp);
 
 static inline union rte_event_crypto_metadata *
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index f7ca8a8a8e..0cb6dbb38c 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -375,35 +375,24 @@ otx_cpt_asym_session_size_get(struct rte_cryptodev *dev __rte_unused)
 }
 
 static int
-otx_cpt_asym_session_cfg(struct rte_cryptodev *dev,
+otx_cpt_asym_session_cfg(struct rte_cryptodev *dev __rte_unused,
 			 struct rte_crypto_asym_xform *xform __rte_unused,
-			 struct rte_cryptodev_asym_session *sess,
-			 struct rte_mempool *pool)
+			 struct rte_cryptodev_asym_session *sess)
 {
-	struct cpt_asym_sess_misc *priv;
+	struct cpt_asym_sess_misc *priv = (struct cpt_asym_sess_misc *)
+			sess->sess_private_data;
 	int ret;
 
 	CPT_PMD_INIT_FUNC_TRACE();
 
-	if (rte_mempool_get(pool, (void **)&priv)) {
-		CPT_LOG_ERR("Could not allocate session private data");
-		return -ENOMEM;
-	}
-
-	memset(priv, 0, sizeof(struct cpt_asym_sess_misc));
-
 	ret = cpt_fill_asym_session_parameters(priv, xform);
 	if (ret) {
 		CPT_LOG_ERR("Could not configure session parameters");
-
-		/* Return session to mempool */
-		rte_mempool_put(pool, priv);
 		return ret;
 	}
 
 	priv->cpt_inst_w7 = 0;
 
-	set_asym_session_private_data(sess, dev->driver_id, priv);
 	return 0;
 }
 
@@ -412,11 +401,10 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 			   struct rte_cryptodev_asym_session *sess)
 {
 	struct cpt_asym_sess_misc *priv;
-	struct rte_mempool *sess_mp;
 
 	CPT_PMD_INIT_FUNC_TRACE();
 
-	priv = get_asym_session_private_data(sess, dev->driver_id);
+	priv = (struct cpt_asym_sess_misc *) sess->sess_private_data;
 
 	if (priv == NULL)
 		return;
@@ -424,9 +412,6 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 	/* Free resources allocated during session configure */
 	cpt_free_asym_session_parameters(priv);
 	memset(priv, 0, otx_cpt_asym_session_size_get(dev));
-	sess_mp = rte_mempool_from_obj(priv);
-	set_asym_session_private_data(sess, dev->driver_id, NULL);
-	rte_mempool_put(sess_mp, priv);
 }
 
 static __rte_always_inline void * __rte_hot
@@ -471,8 +456,8 @@ otx_cpt_enq_single_asym(struct cpt_instance *instance,
 		return NULL;
 	}
 
-	sess = get_asym_session_private_data(asym_op->session,
-					     otx_cryptodev_driver_id);
+	sess = (struct cpt_asym_sess_misc *)
+			asym_op->session->sess_private_data;
 
 	/* Store phys_addr of the mdata to meta_buf */
 	params.meta_buf = rte_mempool_virt2iova(mdata);
@@ -852,8 +837,7 @@ otx_cpt_asym_post_process(struct rte_crypto_op *cop,
 	struct rte_crypto_asym_op *op = cop->asym;
 	struct cpt_asym_sess_misc *sess;
 
-	sess = get_asym_session_private_data(op->session,
-					     otx_cryptodev_driver_id);
+	sess = (struct cpt_asym_sess_misc *) op->session->sess_private_data;
 
 	switch (sess->xfrm_type) {
 	case RTE_CRYPTO_ASYM_XFORM_RSA:
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 5794ed8159..d80e1052e2 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -748,9 +748,7 @@ get_session(struct openssl_qp *qp, struct rte_crypto_op *op)
 		} else {
 			if (likely(op->asym->session != NULL))
 				asym_sess = (struct openssl_asym_session *)
-						get_asym_session_private_data(
-						op->asym->session,
-						cryptodev_driver_id);
+						op->asym->session->sess_private_data;
 			if (asym_sess == NULL)
 				op->status =
 					RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 52715f86f8..556fd226ed 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -1119,8 +1119,7 @@ static int openssl_set_asym_session_parameters(
 static int
 openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool)
+		struct rte_cryptodev_asym_session *sess)
 {
 	void *asym_sess_private_data;
 	int ret;
@@ -1130,25 +1129,14 @@ openssl_pmd_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		return -EINVAL;
 	}
 
-	if (rte_mempool_get(mempool, &asym_sess_private_data)) {
-		CDEV_LOG_ERR(
-			"Couldn't get object from session mempool");
-		return -ENOMEM;
-	}
-
+	asym_sess_private_data = sess->sess_private_data;
 	ret = openssl_set_asym_session_parameters(asym_sess_private_data,
 			xform);
 	if (ret != 0) {
 		OPENSSL_LOG(ERR, "failed configure session parameters");
-
-		/* Return session to mempool */
-		rte_mempool_put(mempool, asym_sess_private_data);
 		return ret;
 	}
 
-	set_asym_session_private_data(sess, dev->driver_id,
-			asym_sess_private_data);
-
 	return 0;
 }
 
@@ -1206,19 +1194,15 @@ static void openssl_reset_asym_session(struct openssl_asym_session *sess)
  * so it doesn't leave key material behind
  */
 static void
-openssl_pmd_asym_session_clear(struct rte_cryptodev *dev,
+openssl_pmd_asym_session_clear(struct rte_cryptodev *dev __rte_unused,
 		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t index = dev->driver_id;
-	void *sess_priv = get_asym_session_private_data(sess, index);
+	void *sess_priv = sess->sess_private_data;
 
 	/* Zero out the whole structure */
 	if (sess_priv) {
 		openssl_reset_asym_session(sess_priv);
 		memset(sess_priv, 0, sizeof(struct openssl_asym_session));
-		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
-		set_asym_session_private_data(sess, index, NULL);
-		rte_mempool_put(sess_mp, sess_priv);
 	}
 }
 
diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index 09d8761c5f..f46eefd4b3 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -492,8 +492,7 @@ qat_asym_build_request(void *in_op,
 	op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
 	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 		ctx = (struct qat_asym_session *)
-			get_asym_session_private_data(
-			op->asym->session, qat_asym_driver_id);
+				op->asym->session->sess_private_data;
 		if (unlikely(ctx == NULL)) {
 			QAT_LOG(ERR, "Session has not been created for this device");
 			goto error;
@@ -711,8 +710,8 @@ qat_asym_process_response(void **op, uint8_t *resp,
 	}
 
 	if (rx_op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
-		ctx = (struct qat_asym_session *)get_asym_session_private_data(
-			rx_op->asym->session, qat_asym_driver_id);
+		ctx = (struct qat_asym_session *)
+				rx_op->asym->session->sess_private_data;
 		qat_asym_collect_response(rx_op, cookie, ctx->xform);
 	} else if (rx_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
 		qat_asym_collect_response(rx_op, cookie, rx_op->asym->xform);
@@ -726,61 +725,42 @@ qat_asym_process_response(void **op, uint8_t *resp,
 }
 
 int
-qat_asym_session_configure(struct rte_cryptodev *dev,
+qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool)
+		struct rte_cryptodev_asym_session *sess)
 {
-	int err = 0;
-	void *sess_private_data;
 	struct qat_asym_session *session;
 
-	if (rte_mempool_get(mempool, &sess_private_data)) {
-		QAT_LOG(ERR,
-			"Couldn't get object from session mempool");
-		return -ENOMEM;
-	}
-
-	session = sess_private_data;
+	session = (struct qat_asym_session *) sess->sess_private_data;
 	if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODEX) {
 		if (xform->modex.exponent.length == 0 ||
 				xform->modex.modulus.length == 0) {
 			QAT_LOG(ERR, "Invalid mod exp input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_MODINV) {
 		if (xform->modinv.modulus.length == 0) {
 			QAT_LOG(ERR, "Invalid mod inv input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type == RTE_CRYPTO_ASYM_XFORM_RSA) {
 		if (xform->rsa.n.length == 0) {
 			QAT_LOG(ERR, "Invalid rsa input parameter");
-			err = -EINVAL;
-			goto error;
+			return -EINVAL;
 		}
 	} else if (xform->xform_type >= RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
 			|| xform->xform_type <= RTE_CRYPTO_ASYM_XFORM_NONE) {
 		QAT_LOG(ERR, "Invalid asymmetric crypto xform");
-		err = -EINVAL;
-		goto error;
+		return -EINVAL;
 	} else {
 		QAT_LOG(ERR, "Asymmetric crypto xform not implemented");
-		err = -EINVAL;
-		goto error;
+		return -EINVAL;
 	}
 
 	session->xform = xform;
-	qat_asym_build_req_tmpl(sess_private_data);
-	set_asym_session_private_data(sess, dev->driver_id,
-		sess_private_data);
+	qat_asym_build_req_tmpl(session);
 
 	return 0;
-error:
-	rte_mempool_put(mempool, sess_private_data);
-	return err;
 }
 
 unsigned int qat_asym_session_get_private_size(
@@ -793,15 +773,9 @@ void
 qat_asym_session_clear(struct rte_cryptodev *dev,
 		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t index = dev->driver_id;
-	void *sess_priv = get_asym_session_private_data(sess, index);
+	void *sess_priv = sess->sess_private_data;
 	struct qat_asym_session *s = (struct qat_asym_session *)sess_priv;
 
-	if (sess_priv) {
+	if (sess_priv)
 		memset(s, 0, qat_asym_session_get_private_size(dev));
-		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
-
-		set_asym_session_private_data(sess, index, NULL);
-		rte_mempool_put(sess_mp, sess_priv);
-	}
 }
diff --git a/drivers/crypto/qat/qat_asym.h b/drivers/crypto/qat/qat_asym.h
index 308b6b2e0b..c9242a12ca 100644
--- a/drivers/crypto/qat/qat_asym.h
+++ b/drivers/crypto/qat/qat_asym.h
@@ -46,10 +46,9 @@ struct qat_asym_session {
 };
 
 int
-qat_asym_session_configure(struct rte_cryptodev *dev,
+qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_mempool *mempool);
+		struct rte_cryptodev_asym_session *sess);
 
 unsigned int
 qat_asym_session_get_private_size(struct rte_cryptodev *dev);
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index b9146f652c..142bfb7c66 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -319,7 +319,6 @@ typedef int (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
  * @param	dev		Crypto device pointer
  * @param	xform		Single or chain of crypto xforms
  * @param	session		Pointer to cryptodev's private session structure
- * @param	mp		Mempool where the private session is allocated
  *
  * @return
  *  - Returns 0 if private session structure have been created successfully.
@@ -329,8 +328,7 @@ typedef int (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
  */
 typedef int (*cryptodev_asym_configure_session_t)(struct rte_cryptodev *dev,
 		struct rte_crypto_asym_xform *xform,
-		struct rte_cryptodev_asym_session *session,
-		struct rte_mempool *mp);
+		struct rte_cryptodev_asym_session *session);
 /**
  * Free driver private session data.
  *
@@ -340,12 +338,12 @@ typedef int (*cryptodev_asym_configure_session_t)(struct rte_cryptodev *dev,
 typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		struct rte_cryptodev_sym_session *sess);
 /**
- * Free asymmetric session private data.
+ * Clear asymmetric session private data.
  *
  * @param	dev		Crypto device pointer
  * @param	sess		Cryptodev session structure
  */
-typedef void (*cryptodev_asym_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_asym_clear_session_t)(struct rte_cryptodev *dev,
 		struct rte_cryptodev_asym_session *sess);
 /**
  * Perform actual crypto processing (encrypt/digest or auth/decrypt)
@@ -429,7 +427,7 @@ struct rte_cryptodev_ops {
 	/**< Configure asymmetric Crypto session. */
 	cryptodev_sym_free_session_t sym_session_clear;
 	/**< Clear a Crypto sessions private data. */
-	cryptodev_asym_free_session_t asym_session_clear;
+	cryptodev_asym_clear_session_t asym_session_clear;
 	/**< Clear a Crypto sessions private data. */
 	union {
 		cryptodev_sym_cpu_crypto_process_t sym_cpu_process;
@@ -627,17 +625,4 @@ set_sym_session_private_data(struct rte_cryptodev_sym_session *sess,
 	sess->sess_data[driver_id].data = private_data;
 }
 
-static inline void *
-get_asym_session_private_data(const struct rte_cryptodev_asym_session *sess,
-		uint8_t driver_id) {
-	return sess->sess_private_data[driver_id];
-}
-
-static inline void
-set_asym_session_private_data(struct rte_cryptodev_asym_session *sess,
-		uint8_t driver_id, void *private_data)
-{
-	sess->sess_private_data[driver_id] = private_data;
-}
-
 #endif /* _CRYPTODEV_PMD_H_ */
diff --git a/lib/cryptodev/cryptodev_trace_points.c b/lib/cryptodev/cryptodev_trace_points.c
index 5d58951fd5..c5bfe08b79 100644
--- a/lib/cryptodev/cryptodev_trace_points.c
+++ b/lib/cryptodev/cryptodev_trace_points.c
@@ -24,6 +24,9 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_setup,
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_pool_create,
 	lib.cryptodev.sym.pool.create)
 
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_pool_create,
+	lib.cryptodev.asym.pool.create)
+
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_create,
 	lib.cryptodev.sym.create)
 
@@ -39,15 +42,9 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_free,
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_init,
 	lib.cryptodev.sym.init)
 
-RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_init,
-	lib.cryptodev.asym.init)
-
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_clear,
 	lib.cryptodev.sym.clear)
 
-RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_clear,
-	lib.cryptodev.asym.clear)
-
 RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_enqueue_burst,
 	lib.cryptodev.enq.burst)
 
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index a40536c5ea..b056d88ac2 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -195,7 +195,7 @@ const char *rte_crypto_asym_op_strings[] = {
 };
 
 /**
- * The private data structure stored in the session mempool private data.
+ * The private data structure stored in the sym session mempool private data.
  */
 struct rte_cryptodev_sym_session_pool_private_data {
 	uint16_t nb_drivers;
@@ -204,6 +204,14 @@ struct rte_cryptodev_sym_session_pool_private_data {
 	/**< session user data will be placed after sess_data */
 };
 
+/**
+ * The private data structure stored in the asym session mempool private data.
+ */
+struct rte_cryptodev_asym_session_pool_private_data {
+	uint16_t max_priv_session_sz;
+	/**< Size of private session data used when creating mempool */
+};
+
 int
 rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum,
 		const char *algo_string)
@@ -1751,47 +1759,6 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 	return 0;
 }
 
-int
-rte_cryptodev_asym_session_init(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess,
-		struct rte_crypto_asym_xform *xforms,
-		struct rte_mempool *mp)
-{
-	struct rte_cryptodev *dev;
-	uint8_t index;
-	int ret;
-
-	if (!rte_cryptodev_is_valid_dev(dev_id)) {
-		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_get_dev(dev_id);
-
-	if (sess == NULL || xforms == NULL || dev == NULL)
-		return -EINVAL;
-
-	index = dev->driver_id;
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure,
-				-ENOTSUP);
-
-	if (sess->sess_private_data[index] == NULL) {
-		ret = dev->dev_ops->asym_session_configure(dev,
-							xforms,
-							sess, mp);
-		if (ret < 0) {
-			CDEV_LOG_ERR(
-				"dev_id %d failed to configure session details",
-				dev_id);
-			return ret;
-		}
-	}
-
-	rte_cryptodev_trace_asym_session_init(dev_id, sess, xforms, mp);
-	return 0;
-}
-
 struct rte_mempool *
 rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	uint32_t elt_size, uint32_t cache_size, uint16_t user_data_size,
@@ -1834,6 +1801,53 @@ rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	return mp;
 }
 
+struct rte_mempool *
+rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
+	uint32_t cache_size, int socket_id)
+{
+	struct rte_mempool *mp;
+	struct rte_cryptodev_asym_session_pool_private_data *pool_priv;
+	uint32_t obj_sz, obj_sz_aligned;
+	uint8_t dev_id, priv_sz, max_priv_sz = 0;
+
+	for (dev_id = 0; dev_id < RTE_CRYPTO_MAX_DEVS; dev_id++)
+		if (rte_cryptodev_is_valid_dev(dev_id)) {
+			priv_sz = rte_cryptodev_asym_get_private_session_size(dev_id);
+			if (priv_sz > max_priv_sz)
+				max_priv_sz = priv_sz;
+		}
+	if (max_priv_sz == 0) {
+		CDEV_LOG_INFO("Could not set max private session size\n");
+		return NULL;
+	}
+
+	obj_sz = rte_cryptodev_asym_get_header_session_size() + max_priv_sz;
+	obj_sz_aligned =  RTE_ALIGN_CEIL(obj_sz, RTE_CACHE_LINE_SIZE);
+
+	mp = rte_mempool_create(name, nb_elts, obj_sz_aligned, cache_size,
+			(uint32_t)(sizeof(*pool_priv)),
+			NULL, NULL, NULL, NULL,
+			socket_id, 0);
+	if (mp == NULL) {
+		CDEV_LOG_ERR("%s(name=%s) failed, rte_errno=%d\n",
+			__func__, name, rte_errno);
+		return NULL;
+	}
+
+	pool_priv = rte_mempool_get_priv(mp);
+	if (!pool_priv) {
+		CDEV_LOG_ERR("%s(name=%s) failed to get private data\n",
+			__func__, name);
+		rte_mempool_free(mp);
+		return NULL;
+	}
+	pool_priv->max_priv_session_sz = max_priv_sz;
+
+	rte_cryptodev_trace_asym_session_pool_create(name, nb_elts,
+		cache_size, mp);
+	return mp;
+}
+
 static unsigned int
 rte_cryptodev_sym_session_data_size(struct rte_cryptodev_sym_session *sess)
 {
@@ -1895,19 +1909,44 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 }
 
 struct rte_cryptodev_asym_session *
-rte_cryptodev_asym_session_create(struct rte_mempool *mp)
+rte_cryptodev_asym_session_create(uint8_t dev_id,
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp)
 {
 	struct rte_cryptodev_asym_session *sess;
-	unsigned int session_size =
+	uint32_t session_priv_data_sz;
+	struct rte_cryptodev_asym_session_pool_private_data *pool_priv;
+	unsigned int session_header_size =
 			rte_cryptodev_asym_get_header_session_size();
+	struct rte_cryptodev *dev;
+	int ret;
+
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
+		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
+		return NULL;
+	}
+
+	dev = rte_cryptodev_pmd_get_dev(dev_id);
+
+	if (dev == NULL)
+		return NULL;
 
 	if (!mp) {
 		CDEV_LOG_ERR("invalid mempool\n");
 		return NULL;
 	}
 
+	session_priv_data_sz = rte_cryptodev_asym_get_private_session_size(
+			dev_id);
+	pool_priv = rte_mempool_get_priv(mp);
+
+	if (pool_priv->max_priv_session_sz < session_priv_data_sz) {
+		CDEV_LOG_DEBUG(
+			"The private session data size used when creating the mempool is smaller than this device's private session data.");
+		return NULL;
+	}
+
 	/* Verify if provided mempool can hold elements big enough. */
-	if (mp->elt_size < session_size) {
+	if (mp->elt_size < session_header_size + session_priv_data_sz) {
 		CDEV_LOG_ERR(
 			"mempool elements too small to hold session objects");
 		return NULL;
@@ -1919,12 +1958,25 @@ rte_cryptodev_asym_session_create(struct rte_mempool *mp)
 		return NULL;
 	}
 
-	/* Clear device session pointer.
-	 * Include the flag indicating presence of private data
-	 */
-	memset(sess, 0, session_size);
+	sess->driver_id = dev->driver_id;
+	sess->max_priv_data_sz = pool_priv->max_priv_session_sz;
+
+	/* Clear device session pointer.*/
+	memset(sess->sess_private_data, 0, session_priv_data_sz);
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, NULL);
 
-	rte_cryptodev_trace_asym_session_create(mp, sess);
+	if (sess->sess_private_data[0] == 0) {
+		ret = dev->dev_ops->asym_session_configure(dev, xforms, sess);
+		if (ret < 0) {
+			CDEV_LOG_ERR(
+				"dev_id %d failed to configure session details",
+				dev_id);
+			return NULL;
+		}
+	}
+
+	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp);
 	return sess;
 }
 
@@ -1959,30 +2011,6 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id,
 	return 0;
 }
 
-int
-rte_cryptodev_asym_session_clear(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess)
-{
-	struct rte_cryptodev *dev;
-
-	if (!rte_cryptodev_is_valid_dev(dev_id)) {
-		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_get_dev(dev_id);
-
-	if (dev == NULL || sess == NULL)
-		return -EINVAL;
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_clear, -ENOTSUP);
-
-	dev->dev_ops->asym_session_clear(dev, sess);
-
-	rte_cryptodev_trace_sym_session_clear(dev_id, sess);
-	return 0;
-}
-
 int
 rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
 {
@@ -2007,27 +2035,31 @@ rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
 }
 
 int
-rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess)
+rte_cryptodev_asym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess)
 {
-	uint8_t i;
-	void *sess_priv;
 	struct rte_mempool *sess_mp;
+	struct rte_cryptodev *dev;
 
-	if (sess == NULL)
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
+		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
-
-	/* Check that all device private data has been freed */
-	for (i = 0; i < nb_drivers; i++) {
-		sess_priv = get_asym_session_private_data(sess, i);
-		if (sess_priv != NULL)
-			return -EBUSY;
 	}
 
+	dev = rte_cryptodev_pmd_get_dev(dev_id);
+
+	if (dev == NULL || sess == NULL)
+		return -EINVAL;
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_clear, -ENOTSUP);
+
+	dev->dev_ops->asym_session_clear(dev, sess);
+
 	/* Return session to mempool */
 	sess_mp = rte_mempool_from_obj(sess);
 	rte_mempool_put(sess_mp, sess);
 
-	rte_cryptodev_trace_asym_session_free(sess);
+	rte_cryptodev_trace_asym_session_free(dev_id, sess);
 	return 0;
 }
 
@@ -2061,12 +2093,7 @@ rte_cryptodev_sym_get_existing_header_session_size(
 unsigned int
 rte_cryptodev_asym_get_header_session_size(void)
 {
-	/*
-	 * Header contains pointers to the private data
-	 * of all registered drivers, and a flag which
-	 * indicates presence of private data
-	 */
-	return ((sizeof(void *) * nb_drivers) + sizeof(uint8_t));
+	return sizeof(struct rte_cryptodev_asym_session);
 }
 
 unsigned int
@@ -2092,7 +2119,6 @@ unsigned int
 rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
-	unsigned int header_size = sizeof(void *) * nb_drivers;
 	unsigned int priv_sess_size;
 
 	if (!rte_cryptodev_is_valid_dev(dev_id))
@@ -2104,11 +2130,8 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 		return 0;
 
 	priv_sess_size = (*dev->dev_ops->asym_session_get_size)(dev);
-	if (priv_sess_size < header_size)
-		return header_size;
 
 	return priv_sess_size;
-
 }
 
 int
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 59ea5a54df..90e764017d 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -919,9 +919,13 @@ struct rte_cryptodev_sym_session {
 };
 
 /** Cryptodev asymmetric crypto session */
-struct rte_cryptodev_asym_session {
-	__extension__ void *sess_private_data[0];
-	/**< Private asymmetric session material */
+RTE_STD_C11 struct rte_cryptodev_asym_session {
+	uint8_t driver_id;
+	/**< Session driver ID. */
+	uint16_t max_priv_data_sz;
+	/**< Size of private data used when creating mempool */
+	uint8_t padding[5];
+	uint8_t sess_private_data[0];
 };
 
 /**
@@ -956,6 +960,29 @@ rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 	uint32_t elt_size, uint32_t cache_size, uint16_t priv_size,
 	int socket_id);
 
+/**
+ * Create an asymmetric session mempool.
+ *
+ * @param name
+ *   The unique mempool name.
+ * @param nb_elts
+ *   The number of elements in the mempool.
+ * @param cache_size
+ *   The number of per-lcore cache elements
+ * @param socket_id
+ *   The *socket_id* argument is the socket identifier in the case of
+ *   NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA
+ *   constraint for the reserved zone.
+ *
+ * @return
+ *  - On success return mempool
+ *  - On failure returns NULL
+ */
+__rte_experimental
+struct rte_mempool *
+rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
+	uint32_t cache_size, int socket_id);
+
 /**
  * Create symmetric crypto session header (generic with no private data)
  *
@@ -969,17 +996,22 @@ struct rte_cryptodev_sym_session *
 rte_cryptodev_sym_session_create(struct rte_mempool *mempool);
 
 /**
- * Create asymmetric crypto session header (generic with no private data)
+ * Create and initialise an asymmetric crypto session structure.
+ * Calls the PMD to configure the private session data.
  *
- * @param   mempool    mempool to allocate asymmetric session
- *                     objects from
+ * @param   dev_id   ID of device that we want the session to be used on
+ * @param   xforms   Asymmetric crypto transform operations to apply on flow
+ *                   processed with this session
+ * @param   mp       mempool to allocate asymmetric session
+ *                   objects from
  * @return
  *  - On success return pointer to asym-session
  *  - On failure returns NULL
  */
 __rte_experimental
 struct rte_cryptodev_asym_session *
-rte_cryptodev_asym_session_create(struct rte_mempool *mempool);
+rte_cryptodev_asym_session_create(uint8_t dev_id,
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp);
 
 /**
  * Frees symmetric crypto session header, after checking that all
@@ -997,20 +1029,20 @@ int
 rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess);
 
 /**
- * Frees asymmetric crypto session header, after checking that all
- * the device private data has been freed, returning it
- * to its original mempool.
+ * Clears and frees asymmetric crypto session header and private data,
+ * returning it to its original mempool.
  *
+ * @param   dev_id   ID of device that uses the asymmetric session.
  * @param   sess     Session header to be freed.
  *
  * @return
  *  - 0 if successful.
- *  - -EINVAL if session is NULL.
- *  - -EBUSY if not all device private data has been freed.
+ *  - -EINVAL if device is invalid or session is NULL.
  */
 __rte_experimental
 int
-rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess);
+rte_cryptodev_asym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess);
 
 /**
  * Fill out private data for the device id, based on its device type.
@@ -1034,28 +1066,6 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 			struct rte_crypto_sym_xform *xforms,
 			struct rte_mempool *mempool);
 
-/**
- * Initialize asymmetric session on a device with specific asymmetric xform
- *
- * @param   dev_id   ID of device that we want the session to be used on
- * @param   sess     Session to be set up on a device
- * @param   xforms   Asymmetric crypto transform operations to apply on flow
- *                   processed with this session
- * @param   mempool  Mempool to be used for internal allocation.
- *
- * @return
- *  - On success, zero.
- *  - -EINVAL if input parameters are invalid.
- *  - -ENOTSUP if crypto device does not support the crypto transform.
- *  - -ENOMEM if the private session could not be allocated.
- */
-__rte_experimental
-int
-rte_cryptodev_asym_session_init(uint8_t dev_id,
-			struct rte_cryptodev_asym_session *sess,
-			struct rte_crypto_asym_xform *xforms,
-			struct rte_mempool *mempool);
-
 /**
  * Frees private data for the device id, based on its device type,
  * returning it to its mempool. It is the application's responsibility
@@ -1074,21 +1084,6 @@ int
 rte_cryptodev_sym_session_clear(uint8_t dev_id,
 			struct rte_cryptodev_sym_session *sess);
 
-/**
- * Frees resources held by asymmetric session during rte_cryptodev_session_init
- *
- * @param   dev_id   ID of device that uses the asymmetric session.
- * @param   sess     Asymmetric session setup on device using
- *					 rte_cryptodev_session_init
- * @return
- *  - 0 if successful.
- *  - -EINVAL if device is invalid or session is NULL.
- */
-__rte_experimental
-int
-rte_cryptodev_asym_session_clear(uint8_t dev_id,
-			struct rte_cryptodev_asym_session *sess);
-
 /**
  * Get the size of the header session, for all registered drivers excluding
  * the user data size.
@@ -1116,7 +1111,7 @@ rte_cryptodev_sym_get_existing_header_session_size(
 		struct rte_cryptodev_sym_session *sess);
 
 /**
- * Get the size of the asymmetric session header, for all registered drivers.
+ * Get the size of the asymmetric session header.
  *
  * @return
  *   Size of the asymmetric header session.
diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
index d1f4f069a3..a4fa9e8c7e 100644
--- a/lib/cryptodev/rte_cryptodev_trace.h
+++ b/lib/cryptodev/rte_cryptodev_trace.h
@@ -83,12 +83,22 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_u16(sess->user_data_sz);
 )
 
+RTE_TRACE_POINT(
+	rte_cryptodev_trace_asym_session_pool_create,
+	RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts,
+		uint32_t cache_size, void *mempool),
+	rte_trace_point_emit_string(name);
+	rte_trace_point_emit_u32(nb_elts);
+	rte_trace_point_emit_u32(cache_size);
+	rte_trace_point_emit_ptr(mempool);
+)
+
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_create,
-	RTE_TRACE_POINT_ARGS(void *mempool,
-		struct rte_cryptodev_asym_session *sess),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms, void *mempool),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_ptr(xforms);
 	rte_trace_point_emit_ptr(mempool);
-	rte_trace_point_emit_ptr(sess);
 )
 
 RTE_TRACE_POINT(
@@ -99,7 +109,9 @@ RTE_TRACE_POINT(
 
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_free,
-	RTE_TRACE_POINT_ARGS(struct rte_cryptodev_asym_session *sess),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+		struct rte_cryptodev_asym_session *sess),
+	rte_trace_point_emit_u8(dev_id);
 	rte_trace_point_emit_ptr(sess);
 )
 
@@ -117,17 +129,6 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_ptr(mempool);
 )
 
-RTE_TRACE_POINT(
-	rte_cryptodev_trace_asym_session_init,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id,
-		struct rte_cryptodev_asym_session *sess, void *xforms,
-		void *mempool),
-	rte_trace_point_emit_u8(dev_id);
-	rte_trace_point_emit_ptr(sess);
-	rte_trace_point_emit_ptr(xforms);
-	rte_trace_point_emit_ptr(mempool);
-)
-
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_sym_session_clear,
 	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
@@ -135,13 +136,6 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_ptr(sess);
 )
 
-RTE_TRACE_POINT(
-	rte_cryptodev_trace_asym_session_clear,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
-	rte_trace_point_emit_u8(dev_id);
-	rte_trace_point_emit_ptr(sess);
-)
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index c50745fa8c..44d1aff0e2 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -55,10 +55,8 @@ EXPERIMENTAL {
 	rte_cryptodev_asym_get_header_session_size;
 	rte_cryptodev_asym_get_private_session_size;
 	rte_cryptodev_asym_get_xform_enum;
-	rte_cryptodev_asym_session_clear;
 	rte_cryptodev_asym_session_create;
 	rte_cryptodev_asym_session_free;
-	rte_cryptodev_asym_session_init;
 	rte_cryptodev_asym_xform_capability_check_modlen;
 	rte_cryptodev_asym_xform_capability_check_optype;
 	rte_cryptodev_sym_cpu_crypto_process;
@@ -81,9 +79,7 @@ EXPERIMENTAL {
 	__rte_cryptodev_trace_sym_session_free;
 	__rte_cryptodev_trace_asym_session_free;
 	__rte_cryptodev_trace_sym_session_init;
-	__rte_cryptodev_trace_asym_session_init;
 	__rte_cryptodev_trace_sym_session_clear;
-	__rte_cryptodev_trace_asym_session_clear;
 	__rte_cryptodev_trace_dequeue_burst;
 	__rte_cryptodev_trace_enqueue_burst;
 
@@ -104,6 +100,9 @@ EXPERIMENTAL {
 	rte_cryptodev_remove_deq_callback;
 	rte_cryptodev_remove_enq_callback;
 
+	# added 22.03
+	rte_cryptodev_asym_session_pool_create;
+	__rte_cryptodev_trace_asym_session_pool_create;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 1%]

* [PATCH v7 5/5] crypto: modify return value for asym session create
    2022-02-11  9:29  1%   ` [PATCH v7 2/5] crypto: use single buffer for asymmetric session Ciara Power
@ 2022-02-11  9:29  2%   ` Ciara Power
  1 sibling, 0 replies; 200+ results
From: Ciara Power @ 2022-02-11  9:29 UTC (permalink / raw)
  To: dev; +Cc: roy.fan.zhang, gakhil, anoobj, mdr, Ciara Power, Declan Doherty

Rather than the asym session create function returning a session on
success, and a NULL value on error, it is modified to now return int
values - 0 on success or -EINVAL/-ENOTSUP/-ENOMEM on failure.
The session to be used is passed as input.

This adds clarity on the failure of the create function, which enables
treating the -ENOTSUP return as TEST_SKIPPED in test apps.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

---
v5: Added session parameter to create session trace.
v4:
  - Reordered function parameters.
  - Removed docs code additions, these are included due to patch 1
    changing sample doc to use literal includes.
v3:
  - Fixed variable declarations, putting initialised variable last.
  - Made function comment for return value more generic.
  - Fixed log to include line break.
  - Added documentation.
---
 app/test-crypto-perf/cperf_ops.c       |  12 ++-
 app/test/test_cryptodev_asym.c         | 109 +++++++++++++------------
 doc/guides/rel_notes/release_22_03.rst |   3 +-
 lib/cryptodev/rte_cryptodev.c          |  28 ++++---
 lib/cryptodev/rte_cryptodev.h          |  13 ++-
 lib/cryptodev/rte_cryptodev_trace.h    |   4 +-
 6 files changed, 92 insertions(+), 77 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index b8f590b397..479c40eead 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -734,7 +734,9 @@ cperf_create_session(struct rte_mempool *sess_mp,
 	struct rte_crypto_sym_xform auth_xform;
 	struct rte_crypto_sym_xform aead_xform;
 	struct rte_cryptodev_sym_session *sess = NULL;
+	void *asym_sess = NULL;
 	struct rte_crypto_asym_xform xform = {0};
+	int ret;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
 		xform.next = NULL;
@@ -744,11 +746,13 @@ cperf_create_session(struct rte_mempool *sess_mp,
 		xform.modex.exponent.data = perf_mod_e;
 		xform.modex.exponent.length = sizeof(perf_mod_e);
 
-		sess = (void *)rte_cryptodev_asym_session_create(dev_id, &xform, sess_mp);
-		if (sess == NULL)
+		ret = rte_cryptodev_asym_session_create(dev_id, &xform,
+				sess_mp, &asym_sess);
+		if (ret < 0) {
+			RTE_LOG(ERR, USER1, "Asym session create failed\n");
 			return NULL;
-
-		return sess;
+		}
+		return asym_sess;
 	}
 #ifdef RTE_LIB_SECURITY
 	/*
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index f0cb839a49..c2e1b4dafd 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -317,7 +317,7 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	uint8_t input[TEST_DATA_SIZE] = {0};
 	uint8_t *result = NULL;
 
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	xform_tc.next = NULL;
 	xform_tc.xform_type = data_tc->modex.xform_type;
@@ -452,14 +452,14 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (!sessionless) {
-		sess = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
-				ts_params->session_mpool);
-		if (!sess) {
+		ret = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
+				ts_params->session_mpool, &sess);
+		if (ret < 0) {
 			snprintf(test_msg, ASYM_TEST_MSG_LEN,
 					"line %u "
 					"FAILED: %s", __LINE__,
 					"Session creation failed");
-			status = TEST_FAILED;
+			status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 			goto error_exit;
 		}
 
@@ -646,7 +646,7 @@ test_rsa_sign_verify(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with exponent key only,
 	 * Check in PMD feature flag for RSA exponent key type support.
@@ -659,12 +659,12 @@ test_rsa_sign_verify(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -686,7 +686,7 @@ test_rsa_enc_dec(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with exponent key only,
 	 * Check in PMD feature flag for RSA exponent key type support.
@@ -699,11 +699,11 @@ test_rsa_enc_dec(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for enc_dec\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -726,7 +726,7 @@ test_rsa_sign_verify_crt(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with quintuple format key only,
 	 * Check im PMD feature flag for RSA quintuple key type support.
@@ -738,12 +738,12 @@ test_rsa_sign_verify_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"sign_verify_crt\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -766,7 +766,7 @@ test_rsa_enc_dec_crt(void)
 	uint8_t dev_id = ts_params->valid_devs[0];
 	void *sess = NULL;
 	struct rte_cryptodev_info dev_info;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 
 	/* Test case supports op with quintuple format key only,
 	 * Check in PMD feature flag for RSA quintuple key type support.
@@ -778,12 +778,12 @@ test_rsa_enc_dec_crt(void)
 		return TEST_SKIPPED;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool);
+	ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
 
-	if (!sess) {
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Session creation failed for "
 			"enc_dec_crt\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1047,7 +1047,7 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 	uint8_t peer[] = "01234567890123456789012345678901234567890123456789";
@@ -1074,12 +1074,12 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.shared_secret.data = output;
 	asym_op->dh.shared_secret.length = sizeof(output);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1130,7 +1130,7 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
@@ -1152,12 +1152,12 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = output;
 	asym_op->dh.priv_key.length = sizeof(output);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1211,7 +1211,7 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t output[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform xform = *xfrm;
 
@@ -1241,12 +1241,12 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 					0);
 	asym_op->dh.priv_key = dh_test_params.priv_key;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1300,7 +1300,7 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	struct rte_crypto_asym_op *asym_op = NULL;
 	struct rte_crypto_op *op = NULL, *result_op = NULL;
 	void *sess = NULL;
-	int status = TEST_SUCCESS;
+	int ret, status = TEST_SUCCESS;
 	uint8_t out_pub_key[TEST_DH_MOD_LEN];
 	uint8_t out_prv_key[TEST_DH_MOD_LEN];
 	struct rte_crypto_asym_xform pub_key_xform;
@@ -1330,12 +1330,12 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 	asym_op->dh.priv_key.data = out_prv_key;
 	asym_op->dh.priv_key.length = sizeof(out_prv_key);
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1419,12 +1419,12 @@ test_mod_inv(void)
 				return TEST_SKIPPED;
 		}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool);
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &modinv_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1543,13 +1543,13 @@ test_mod_exp(void)
 		goto error_exit;
 	}
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool);
-	if (!sess) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &modex_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				 "line %u "
 				"FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 
@@ -1653,13 +1653,14 @@ test_dsa_sign(void)
 	uint8_t r[TEST_DH_MOD_LEN];
 	uint8_t s[TEST_DH_MOD_LEN];
 	uint8_t dgst[] = "35d81554afaad2cf18f3a1770d5fedc4ea5be344";
+	int ret;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &dsa_xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				 "line %u FAILED: %s", __LINE__,
 				"Session creation failed");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto error_exit;
 	}
 	/* set up crypto op data structure */
@@ -1788,7 +1789,7 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	struct rte_crypto_asym_op *asym_op;
 	struct rte_cryptodev_info dev_info;
 	struct rte_crypto_op *op = NULL;
-	int status = TEST_SUCCESS, ret;
+	int ret, status = TEST_SUCCESS;
 
 	switch (curve_id) {
 	case SECP192R1:
@@ -1833,12 +1834,12 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA;
 	xform.ec.curve_id = input_params.curve;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto exit;
 	}
 
@@ -1990,7 +1991,7 @@ test_ecpm(enum curve curve_id)
 	struct rte_crypto_asym_op *asym_op;
 	struct rte_cryptodev_info dev_info;
 	struct rte_crypto_op *op = NULL;
-	int status = TEST_SUCCESS, ret;
+	int ret, status = TEST_SUCCESS;
 
 	switch (curve_id) {
 	case SECP192R1:
@@ -2035,12 +2036,12 @@ test_ecpm(enum curve curve_id)
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM;
 	xform.ec.curve_id = input_params.curve;
 
-	sess = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool);
-	if (sess == NULL) {
+	ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
 				"Session creation failed\n");
-		status = TEST_FAILED;
+		status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
 		goto exit;
 	}
 
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index a930cbbad6..640691c3ef 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -123,7 +123,8 @@ API Changes
   The session structure was moved to ``cryptodev_pmd.h``,
   hiding it from applications.
   The API ``rte_cryptodev_asym_session_init`` was removed as the initialization
-  is now moved to ``rte_cryptodev_asym_session_create``.
+  is now moved to ``rte_cryptodev_asym_session_create``, which was updated to
+  return an integer value to indicate initialisation errors.
 
 
 ABI Changes
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 91d48d5886..727d271fb9 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1912,9 +1912,10 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 	return sess;
 }
 
-void *
+int
 rte_cryptodev_asym_session_create(uint8_t dev_id,
-		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp)
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
+		void **session)
 {
 	struct rte_cryptodev_asym_session *sess;
 	uint32_t session_priv_data_sz;
@@ -1926,17 +1927,17 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 
 	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
-		return NULL;
+		return -EINVAL;
 	}
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
 
 	if (dev == NULL)
-		return NULL;
+		return -EINVAL;
 
 	if (!mp) {
 		CDEV_LOG_ERR("invalid mempool\n");
-		return NULL;
+		return -EINVAL;
 	}
 
 	session_priv_data_sz = rte_cryptodev_asym_get_private_session_size(
@@ -1946,22 +1947,23 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 	if (pool_priv->max_priv_session_sz < session_priv_data_sz) {
 		CDEV_LOG_DEBUG(
 			"The private session data size used when creating the mempool is smaller than this device's private session data.");
-		return NULL;
+		return -EINVAL;
 	}
 
 	/* Verify if provided mempool can hold elements big enough. */
 	if (mp->elt_size < session_header_size + session_priv_data_sz) {
 		CDEV_LOG_ERR(
 			"mempool elements too small to hold session objects");
-		return NULL;
+		return -EINVAL;
 	}
 
 	/* Allocate a session structure from the session pool */
-	if (rte_mempool_get(mp, (void **)&sess)) {
+	if (rte_mempool_get(mp, session)) {
 		CDEV_LOG_ERR("couldn't get object from session mempool");
-		return NULL;
+		return -ENOMEM;
 	}
 
+	sess = *session;
 	sess->driver_id = dev->driver_id;
 	sess->user_data_sz = pool_priv->user_data_sz;
 	sess->max_priv_data_sz = pool_priv->max_priv_session_sz;
@@ -1969,7 +1971,7 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 	/* Clear device session pointer.*/
 	memset(sess->sess_private_data, 0, session_priv_data_sz + sess->user_data_sz);
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, NULL);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, -ENOTSUP);
 
 	if (sess->sess_private_data[0] == 0) {
 		ret = dev->dev_ops->asym_session_configure(dev, xforms, sess);
@@ -1977,12 +1979,12 @@ rte_cryptodev_asym_session_create(uint8_t dev_id,
 			CDEV_LOG_ERR(
 				"dev_id %d failed to configure session details",
 				dev_id);
-			return NULL;
+			return ret;
 		}
 	}
 
-	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp);
-	return sess;
+	rte_cryptodev_trace_asym_session_create(dev_id, xforms, mp, sess);
+	return 0;
 }
 
 int
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 1d7bd07680..19e2e70287 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -996,14 +996,19 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mempool);
  *                   processed with this session
  * @param   mp       mempool to allocate asymmetric session
  *                   objects from
+ * @param   session  void ** for session to be used
+ *
  * @return
- *  - On success return pointer to asym-session
- *  - On failure returns NULL
+ *  - 0 on success.
+ *  - -EINVAL on invalid arguments.
+ *  - -ENOMEM on memory error for session allocation.
+ *  - -ENOTSUP if device doesn't support session configuration.
  */
 __rte_experimental
-void *
+int
 rte_cryptodev_asym_session_create(uint8_t dev_id,
-		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp);
+		struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
+		void **session);
 
 /**
  * Frees symmetric crypto session header, after checking that all
diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
index 005a4fe38b..a3f6048e7d 100644
--- a/lib/cryptodev/rte_cryptodev_trace.h
+++ b/lib/cryptodev/rte_cryptodev_trace.h
@@ -96,10 +96,12 @@ RTE_TRACE_POINT(
 
 RTE_TRACE_POINT(
 	rte_cryptodev_trace_asym_session_create,
-	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms, void *mempool),
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms, void *mempool,
+			void *sess),
 	rte_trace_point_emit_u8(dev_id);
 	rte_trace_point_emit_ptr(xforms);
 	rte_trace_point_emit_ptr(mempool);
+	rte_trace_point_emit_ptr(sess);
 )
 
 RTE_TRACE_POINT(
-- 
2.25.1


^ permalink raw reply	[relevance 2%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-10 22:16  3%         ` Thomas Monjalon
@ 2022-02-11 10:09  5%           ` Ray Kinsella
  2022-02-14 10:16  4%             ` Ray Kinsella
  0 siblings, 1 reply; 200+ results
From: Ray Kinsella @ 2022-02-11 10:09 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ferruh Yigit, Kalesh A P, dev, ajit.khaparde, asafp,
	David Marchand, Andrew Rybchenko


Thomas Monjalon <thomas@monjalon.net> writes:

> 02/02/2022 12:44, Ray Kinsella:
>> Ferruh Yigit <ferruh.yigit@intel.com> writes:
>> > On 1/28/2022 12:48 PM, Kalesh A P wrote:
>> >> --- a/lib/ethdev/rte_ethdev.h
>> >> +++ b/lib/ethdev/rte_ethdev.h
>> >> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type {
>> >>   	RTE_ETH_EVENT_DESTROY,  /**< port is released */
>> >>   	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
>> >>   	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
>> >> +	RTE_ETH_EVENT_ERR_RECOVERING,
>> >> +			/**< port recovering from an error
>> >> +			 *
>> >> +			 * PMD detected a FW reset or error condition.
>> >> +			 * PMD will try to recover from the error.
>> >> +			 * Data path may be quiesced and Control path operations
>> >> +			 * may fail at this time.
>> >> +			 */
>> >> +	RTE_ETH_EVENT_RECOVERED,
>> >> +			/**< port recovered from an error
>> >> +			 *
>> >> +			 * PMD has recovered from the error condition.
>> >> +			 * Control path and Data path are up now.
>> >> +			 * PMD re-configures the port to the state prior to the error.
>> >> +			 * Since the device has undergone a reset, flow rules
>> >> +			 * offloaded prior to reset may be lost and
>> >> +			 * the application should recreate the rules again.
>> >> +			 */
>> >>   	RTE_ETH_EVENT_MAX       /**< max value of this enum */
>> >
>> >
>> > Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people
>> > to evaluate if it is a false positive:
>> >
>> >
>> > 1 function with some indirect sub-type change:
>> >   [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes:
>> >     parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes:
>> >       underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed:
>> >         in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)':
>> >           parameter 2 of type 'enum rte_eth_event_type' has sub-type changes:
>> >             type size hasn't changed
>> >             2 enumerator insertions:
>> >               'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11'
>> >               'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12'
>> >             1 enumerator change:
>> >               'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1
>> 
>> I don't immediately see the problem that this would cause.
>> There are no array sizes etc dependent on the value of MAX for instance.
>> 
>> Looks safe?
>
> We never know how this enum will be used by the application.
> The max value may be used for the size of an event array.
> It looks a real ABI issue unfortunately.

Right - but we only really care about it when an array size based on MAX
is likely to be passed to DPDK, which doesn't apply in this case.

I noted that some Linux folks explicitly mark similar MAX values as not
part of the ABI.

/usr/include/linux/perf_event.h
37:     PERF_TYPE_MAX,                          /* non-ABI */
60:     PERF_COUNT_HW_MAX,                      /* non-ABI */
79:     PERF_COUNT_HW_CACHE_MAX,                /* non-ABI */
87:     PERF_COUNT_HW_CACHE_OP_MAX,             /* non-ABI */
94:     PERF_COUNT_HW_CACHE_RESULT_MAX,         /* non-ABI */
116:    PERF_COUNT_SW_MAX,                      /* non-ABI */
149:    PERF_SAMPLE_MAX = 1U << 24,             /* non-ABI */
151:    __PERF_SAMPLE_CALLCHAIN_EARLY           = 1ULL << 63, /*
non-ABI; internal use */
189:    PERF_SAMPLE_BRANCH_MAX_SHIFT            /* non-ABI */
267:    PERF_TXN_MAX            = (1 << 8), /* non-ABI */
301:    PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
1067:   PERF_RECORD_MAX,                        /* non-ABI */
1078:   PERF_RECORD_KSYMBOL_TYPE_MAX            /* non-ABI */
1087:   PERF_BPF_EVENT_MAX,             /* non-ABI */

>
> PS: I am not Cc'ed in this patchset,
> so copying what I said on v6 (more than a year ago):
> Please use the option --cc-cmd devtools/get-maintainer.sh


-- 
Regards, Ray K

^ permalink raw reply	[relevance 5%]

* Re: [EXT] [PATCH v2 4/4] crypto: reorganize endianness comments, add crypto uint
  2022-02-10 21:08  4%       ` Akhil Goyal
@ 2022-02-11 10:54  0%         ` Ray Kinsella
  0 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2022-02-11 10:54 UTC (permalink / raw)
  To: Akhil Goyal
  Cc: Zhang, Roy Fan, Kusztal, ArkadiuszX, David Marchand,
	ray.kinsella, Ramkumar Balu, dev

Hi Akhil,


Akhil Goyal <gakhil@marvell.com> writes:

> Hi Fan,
>> Hi Akhil,
>> 
>> I assume everything in asym crypto is under experimental tag at the moment
>> right?
>> The goal is to have them updated and fixed before DPDK 22.11 so the
>> experimental tag can be removed.
>> 
> Asymmetric crypto APIs are marked as experimental, but the structures are not
> explicitly marked experimental.
> rte_crypto_asym_op is part of  union in rte_crypto_op which is definitely not experimental.
> So a change in asym_op will result in ABI issues in rte_crypto_op.
>
> David/Ray: Can you review the patch 1/4 of this series from ABI compatibility  point of view.
> http://patches.dpdk.org/project/dpdk/patch/20220207113555.8431-2-arkadiuszx.kusztal@intel.com/
> IMO, as per current experimental tags, we cannot change parameters inside rte_crypto_asym_op
> and subsequently in struct rte_crypto_dsa_op_param. What do you suggest?
> However, I remember, some exception was added to ignore ABI issues related to asymmetric
> crypto. Could you please check why that exception is not working in this case?
>
> Regards,
> Akhil

So rte_crypto_asym_op is at the end of the rte_crypto_op struct, so any
changes there are safe.

http://mails.dpdk.org/archives/test-report/2022-February/257617.html

The warning above is complaining about changes to rte_crypto_asym_op.
IMHO it is safe to condone these warnings in the libabigail.ignore.

libabigail.ignore exceptions was reset at the 21.11 release, although I
took a look and don't see anything related to asymmetric crypto prior to
that.

-- 
Regards, Ray K

^ permalink raw reply	[relevance 0%]

* [PATCH v5 2/2] buildtools/chkincs: test headers for C++ compatibility
  @ 2022-02-11 11:36 11%   ` Bruce Richardson
  0 siblings, 0 replies; 200+ results
From: Bruce Richardson @ 2022-02-11 11:36 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Aaron Conole, Michael Santana

Add support for checking each of our headers for issues when included in
a C++ file.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 .ci/linux-build.sh             |  1 +
 .github/workflows/build.yml    |  2 +-
 buildtools/chkincs/main.cpp    |  4 ++++
 buildtools/chkincs/meson.build | 18 ++++++++++++++++++
 devtools/test-meson-builds.sh  |  3 ++-
 5 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100644 buildtools/chkincs/main.cpp

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index c10c1a8ab5..67d68535e0 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -74,6 +74,7 @@ fi
 
 if [ "$BUILD_32BIT" = "true" ]; then
     OPTS="$OPTS -Dc_args=-m32 -Dc_link_args=-m32"
+    OPTS="$OPTS -Dcpp_args=-m32 -Dcpp_link_args=-m32"
     export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig"
 fi
 
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6cf997d6ee..d30cfd08d7 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -116,7 +116,7 @@ jobs:
           libdw-dev
     - name: Install i386 cross compiling packages
       if: env.BUILD_32BIT == 'true'
-      run: sudo apt install -y gcc-multilib
+      run: sudo apt install -y gcc-multilib g++-multilib
     - name: Install aarch64 cross compiling packages
       if: env.AARCH64 == 'true'
       run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
diff --git a/buildtools/chkincs/main.cpp b/buildtools/chkincs/main.cpp
new file mode 100644
index 0000000000..d25bb8852a
--- /dev/null
+++ b/buildtools/chkincs/main.cpp
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2021 Intel Corporation
+ */
+int main(void) { return 0; }
diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build
index 7ea136ff95..790f700619 100644
--- a/buildtools/chkincs/meson.build
+++ b/buildtools/chkincs/meson.build
@@ -27,3 +27,21 @@ executable('chkincs', sources,
         include_directories: includes,
         dependencies: deps,
         install: false)
+
+# run tests for c++ builds also
+if not add_languages('cpp', required: false)
+    subdir_done()
+endif
+
+gen_cpp_files = generator(gen_c_file_for_header,
+        output: '@BASENAME@.cpp',
+        arguments: ['@INPUT@', '@OUTPUT@'])
+
+cpp_sources = files('main.cpp')
+cpp_sources += gen_cpp_files.process(dpdk_chkinc_headers)
+
+executable('chkincs-cpp', cpp_sources,
+        cpp_args: ['-include', 'rte_config.h', cflags],
+        include_directories: includes,
+        dependencies: deps,
+        install: false)
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 4ed61328b9..c07fd16fdc 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -246,7 +246,8 @@ if check_cc_flags '-m32' ; then
 		export PKG_CONFIG_LIBDIR='/usr/lib/pkgconfig'
 	fi
 	target_override='i386-pc-linux-gnu'
-	build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32'
+	build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32' \
+			-Dcpp_args='-m32' -Dcpp_link_args='-m32'
 	target_override=
 	unset PKG_CONFIG_LIBDIR
 fi
-- 
2.32.0


^ permalink raw reply	[relevance 11%]

* RE: [EXT] [PATCH] crypto: fix misspelled key in qt format
  @ 2022-02-12 11:34  3% ` Akhil Goyal
  2022-02-18  6:11  0%   ` Kusztal, ArkadiuszX
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2022-02-12 11:34 UTC (permalink / raw)
  To: Arek Kusztal, dev; +Cc: roy.fan.zhang

> This patch fixes misspelled RTE_RSA_KEY_TYPE_QT,
> this will prevent checkpach from complaining wherever
> change to RSA is being made.
> 
> Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op definitions")
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
Fix ABI warning.
Add libabigail.abiignore rule.

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v5] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if.
  2022-01-31  0:05  8%       ` [PATCH v5] " Michael Barker
@ 2022-02-12 14:00  0%         ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-02-12 14:00 UTC (permalink / raw)
  To: Michael Barker; +Cc: dev, Ray Kinsella

31/01/2022 01:05, Michael Barker:
> When compiling with clang using -Wpedantic (or -Wgcc-compat) the use of
> diagnose_if kicks up a warning:
> 
> .../include/rte_interrupts.h:623:1: error: 'diagnose_if' is a clang
> extension [-Werror,-Wgcc-compat]
> __rte_internal
> ^
> .../include/rte_compat.h:36:16: note: expanded from macro '__rte_internal'
> __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
> 
> This change ignores the '-Wgcc-compat' warning in the specific location
> where the warning occurs.  It is safe to do in this circumstance as the
> specific macro is only defined when using the clang compiler.
> 
> Signed-off-by: Michael Barker <mikeb01@gmail.com>

Applied with following title, thanks:
	eal: ignore gcc-compat warning in clang-only macro




^ permalink raw reply	[relevance 0%]

* Re: [PATCH v6 00/26] Net/SPNIC: support SPNIC into DPDK 22.03
  2022-01-21 10:22  0%     ` Ferruh Yigit
  2022-01-24  5:12  0%       ` Hemant Agrawal
@ 2022-02-12 14:01  0%       ` Yanling Song
  1 sibling, 0 replies; 200+ results
From: Yanling Song @ 2022-02-12 14:01 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: dev, yanling.song, yanggan, xuyun, stephen, lihuisong,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Hemant Agrawal

On Fri, 21 Jan 2022 10:22:10 +0000
Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 1/21/2022 9:27 AM, Yanling Song wrote:
> > On Wed, 19 Jan 2022 16:56:52 +0000
> > Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> >   
> >> On 12/30/2021 6:08 AM, Yanling Song wrote:  
> >>> The patchsets introduce SPNIC driver for Ramaxel's SPNxx serial
> >>> NIC cards into DPDK 22.03. Ramaxel Memory Technology is a company
> >>> which supply a lot of electric products: storage, communication,
> >>> PCB... SPNxxx is a serial PCIE interface NIC cards:
> >>> SPN110: 2 PORTs *25G
> >>> SPN120: 4 PORTs *25G
> >>> SPN130: 2 PORTs *100G
> >>>      
> >>
> >> Hi Yanling,
> >>
> >> As far as I can see hnic (from Huawei) and this spnic drivers are
> >> alike, what is the relation between these two?
> >>  
> > It is hard to create a brand new driver from scratch, so we
> > referenced to hinic driver when developing spnic.
> >   
> 
> That is OK, but based on the familiarity of the code you may consider
> keeping the original code Copyright, I didn't investigate in
> that level but cc'ed hinic maintainers for info.
> Also cc'ed Hemant for guidance.
> 
> 
Sorry for late reponse since it was Spring Festival and I was in
vacation, just back to work.

Hemant gave the guidance already, but we do not want to keep another
company's copyright in our code. How should we modify code so that the
code meet DPDK's requirment and can be accepted with our copyright
only? 


> But my question was more related to the HW, is there any relation
> between the hinic HW and spnic HW? Like one is derived from other
> etc...

I'm not clear what's the relation between hinic/spnic hw since we do
not know what's the hinic hw.

> 
> >>> The following is main features of our SPNIC:
> >>> - TSO
> >>> - LRO
> >>> - Flow control
> >>> - SR-IOV(Partially supported)
> >>> - VLAN offload
> >>> - VLAN filter
> >>> - CRC offload
> >>> - Promiscuous mode
> >>> - RSS
> >>>
> >>> v6->v5, No real changes:
> >>> 1. Move the fix of RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS from patch 26
> >>> to patch 2; 2. Change the description of patch 26.
> >>>
> >>> v5->v4:
> >>> 1. Add prefix "spinc_" for external functions;
> >>> 2. Remove temporary MACRO: RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS
> >>> 3. Do not use void* for keeping the type information
> >>>
> >>> v3->v4:
> >>> 1. Fix ABI test failure;
> >>> 2. Remove some descriptions in spnic.rst.
> >>>
> >>> v2->v3:
> >>> 1. Fix clang compiling failure.
> >>>
> >>> v1->v2:
> >>> 1. Fix coding style issues and compiling failures;
> >>> 2. Only support linux in meson.build;
> >>> 3. Use CLOCK_MONOTONIC_COARSE instead of
> >>> CLOCK_MONOTONIC/CLOCK_MONOTONIC_RAW; 4. Fix time_before();
> >>> 5. Remove redundant checks in spnic_dev_configure();
> >>>
> >>> Yanling Song (26):
> >>>     drivers/net: introduce a new PMD driver
> >>>     net/spnic: initialize the HW interface
> >>>     net/spnic: add mbox message channel
> >>>     net/spnic: introduce event queue
> >>>     net/spnic: add mgmt module
> >>>     net/spnic: add cmdq and work queue
> >>>     net/spnic: add interface handling cmdq message
> >>>     net/spnic: add hardware info initialization
> >>>     net/spnic: support MAC and link event handling
> >>>     net/spnic: add function info initialization
> >>>     net/spnic: add queue pairs context initialization
> >>>     net/spnic: support mbuf handling of Tx/Rx
> >>>     net/spnic: support Rx congfiguration
> >>>     net/spnic: add port/vport enable
> >>>     net/spnic: support IO packets handling
> >>>     net/spnic: add device configure/version/info
> >>>     net/spnic: support RSS configuration update and get
> >>>     net/spnic: support VLAN filtering and offloading
> >>>     net/spnic: support promiscuous and allmulticast Rx modes
> >>>     net/spnic: support flow control
> >>>     net/spnic: support getting Tx/Rx queues info
> >>>     net/spnic: net/spnic: support xstats statistics
> >>>     net/spnic: support VFIO interrupt
> >>>     net/spnic: support Tx/Rx queue start/stop
> >>>     net/spnic: add doc infrastructure
> >>>     net/spnic: fixes unsafe C style code  
> >>
> >> <...>  
> >   
> 


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-11 10:09  5%           ` Ray Kinsella
@ 2022-02-14 10:16  4%             ` Ray Kinsella
  2022-02-14 11:15  4%               ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: Ray Kinsella @ 2022-02-14 10:16 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ferruh Yigit, Kalesh A P, dev, ajit.khaparde, asafp,
	David Marchand, Andrew Rybchenko


Ray Kinsella <mdr@ashroe.eu> writes:

> Thomas Monjalon <thomas@monjalon.net> writes:
>
>> 02/02/2022 12:44, Ray Kinsella:
>>> Ferruh Yigit <ferruh.yigit@intel.com> writes:
>>> > On 1/28/2022 12:48 PM, Kalesh A P wrote:
>>> >> --- a/lib/ethdev/rte_ethdev.h
>>> >> +++ b/lib/ethdev/rte_ethdev.h
>>> >> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type {
>>> >>   	RTE_ETH_EVENT_DESTROY,  /**< port is released */
>>> >>   	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
>>> >>   	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
>>> >> +	RTE_ETH_EVENT_ERR_RECOVERING,
>>> >> +			/**< port recovering from an error
>>> >> +			 *
>>> >> +			 * PMD detected a FW reset or error condition.
>>> >> +			 * PMD will try to recover from the error.
>>> >> +			 * Data path may be quiesced and Control path operations
>>> >> +			 * may fail at this time.
>>> >> +			 */
>>> >> +	RTE_ETH_EVENT_RECOVERED,
>>> >> +			/**< port recovered from an error
>>> >> +			 *
>>> >> +			 * PMD has recovered from the error condition.
>>> >> +			 * Control path and Data path are up now.
>>> >> +			 * PMD re-configures the port to the state prior to the error.
>>> >> +			 * Since the device has undergone a reset, flow rules
>>> >> +			 * offloaded prior to reset may be lost and
>>> >> +			 * the application should recreate the rules again.
>>> >> +			 */
>>> >>   	RTE_ETH_EVENT_MAX       /**< max value of this enum */
>>> >
>>> >
>>> > Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people
>>> > to evaluate if it is a false positive:
>>> >
>>> >
>>> > 1 function with some indirect sub-type change:
>>> >   [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes:
>>> >     parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes:
>>> >       underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed:
>>> >         in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)':
>>> >           parameter 2 of type 'enum rte_eth_event_type' has sub-type changes:
>>> >             type size hasn't changed
>>> >             2 enumerator insertions:
>>> >               'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11'
>>> >               'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12'
>>> >             1 enumerator change:
>>> >               'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1
>>> 
>>> I don't immediately see the problem that this would cause.
>>> There are no array sizes etc dependent on the value of MAX for instance.
>>> 
>>> Looks safe?
>>
>> We never know how this enum will be used by the application.
>> The max value may be used for the size of an event array.
>> It looks a real ABI issue unfortunately.
>
> Right - but we only really care about it when an array size based on MAX
> is likely to be passed to DPDK, which doesn't apply in this case.
>
> I noted that some Linux folks explicitly mark similar MAX values as not
> part of the ABI.
>
> /usr/include/linux/perf_event.h
> 37:     PERF_TYPE_MAX,                          /* non-ABI */
> 60:     PERF_COUNT_HW_MAX,                      /* non-ABI */
> 79:     PERF_COUNT_HW_CACHE_MAX,                /* non-ABI */
> 87:     PERF_COUNT_HW_CACHE_OP_MAX,             /* non-ABI */
> 94:     PERF_COUNT_HW_CACHE_RESULT_MAX,         /* non-ABI */
> 116:    PERF_COUNT_SW_MAX,                      /* non-ABI */
> 149:    PERF_SAMPLE_MAX = 1U << 24,             /* non-ABI */
> 151:    __PERF_SAMPLE_CALLCHAIN_EARLY           = 1ULL << 63, /*
> non-ABI; internal use */
> 189:    PERF_SAMPLE_BRANCH_MAX_SHIFT            /* non-ABI */
> 267:    PERF_TXN_MAX            = (1 << 8), /* non-ABI */
> 301:    PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
> 1067:   PERF_RECORD_MAX,                        /* non-ABI */
> 1078:   PERF_RECORD_KSYMBOL_TYPE_MAX            /* non-ABI */
> 1087:   PERF_BPF_EVENT_MAX,             /* non-ABI */
>
>>
>> PS: I am not Cc'ed in this patchset,
>> so copying what I said on v6 (more than a year ago):
>> Please use the option --cc-cmd devtools/get-maintainer.sh

Any thoughts on similarly annotating all our _MAX enums in the same way?
We could also add a section in the ABI Policy to make it explicit _MAX
enum values are not part of the ABI - what do folks think?

-- 
Regards, Ray K

^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-14 10:16  4%             ` Ray Kinsella
@ 2022-02-14 11:15  4%               ` Thomas Monjalon
  2022-02-14 16:06  5%                 ` Ray Kinsella
  0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-02-14 11:15 UTC (permalink / raw)
  To: Ray Kinsella
  Cc: Ferruh Yigit, Kalesh A P, dev, ajit.khaparde, asafp,
	David Marchand, Andrew Rybchenko

14/02/2022 11:16, Ray Kinsella:
> Ray Kinsella <mdr@ashroe.eu> writes:
> > Thomas Monjalon <thomas@monjalon.net> writes:
> >> 02/02/2022 12:44, Ray Kinsella:
> >>> Ferruh Yigit <ferruh.yigit@intel.com> writes:
> >>> > On 1/28/2022 12:48 PM, Kalesh A P wrote:
> >>> >> --- a/lib/ethdev/rte_ethdev.h
> >>> >> +++ b/lib/ethdev/rte_ethdev.h
> >>> >> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type {
> >>> >>   	RTE_ETH_EVENT_DESTROY,  /**< port is released */
> >>> >>   	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
> >>> >>   	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
> >>> >> +	RTE_ETH_EVENT_ERR_RECOVERING,
> >>> >> +			/**< port recovering from an error
> >>> >> +			 *
> >>> >> +			 * PMD detected a FW reset or error condition.
> >>> >> +			 * PMD will try to recover from the error.
> >>> >> +			 * Data path may be quiesced and Control path operations
> >>> >> +			 * may fail at this time.
> >>> >> +			 */
> >>> >> +	RTE_ETH_EVENT_RECOVERED,
> >>> >> +			/**< port recovered from an error
> >>> >> +			 *
> >>> >> +			 * PMD has recovered from the error condition.
> >>> >> +			 * Control path and Data path are up now.
> >>> >> +			 * PMD re-configures the port to the state prior to the error.
> >>> >> +			 * Since the device has undergone a reset, flow rules
> >>> >> +			 * offloaded prior to reset may be lost and
> >>> >> +			 * the application should recreate the rules again.
> >>> >> +			 */
> >>> >>   	RTE_ETH_EVENT_MAX       /**< max value of this enum */
> >>> >
> >>> >
> >>> > Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people
> >>> > to evaluate if it is a false positive:
> >>> >
> >>> >
> >>> > 1 function with some indirect sub-type change:
> >>> >   [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes:
> >>> >     parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes:
> >>> >       underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed:
> >>> >         in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)':
> >>> >           parameter 2 of type 'enum rte_eth_event_type' has sub-type changes:
> >>> >             type size hasn't changed
> >>> >             2 enumerator insertions:
> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11'
> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12'
> >>> >             1 enumerator change:
> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1
> >>> 
> >>> I don't immediately see the problem that this would cause.
> >>> There are no array sizes etc dependent on the value of MAX for instance.
> >>> 
> >>> Looks safe?
> >>
> >> We never know how this enum will be used by the application.
> >> The max value may be used for the size of an event array.
> >> It looks a real ABI issue unfortunately.
> >
> > Right - but we only really care about it when an array size based on MAX
> > is likely to be passed to DPDK, which doesn't apply in this case.

I don't completely agree.
A developer may assume an event will never exceed MAX value.
However, after an upgrade of DPDK without app rebuild,
a higher event value may be received in the app,
breaking the assumption.
Should we consider this case as an ABI breakage?

> > I noted that some Linux folks explicitly mark similar MAX values as not
> > part of the ABI.
> >
> > /usr/include/linux/perf_event.h
> > 37:     PERF_TYPE_MAX,                          /* non-ABI */
> > 60:     PERF_COUNT_HW_MAX,                      /* non-ABI */
> > 79:     PERF_COUNT_HW_CACHE_MAX,                /* non-ABI */
> > 87:     PERF_COUNT_HW_CACHE_OP_MAX,             /* non-ABI */
> > 94:     PERF_COUNT_HW_CACHE_RESULT_MAX,         /* non-ABI */
> > 116:    PERF_COUNT_SW_MAX,                      /* non-ABI */
> > 149:    PERF_SAMPLE_MAX = 1U << 24,             /* non-ABI */
> > 151:    __PERF_SAMPLE_CALLCHAIN_EARLY           = 1ULL << 63, /*
> > non-ABI; internal use */
> > 189:    PERF_SAMPLE_BRANCH_MAX_SHIFT            /* non-ABI */
> > 267:    PERF_TXN_MAX            = (1 << 8), /* non-ABI */
> > 301:    PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
> > 1067:   PERF_RECORD_MAX,                        /* non-ABI */
> > 1078:   PERF_RECORD_KSYMBOL_TYPE_MAX            /* non-ABI */
> > 1087:   PERF_BPF_EVENT_MAX,             /* non-ABI */
> 
> Any thoughts on similarly annotating all our _MAX enums in the same way?
> We could also add a section in the ABI Policy to make it explicit _MAX
> enum values are not part of the ABI - what do folks think?

Interesting. I am not sure it is always ABI-safe though.



^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-14 11:15  4%               ` Thomas Monjalon
@ 2022-02-14 16:06  5%                 ` Ray Kinsella
  2022-02-14 16:25  0%                   ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: Ray Kinsella @ 2022-02-14 16:06 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ferruh Yigit, Kalesh A P, dev, ajit.khaparde, asafp,
	David Marchand, Andrew Rybchenko


Thomas Monjalon <thomas@monjalon.net> writes:

> 14/02/2022 11:16, Ray Kinsella:
>> Ray Kinsella <mdr@ashroe.eu> writes:
>> > Thomas Monjalon <thomas@monjalon.net> writes:
>> >> 02/02/2022 12:44, Ray Kinsella:
>> >>> Ferruh Yigit <ferruh.yigit@intel.com> writes:
>> >>> > On 1/28/2022 12:48 PM, Kalesh A P wrote:
>> >>> >> --- a/lib/ethdev/rte_ethdev.h
>> >>> >> +++ b/lib/ethdev/rte_ethdev.h
>> >>> >> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type {
>> >>> >>   	RTE_ETH_EVENT_DESTROY,  /**< port is released */
>> >>> >>   	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
>> >>> >>   	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
>> >>> >> +	RTE_ETH_EVENT_ERR_RECOVERING,
>> >>> >> +			/**< port recovering from an error
>> >>> >> +			 *
>> >>> >> +			 * PMD detected a FW reset or error condition.
>> >>> >> +			 * PMD will try to recover from the error.
>> >>> >> +			 * Data path may be quiesced and Control path operations
>> >>> >> +			 * may fail at this time.
>> >>> >> +			 */
>> >>> >> +	RTE_ETH_EVENT_RECOVERED,
>> >>> >> +			/**< port recovered from an error
>> >>> >> +			 *
>> >>> >> +			 * PMD has recovered from the error condition.
>> >>> >> +			 * Control path and Data path are up now.
>> >>> >> +			 * PMD re-configures the port to the state prior to the error.
>> >>> >> +			 * Since the device has undergone a reset, flow rules
>> >>> >> +			 * offloaded prior to reset may be lost and
>> >>> >> +			 * the application should recreate the rules again.
>> >>> >> +			 */
>> >>> >>   	RTE_ETH_EVENT_MAX       /**< max value of this enum */
>> >>> >
>> >>> >
>> >>> > Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people
>> >>> > to evaluate if it is a false positive:
>> >>> >
>> >>> >
>> >>> > 1 function with some indirect sub-type change:
>> >>> >   [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes:
>> >>> >     parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes:
>> >>> >       underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed:
>> >>> >         in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)':
>> >>> >           parameter 2 of type 'enum rte_eth_event_type' has sub-type changes:
>> >>> >             type size hasn't changed
>> >>> >             2 enumerator insertions:
>> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11'
>> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12'
>> >>> >             1 enumerator change:
>> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1
>> >>> 
>> >>> I don't immediately see the problem that this would cause.
>> >>> There are no array sizes etc dependent on the value of MAX for instance.
>> >>> 
>> >>> Looks safe?
>> >>
>> >> We never know how this enum will be used by the application.
>> >> The max value may be used for the size of an event array.
>> >> It looks a real ABI issue unfortunately.
>> >
>> > Right - but we only really care about it when an array size based on MAX
>> > is likely to be passed to DPDK, which doesn't apply in this case.
>
> I don't completely agree.
> A developer may assume an event will never exceed MAX value.
> However, after an upgrade of DPDK without app rebuild,
> a higher event value may be received in the app,
> breaking the assumption.
> Should we consider this case as an ABI breakage?

Nope - I think we should explicitly exclude MAX values from any
ABI guarantee, as being able to change them is key to our be able to
evolve DPDK while maintaining ABI stability. 

Consider what it means applying the ABI policy to a MAX value, you are
in effect saying that that no value can be added to this enumeration
until the next ABI version, for me this is very restrictive without a
solid reason. 

>
>> > I noted that some Linux folks explicitly mark similar MAX values as not
>> > part of the ABI.
>> >
>> > /usr/include/linux/perf_event.h
>> > 37:     PERF_TYPE_MAX,                          /* non-ABI */
>> > 60:     PERF_COUNT_HW_MAX,                      /* non-ABI */
>> > 79:     PERF_COUNT_HW_CACHE_MAX,                /* non-ABI */
>> > 87:     PERF_COUNT_HW_CACHE_OP_MAX,             /* non-ABI */
>> > 94:     PERF_COUNT_HW_CACHE_RESULT_MAX,         /* non-ABI */
>> > 116:    PERF_COUNT_SW_MAX,                      /* non-ABI */
>> > 149:    PERF_SAMPLE_MAX = 1U << 24,             /* non-ABI */
>> > 151:    __PERF_SAMPLE_CALLCHAIN_EARLY           = 1ULL << 63, /*
>> > non-ABI; internal use */
>> > 189:    PERF_SAMPLE_BRANCH_MAX_SHIFT            /* non-ABI */
>> > 267:    PERF_TXN_MAX            = (1 << 8), /* non-ABI */
>> > 301:    PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
>> > 1067:   PERF_RECORD_MAX,                        /* non-ABI */
>> > 1078:   PERF_RECORD_KSYMBOL_TYPE_MAX            /* non-ABI */
>> > 1087:   PERF_BPF_EVENT_MAX,             /* non-ABI */
>> 
>> Any thoughts on similarly annotating all our _MAX enums in the same way?
>> We could also add a section in the ABI Policy to make it explicit _MAX
>> enum values are not part of the ABI - what do folks think?
>
> Interesting. I am not sure it is always ABI-safe though.


-- 
Regards, Ray K

^ permalink raw reply	[relevance 5%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-14 16:06  5%                 ` Ray Kinsella
@ 2022-02-14 16:25  0%                   ` Thomas Monjalon
  2022-02-14 18:27  0%                     ` Ray Kinsella
  0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-02-14 16:25 UTC (permalink / raw)
  To: Ray Kinsella
  Cc: Ferruh Yigit, Kalesh A P, dev, ajit.khaparde, asafp,
	David Marchand, Andrew Rybchenko

14/02/2022 17:06, Ray Kinsella:
> Thomas Monjalon <thomas@monjalon.net> writes:
> > 14/02/2022 11:16, Ray Kinsella:
> >> Ray Kinsella <mdr@ashroe.eu> writes:
> >> > Thomas Monjalon <thomas@monjalon.net> writes:
> >> >> 02/02/2022 12:44, Ray Kinsella:
> >> >>> Ferruh Yigit <ferruh.yigit@intel.com> writes:
> >> >>> > On 1/28/2022 12:48 PM, Kalesh A P wrote:
> >> >>> >> --- a/lib/ethdev/rte_ethdev.h
> >> >>> >> +++ b/lib/ethdev/rte_ethdev.h
> >> >>> >> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type {
> >> >>> >>   	RTE_ETH_EVENT_DESTROY,  /**< port is released */
> >> >>> >>   	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
> >> >>> >>   	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
> >> >>> >> +	RTE_ETH_EVENT_ERR_RECOVERING,
> >> >>> >> +			/**< port recovering from an error
> >> >>> >> +			 *
> >> >>> >> +			 * PMD detected a FW reset or error condition.
> >> >>> >> +			 * PMD will try to recover from the error.
> >> >>> >> +			 * Data path may be quiesced and Control path operations
> >> >>> >> +			 * may fail at this time.
> >> >>> >> +			 */
> >> >>> >> +	RTE_ETH_EVENT_RECOVERED,
> >> >>> >> +			/**< port recovered from an error
> >> >>> >> +			 *
> >> >>> >> +			 * PMD has recovered from the error condition.
> >> >>> >> +			 * Control path and Data path are up now.
> >> >>> >> +			 * PMD re-configures the port to the state prior to the error.
> >> >>> >> +			 * Since the device has undergone a reset, flow rules
> >> >>> >> +			 * offloaded prior to reset may be lost and
> >> >>> >> +			 * the application should recreate the rules again.
> >> >>> >> +			 */
> >> >>> >>   	RTE_ETH_EVENT_MAX       /**< max value of this enum */
> >> >>> >
> >> >>> >
> >> >>> > Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people
> >> >>> > to evaluate if it is a false positive:
> >> >>> >
> >> >>> >
> >> >>> > 1 function with some indirect sub-type change:
> >> >>> >   [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes:
> >> >>> >     parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes:
> >> >>> >       underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed:
> >> >>> >         in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)':
> >> >>> >           parameter 2 of type 'enum rte_eth_event_type' has sub-type changes:
> >> >>> >             type size hasn't changed
> >> >>> >             2 enumerator insertions:
> >> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11'
> >> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12'
> >> >>> >             1 enumerator change:
> >> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1
> >> >>> 
> >> >>> I don't immediately see the problem that this would cause.
> >> >>> There are no array sizes etc dependent on the value of MAX for instance.
> >> >>> 
> >> >>> Looks safe?
> >> >>
> >> >> We never know how this enum will be used by the application.
> >> >> The max value may be used for the size of an event array.
> >> >> It looks a real ABI issue unfortunately.
> >> >
> >> > Right - but we only really care about it when an array size based on MAX
> >> > is likely to be passed to DPDK, which doesn't apply in this case.
> >
> > I don't completely agree.
> > A developer may assume an event will never exceed MAX value.
> > However, after an upgrade of DPDK without app rebuild,
> > a higher event value may be received in the app,
> > breaking the assumption.
> > Should we consider this case as an ABI breakage?
> 
> Nope - I think we should explicitly exclude MAX values from any
> ABI guarantee, as being able to change them is key to our be able to
> evolve DPDK while maintaining ABI stability.

Or we can simply remove the MAX values so there is no confusion.

> Consider what it means applying the ABI policy to a MAX value, you are
> in effect saying that that no value can be added to this enumeration
> until the next ABI version, for me this is very restrictive without a
> solid reason. 

I agree it is too much restrictive, that's why I am advocating
for their removal.

> >> > I noted that some Linux folks explicitly mark similar MAX values as not
> >> > part of the ABI.
> >> >
> >> > /usr/include/linux/perf_event.h
> >> > 37:     PERF_TYPE_MAX,                          /* non-ABI */
> >> > 60:     PERF_COUNT_HW_MAX,                      /* non-ABI */
> >> > 79:     PERF_COUNT_HW_CACHE_MAX,                /* non-ABI */
> >> > 87:     PERF_COUNT_HW_CACHE_OP_MAX,             /* non-ABI */
> >> > 94:     PERF_COUNT_HW_CACHE_RESULT_MAX,         /* non-ABI */
> >> > 116:    PERF_COUNT_SW_MAX,                      /* non-ABI */
> >> > 149:    PERF_SAMPLE_MAX = 1U << 24,             /* non-ABI */
> >> > 151:    __PERF_SAMPLE_CALLCHAIN_EARLY           = 1ULL << 63, /*
> >> > non-ABI; internal use */
> >> > 189:    PERF_SAMPLE_BRANCH_MAX_SHIFT            /* non-ABI */
> >> > 267:    PERF_TXN_MAX            = (1 << 8), /* non-ABI */
> >> > 301:    PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
> >> > 1067:   PERF_RECORD_MAX,                        /* non-ABI */
> >> > 1078:   PERF_RECORD_KSYMBOL_TYPE_MAX            /* non-ABI */
> >> > 1087:   PERF_BPF_EVENT_MAX,             /* non-ABI */
> >> 
> >> Any thoughts on similarly annotating all our _MAX enums in the same way?
> >> We could also add a section in the ABI Policy to make it explicit _MAX
> >> enum values are not part of the ABI - what do folks think?
> >
> > Interesting. I am not sure it is always ABI-safe though.




^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-14 16:25  0%                   ` Thomas Monjalon
@ 2022-02-14 18:27  0%                     ` Ray Kinsella
  2022-02-15 13:55  4%                       ` Ray Kinsella
  0 siblings, 1 reply; 200+ results
From: Ray Kinsella @ 2022-02-14 18:27 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ferruh Yigit, Kalesh A P, dev, ajit.khaparde, asafp,
	David Marchand, Andrew Rybchenko


Thomas Monjalon <thomas@monjalon.net> writes:

> 14/02/2022 17:06, Ray Kinsella:
>> Thomas Monjalon <thomas@monjalon.net> writes:
>> > 14/02/2022 11:16, Ray Kinsella:
>> >> Ray Kinsella <mdr@ashroe.eu> writes:
>> >> > Thomas Monjalon <thomas@monjalon.net> writes:
>> >> >> 02/02/2022 12:44, Ray Kinsella:
>> >> >>> Ferruh Yigit <ferruh.yigit@intel.com> writes:
>> >> >>> > On 1/28/2022 12:48 PM, Kalesh A P wrote:
>> >> >>> >> --- a/lib/ethdev/rte_ethdev.h
>> >> >>> >> +++ b/lib/ethdev/rte_ethdev.h
>> >> >>> >> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type {
>> >> >>> >>   	RTE_ETH_EVENT_DESTROY,  /**< port is released */
>> >> >>> >>   	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
>> >> >>> >>   	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
>> >> >>> >> +	RTE_ETH_EVENT_ERR_RECOVERING,
>> >> >>> >> +			/**< port recovering from an error
>> >> >>> >> +			 *
>> >> >>> >> +			 * PMD detected a FW reset or error condition.
>> >> >>> >> +			 * PMD will try to recover from the error.
>> >> >>> >> +			 * Data path may be quiesced and Control path operations
>> >> >>> >> +			 * may fail at this time.
>> >> >>> >> +			 */
>> >> >>> >> +	RTE_ETH_EVENT_RECOVERED,
>> >> >>> >> +			/**< port recovered from an error
>> >> >>> >> +			 *
>> >> >>> >> +			 * PMD has recovered from the error condition.
>> >> >>> >> +			 * Control path and Data path are up now.
>> >> >>> >> +			 * PMD re-configures the port to the state prior to the error.
>> >> >>> >> +			 * Since the device has undergone a reset, flow rules
>> >> >>> >> +			 * offloaded prior to reset may be lost and
>> >> >>> >> +			 * the application should recreate the rules again.
>> >> >>> >> +			 */
>> >> >>> >>   	RTE_ETH_EVENT_MAX       /**< max value of this enum */
>> >> >>> >
>> >> >>> >
>> >> >>> > Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people
>> >> >>> > to evaluate if it is a false positive:
>> >> >>> >
>> >> >>> >
>> >> >>> > 1 function with some indirect sub-type change:
>> >> >>> >   [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes:
>> >> >>> >     parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes:
>> >> >>> >       underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed:
>> >> >>> >         in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)':
>> >> >>> >           parameter 2 of type 'enum rte_eth_event_type' has sub-type changes:
>> >> >>> >             type size hasn't changed
>> >> >>> >             2 enumerator insertions:
>> >> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11'
>> >> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12'
>> >> >>> >             1 enumerator change:
>> >> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1
>> >> >>> 
>> >> >>> I don't immediately see the problem that this would cause.
>> >> >>> There are no array sizes etc dependent on the value of MAX for instance.
>> >> >>> 
>> >> >>> Looks safe?
>> >> >>
>> >> >> We never know how this enum will be used by the application.
>> >> >> The max value may be used for the size of an event array.
>> >> >> It looks a real ABI issue unfortunately.
>> >> >
>> >> > Right - but we only really care about it when an array size based on MAX
>> >> > is likely to be passed to DPDK, which doesn't apply in this case.
>> >
>> > I don't completely agree.
>> > A developer may assume an event will never exceed MAX value.
>> > However, after an upgrade of DPDK without app rebuild,
>> > a higher event value may be received in the app,
>> > breaking the assumption.
>> > Should we consider this case as an ABI breakage?
>> 
>> Nope - I think we should explicitly exclude MAX values from any
>> ABI guarantee, as being able to change them is key to our be able to
>> evolve DPDK while maintaining ABI stability.
>
> Or we can simply remove the MAX values so there is no confusion.
>
>> Consider what it means applying the ABI policy to a MAX value, you are
>> in effect saying that that no value can be added to this enumeration
>> until the next ABI version, for me this is very restrictive without a
>> solid reason. 
>
> I agree it is too much restrictive, that's why I am advocating
> for their removal.

I think that would be simplest yes - may require some rework of the
sample code though. I will take a look at it.

>
>> >> > I noted that some Linux folks explicitly mark similar MAX values as not
>> >> > part of the ABI.
>> >> >
>> >> > /usr/include/linux/perf_event.h
>> >> > 37:     PERF_TYPE_MAX,                          /* non-ABI */
>> >> > 60:     PERF_COUNT_HW_MAX,                      /* non-ABI */
>> >> > 79:     PERF_COUNT_HW_CACHE_MAX,                /* non-ABI */
>> >> > 87:     PERF_COUNT_HW_CACHE_OP_MAX,             /* non-ABI */
>> >> > 94:     PERF_COUNT_HW_CACHE_RESULT_MAX,         /* non-ABI */
>> >> > 116:    PERF_COUNT_SW_MAX,                      /* non-ABI */
>> >> > 149:    PERF_SAMPLE_MAX = 1U << 24,             /* non-ABI */
>> >> > 151:    __PERF_SAMPLE_CALLCHAIN_EARLY           = 1ULL << 63, /*
>> >> > non-ABI; internal use */
>> >> > 189:    PERF_SAMPLE_BRANCH_MAX_SHIFT            /* non-ABI */
>> >> > 267:    PERF_TXN_MAX            = (1 << 8), /* non-ABI */
>> >> > 301:    PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
>> >> > 1067:   PERF_RECORD_MAX,                        /* non-ABI */
>> >> > 1078:   PERF_RECORD_KSYMBOL_TYPE_MAX            /* non-ABI */
>> >> > 1087:   PERF_BPF_EVENT_MAX,             /* non-ABI */
>> >> 
>> >> Any thoughts on similarly annotating all our _MAX enums in the same way?
>> >> We could also add a section in the ABI Policy to make it explicit _MAX
>> >> enum values are not part of the ABI - what do folks think?
>> >
>> > Interesting. I am not sure it is always ABI-safe though.


-- 
Regards, Ray K

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-14 18:27  0%                     ` Ray Kinsella
@ 2022-02-15 13:55  4%                       ` Ray Kinsella
  2022-02-15 15:12  0%                         ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: Ray Kinsella @ 2022-02-15 13:55 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ferruh Yigit, Kalesh A P, dev, ajit.khaparde, asafp,
	David Marchand, Andrew Rybchenko


Ray Kinsella <mdr@ashroe.eu> writes:

> Thomas Monjalon <thomas@monjalon.net> writes:
>
>> 14/02/2022 17:06, Ray Kinsella:
>>> Thomas Monjalon <thomas@monjalon.net> writes:
>>> > 14/02/2022 11:16, Ray Kinsella:
>>> >> Ray Kinsella <mdr@ashroe.eu> writes:
>>> >> > Thomas Monjalon <thomas@monjalon.net> writes:
>>> >> >> 02/02/2022 12:44, Ray Kinsella:
>>> >> >>> Ferruh Yigit <ferruh.yigit@intel.com> writes:
>>> >> >>> > On 1/28/2022 12:48 PM, Kalesh A P wrote:
>>> >> >>> >> --- a/lib/ethdev/rte_ethdev.h
>>> >> >>> >> +++ b/lib/ethdev/rte_ethdev.h
>>> >> >>> >> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type {
>>> >> >>> >>   	RTE_ETH_EVENT_DESTROY,  /**< port is released */
>>> >> >>> >>   	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
>>> >> >>> >>   	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */
>>> >> >>> >> +	RTE_ETH_EVENT_ERR_RECOVERING,
>>> >> >>> >> +			/**< port recovering from an error
>>> >> >>> >> +			 *
>>> >> >>> >> +			 * PMD detected a FW reset or error condition.
>>> >> >>> >> +			 * PMD will try to recover from the error.
>>> >> >>> >> +			 * Data path may be quiesced and Control path operations
>>> >> >>> >> +			 * may fail at this time.
>>> >> >>> >> +			 */
>>> >> >>> >> +	RTE_ETH_EVENT_RECOVERED,
>>> >> >>> >> +			/**< port recovered from an error
>>> >> >>> >> +			 *
>>> >> >>> >> +			 * PMD has recovered from the error condition.
>>> >> >>> >> +			 * Control path and Data path are up now.
>>> >> >>> >> +			 * PMD re-configures the port to the state prior to the error.
>>> >> >>> >> +			 * Since the device has undergone a reset, flow rules
>>> >> >>> >> +			 * offloaded prior to reset may be lost and
>>> >> >>> >> +			 * the application should recreate the rules again.
>>> >> >>> >> +			 */
>>> >> >>> >>   	RTE_ETH_EVENT_MAX       /**< max value of this enum */
>>> >> >>> >
>>> >> >>> >
>>> >> >>> > Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people
>>> >> >>> > to evaluate if it is a false positive:
>>> >> >>> >
>>> >> >>> >
>>> >> >>> > 1 function with some indirect sub-type change:
>>> >> >>> >   [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes:
>>> >> >>> >     parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes:
>>> >> >>> >       underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed:
>>> >> >>> >         in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)':
>>> >> >>> >           parameter 2 of type 'enum rte_eth_event_type' has sub-type changes:
>>> >> >>> >             type size hasn't changed
>>> >> >>> >             2 enumerator insertions:
>>> >> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11'
>>> >> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12'
>>> >> >>> >             1 enumerator change:
>>> >> >>> >               'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1
>>> >> >>> 
>>> >> >>> I don't immediately see the problem that this would cause.
>>> >> >>> There are no array sizes etc dependent on the value of MAX for instance.
>>> >> >>> 
>>> >> >>> Looks safe?
>>> >> >>
>>> >> >> We never know how this enum will be used by the application.
>>> >> >> The max value may be used for the size of an event array.
>>> >> >> It looks a real ABI issue unfortunately.
>>> >> >
>>> >> > Right - but we only really care about it when an array size based on MAX
>>> >> > is likely to be passed to DPDK, which doesn't apply in this case.
>>> >
>>> > I don't completely agree.
>>> > A developer may assume an event will never exceed MAX value.
>>> > However, after an upgrade of DPDK without app rebuild,
>>> > a higher event value may be received in the app,
>>> > breaking the assumption.
>>> > Should we consider this case as an ABI breakage?
>>> 
>>> Nope - I think we should explicitly exclude MAX values from any
>>> ABI guarantee, as being able to change them is key to our be able to
>>> evolve DPDK while maintaining ABI stability.
>>
>> Or we can simply remove the MAX values so there is no confusion.
>>
>>> Consider what it means applying the ABI policy to a MAX value, you are
>>> in effect saying that that no value can be added to this enumeration
>>> until the next ABI version, for me this is very restrictive without a
>>> solid reason. 
>>
>> I agree it is too much restrictive, that's why I am advocating
>> for their removal.
>
> I think that would be simplest yes - may require some rework of the
> sample code though. I will take a look at it.

Thinking about this some more - we can't remove the MAX values between
now the next stable ABI. So we may need a short term plan, and long term
plan.

Long term, I agree we look at every _MAX enumeration value and ask do we
need it.

Short term (until the next ABI), we still need to answer the question do
we allow people to change _MAX values?

>>
>>> >> > I noted that some Linux folks explicitly mark similar MAX values as not
>>> >> > part of the ABI.
>>> >> >
>>> >> > /usr/include/linux/perf_event.h
>>> >> > 37:     PERF_TYPE_MAX,                          /* non-ABI */
>>> >> > 60:     PERF_COUNT_HW_MAX,                      /* non-ABI */
>>> >> > 79:     PERF_COUNT_HW_CACHE_MAX,                /* non-ABI */
>>> >> > 87:     PERF_COUNT_HW_CACHE_OP_MAX,             /* non-ABI */
>>> >> > 94:     PERF_COUNT_HW_CACHE_RESULT_MAX,         /* non-ABI */
>>> >> > 116:    PERF_COUNT_SW_MAX,                      /* non-ABI */
>>> >> > 149:    PERF_SAMPLE_MAX = 1U << 24,             /* non-ABI */
>>> >> > 151:    __PERF_SAMPLE_CALLCHAIN_EARLY           = 1ULL << 63, /*
>>> >> > non-ABI; internal use */
>>> >> > 189:    PERF_SAMPLE_BRANCH_MAX_SHIFT            /* non-ABI */
>>> >> > 267:    PERF_TXN_MAX            = (1 << 8), /* non-ABI */
>>> >> > 301:    PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
>>> >> > 1067:   PERF_RECORD_MAX,                        /* non-ABI */
>>> >> > 1078:   PERF_RECORD_KSYMBOL_TYPE_MAX            /* non-ABI */
>>> >> > 1087:   PERF_BPF_EVENT_MAX,             /* non-ABI */
>>> >> 
>>> >> Any thoughts on similarly annotating all our _MAX enums in the same way?
>>> >> We could also add a section in the ABI Policy to make it explicit _MAX
>>> >> enum values are not part of the ABI - what do folks think?
>>> >
>>> > Interesting. I am not sure it is always ABI-safe though.


-- 
Regards, Ray K

^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-15 13:55  4%                       ` Ray Kinsella
@ 2022-02-15 15:12  0%                         ` Thomas Monjalon
  2022-02-15 16:12  0%                           ` Ray Kinsella
  0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-02-15 15:12 UTC (permalink / raw)
  To: Ray Kinsella
  Cc: Ferruh Yigit, Kalesh A P, dev, ajit.khaparde, asafp,
	David Marchand, Andrew Rybchenko

15/02/2022 14:55, Ray Kinsella:
> Ray Kinsella <mdr@ashroe.eu> writes:
> > Thomas Monjalon <thomas@monjalon.net> writes:
> >> 14/02/2022 17:06, Ray Kinsella:
> >>> Thomas Monjalon <thomas@monjalon.net> writes:
> >>> > 14/02/2022 11:16, Ray Kinsella:
> >>> >> Ray Kinsella <mdr@ashroe.eu> writes:
> >>> >> > Thomas Monjalon <thomas@monjalon.net> writes:
> >>> >> >> We never know how this enum will be used by the application.
> >>> >> >> The max value may be used for the size of an event array.
> >>> >> >> It looks a real ABI issue unfortunately.
> >>> >> >
> >>> >> > Right - but we only really care about it when an array size based on MAX
> >>> >> > is likely to be passed to DPDK, which doesn't apply in this case.
> >>> >
> >>> > I don't completely agree.
> >>> > A developer may assume an event will never exceed MAX value.
> >>> > However, after an upgrade of DPDK without app rebuild,
> >>> > a higher event value may be received in the app,
> >>> > breaking the assumption.
> >>> > Should we consider this case as an ABI breakage?
> >>> 
> >>> Nope - I think we should explicitly exclude MAX values from any
> >>> ABI guarantee, as being able to change them is key to our be able to
> >>> evolve DPDK while maintaining ABI stability.
> >>
> >> Or we can simply remove the MAX values so there is no confusion.
> >>
> >>> Consider what it means applying the ABI policy to a MAX value, you are
> >>> in effect saying that that no value can be added to this enumeration
> >>> until the next ABI version, for me this is very restrictive without a
> >>> solid reason. 
> >>
> >> I agree it is too much restrictive, that's why I am advocating
> >> for their removal.
> >
> > I think that would be simplest yes - may require some rework of the
> > sample code though. I will take a look at it.
> 
> Thinking about this some more - we can't remove the MAX values between
> now the next stable ABI. So we may need a short term plan, and long term
> plan.
> 
> Long term, I agree we look at every _MAX enumeration value and ask do we
> need it.
> 
> Short term (until the next ABI), we still need to answer the question do
> we allow people to change _MAX values?

There's a problem of incentive.
We already said in the past that we should remove the _MAX values,
but it doesn't happen because our time on this planet is limited.
I think it would work if the developers have a special interest in such work.
And guess what? Here there is a special interest to remove this one.
If we are at the negotiation table, we could imagine a short-term exception
if the long-term patch is available and reviewed.




^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events
  2022-02-15 15:12  0%                         ` Thomas Monjalon
@ 2022-02-15 16:12  0%                           ` Ray Kinsella
  0 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2022-02-15 16:12 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ferruh Yigit, Kalesh A P, dev, ajit.khaparde, asafp,
	David Marchand, Andrew Rybchenko


Thomas Monjalon <thomas@monjalon.net> writes:

> 15/02/2022 14:55, Ray Kinsella:
>> Ray Kinsella <mdr@ashroe.eu> writes:
>> > Thomas Monjalon <thomas@monjalon.net> writes:
>> >> 14/02/2022 17:06, Ray Kinsella:
>> >>> Thomas Monjalon <thomas@monjalon.net> writes:
>> >>> > 14/02/2022 11:16, Ray Kinsella:
>> >>> >> Ray Kinsella <mdr@ashroe.eu> writes:
>> >>> >> > Thomas Monjalon <thomas@monjalon.net> writes:
>> >>> >> >> We never know how this enum will be used by the application.
>> >>> >> >> The max value may be used for the size of an event array.
>> >>> >> >> It looks a real ABI issue unfortunately.
>> >>> >> >
>> >>> >> > Right - but we only really care about it when an array size based on MAX
>> >>> >> > is likely to be passed to DPDK, which doesn't apply in this case.
>> >>> >
>> >>> > I don't completely agree.
>> >>> > A developer may assume an event will never exceed MAX value.
>> >>> > However, after an upgrade of DPDK without app rebuild,
>> >>> > a higher event value may be received in the app,
>> >>> > breaking the assumption.
>> >>> > Should we consider this case as an ABI breakage?
>> >>> 
>> >>> Nope - I think we should explicitly exclude MAX values from any
>> >>> ABI guarantee, as being able to change them is key to our be able to
>> >>> evolve DPDK while maintaining ABI stability.
>> >>
>> >> Or we can simply remove the MAX values so there is no confusion.
>> >>
>> >>> Consider what it means applying the ABI policy to a MAX value, you are
>> >>> in effect saying that that no value can be added to this enumeration
>> >>> until the next ABI version, for me this is very restrictive without a
>> >>> solid reason. 
>> >>
>> >> I agree it is too much restrictive, that's why I am advocating
>> >> for their removal.
>> >
>> > I think that would be simplest yes - may require some rework of the
>> > sample code though. I will take a look at it.
>> 
>> Thinking about this some more - we can't remove the MAX values between
>> now the next stable ABI. So we may need a short term plan, and long term
>> plan.
>> 
>> Long term, I agree we look at every _MAX enumeration value and ask do we
>> need it.
>> 
>> Short term (until the next ABI), we still need to answer the question do
>> we allow people to change _MAX values?
>
> There's a problem of incentive.
> We already said in the past that we should remove the _MAX values,
> but it doesn't happen because our time on this planet is limited.
> I think it would work if the developers have a special interest in such work.
> And guess what? Here there is a special interest to remove this one.
> If we are at the negotiation table, we could imagine a short-term exception
> if the long-term patch is available and reviewed.

:-) ... I like that plan.

-- 
Regards, Ray K

^ permalink raw reply	[relevance 0%]

* RE: [EXT] [PATCH] crypto: fix misspelled key in qt format
  2022-02-12 11:34  3% ` [EXT] " Akhil Goyal
@ 2022-02-18  6:11  0%   ` Kusztal, ArkadiuszX
  2022-02-25 17:56  4%     ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: Kusztal, ArkadiuszX @ 2022-02-18  6:11 UTC (permalink / raw)
  To: Akhil Goyal, dev; +Cc: Zhang, Roy Fan



> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Saturday, February 12, 2022 12:34 PM
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
> Cc: Zhang, Roy Fan <roy.fan.zhang@intel.com>
> Subject: RE: [EXT] [PATCH] crypto: fix misspelled key in qt format
> 
> > This patch fixes misspelled RTE_RSA_KEY_TYPE_QT, this will prevent
> > checkpach from complaining wherever change to RSA is being made.
> >
> > Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op
> > definitions")
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> > ---
> Fix ABI warning.
> Add libabigail.abiignore rule.

I think what is worth noticing is a fact that after "random 'k' patch" addition of
[suppress_type]
        name = rte_crypto_asym_op
this problem does not show up.

But I think it is safer to send addition of
[suppress_type]
        name = rte_crypto_rsa_priv_key_type
anyway.
Will send v2.

^ permalink raw reply	[relevance 0%]

* [PATCH v3 0/8] yet more unnecessary NULL checks
  @ 2022-02-20 18:21  3% ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2022-02-20 18:21 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Thomas suggested there are some other functions that could
use the nullfree cleanup; this covers the rest of the story.

Note: this does not change existing API/ABI, there are still
some outliers that don't use the convention but fixing these
will have to wait until next LTS.

v3 - fix another typo and add more functions

v2 - fix spelling typo and add functions

Stephen Hemminger (8):
  cocci/nullfree: add more functions
  acl: remove unnecessary null checks
  lpm: remove unnecessary NULL checks
  lib: document existing free functions
  test: remove unnecessary NULL checks before free
  fips_validation: remove unnecessary NULL check
  event/sw: remove unnecessary NULL check
  pipeline: remove unnecessary checks for NULL pointer before free

 app/test/test_acl.c                           |  12 +-
 app/test/test_cmdline_lib.c                   |   3 +-
 app/test/test_cryptodev.c                     |   9 +-
 app/test/test_cryptodev_asym.c                |  30 ++---
 app/test/test_cryptodev_blockcipher.c         |   3 +-
 app/test/test_func_reentrancy.c               |   6 +-
 app/test/test_hash.c                          |   3 +-
 devtools/cocci/nullfree.cocci                 | 108 +++++++++++++++++-
 drivers/event/sw/sw_evdev.c                   |   6 +-
 examples/fips_validation/fips_dev_self_test.c |   3 +-
 lib/acl/rte_acl.h                             |   1 +
 lib/bitratestats/rte_bitrate.h                |   1 +
 lib/compressdev/rte_comp.h                    |   1 +
 lib/cryptodev/rte_crypto.h                    |   1 +
 lib/eal/include/rte_interrupts.h              |   4 +-
 lib/efd/rte_efd.h                             |   1 +
 lib/eventdev/rte_event_ring.h                 |   1 +
 lib/fib/rte_fib.h                             |   1 +
 lib/fib/rte_fib6.h                            |   1 +
 lib/lpm/rte_lpm.h                             |   1 +
 lib/lpm/rte_lpm6.h                            |   1 +
 lib/member/rte_member.h                       |   1 +
 lib/pipeline/rte_port_in_action.h             |   6 +-
 lib/pipeline/rte_swx_ctl.c                    |   3 +-
 lib/pipeline/rte_swx_ctl.h                    |   1 +
 lib/pipeline/rte_swx_pipeline.c               |   6 +-
 lib/pipeline/rte_swx_pipeline.h               |   1 +
 lib/reorder/rte_reorder.h                     |   1 +
 lib/rib/rte_rib.h                             |   1 +
 lib/rib/rte_rib6.h                            |   1 +
 lib/sched/rte_sched.h                         |   1 +
 lib/stack/rte_stack.h                         |   1 +
 lib/table/rte_swx_table_wm.c                  |   3 +-
 lib/table/rte_table_acl.c                     |  15 +--
 lib/telemetry/rte_telemetry.h                 |   2 +-
 35 files changed, 162 insertions(+), 78 deletions(-)

-- 
2.34.1


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v18 8/8] eal: implement functions for mutex management
  2022-02-09 13:57  0%     ` Ananyev, Konstantin
@ 2022-02-20 21:56  4%       ` Dmitry Kozlyuk
  2022-02-23 17:08  0%         ` Dmitry Kozlyuk
  0 siblings, 1 reply; 200+ results
From: Dmitry Kozlyuk @ 2022-02-20 21:56 UTC (permalink / raw)
  To: Ananyev, Konstantin
  Cc: Narcisa Ana Maria Vasile, Richardson, Bruce, david.marchand, dev,
	dmitrym, khot, navasile, ocardona, Kadam, Pallavi, roretzla,
	talshn, thomas

2022-02-09 13:57 (UTC+0000), Ananyev, Konstantin:
> > > Actually, please scrap that comment.
> > > Obviously it wouldn't work for static variables,
> > > and doesn't make much sense.
> > > Though few thoughts remain:
> > > for posix we probably don't need an indirection and
> > > rte_thread_mutex can be just typedef of pthread_mutex_t.
> > > also for posix we don't need RTE_INIT constructor for each
> > > static mutex initialization.
> > > Something like:
> > > #define RTE_STATIC_INITIALIZED_MUTEX(mx) \
> > > 	rte_thread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER
> > > should work, I think.
> > > Konstantin  
> > 
> > Thank you for reviewing, Konstantin!
> > Some context for the current representation of mutex
> > can be found in v9, patch 7/10 of this patchset.
> > 
> > Originally we've typedef'ed the pthread_mutex_t on POSIX, just
> > like you are suggesting here.
> > However, on Windows there's no static initializer similar to the pthread
> > one. Still, we want ABI compatibility and same thread behavior between
> > platforms. The most elegant solution we found was the current representation,
> > as suggested by Dmitry K.  
> 
> Yes, I agree it is a problem with Windows for static initializer.
> But why we can't have different structs typedef for mutex 
> for posix and windows platforms?

Yes, I agree that having different mutex types on *nix and Windows
is a great idea. It will avoid ABI change for *nix
and will guarantee no performance impact.

Maybe wrap pthread_mutex_t into a struct to have a distinct type
and to force using only DPDK API with it?

[...]
> Yes, on Windows rte_thread_mutex still wouldn't work for MP,
> but that's the same as with current design.

MP support is not planned for Windows and it is unknown if it ever will be,
so it's not an issue.
Data location is.
The reason rte_thread_mutex_t is not a typedef of CRITICAL_SECTION
(akin to pthread_mutex_t) is to avoid including Windows headers
into DPDK public headers, because Windows headers can break user code
by some macros they define.
Maybe instead of a pointer it could be an opaque array:

	#define RTE_PTHREAD_MUTEX_SIZE 40

	struct rte_pthread_mutex_t {
		uint8_t opaque[RTE_PTHREAD_MUTEX_SIZE];
	};

where RTE_PTHREAD_MUTEX_SIZE is actually sizeof(CRITICAL_SECTION).
Win32 ABI is remarkably stable, I don't think this constant will ever change,
it would break all the Windows user space.
Naty, DmitryM, Tyler, what do you think?

^ permalink raw reply	[relevance 4%]

* RE: [PATCH v8 02/11] ethdev: add flow item/action templates
  @ 2022-02-21 15:14  3%         ` Alexander Kozyrev
  0 siblings, 0 replies; 200+ results
From: Alexander Kozyrev @ 2022-02-21 15:14 UTC (permalink / raw)
  To: Ori Kam, Andrew Rybchenko, dev
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	ivan.malov, ferruh.yigit, mohammad.abdul.awal, qi.z.zhang,
	jerinj, ajit.khaparde, bruce.richardson

On Monday, February 21, 2022 8:12 Ori Kam <orika@nvidia.com> wrote:

> > See notes about order of checks in previous patch review notes.

I'll fix order of checks in all patches, thank you for the suggestion.

> > Would it be useful to mentioned that at least one direction
> > bit must be set? Otherwise request does not make sense.
> >
> Agree one direction must be set.

Will add comments about mandatory setting of the direction.

> > > + */
> > > +__extension__
> > > +struct rte_flow_pattern_template_attr {
> > > +	/**
> > > +	 * Relaxed matching policy.
> > > +	 * - PMD may match only on items with mask member set and skip
> > > +	 * matching on protocol layers specified without any masks.
> > > +	 * - If not set, PMD will match on protocol layers
> > > +	 * specified without any masks as well.
> > > +	 * - Packet data must be stacked in the same order as the
> > > +	 * protocol layers to match inside packets, starting from the lowest.
> > > +	 */
> > > +	uint32_t relaxed_matching:1;
> >
> > I should notice this earlier, but it looks like a new feature
> > which sounds unrelated to templates. If so, it makes asymmetry
> > in sync and async flow rules capabilities.
> > Am I missing something?
> >
> > Anyway, the feature looks hidden in the patch.
> >
> No this is not hidden feature.
> In current API application must specify all the preciding items,
> For example application wants to match on udp source port.
> The rte flow will look something like eth / ipv4/ udp sport = xxx ..
> When PMD gets this pattern it must enforce the after the eth
> there will be IPv4 and then UDP and then add the match for the
> sport.
> This means that the PMD addes extra matching.
> If the application already validated that there is udp in the packet
> in group 0 and then jump to group 1  it can save the HW those extra matching
> by enabling this bit which means that the HW should only match on implicit
> masked fields.

This is a new capability that only exists for templates.
We can think about adding it to the old rte_flow_create() API when
we are allowed to break ABI again.

^ permalink raw reply	[relevance 3%]

* Re: [PATCH] raw/cnxk_gpio: fix DPDK version in a map file
  @ 2022-02-23 16:28  3%   ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-02-23 16:28 UTC (permalink / raw)
  To: Tomasz Duszynski; +Cc: dev, jerinj, Ferruh Yigit

23/02/2022 14:50, Ferruh Yigit:
> On 2/23/2022 1:32 PM, Tomasz Duszynski wrote:
> > PMD driver got merged during 22.03 merge window and number in map file
> > should reflect that.
> > 
> > Fixes: d0b8a4e19131 ("raw/cnxk_gpio: add GPIO driver skeleton")
> > 
> > Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied with title "fix ABI version"



^ permalink raw reply	[relevance 3%]

* Re: DPDK LTS release
  @ 2022-02-23 16:57  3%     ` Kevin Traynor
  0 siblings, 0 replies; 200+ results
From: Kevin Traynor @ 2022-02-23 16:57 UTC (permalink / raw)
  To: Kamaraj P; +Cc: dev, hpai, Kamaraj P (kamp)

On 23/02/2022 16:16, Kamaraj P wrote:
> Thanks Kevin.
> 
> Apart from release notes to identify changes of DPDK version from 19.11 to
> 21.11, is there any any major design changes in DPDK ? for example (memory
> management, mempool allocation behavior etc)
> Please share if there is any pointers.
> 

Notably the make based build system was removed in 20.11, but you'll 
need to check the release notes [0] to see what else impacts you. In 
particular the 20.11 and 21.11 were ABI breaking releases.

[0] http://doc.dpdk.org/guides/rel_notes/index.html


> Thanks,
> Kamaraj
> 
> On Mon, Feb 21, 2022 at 3:53 PM Kevin Traynor <ktraynor@redhat.com> wrote:
> 
>> On 21/02/2022 06:47, Kamaraj P wrote:
>>> Hi Team,
>>>
>>
>> Hi,
>>
>>> We are planning to upgrade the DPDK stable LTS version from DPDK19.11.
>>> Could you please suggest what would be the stable LTS version of DPDK ?
>>>
>>
>> If you are looking for an LTS version that will be maintained for the
>> longest time in the future, then you can jump to the latest DPDK LTS
>> series 21.11.
>>
>> It will be maintained with backported bugfixes until at least November
>> 2023, but we are trialing longer support on some LTS releases so there
>> is a possibility it might be extended.
>>
>> If you take a look at http://core.dpdk.org/roadmap/#stable you can see
>> the current roadmap of how long each LTS version is maintained for.
>>
>> thanks,
>> Kevin.
>>
>>> Thanks,
>>> Kamaraj
>>>
>>
>>
> 


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v18 8/8] eal: implement functions for mutex management
  2022-02-20 21:56  4%       ` Dmitry Kozlyuk
@ 2022-02-23 17:08  0%         ` Dmitry Kozlyuk
  2022-02-24 17:29  0%           ` Ananyev, Konstantin
  0 siblings, 1 reply; 200+ results
From: Dmitry Kozlyuk @ 2022-02-23 17:08 UTC (permalink / raw)
  To: Ananyev, Konstantin
  Cc: Narcisa Ana Maria Vasile, Richardson, Bruce, david.marchand, dev,
	dmitrym, khot, navasile, ocardona, Kadam, Pallavi, roretzla,
	talshn, thomas

2022-02-21 00:56 (UTC+0300), Dmitry Kozlyuk:
> 2022-02-09 13:57 (UTC+0000), Ananyev, Konstantin:
> > > > Actually, please scrap that comment.
> > > > Obviously it wouldn't work for static variables,
> > > > and doesn't make much sense.
> > > > Though few thoughts remain:
> > > > for posix we probably don't need an indirection and
> > > > rte_thread_mutex can be just typedef of pthread_mutex_t.
> > > > also for posix we don't need RTE_INIT constructor for each
> > > > static mutex initialization.
> > > > Something like:
> > > > #define RTE_STATIC_INITIALIZED_MUTEX(mx) \
> > > > 	rte_thread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER
> > > > should work, I think.
> > > > Konstantin    
> > > 
> > > Thank you for reviewing, Konstantin!
> > > Some context for the current representation of mutex
> > > can be found in v9, patch 7/10 of this patchset.
> > > 
> > > Originally we've typedef'ed the pthread_mutex_t on POSIX, just
> > > like you are suggesting here.
> > > However, on Windows there's no static initializer similar to the pthread
> > > one. Still, we want ABI compatibility and same thread behavior between
> > > platforms. The most elegant solution we found was the current representation,
> > > as suggested by Dmitry K.    
> > 
> > Yes, I agree it is a problem with Windows for static initializer.
> > But why we can't have different structs typedef for mutex 
> > for posix and windows platforms?  
> 
> Yes, I agree that having different mutex types on *nix and Windows
> is a great idea. It will avoid ABI change for *nix
> and will guarantee no performance impact.
> 
> Maybe wrap pthread_mutex_t into a struct to have a distinct type
> and to force using only DPDK API with it?
> 
> [...]
> > Yes, on Windows rte_thread_mutex still wouldn't work for MP,
> > but that's the same as with current design.  
> 
> MP support is not planned for Windows and it is unknown if it ever will be,
> so it's not an issue.
> Data location is.
> The reason rte_thread_mutex_t is not a typedef of CRITICAL_SECTION
> (akin to pthread_mutex_t) is to avoid including Windows headers
> into DPDK public headers, because Windows headers can break user code
> by some macros they define.
> Maybe instead of a pointer it could be an opaque array:
> 
> 	#define RTE_PTHREAD_MUTEX_SIZE 40
> 
> 	struct rte_pthread_mutex_t {
> 		uint8_t opaque[RTE_PTHREAD_MUTEX_SIZE];
> 	};
> 
> where RTE_PTHREAD_MUTEX_SIZE is actually sizeof(CRITICAL_SECTION).
> Win32 ABI is remarkably stable, I don't think this constant will ever change,
> it would break all the Windows user space.
> Naty, DmitryM, Tyler, what do you think?

Conclusion from offline call: yes, this is OK to do so.

However, DmitryM suggested using Slim Reader-Writer lock (SRW):
https://docs.microsoft.com/en-us/windows/win32/sync/slim-reader-writer--srw--locks
instead of CRITICAL_SECTION.
It seems to be a much better option:

* sizeof(SRWLOCK) == 8 (technically "size of a pointer"),
  same as sizeof(pthread_mutex_t) on a typical Linux.
  Layout of data structures containing rte_thread_mutex_t
  can be the same on Windows and Unix,
  which simplifies design and promises similar less performance differences.

* Can be taken by multiple readers and one writer,
  which is semantically similar to pthread_mutex_t
  (CRITICAL_SECTION can only be taken by a single thread).

Technically it can be a "typedef uintptr_t" or a structure wrapping it.

^ permalink raw reply	[relevance 0%]

* [PATCH v2 0/6] mlx5: external RxQ support
  @ 2022-02-23 18:48  3% ` Michael Baum
  2022-02-23 18:48  4%   ` [PATCH v2 1/6] common/mlx5: consider local functions as internal Michael Baum
                     ` (2 more replies)
  0 siblings, 3 replies; 200+ results
From: Michael Baum @ 2022-02-23 18:48 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko

These patches add support to external Rx queues.
External queue is a queue that is managed by a process external to PMD,
but uses PMD process to generate its flow rules.

For the hardware to allow the DPDK process to set rules for it, the
process needs to use the same PD of the external process. In addition,
the indexes of the queues in hardware are represented by 32-bit compared
to the rte_flow indexes represented by 16-bit, so the processes need to
share some mapping between the indexes.

These patches allow the external process to provide devargs which enable
importing its context and PD, instead of prepare new ones. In addition,
an API is provided for mapping for the indexes of the queues. 

v2:
- Rebase.
- Add ABI exception for common/mlx5 library.
- Correct DevX flag updating.
- Improve explanations in doc and comments.
- Remove teatpmd part.


Michael Baum (6):
  common/mlx5: consider local functions as internal
  common/mlx5: glue device and PD importation
  common/mlx5: add remote PD and CTX support
  net/mlx5: optimize RxQ/TxQ control structure
  net/mlx5: add external RxQ mapping API
  net/mlx5: support queue/RSS action for external RxQ

 devtools/libabigail.abignore                 |   4 +
 doc/guides/nics/mlx5.rst                     |   1 +
 doc/guides/platform/mlx5.rst                 |  37 ++-
 doc/guides/rel_notes/release_22_03.rst       |   1 +
 drivers/common/mlx5/linux/meson.build        |   2 +
 drivers/common/mlx5/linux/mlx5_common_os.c   | 196 ++++++++++++--
 drivers/common/mlx5/linux/mlx5_common_os.h   |   7 +-
 drivers/common/mlx5/linux/mlx5_glue.c        |  41 +++
 drivers/common/mlx5/linux/mlx5_glue.h        |   4 +
 drivers/common/mlx5/mlx5_common.c            |  64 ++++-
 drivers/common/mlx5/mlx5_common.h            |  23 +-
 drivers/common/mlx5/version.map              |   3 +
 drivers/common/mlx5/windows/mlx5_common_os.c |  37 ++-
 drivers/common/mlx5/windows/mlx5_common_os.h |   1 -
 drivers/net/mlx5/linux/mlx5_os.c             |  18 ++
 drivers/net/mlx5/mlx5.c                      |   6 +
 drivers/net/mlx5/mlx5.h                      |   1 +
 drivers/net/mlx5/mlx5_defs.h                 |   3 +
 drivers/net/mlx5/mlx5_devx.c                 |  52 ++--
 drivers/net/mlx5/mlx5_ethdev.c               |  18 +-
 drivers/net/mlx5/mlx5_flow.c                 |  43 ++--
 drivers/net/mlx5/mlx5_flow_dv.c              |  14 +-
 drivers/net/mlx5/mlx5_rx.h                   |  49 +++-
 drivers/net/mlx5/mlx5_rxq.c                  | 258 +++++++++++++++++--
 drivers/net/mlx5/mlx5_trigger.c              |  36 +--
 drivers/net/mlx5/mlx5_tx.h                   |   7 +-
 drivers/net/mlx5/mlx5_txq.c                  |  14 +-
 drivers/net/mlx5/rte_pmd_mlx5.h              |  50 +++-
 drivers/net/mlx5/version.map                 |   3 +
 29 files changed, 821 insertions(+), 172 deletions(-)

-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [PATCH v2 1/6] common/mlx5: consider local functions as internal
  2022-02-23 18:48  3% ` [PATCH v2 " Michael Baum
@ 2022-02-23 18:48  4%   ` Michael Baum
  2022-02-24  8:38  0%   ` [PATCH v2 0/6] mlx5: external RxQ support Matan Azrad
  2022-02-24 23:25  3%   ` [PATCH v3 " Michael Baum
  2 siblings, 0 replies; 200+ results
From: Michael Baum @ 2022-02-23 18:48 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko

The functions which are not explicitly marked as internal
were exported because the local catch-all rule was missing in the
version script.
After adding the missing rule, all local functions are hidden.
The function mlx5_get_device_guid is used in another library,
so it needs to be exported (as internal).

Because the local functions were exported as non-internal
in DPDK 21.11, any change in these functions would break the ABI.
An ABI exception is added for this library, considering that all
functions are either local or internal.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
---
 devtools/libabigail.abignore               | 4 ++++
 drivers/common/mlx5/linux/mlx5_common_os.h | 1 +
 drivers/common/mlx5/version.map            | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index ef0602975a..78d57497e6 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -20,3 +20,7 @@
 ; Ignore changes to rte_crypto_asym_op, asymmetric crypto API is experimental
 [suppress_type]
         name = rte_crypto_asym_op
+
+; Ignore changes in common mlx5 driver, should be all internal
+[suppress_file]
+        soname_regexp = ^librte_common_mlx5\.
\ No newline at end of file
diff --git a/drivers/common/mlx5/linux/mlx5_common_os.h b/drivers/common/mlx5/linux/mlx5_common_os.h
index 83066e752d..edf356a30a 100644
--- a/drivers/common/mlx5/linux/mlx5_common_os.h
+++ b/drivers/common/mlx5/linux/mlx5_common_os.h
@@ -300,6 +300,7 @@ mlx5_set_context_attr(struct rte_device *dev, struct ibv_context *ctx);
  *  0 if OFED doesn't support.
  *  >0 if success.
  */
+__rte_internal
 int
 mlx5_get_device_guid(const struct rte_pci_addr *dev, uint8_t *guid, size_t len);
 
diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map
index 1c6153c576..cb20a7d893 100644
--- a/drivers/common/mlx5/version.map
+++ b/drivers/common/mlx5/version.map
@@ -80,6 +80,7 @@ INTERNAL {
 
 	mlx5_free;
 
+	mlx5_get_device_guid; # WINDOWS_NO_EXPORT
 	mlx5_get_ifname_sysfs; # WINDOWS_NO_EXPORT
 	mlx5_get_pci_addr; # WINDOWS_NO_EXPORT
 
@@ -149,4 +150,6 @@ INTERNAL {
 	mlx5_mp_req_mempool_reg;
 	mlx5_mr_mempool2mr_bh;
 	mlx5_mr_mempool_populate_cache;
+
+	local: *;
 };
-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* RE: [PATCH v2 0/6] mlx5: external RxQ support
  2022-02-23 18:48  3% ` [PATCH v2 " Michael Baum
  2022-02-23 18:48  4%   ` [PATCH v2 1/6] common/mlx5: consider local functions as internal Michael Baum
@ 2022-02-24  8:38  0%   ` Matan Azrad
  2022-02-24 23:25  3%   ` [PATCH v3 " Michael Baum
  2 siblings, 0 replies; 200+ results
From: Matan Azrad @ 2022-02-24  8:38 UTC (permalink / raw)
  To: Michael Baum, dev; +Cc: Raslan Darawsheh, Slava Ovsiienko



From: Michael Baum
> These patches add support to external Rx queues.
> External queue is a queue that is managed by a process external to PMD, but
> uses PMD process to generate its flow rules.
> 
> For the hardware to allow the DPDK process to set rules for it, the process needs
> to use the same PD of the external process. In addition, the indexes of the
> queues in hardware are represented by 32-bit compared to the rte_flow indexes
> represented by 16-bit, so the processes need to share some mapping between
> the indexes.
> 
> These patches allow the external process to provide devargs which enable
> importing its context and PD, instead of prepare new ones. In addition, an API is
> provided for mapping for the indexes of the queues.
> 
> v2:
> - Rebase.
> - Add ABI exception for common/mlx5 library.
> - Correct DevX flag updating.
> - Improve explanations in doc and comments.
> - Remove teatpmd part.
> 

Series-acked-by: Matan Azrad <matan@nvidia.com>

> Michael Baum (6):
>   common/mlx5: consider local functions as internal
>   common/mlx5: glue device and PD importation
>   common/mlx5: add remote PD and CTX support
>   net/mlx5: optimize RxQ/TxQ control structure
>   net/mlx5: add external RxQ mapping API
>   net/mlx5: support queue/RSS action for external RxQ
> 
>  devtools/libabigail.abignore                 |   4 +
>  doc/guides/nics/mlx5.rst                     |   1 +
>  doc/guides/platform/mlx5.rst                 |  37 ++-
>  doc/guides/rel_notes/release_22_03.rst       |   1 +
>  drivers/common/mlx5/linux/meson.build        |   2 +
>  drivers/common/mlx5/linux/mlx5_common_os.c   | 196 ++++++++++++--
>  drivers/common/mlx5/linux/mlx5_common_os.h   |   7 +-
>  drivers/common/mlx5/linux/mlx5_glue.c        |  41 +++
>  drivers/common/mlx5/linux/mlx5_glue.h        |   4 +
>  drivers/common/mlx5/mlx5_common.c            |  64 ++++-
>  drivers/common/mlx5/mlx5_common.h            |  23 +-
>  drivers/common/mlx5/version.map              |   3 +
>  drivers/common/mlx5/windows/mlx5_common_os.c |  37 ++-
>  drivers/common/mlx5/windows/mlx5_common_os.h |   1 -
>  drivers/net/mlx5/linux/mlx5_os.c             |  18 ++
>  drivers/net/mlx5/mlx5.c                      |   6 +
>  drivers/net/mlx5/mlx5.h                      |   1 +
>  drivers/net/mlx5/mlx5_defs.h                 |   3 +
>  drivers/net/mlx5/mlx5_devx.c                 |  52 ++--
>  drivers/net/mlx5/mlx5_ethdev.c               |  18 +-
>  drivers/net/mlx5/mlx5_flow.c                 |  43 ++--
>  drivers/net/mlx5/mlx5_flow_dv.c              |  14 +-
>  drivers/net/mlx5/mlx5_rx.h                   |  49 +++-
>  drivers/net/mlx5/mlx5_rxq.c                  | 258 +++++++++++++++++--
>  drivers/net/mlx5/mlx5_trigger.c              |  36 +--
>  drivers/net/mlx5/mlx5_tx.h                   |   7 +-
>  drivers/net/mlx5/mlx5_txq.c                  |  14 +-
>  drivers/net/mlx5/rte_pmd_mlx5.h              |  50 +++-
>  drivers/net/mlx5/version.map                 |   3 +
>  29 files changed, 821 insertions(+), 172 deletions(-)
> 
> --
> 2.25.1


^ permalink raw reply	[relevance 0%]

* RE: [PATCH v18 8/8] eal: implement functions for mutex management
  2022-02-23 17:08  0%         ` Dmitry Kozlyuk
@ 2022-02-24 17:29  0%           ` Ananyev, Konstantin
  2022-02-24 17:44  0%             ` Stephen Hemminger
  0 siblings, 1 reply; 200+ results
From: Ananyev, Konstantin @ 2022-02-24 17:29 UTC (permalink / raw)
  To: Dmitry Kozlyuk
  Cc: Narcisa Ana Maria Vasile, Richardson, Bruce, david.marchand, dev,
	dmitrym, khot, navasile, ocardona, Kadam, Pallavi, roretzla,
	talshn, thomas


Hi Dmitry,

> 2022-02-21 00:56 (UTC+0300), Dmitry Kozlyuk:
> > 2022-02-09 13:57 (UTC+0000), Ananyev, Konstantin:
> > > > > Actually, please scrap that comment.
> > > > > Obviously it wouldn't work for static variables,
> > > > > and doesn't make much sense.
> > > > > Though few thoughts remain:
> > > > > for posix we probably don't need an indirection and
> > > > > rte_thread_mutex can be just typedef of pthread_mutex_t.
> > > > > also for posix we don't need RTE_INIT constructor for each
> > > > > static mutex initialization.
> > > > > Something like:
> > > > > #define RTE_STATIC_INITIALIZED_MUTEX(mx) \
> > > > > 	rte_thread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER
> > > > > should work, I think.
> > > > > Konstantin
> > > >
> > > > Thank you for reviewing, Konstantin!
> > > > Some context for the current representation of mutex
> > > > can be found in v9, patch 7/10 of this patchset.
> > > >
> > > > Originally we've typedef'ed the pthread_mutex_t on POSIX, just
> > > > like you are suggesting here.
> > > > However, on Windows there's no static initializer similar to the pthread
> > > > one. Still, we want ABI compatibility and same thread behavior between
> > > > platforms. The most elegant solution we found was the current representation,
> > > > as suggested by Dmitry K.
> > >
> > > Yes, I agree it is a problem with Windows for static initializer.
> > > But why we can't have different structs typedef for mutex
> > > for posix and windows platforms?
> >
> > Yes, I agree that having different mutex types on *nix and Windows
> > is a great idea. It will avoid ABI change for *nix
> > and will guarantee no performance impact.
> >
> > Maybe wrap pthread_mutex_t into a struct to have a distinct type
> > and to force using only DPDK API with it?
> >
> > [...]
> > > Yes, on Windows rte_thread_mutex still wouldn't work for MP,
> > > but that's the same as with current design.
> >
> > MP support is not planned for Windows and it is unknown if it ever will be,
> > so it's not an issue.
> > Data location is.
> > The reason rte_thread_mutex_t is not a typedef of CRITICAL_SECTION
> > (akin to pthread_mutex_t) is to avoid including Windows headers
> > into DPDK public headers, because Windows headers can break user code
> > by some macros they define.
> > Maybe instead of a pointer it could be an opaque array:
> >
> > 	#define RTE_PTHREAD_MUTEX_SIZE 40
> >
> > 	struct rte_pthread_mutex_t {
> > 		uint8_t opaque[RTE_PTHREAD_MUTEX_SIZE];
> > 	};
> >
> > where RTE_PTHREAD_MUTEX_SIZE is actually sizeof(CRITICAL_SECTION).
> > Win32 ABI is remarkably stable, I don't think this constant will ever change,
> > it would break all the Windows user space.
> > Naty, DmitryM, Tyler, what do you think?
> 
> Conclusion from offline call: yes, this is OK to do so.
> 
> However, DmitryM suggested using Slim Reader-Writer lock (SRW):
> https://docs.microsoft.com/en-us/windows/win32/sync/slim-reader-writer--srw--locks
> instead of CRITICAL_SECTION.
> It seems to be a much better option:
> 
> * sizeof(SRWLOCK) == 8 (technically "size of a pointer"),
>   same as sizeof(pthread_mutex_t) on a typical Linux.
>   Layout of data structures containing rte_thread_mutex_t
>   can be the same on Windows and Unix,
>   which simplifies design and promises similar less performance differences.
> 
> * Can be taken by multiple readers and one writer,
>   which is semantically similar to pthread_mutex_t

Not sure I understand you here:
pthread_mutex provides only mutually-exclusive lock semantics.
For RW lock there exists: pthread_rwlock_t.
Off-course you can use rwlock fo exclusive locking too -
if all callers will use only writer locks, but usually that's no point to do that -
mutexes are simpler and faster.
That's for posix-like systems, don't know much about Windows environment :)

>   (CRITICAL_SECTION can only be taken by a single thread).
> 
> Technically it can be a "typedef uintptr_t" or a structure wrapping it.

Again can't say much about Windows, but pthread_mutex_t
can (and is) bigger then then 8 bytes. 



^ permalink raw reply	[relevance 0%]

* Re: [PATCH v18 8/8] eal: implement functions for mutex management
  2022-02-24 17:29  0%           ` Ananyev, Konstantin
@ 2022-02-24 17:44  0%             ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2022-02-24 17:44 UTC (permalink / raw)
  To: Ananyev, Konstantin
  Cc: Dmitry Kozlyuk, Narcisa Ana Maria Vasile, Richardson, Bruce,
	david.marchand, dev, dmitrym, khot, navasile, ocardona, Kadam,
	Pallavi, roretzla, talshn, thomas

On Thu, 24 Feb 2022 17:29:03 +0000
"Ananyev, Konstantin" <konstantin.ananyev@intel.com> wrote:

> Hi Dmitry,
> 
> > 2022-02-21 00:56 (UTC+0300), Dmitry Kozlyuk:  
> > > 2022-02-09 13:57 (UTC+0000), Ananyev, Konstantin:  
> > > > > > Actually, please scrap that comment.
> > > > > > Obviously it wouldn't work for static variables,
> > > > > > and doesn't make much sense.
> > > > > > Though few thoughts remain:
> > > > > > for posix we probably don't need an indirection and
> > > > > > rte_thread_mutex can be just typedef of pthread_mutex_t.
> > > > > > also for posix we don't need RTE_INIT constructor for each
> > > > > > static mutex initialization.
> > > > > > Something like:
> > > > > > #define RTE_STATIC_INITIALIZED_MUTEX(mx) \
> > > > > > 	rte_thread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER
> > > > > > should work, I think.
> > > > > > Konstantin  
> > > > >
> > > > > Thank you for reviewing, Konstantin!
> > > > > Some context for the current representation of mutex
> > > > > can be found in v9, patch 7/10 of this patchset.
> > > > >
> > > > > Originally we've typedef'ed the pthread_mutex_t on POSIX, just
> > > > > like you are suggesting here.
> > > > > However, on Windows there's no static initializer similar to the pthread
> > > > > one. Still, we want ABI compatibility and same thread behavior between
> > > > > platforms. The most elegant solution we found was the current representation,
> > > > > as suggested by Dmitry K.  
> > > >
> > > > Yes, I agree it is a problem with Windows for static initializer.
> > > > But why we can't have different structs typedef for mutex
> > > > for posix and windows platforms?  
> > >
> > > Yes, I agree that having different mutex types on *nix and Windows
> > > is a great idea. It will avoid ABI change for *nix
> > > and will guarantee no performance impact.
> > >
> > > Maybe wrap pthread_mutex_t into a struct to have a distinct type
> > > and to force using only DPDK API with it?
> > >
> > > [...]  
> > > > Yes, on Windows rte_thread_mutex still wouldn't work for MP,
> > > > but that's the same as with current design.  
> > >
> > > MP support is not planned for Windows and it is unknown if it ever will be,
> > > so it's not an issue.
> > > Data location is.
> > > The reason rte_thread_mutex_t is not a typedef of CRITICAL_SECTION
> > > (akin to pthread_mutex_t) is to avoid including Windows headers
> > > into DPDK public headers, because Windows headers can break user code
> > > by some macros they define.
> > > Maybe instead of a pointer it could be an opaque array:
> > >
> > > 	#define RTE_PTHREAD_MUTEX_SIZE 40
> > >
> > > 	struct rte_pthread_mutex_t {
> > > 		uint8_t opaque[RTE_PTHREAD_MUTEX_SIZE];
> > > 	};
> > >
> > > where RTE_PTHREAD_MUTEX_SIZE is actually sizeof(CRITICAL_SECTION).
> > > Win32 ABI is remarkably stable, I don't think this constant will ever change,
> > > it would break all the Windows user space.
> > > Naty, DmitryM, Tyler, what do you think?  
> > 
> > Conclusion from offline call: yes, this is OK to do so.
> > 
> > However, DmitryM suggested using Slim Reader-Writer lock (SRW):
> > https://docs.microsoft.com/en-us/windows/win32/sync/slim-reader-writer--srw--locks
> > instead of CRITICAL_SECTION.
> > It seems to be a much better option:
> > 
> > * sizeof(SRWLOCK) == 8 (technically "size of a pointer"),
> >   same as sizeof(pthread_mutex_t) on a typical Linux.
> >   Layout of data structures containing rte_thread_mutex_t
> >   can be the same on Windows and Unix,
> >   which simplifies design and promises similar less performance differences.
> > 
> > * Can be taken by multiple readers and one writer,
> >   which is semantically similar to pthread_mutex_t  
> 
> Not sure I understand you here:
> pthread_mutex provides only mutually-exclusive lock semantics.
> For RW lock there exists: pthread_rwlock_t.
> Off-course you can use rwlock fo exclusive locking too -
> if all callers will use only writer locks, but usually that's no point to do that -
> mutexes are simpler and faster.
> That's for posix-like systems, don't know much about Windows environment :)
> 
> >   (CRITICAL_SECTION can only be taken by a single thread).
> > 
> > Technically it can be a "typedef uintptr_t" or a structure wrapping it.  
> 
> Again can't say much about Windows, but pthread_mutex_t
> can (and is) bigger then then 8 bytes. 
> 
> 


There seems to be some confusion here:
   pthread_mutex put thread to sleep if contended and on linux are built on the futex system call.
   pthread_rwlock are the reader/writer versions of these.

The DPDK has primitives for multiple types of locks: spinlock, rwlock, ticketlock, pflock, etc
   these are build using atomic primitives (no syscall).
   these are platform independent
   these spin if contended

Not sure about Windows, but it looks like slim rwlocks came from Windows NT and are an implementation
of the same kind of spinning lock DPDK already has.


^ permalink raw reply	[relevance 0%]

* [PATCH v3 0/6] mlx5: external RxQ support
  2022-02-23 18:48  3% ` [PATCH v2 " Michael Baum
  2022-02-23 18:48  4%   ` [PATCH v2 1/6] common/mlx5: consider local functions as internal Michael Baum
  2022-02-24  8:38  0%   ` [PATCH v2 0/6] mlx5: external RxQ support Matan Azrad
@ 2022-02-24 23:25  3%   ` Michael Baum
  2022-02-24 23:25  4%     ` [PATCH v3 1/6] common/mlx5: consider local functions as internal Michael Baum
  2 siblings, 1 reply; 200+ results
From: Michael Baum @ 2022-02-24 23:25 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko

These patches add support to external Rx queues.
External queue is a queue that is managed by a process external to PMD,
but uses PMD process to generate its flow rules.

For the hardware to allow the DPDK process to set rules for it, the
process needs to use the same PD of the external process. In addition,
the indexes of the queues in hardware are represented by 32-bit compared
to the rte_flow indexes represented by 16-bit, so the processes need to
share some mapping between the indexes.

These patches allow the external process to provide devargs which enable
importing its context and PD, instead of prepare new ones. In addition,
an API is provided for mapping for the indexes of the queues.

v1:
- initial commits.

v2:
- Rebase.
- Add ABI exception for common/mlx5 library.
- Correct DevX flag updating.
- Improve explanations in doc and comments.
- Remove teatpmd part. 

v3:
- Rebase.
- Fix compilation error.
- Avoide TOCTOU issue in external RxQ map/unmap functions.
- Add check it the queue still referenced in unmapping function.
- Improve guide explanations for the new devargs.


Michael Baum (6):
  common/mlx5: consider local functions as internal
  common/mlx5: glue device and PD importation
  common/mlx5: add remote PD and CTX support
  net/mlx5: optimize RxQ/TxQ control structure
  net/mlx5: add external RxQ mapping API
  net/mlx5: support queue/RSS action for external RxQ

 devtools/libabigail.abignore                 |   4 +
 doc/guides/nics/mlx5.rst                     |   1 +
 doc/guides/platform/mlx5.rst                 |  37 ++-
 doc/guides/rel_notes/release_22_03.rst       |   1 +
 drivers/common/mlx5/linux/meson.build        |   2 +
 drivers/common/mlx5/linux/mlx5_common_os.c   | 196 ++++++++++++--
 drivers/common/mlx5/linux/mlx5_common_os.h   |   7 +-
 drivers/common/mlx5/linux/mlx5_glue.c        |  41 +++
 drivers/common/mlx5/linux/mlx5_glue.h        |   4 +
 drivers/common/mlx5/mlx5_common.c            |  84 ++++--
 drivers/common/mlx5/mlx5_common.h            |  23 +-
 drivers/common/mlx5/version.map              |   3 +
 drivers/common/mlx5/windows/mlx5_common_os.c |  37 ++-
 drivers/common/mlx5/windows/mlx5_common_os.h |   1 -
 drivers/net/mlx5/linux/mlx5_os.c             |  17 ++
 drivers/net/mlx5/mlx5.c                      |   5 +
 drivers/net/mlx5/mlx5.h                      |   1 +
 drivers/net/mlx5/mlx5_defs.h                 |   3 +
 drivers/net/mlx5/mlx5_devx.c                 |  52 ++--
 drivers/net/mlx5/mlx5_ethdev.c               |  18 +-
 drivers/net/mlx5/mlx5_flow.c                 |  43 +--
 drivers/net/mlx5/mlx5_flow_dv.c              |  14 +-
 drivers/net/mlx5/mlx5_rx.h                   |  49 +++-
 drivers/net/mlx5/mlx5_rxq.c                  | 266 +++++++++++++++++--
 drivers/net/mlx5/mlx5_trigger.c              |  36 +--
 drivers/net/mlx5/mlx5_tx.h                   |   7 +-
 drivers/net/mlx5/mlx5_txq.c                  |  14 +-
 drivers/net/mlx5/rte_pmd_mlx5.h              |  50 +++-
 drivers/net/mlx5/version.map                 |   3 +
 29 files changed, 838 insertions(+), 181 deletions(-)

-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [PATCH v3 1/6] common/mlx5: consider local functions as internal
  2022-02-24 23:25  3%   ` [PATCH v3 " Michael Baum
@ 2022-02-24 23:25  4%     ` Michael Baum
  2022-02-25 18:01  0%       ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Michael Baum @ 2022-02-24 23:25 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko

The functions which are not explicitly marked as internal
were exported because the local catch-all rule was missing in the
version script.
After adding the missing rule, all local functions are hidden.
The function mlx5_get_device_guid is used in another library,
so it needs to be exported (as internal).

Because the local functions were exported as non-internal
in DPDK 21.11, any change in these functions would break the ABI.
An ABI exception is added for this library, considering that all
functions are either local or internal.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 devtools/libabigail.abignore               | 4 ++++
 drivers/common/mlx5/linux/mlx5_common_os.h | 1 +
 drivers/common/mlx5/version.map            | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index ef0602975a..78d57497e6 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -20,3 +20,7 @@
 ; Ignore changes to rte_crypto_asym_op, asymmetric crypto API is experimental
 [suppress_type]
         name = rte_crypto_asym_op
+
+; Ignore changes in common mlx5 driver, should be all internal
+[suppress_file]
+        soname_regexp = ^librte_common_mlx5\.
\ No newline at end of file
diff --git a/drivers/common/mlx5/linux/mlx5_common_os.h b/drivers/common/mlx5/linux/mlx5_common_os.h
index 83066e752d..edf356a30a 100644
--- a/drivers/common/mlx5/linux/mlx5_common_os.h
+++ b/drivers/common/mlx5/linux/mlx5_common_os.h
@@ -300,6 +300,7 @@ mlx5_set_context_attr(struct rte_device *dev, struct ibv_context *ctx);
  *  0 if OFED doesn't support.
  *  >0 if success.
  */
+__rte_internal
 int
 mlx5_get_device_guid(const struct rte_pci_addr *dev, uint8_t *guid, size_t len);
 
diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map
index 1c6153c576..cb20a7d893 100644
--- a/drivers/common/mlx5/version.map
+++ b/drivers/common/mlx5/version.map
@@ -80,6 +80,7 @@ INTERNAL {
 
 	mlx5_free;
 
+	mlx5_get_device_guid; # WINDOWS_NO_EXPORT
 	mlx5_get_ifname_sysfs; # WINDOWS_NO_EXPORT
 	mlx5_get_pci_addr; # WINDOWS_NO_EXPORT
 
@@ -149,4 +150,6 @@ INTERNAL {
 	mlx5_mp_req_mempool_reg;
 	mlx5_mr_mempool2mr_bh;
 	mlx5_mr_mempool_populate_cache;
+
+	local: *;
 };
-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* Re: [EXT] [PATCH] crypto: fix misspelled key in qt format
  2022-02-18  6:11  0%   ` Kusztal, ArkadiuszX
@ 2022-02-25 17:56  4%     ` Thomas Monjalon
  2022-02-25 19:35  0%       ` Ray Kinsella
  0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-02-25 17:56 UTC (permalink / raw)
  To: Akhil Goyal, Kusztal, ArkadiuszX
  Cc: dev, Zhang, Roy Fan, ray.kinsella, david.marchand

18/02/2022 07:11, Kusztal, ArkadiuszX:
> From: Akhil Goyal <gakhil@marvell.com>
> > Fix ABI warning.
> > Add libabigail.abiignore rule.
> 
> I think what is worth noticing is a fact that after "random 'k' patch" addition of
> [suppress_type]
>         name = rte_crypto_asym_op
> this problem does not show up.
> 
> But I think it is safer to send addition of
> [suppress_type]
>         name = rte_crypto_rsa_priv_key_type
> anyway.
> Will send v2.

I don't understand why adding this rule,
and the comment does say nothing about it:
	"Ignore name change of rsa qt key type"

The ABI check is fine without above because of this existing exception:

; Ignore changes to rte_crypto_asym_op, asymmetric crypto API is experimental
[suppress_type]
        name = rte_crypto_asym_op

So I will just drop the unjustified additional exception while pulling.

Next time, please make sure such ABI exception is approved by more maintainers.



^ permalink raw reply	[relevance 4%]

* Re: [PATCH v3 1/6] common/mlx5: consider local functions as internal
  2022-02-24 23:25  4%     ` [PATCH v3 1/6] common/mlx5: consider local functions as internal Michael Baum
@ 2022-02-25 18:01  0%       ` Ferruh Yigit
  2022-02-25 18:38  3%         ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2022-02-25 18:01 UTC (permalink / raw)
  To: Michael Baum, dev, Thomas Monjalon
  Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko,
	David Marchand, Ray Kinsella

On 2/24/2022 11:25 PM, Michael Baum wrote:
> The functions which are not explicitly marked as internal
> were exported because the local catch-all rule was missing in the
> version script.
> After adding the missing rule, all local functions are hidden.
> The function mlx5_get_device_guid is used in another library,
> so it needs to be exported (as internal).
> 
> Because the local functions were exported as non-internal
> in DPDK 21.11, any change in these functions would break the ABI.
> An ABI exception is added for this library, considering that all
> functions are either local or internal.
> 

When a function is not listed explicitly in .map file, it shouldn't
be exported at all.

So I am not sure if this exception is required, did you get
warning for tool, or is this theoretical?

cc'ed David and Ray for comment.

> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>


<...>



^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 1/6] common/mlx5: consider local functions as internal
  2022-02-25 18:01  0%       ` Ferruh Yigit
@ 2022-02-25 18:38  3%         ` Thomas Monjalon
  2022-02-25 19:13  0%           ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-02-25 18:38 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Michael Baum, dev, Matan Azrad, Raslan Darawsheh,
	Viacheslav Ovsiienko, David Marchand, Ray Kinsella

25/02/2022 19:01, Ferruh Yigit:
> On 2/24/2022 11:25 PM, Michael Baum wrote:
> > The functions which are not explicitly marked as internal
> > were exported because the local catch-all rule was missing in the
> > version script.
> > After adding the missing rule, all local functions are hidden.
> > The function mlx5_get_device_guid is used in another library,
> > so it needs to be exported (as internal).
> > 
> > Because the local functions were exported as non-internal
> > in DPDK 21.11, any change in these functions would break the ABI.
> > An ABI exception is added for this library, considering that all
> > functions are either local or internal.
> > 
> 
> When a function is not listed explicitly in .map file, it shouldn't
> be exported at all.

It seems we need local:* to achieve this behaviour.
Few other libs are missing it. I plan to send a patch for them.

> So I am not sure if this exception is required, did you get
> warning for tool, or is this theoretical?

It is not theoritical, you can check with objdump:
objdump -T build/lib/librte_common_mlx5.so | sed -rn 's,^[[:xdigit:]]* g *(D[^0]*)[^ ]* *,\1,p'

I did not check the ABI tool without the exception.



^ permalink raw reply	[relevance 3%]

* Re: [PATCH v3 1/6] common/mlx5: consider local functions as internal
  2022-02-25 18:38  3%         ` Thomas Monjalon
@ 2022-02-25 19:13  0%           ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2022-02-25 19:13 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Michael Baum, dev, Matan Azrad, Raslan Darawsheh,
	Viacheslav Ovsiienko, David Marchand, Ray Kinsella

On 2/25/2022 6:38 PM, Thomas Monjalon wrote:
> 25/02/2022 19:01, Ferruh Yigit:
>> On 2/24/2022 11:25 PM, Michael Baum wrote:
>>> The functions which are not explicitly marked as internal
>>> were exported because the local catch-all rule was missing in the
>>> version script.
>>> After adding the missing rule, all local functions are hidden.
>>> The function mlx5_get_device_guid is used in another library,
>>> so it needs to be exported (as internal).
>>>
>>> Because the local functions were exported as non-internal
>>> in DPDK 21.11, any change in these functions would break the ABI.
>>> An ABI exception is added for this library, considering that all
>>> functions are either local or internal.
>>>
>>
>> When a function is not listed explicitly in .map file, it shouldn't
>> be exported at all.
> 
> It seems we need local:* to achieve this behaviour.
> Few other libs are missing it. I plan to send a patch for them.
> 

+1 for this patch, thanks.

>> So I am not sure if this exception is required, did you get
>> warning for tool, or is this theoretical?
> 
> It is not theoritical, you can check with objdump:
> objdump -T build/lib/librte_common_mlx5.so | sed -rn 's,^[[:xdigit:]]* g *(D[^0]*)[^ ]* *,\1,p'
> 
> I did not check the ABI tool without the exception.
> 

Yes tool complains with change [1], I will proceed with original patch.

[1]
29 Removed functions:

   [D] 'function int mlx5_auxiliary_get_pci_str(const rte_auxiliary_device*, char*, size_t)'    {mlx5_auxiliary_get_pci_str}
   [D] 'function void mlx5_common_auxiliary_init()'    {mlx5_common_auxiliary_init}
   [D] 'function int mlx5_common_dev_dma_map(rte_device*, void*, uint64_t, size_t)'    {mlx5_common_dev_dma_map}
   [D] 'function int mlx5_common_dev_dma_unmap(rte_device*, void*, uint64_t, size_t)'    {mlx5_common_dev_dma_unmap}
   [D] 'function int mlx5_common_dev_probe(rte_device*)'    {mlx5_common_dev_probe}
   [D] 'function int mlx5_common_dev_remove(rte_device*)'    {mlx5_common_dev_remove}
   [D] 'function void mlx5_common_driver_on_register_pci(mlx5_class_driver*)'    {mlx5_common_driver_on_register_pci}
   [D] 'function void mlx5_common_pci_init()'    {mlx5_common_pci_init}
   [D] 'function mlx5_mr* mlx5_create_mr_ext(void*, uintptr_t, size_t, int, mlx5_reg_mr_t)'    {mlx5_create_mr_ext}
   [D] 'function bool mlx5_dev_pci_match(const mlx5_class_driver*, const rte_device*)'    {mlx5_dev_pci_match}
   [D] 'function int mlx5_dev_to_pci_str(const rte_device*, char*, size_t)'    {mlx5_dev_to_pci_str}
   [D] 'function void mlx5_free_mr_by_addr(mlx5_mr_share_cache*, const char*, void*, size_t)'    {mlx5_free_mr_by_addr}
   [D] 'function ibv_device* mlx5_get_aux_ibv_device(const rte_auxiliary_device*)'    {mlx5_get_aux_ibv_device}
   [D] 'function void mlx5_glue_constructor()'    {mlx5_glue_constructor}
   [D] 'function void mlx5_malloc_mem_select(uint32_t)'    {mlx5_malloc_mem_select}
   [D] 'function void mlx5_mr_btree_dump(mlx5_mr_btree*)'    {mlx5_mr_btree_dump}
   [D] 'function int mlx5_mr_create_cache(mlx5_mr_share_cache*, int)'    {mlx5_mr_create_cache}
   [D] 'function void mlx5_mr_free(mlx5_mr*, mlx5_dereg_mr_t)'    {mlx5_mr_free}
   [D] 'function int mlx5_mr_insert_cache(mlx5_mr_share_cache*, mlx5_mr*)'    {mlx5_mr_insert_cache}
   [D] 'function mlx5_mr* mlx5_mr_lookup_list(mlx5_mr_share_cache*, mr_cache_entry*, uintptr_t)'    {mlx5_mr_lookup_list}
   [D] 'function void mlx5_mr_rebuild_cache(mlx5_mr_share_cache*)'    {mlx5_mr_rebuild_cache}
   [D] 'function void mlx5_mr_release_cache(mlx5_mr_share_cache*)'    {mlx5_mr_release_cache}
   [D] 'function int mlx5_nl_devlink_family_id_get(int)'    {mlx5_nl_devlink_family_id_get}
   [D] 'function int mlx5_nl_enable_roce_get(int, int, const char*, int*)'    {mlx5_nl_enable_roce_get}
   [D] 'function int mlx5_nl_enable_roce_set(int, int, const char*, int)'    {mlx5_nl_enable_roce_set}
   [D] 'function int mlx5_os_open_device(mlx5_common_device*, uint32_t)'    {mlx5_os_open_device}
   [D] 'function int mlx5_os_pd_create(mlx5_common_device*)'    {mlx5_os_pd_create}
   [D] 'function void mlx5_os_set_reg_mr_cb(mlx5_reg_mr_t*, mlx5_dereg_mr_t*)'    {mlx5_os_set_reg_mr_cb}
   [D] 'function void mlx5_set_context_attr(rte_device*, ibv_context*)'    {mlx5_set_context_attr}

2 Removed variables:

   [D] 'uint32_t atomic_sn'    {atomic_sn}
   [D] 'int mlx5_common_logtype'    {mlx5_common_logtype}

1 Removed function symbol not referenced by debug info:

   [D] mlx5_mr_dump_cache

^ permalink raw reply	[relevance 0%]

* Re: [EXT] [PATCH] crypto: fix misspelled key in qt format
  2022-02-25 17:56  4%     ` Thomas Monjalon
@ 2022-02-25 19:35  0%       ` Ray Kinsella
  0 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2022-02-25 19:35 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Akhil Goyal, Kusztal, ArkadiuszX, Zhang, Roy Fan, ray.kinsella,
	david.marchand, dev


Thomas Monjalon <thomas@monjalon.net> writes:

> 18/02/2022 07:11, Kusztal, ArkadiuszX:
>> From: Akhil Goyal <gakhil@marvell.com>
>> > Fix ABI warning.
>> > Add libabigail.abiignore rule.
>> 
>> I think what is worth noticing is a fact that after "random 'k' patch" addition of
>> [suppress_type]
>>         name = rte_crypto_asym_op
>> this problem does not show up.
>> 
>> But I think it is safer to send addition of
>> [suppress_type]
>>         name = rte_crypto_rsa_priv_key_type
>> anyway.
>> Will send v2.
>
> I don't understand why adding this rule,
> and the comment does say nothing about it:
> 	"Ignore name change of rsa qt key type"
>
> The ABI check is fine without above because of this existing exception:
>
> ; Ignore changes to rte_crypto_asym_op, asymmetric crypto API is experimental
> [suppress_type]
>         name = rte_crypto_asym_op
>
> So I will just drop the unjustified additional exception while pulling.
>
> Next time, please make sure such ABI exception is approved by more maintainers.

To be fair to those involved, I had been CC'ed on the v2 of this.
I didn't respond before the patch was merged however.

-- 
Regards, Ray K

^ permalink raw reply	[relevance 0%]

* [PATCH v2] ci: remove outdated default versions for ABI check
  2022-02-08 13:47  4% [PATCH] ci: remove outdated default reference tag for ABI Thomas Monjalon
  2022-02-08 15:08  7% ` Aaron Conole
@ 2022-03-01  9:56  9% ` Thomas Monjalon
  2022-03-01 10:07  4%   ` David Marchand
  1 sibling, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-03-01  9:56 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, Aaron Conole, Michael Santana

The variables REF_GIT_TAG and LIBABIGAIL_VERSION are set
in the CI configuration like .travis.yml or .github/workflows/build.yml.
The default values are outdated and probably unused.

The default values are removed completely
to avoid forgetting an update in future.

The use of the variables is quoted to make sure
a missing value will trigger an appropriate failure.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Aaron Conole <aconole@redhat.com>
---
 .ci/linux-build.sh | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 67d68535e0..05aa21ec69 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -104,8 +104,6 @@ if [ "$AARCH64" != "true" ] && [ "$PPC64LE" != "true" ]; then
 fi
 
 if [ "$ABI_CHECKS" = "true" ]; then
-    LIBABIGAIL_VERSION=${LIBABIGAIL_VERSION:-libabigail-1.6}
-
     if [ "$(cat libabigail/VERSION 2>/dev/null)" != "$LIBABIGAIL_VERSION" ]; then
         rm -rf libabigail
         # if we change libabigail, invalidate existing abi cache
@@ -113,14 +111,13 @@ if [ "$ABI_CHECKS" = "true" ]; then
     fi
 
     if [ ! -d libabigail ]; then
-        install_libabigail $LIBABIGAIL_VERSION $(pwd)/libabigail
+        install_libabigail "$LIBABIGAIL_VERSION" $(pwd)/libabigail
         echo $LIBABIGAIL_VERSION > libabigail/VERSION
     fi
 
     export PATH=$(pwd)/libabigail/bin:$PATH
 
     REF_GIT_REPO=${REF_GIT_REPO:-https://dpdk.org/git/dpdk}
-    REF_GIT_TAG=${REF_GIT_TAG:-v19.11}
 
     if [ "$(cat reference/VERSION 2>/dev/null)" != "$REF_GIT_TAG" ]; then
         rm -rf reference
@@ -128,7 +125,7 @@ if [ "$ABI_CHECKS" = "true" ]; then
 
     if [ ! -d reference ]; then
         refsrcdir=$(readlink -f $(pwd)/../dpdk-$REF_GIT_TAG)
-        git clone --single-branch -b $REF_GIT_TAG $REF_GIT_REPO $refsrcdir
+        git clone --single-branch -b "$REF_GIT_TAG" $REF_GIT_REPO $refsrcdir
         meson $OPTS -Dexamples= $refsrcdir $refsrcdir/build
         ninja -C $refsrcdir/build
         DESTDIR=$(pwd)/reference ninja -C $refsrcdir/build install
-- 
2.34.1


^ permalink raw reply	[relevance 9%]

* Re: [PATCH v2] ci: remove outdated default versions for ABI check
  2022-03-01  9:56  9% ` [PATCH v2] ci: remove outdated default versions for ABI check Thomas Monjalon
@ 2022-03-01 10:07  4%   ` David Marchand
  2022-03-06  9:27  4%     ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2022-03-01 10:07 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Aaron Conole, Michael Santana

On Tue, Mar 1, 2022 at 10:57 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The variables REF_GIT_TAG and LIBABIGAIL_VERSION are set
> in the CI configuration like .travis.yml or .github/workflows/build.yml.
> The default values are outdated and probably unused.
>
> The default values are removed completely
> to avoid forgetting an update in future.
>
> The use of the variables is quoted to make sure
> a missing value will trigger an appropriate failure.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


^ permalink raw reply	[relevance 4%]

* [PATCH 1/2] devtools: remove event/dlb exception in ABI check
@ 2022-03-01 16:54 15% David Marchand
  2022-03-01 16:54 10% ` [PATCH 2/2] devtools: use libabigail rule for mlx glue drivers David Marchand
  2022-03-02 10:13  4% ` [PATCH 1/2] devtools: remove event/dlb exception in ABI check Ray Kinsella
  0 siblings, 2 replies; 200+ results
From: David Marchand @ 2022-03-01 16:54 UTC (permalink / raw)
  To: dev; +Cc: thomas, stable, Ray Kinsella, Ferruh Yigit

The event/dlb driver exception can be removed, as this rule made sense
for changes in DPDK_21 ABI and is obsolete for DPDK_22.

Fixes: fdab8f2e1749 ("version: 21.11-rc0")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/check-abi.sh | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh
index 675f10142e..033f6252d0 100755
--- a/devtools/check-abi.sh
+++ b/devtools/check-abi.sh
@@ -44,10 +44,6 @@ for dump in $(find $refdir -name "*.dump"); do
 		echo "Skipped glue library $name."
 		continue
 	fi
-	if grep -qE "\<soname='librte_event_dlb\.so" $dump; then
-		echo "Skipped removed driver $name."
-		continue
-	fi
 	if grep -qE "\<librte_*.*_octeontx2" $dump; then
 		echo "Skipped removed driver $name."
 		continue
-- 
2.23.0


^ permalink raw reply	[relevance 15%]

* [PATCH 2/2] devtools: use libabigail rule for mlx glue drivers
  2022-03-01 16:54 15% [PATCH 1/2] devtools: remove event/dlb exception in ABI check David Marchand
@ 2022-03-01 16:54 10% ` David Marchand
  2022-03-02 10:16  3%   ` Ray Kinsella
  2022-03-02 10:13  4% ` [PATCH 1/2] devtools: remove event/dlb exception in ABI check Ray Kinsella
  1 sibling, 1 reply; 200+ results
From: David Marchand @ 2022-03-01 16:54 UTC (permalink / raw)
  To: dev; +Cc: thomas, Ray Kinsella

Convert the existing exception in the ABI script into a libabigail
suppression rule.

Note: file_name_regexp could be used to achive the same with versions of
libabigail < 1.7 but soname_regexp has been preferred here since it is
already used with a recent change on common/mlx5.

While at it, fix indent from a recent change.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/check-abi.sh        | 7 -------
 devtools/libabigail.abignore | 8 ++++++--
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh
index 033f6252d0..64e148070d 100755
--- a/devtools/check-abi.sh
+++ b/devtools/check-abi.sh
@@ -37,13 +37,6 @@ fi
 error=
 for dump in $(find $refdir -name "*.dump"); do
 	name=$(basename $dump)
-	# skip glue drivers, example librte_pmd_mlx5_glue.dump
-	# We can't rely on a suppression rule for now:
-	# https://sourceware.org/bugzilla/show_bug.cgi?id=25480
-	if grep -qE "\<soname='[^']*_glue\.so\.[^']*'" $dump; then
-		echo "Skipped glue library $name."
-		continue
-	fi
 	if grep -qE "\<librte_*.*_octeontx2" $dump; then
 		echo "Skipped removed driver $name."
 		continue
diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 301b3dacb8..9c921c47d4 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -12,10 +12,14 @@
 [suppress_variable]
         name_regexp = _pmd_info$
 
+; Ignore changes on soname for mlx glue internal drivers
+[suppress_file]
+        soname_regexp = ^librte_.*mlx.*glue\.
+
 ; Ignore fields inserted in place of reserved_opts of rte_security_ipsec_sa_options
 [suppress_type]
-       name = rte_security_ipsec_sa_options
-       has_data_member_inserted_between = {offset_of(reserved_opts), end}
+        name = rte_security_ipsec_sa_options
+        has_data_member_inserted_between = {offset_of(reserved_opts), end}
 
 ; Ignore changes to rte_crypto_asym_op, asymmetric crypto API is experimental
 [suppress_type]
-- 
2.23.0


^ permalink raw reply	[relevance 10%]

* Re: [PATCH 1/2] devtools: remove event/dlb exception in ABI check
  2022-03-01 16:54 15% [PATCH 1/2] devtools: remove event/dlb exception in ABI check David Marchand
  2022-03-01 16:54 10% ` [PATCH 2/2] devtools: use libabigail rule for mlx glue drivers David Marchand
@ 2022-03-02 10:13  4% ` Ray Kinsella
  1 sibling, 0 replies; 200+ results
From: Ray Kinsella @ 2022-03-02 10:13 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, thomas, stable, Ferruh Yigit


David Marchand <david.marchand@redhat.com> writes:

> The event/dlb driver exception can be removed, as this rule made sense
> for changes in DPDK_21 ABI and is obsolete for DPDK_22.
>
> Fixes: fdab8f2e1749 ("version: 21.11-rc0")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Acked-by: Ray Kinsella <mdr@ashroe.eu>


-- 
Regards, Ray K

^ permalink raw reply	[relevance 4%]

* Re: [PATCH 2/2] devtools: use libabigail rule for mlx glue drivers
  2022-03-01 16:54 10% ` [PATCH 2/2] devtools: use libabigail rule for mlx glue drivers David Marchand
@ 2022-03-02 10:16  3%   ` Ray Kinsella
  2022-03-08 14:04  0%     ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: Ray Kinsella @ 2022-03-02 10:16 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, thomas


David Marchand <david.marchand@redhat.com> writes:

> Convert the existing exception in the ABI script into a libabigail
> suppression rule.
>
> Note: file_name_regexp could be used to achive the same with versions of
> libabigail < 1.7 but soname_regexp has been preferred here since it is
> already used with a recent change on common/mlx5.
>
> While at it, fix indent from a recent change.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  devtools/check-abi.sh        | 7 -------
>  devtools/libabigail.abignore | 8 ++++++--
>  2 files changed, 6 insertions(+), 9 deletions(-)
>

Minor niggle that changes to the check-abi.sh script should have been in
the first patch?

Acked-by: Ray Kinsella <mdr@ashroe.eu>
-- 
Regards, Ray K

^ permalink raw reply	[relevance 3%]

* Re: [RFC] ethdev: introduce protocol type based header split
  @ 2022-03-03 16:15  3% ` Stephen Hemminger
  2022-03-04  9:58  3%   ` Zhang, Qi Z
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2022-03-03 16:15 UTC (permalink / raw)
  To: xuan.ding
  Cc: thomas, ferruh.yigit, andrew.rybchenko, dev, viacheslavo,
	qi.z.zhang, ping.yu, Yuan Wang

On Thu,  3 Mar 2022 06:01:36 +0000
xuan.ding@intel.com wrote:

> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index c2d1f9a972..6743648c22 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -1202,7 +1202,8 @@ struct rte_eth_rxseg_split {
>  	struct rte_mempool *mp; /**< Memory pool to allocate segment from. */
>  	uint16_t length; /**< Segment data length, configures split point. */
>  	uint16_t offset; /**< Data offset from beginning of mbuf data buffer. */
> -	uint32_t reserved; /**< Reserved field. */
> +	uint16_t proto;
> +	uint16_t reserved; /**< Reserved field. */
>  };

This feature suffers from a common bad design pattern.
You can't just start using reserved fields unless the previous versions
enforced that the field was a particular value (usually zero).

There is no guarantee that application will initialize these reserved
fields and now using them risks breaking the API/ABI. It looks like

rte_eth_rx_queue_check_split(const struct rte_eth_rxseg_split *rx_seg,

Would have had to check in previous release.

This probably has to wait until 22.11 next API release.

^ permalink raw reply	[relevance 3%]

* RE: [RFC] ethdev: introduce protocol type based header split
  2022-03-03 16:15  3% ` Stephen Hemminger
@ 2022-03-04  9:58  3%   ` Zhang, Qi Z
  2022-03-04 11:54  0%     ` Morten Brørup
  2022-03-04 17:32  3%     ` Stephen Hemminger
  0 siblings, 2 replies; 200+ results
From: Zhang, Qi Z @ 2022-03-04  9:58 UTC (permalink / raw)
  To: Stephen Hemminger, Ding, Xuan
  Cc: thomas, Yigit, Ferruh, andrew.rybchenko, dev, viacheslavo, Yu,
	Ping, Wang, YuanX



> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Friday, March 4, 2022 12:16 AM
> To: Ding, Xuan <xuan.ding@intel.com>
> Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>;
> andrew.rybchenko@oktetlabs.ru; dev@dpdk.org; viacheslavo@nvidia.com;
> Zhang, Qi Z <qi.z.zhang@intel.com>; Yu, Ping <ping.yu@intel.com>; Wang,
> YuanX <yuanx.wang@intel.com>
> Subject: Re: [RFC] ethdev: introduce protocol type based header split
> 
> On Thu,  3 Mar 2022 06:01:36 +0000
> xuan.ding@intel.com wrote:
> 
> > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> > c2d1f9a972..6743648c22 100644
> > --- a/lib/ethdev/rte_ethdev.h
> > +++ b/lib/ethdev/rte_ethdev.h
> > @@ -1202,7 +1202,8 @@ struct rte_eth_rxseg_split {
> >  	struct rte_mempool *mp; /**< Memory pool to allocate segment from.
> */
> >  	uint16_t length; /**< Segment data length, configures split point. */
> >  	uint16_t offset; /**< Data offset from beginning of mbuf data buffer. */
> > -	uint32_t reserved; /**< Reserved field. */
> > +	uint16_t proto;
> > +	uint16_t reserved; /**< Reserved field. */
> >  };
> 
> This feature suffers from a common bad design pattern.
> You can't just start using reserved fields unless the previous versions enforced
> that the field was a particular value (usually zero).

Yes, agree, that's a mistake there is no document for the reserved field in the previous release, and usually, it should be zero, 
And I think one of the typical purposes of the reserved field is to make life easy for new feature adding without breaking ABI.
So, should we just take the risk as I guess it might not be a big deal in real cases? 

Thanks
Qi



> 
> There is no guarantee that application will initialize these reserved fields and
> now using them risks breaking the API/ABI. It looks like
> 
> rte_eth_rx_queue_check_split(const struct rte_eth_rxseg_split *rx_seg,
> 
> Would have had to check in previous release.
> 
> This probably has to wait until 22.11 next API release.

^ permalink raw reply	[relevance 3%]

* RE: [RFC] ethdev: introduce protocol type based header split
  2022-03-04  9:58  3%   ` Zhang, Qi Z
@ 2022-03-04 11:54  0%     ` Morten Brørup
  2022-03-04 17:32  3%     ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Morten Brørup @ 2022-03-04 11:54 UTC (permalink / raw)
  To: Zhang, Qi Z, Stephen Hemminger, Ding, Xuan
  Cc: thomas, Yigit, Ferruh, andrew.rybchenko, dev, viacheslavo, Yu,
	Ping, Wang, YuanX

> From: Zhang, Qi Z [mailto:qi.z.zhang@intel.com]
> Sent: Friday, 4 March 2022 10.58
> 
> > From: Stephen Hemminger <stephen@networkplumber.org>
> > Sent: Friday, March 4, 2022 12:16 AM
> >
> > On Thu,  3 Mar 2022 06:01:36 +0000
> > xuan.ding@intel.com wrote:
> >
> > > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index
> > > c2d1f9a972..6743648c22 100644
> > > --- a/lib/ethdev/rte_ethdev.h
> > > +++ b/lib/ethdev/rte_ethdev.h
> > > @@ -1202,7 +1202,8 @@ struct rte_eth_rxseg_split {
> > >  	struct rte_mempool *mp; /**< Memory pool to allocate segment
> from.
> > */
> > >  	uint16_t length; /**< Segment data length, configures split
> point. */
> > >  	uint16_t offset; /**< Data offset from beginning of mbuf data
> buffer. */
> > > -	uint32_t reserved; /**< Reserved field. */
> > > +	uint16_t proto;
> > > +	uint16_t reserved; /**< Reserved field. */
> > >  };
> >
> > This feature suffers from a common bad design pattern.
> > You can't just start using reserved fields unless the previous
> versions enforced
> > that the field was a particular value (usually zero).
> 
> Yes, agree, that's a mistake there is no document for the reserved
> field in the previous release, and usually, it should be zero,
> And I think one of the typical purposes of the reserved field is to
> make life easy for new feature adding without breaking ABI.
> So, should we just take the risk as I guess it might not be a big deal
> in real cases?
> 

In this specific case, I think it can be done with very low risk in real cases.

Assuming that splitting based on fixed length and protocol header parsing is mutually exclusive, the PMDs can simply ignore the "proto" field (and log a warning about it) if the length field is non-zero. This will provide backwards compatibility with applications not zeroing out the 32 bit "reserved" field.

> Thanks
> Qi
> 
> 
> 
> >
> > There is no guarantee that application will initialize these reserved
> fields and
> > now using them risks breaking the API/ABI. It looks like
> >
> > rte_eth_rx_queue_check_split(const struct rte_eth_rxseg_split
> *rx_seg,
> >
> > Would have had to check in previous release.
> >
> > This probably has to wait until 22.11 next API release.


^ permalink raw reply	[relevance 0%]

* Re: [RFC] ethdev: introduce protocol type based header split
  2022-03-04  9:58  3%   ` Zhang, Qi Z
  2022-03-04 11:54  0%     ` Morten Brørup
@ 2022-03-04 17:32  3%     ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2022-03-04 17:32 UTC (permalink / raw)
  To: Zhang, Qi Z
  Cc: Ding, Xuan, thomas, Yigit, Ferruh, andrew.rybchenko, dev,
	viacheslavo, Yu, Ping, Wang, YuanX

On Fri, 4 Mar 2022 09:58:11 +0000
"Zhang, Qi Z" <qi.z.zhang@intel.com> wrote:

> > -----Original Message-----
> > From: Stephen Hemminger <stephen@networkplumber.org>
> > Sent: Friday, March 4, 2022 12:16 AM
> > To: Ding, Xuan <xuan.ding@intel.com>
> > Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>;
> > andrew.rybchenko@oktetlabs.ru; dev@dpdk.org; viacheslavo@nvidia.com;
> > Zhang, Qi Z <qi.z.zhang@intel.com>; Yu, Ping <ping.yu@intel.com>; Wang,
> > YuanX <yuanx.wang@intel.com>
> > Subject: Re: [RFC] ethdev: introduce protocol type based header split
> > 
> > On Thu,  3 Mar 2022 06:01:36 +0000
> > xuan.ding@intel.com wrote:
> >   
> > > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> > > c2d1f9a972..6743648c22 100644
> > > --- a/lib/ethdev/rte_ethdev.h
> > > +++ b/lib/ethdev/rte_ethdev.h
> > > @@ -1202,7 +1202,8 @@ struct rte_eth_rxseg_split {
> > >  	struct rte_mempool *mp; /**< Memory pool to allocate segment from.  
> > */  
> > >  	uint16_t length; /**< Segment data length, configures split point. */
> > >  	uint16_t offset; /**< Data offset from beginning of mbuf data buffer. */
> > > -	uint32_t reserved; /**< Reserved field. */
> > > +	uint16_t proto;
> > > +	uint16_t reserved; /**< Reserved field. */
> > >  };  
> > 
> > This feature suffers from a common bad design pattern.
> > You can't just start using reserved fields unless the previous versions enforced
> > that the field was a particular value (usually zero).  
> 
> Yes, agree, that's a mistake there is no document for the reserved field in the previous release, and usually, it should be zero, 
> And I think one of the typical purposes of the reserved field is to make life easy for new feature adding without breaking ABI.
> So, should we just take the risk as I guess it might not be a big deal in real cases? 

There is a cost/benefit tradeoff here. Although HW vendors would like to enable
more features, it really is not that much of an impact to wait until next LTS
for users.

Yes, the API/ABI rules are restrictive, but IMHO it is about learning how to
handle SW upgrades in a more user friendly manner. It was hard for the Linux
kernel to learn how to do this, but after 10 years they mostly have it right.

If this were a bug (especially a security bug), then the rules could be lifted.

^ permalink raw reply	[relevance 3%]

* [PATCH 1/2] regexdev: fix section attribute of symbols
  @ 2022-03-06  9:20  4% ` Thomas Monjalon
  2022-03-07 10:15  0%   ` Ori Kam
  2022-03-06  9:20  4% ` [PATCH 2/2] build: hide local symbols in shared libraries Thomas Monjalon
    2 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-03-06  9:20 UTC (permalink / raw)
  To: dev; +Cc: stable, Ray Kinsella, Ori Kam, Jerin Jacob, Pavan Nikhilesh

The functions used by the drivers must be internal,
while the function and variables used in inline functions
must be experimental.

These are the changes done in the shared libraries:
- DF .text  Base          rte_regexdev_get_device_by_name
+ DF .text  INTERNAL      rte_regexdev_get_device_by_name
- DF .text  Base          rte_regexdev_register
+ DF .text  INTERNAL      rte_regexdev_register
- DF .text  Base          rte_regexdev_unregister
+ DF .text  INTERNAL      rte_regexdev_unregister
- DF .text  Base          rte_regexdev_is_valid_dev
+ DF .text  EXPERIMENTAL  rte_regexdev_is_valid_dev
- DO .bss   Base          rte_regex_devices
+ DO .bss   EXPERIMENTAL  rte_regex_devices
- DO .bss   Base          rte_regexdev_logtype
+ DO .bss   EXPERIMENTAL  rte_regexdev_logtype

Because these symbols were exported in the default section in DPDK 21.11,
any change in these functions would be seen as incompatible
by the ABI compatibility check.
An exception rule is added for this experimental library,
so the ABI check will skip it until the next ABI version.

Fixes: bab9497ef78b ("regexdev: introduce API")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/libabigail.abignore       | 4 ++++
 lib/regexdev/rte_regexdev.h        | 4 ++++
 lib/regexdev/rte_regexdev_driver.h | 3 +++
 lib/regexdev/version.map           | 9 +++++++++
 4 files changed, 20 insertions(+)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 301b3dacb8..cff7a293ae 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -21,6 +21,10 @@
 [suppress_type]
         name = rte_crypto_asym_op
 
+; Ignore section attribute fixes in experimental regexdev library
+[suppress_file]
+        soname_regexp = ^librte_regexdev\.
+
 ; Ignore changes in common mlx5 driver, should be all internal
 [suppress_file]
         soname_regexp = ^librte_common_mlx5\.
diff --git a/lib/regexdev/rte_regexdev.h b/lib/regexdev/rte_regexdev.h
index 4ba67b0c25..3bce8090f6 100644
--- a/lib/regexdev/rte_regexdev.h
+++ b/lib/regexdev/rte_regexdev.h
@@ -225,6 +225,9 @@ extern int rte_regexdev_logtype;
 } while (0)
 
 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
  * Check if dev_id is ready.
  *
  * @param dev_id
@@ -234,6 +237,7 @@ extern int rte_regexdev_logtype;
  *   - 0 if device state is not in ready state.
  *   - 1 if device state is ready state.
  */
+__rte_experimental
 int rte_regexdev_is_valid_dev(uint16_t dev_id);
 
 /**
diff --git a/lib/regexdev/rte_regexdev_driver.h b/lib/regexdev/rte_regexdev_driver.h
index 64742016c0..6246b144a6 100644
--- a/lib/regexdev/rte_regexdev_driver.h
+++ b/lib/regexdev/rte_regexdev_driver.h
@@ -32,6 +32,7 @@ extern "C" {
  *   A pointer to the RegEx device slot case of success,
  *   NULL otherwise.
  */
+__rte_internal
 struct rte_regexdev *rte_regexdev_register(const char *name);
 
 /**
@@ -41,6 +42,7 @@ struct rte_regexdev *rte_regexdev_register(const char *name);
  * @param dev
  *   Device to be released.
  */
+__rte_internal
 void rte_regexdev_unregister(struct rte_regexdev *dev);
 
 /**
@@ -50,6 +52,7 @@ void rte_regexdev_unregister(struct rte_regexdev *dev);
  * @param name
  *   The device name.
  */
+__rte_internal
 struct rte_regexdev *rte_regexdev_get_device_by_name(const char *name);
 
 #ifdef __cplusplus
diff --git a/lib/regexdev/version.map b/lib/regexdev/version.map
index 8db9b17018..988b909638 100644
--- a/lib/regexdev/version.map
+++ b/lib/regexdev/version.map
@@ -1,6 +1,7 @@
 EXPERIMENTAL {
 	global:
 
+	rte_regex_devices;
 	rte_regexdev_attr_get;
 	rte_regexdev_attr_set;
 	rte_regexdev_close;
@@ -11,6 +12,8 @@ EXPERIMENTAL {
 	rte_regexdev_enqueue_burst;
 	rte_regexdev_get_dev_id;
 	rte_regexdev_info_get;
+	rte_regexdev_is_valid_dev;
+	rte_regexdev_logtype;
 	rte_regexdev_queue_pair_setup;
 	rte_regexdev_rule_db_compile_activate;
 	rte_regexdev_rule_db_export;
@@ -24,3 +27,9 @@ EXPERIMENTAL {
 	rte_regexdev_xstats_names_get;
 	rte_regexdev_xstats_reset;
 };
+
+INTERNAL {
+	rte_regexdev_get_device_by_name;
+	rte_regexdev_register;
+	rte_regexdev_unregister;
+};
-- 
2.34.1


^ permalink raw reply	[relevance 4%]

* [PATCH 2/2] build: hide local symbols in shared libraries
    2022-03-06  9:20  4% ` [PATCH 1/2] regexdev: fix section attribute of symbols Thomas Monjalon
@ 2022-03-06  9:20  4% ` Thomas Monjalon
    2 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-03-06  9:20 UTC (permalink / raw)
  To: dev
  Cc: stable, Ray Kinsella, Parav Pandit, Xueming Li, Elena Agostini,
	Ori Kam, Andrew Rybchenko

The symbols which are not listed in the version script
are exported by default.
Adding a local section with a wildcard make non-listed functions
and variables as hidden, as it should be in all version.map files.

These are the changes done in the shared libraries:
- DF .text  Base          auxiliary_add_device
- DF .text  Base          auxiliary_dev_exists
- DF .text  Base          auxiliary_dev_iterate
- DF .text  Base          auxiliary_insert_device
- DF .text  Base          auxiliary_is_ignored_device
- DF .text  Base          auxiliary_match
- DF .text  Base          auxiliary_on_scan
- DF .text  Base          auxiliary_scan
- DO .bss   Base          auxiliary_bus_logtype
- DO .data  Base          auxiliary_bus
- DO .bss   Base          gpu_logtype

There is no impact on regexdev library.

Because these local symbols were exported as non-internal
in DPDK 21.11, any change in these functions would break the ABI.
Exception rules are added for these experimental libraries,
so the ABI check will skip them until the next ABI version.

Fixes: 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")
Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/libabigail.abignore      | 8 ++++++++
 drivers/bus/auxiliary/version.map | 2 ++
 lib/gpudev/version.map            | 2 ++
 lib/regexdev/version.map          | 2 ++
 4 files changed, 14 insertions(+)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index cff7a293ae..d698d8199d 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -28,3 +28,11 @@
 ; Ignore changes in common mlx5 driver, should be all internal
 [suppress_file]
         soname_regexp = ^librte_common_mlx5\.
+
+; Ignore visibility fix of local functions in experimental auxiliary driver
+[suppress_file]
+        soname_regexp = ^librte_bus_auxiliary\.
+
+; Ignore visibility fix of local functions in experimental gpudev library
+[suppress_file]
+        soname_regexp = ^librte_gpudev\.
diff --git a/drivers/bus/auxiliary/version.map b/drivers/bus/auxiliary/version.map
index a52260657c..dc993e84ff 100644
--- a/drivers/bus/auxiliary/version.map
+++ b/drivers/bus/auxiliary/version.map
@@ -4,4 +4,6 @@ EXPERIMENTAL {
 	# added in 21.08
 	rte_auxiliary_register;
 	rte_auxiliary_unregister;
+
+	local: *;
 };
diff --git a/lib/gpudev/version.map b/lib/gpudev/version.map
index b23e3fd6eb..a2c8ce5759 100644
--- a/lib/gpudev/version.map
+++ b/lib/gpudev/version.map
@@ -39,4 +39,6 @@ INTERNAL {
 	rte_gpu_get_by_name;
 	rte_gpu_notify;
 	rte_gpu_release;
+
+	local: *;
 };
diff --git a/lib/regexdev/version.map b/lib/regexdev/version.map
index 988b909638..3c6e9fffa1 100644
--- a/lib/regexdev/version.map
+++ b/lib/regexdev/version.map
@@ -26,6 +26,8 @@ EXPERIMENTAL {
 	rte_regexdev_xstats_get;
 	rte_regexdev_xstats_names_get;
 	rte_regexdev_xstats_reset;
+
+	local: *;
 };
 
 INTERNAL {
-- 
2.34.1


^ permalink raw reply	[relevance 4%]

* Re: [PATCH v2] ci: remove outdated default versions for ABI check
  2022-03-01 10:07  4%   ` David Marchand
@ 2022-03-06  9:27  4%     ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-03-06  9:27 UTC (permalink / raw)
  To: dev; +Cc: Aaron Conole, Michael Santana, David Marchand

01/03/2022 11:07, David Marchand:
> On Tue, Mar 1, 2022 at 10:57 AM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > The variables REF_GIT_TAG and LIBABIGAIL_VERSION are set
> > in the CI configuration like .travis.yml or .github/workflows/build.yml.
> > The default values are outdated and probably unused.
> >
> > The default values are removed completely
> > to avoid forgetting an update in future.
> >
> > The use of the variables is quoted to make sure
> > a missing value will trigger an appropriate failure.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > Acked-by: Aaron Conole <aconole@redhat.com>
> Acked-by: David Marchand <david.marchand@redhat.com>

Applied




^ permalink raw reply	[relevance 4%]

* RE: [PATCH 1/2] regexdev: fix section attribute of symbols
  2022-03-06  9:20  4% ` [PATCH 1/2] regexdev: fix section attribute of symbols Thomas Monjalon
@ 2022-03-07 10:15  0%   ` Ori Kam
  0 siblings, 0 replies; 200+ results
From: Ori Kam @ 2022-03-07 10:15 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon (EXTERNAL), dev
  Cc: stable, Ray Kinsella, Jerin Jacob, Pavan Nikhilesh

Hi Thomas,

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Sunday, March 6, 2022 11:20 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Ray Kinsella <mdr@ashroe.eu>; Ori Kam <orika@nvidia.com>; Jerin Jacob
> <jerinj@marvell.com>; Pavan Nikhilesh <pbhagavatula@marvell.com>
> Subject: [PATCH 1/2] regexdev: fix section attribute of symbols
> 
> The functions used by the drivers must be internal,
> while the function and variables used in inline functions
> must be experimental.
> 
> These are the changes done in the shared libraries:
> - DF .text  Base          rte_regexdev_get_device_by_name
> + DF .text  INTERNAL      rte_regexdev_get_device_by_name
> - DF .text  Base          rte_regexdev_register
> + DF .text  INTERNAL      rte_regexdev_register
> - DF .text  Base          rte_regexdev_unregister
> + DF .text  INTERNAL      rte_regexdev_unregister
> - DF .text  Base          rte_regexdev_is_valid_dev
> + DF .text  EXPERIMENTAL  rte_regexdev_is_valid_dev
> - DO .bss   Base          rte_regex_devices
> + DO .bss   EXPERIMENTAL  rte_regex_devices
> - DO .bss   Base          rte_regexdev_logtype
> + DO .bss   EXPERIMENTAL  rte_regexdev_logtype
> 
> Because these symbols were exported in the default section in DPDK 21.11,
> any change in these functions would be seen as incompatible
> by the ABI compatibility check.
> An exception rule is added for this experimental library,
> so the ABI check will skip it until the next ABI version.
> 
> Fixes: bab9497ef78b ("regexdev: introduce API")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
 
Acked-by: Ori Kam <orika@nvidia.com>

Best,
Ori



^ permalink raw reply	[relevance 0%]

* RE: [PATCH] examples/distributor: one Tx queue is enough
  @ 2022-03-08  3:26  3% ` Honnappa Nagarahalli
  0 siblings, 0 replies; 200+ results
From: Honnappa Nagarahalli @ 2022-03-08  3:26 UTC (permalink / raw)
  To: Honnappa Nagarahalli, dev, lijuan.tu, juraj.linkes, ohilyard,
	david.marchand, thomas, david.hunt
  Cc: Ruifeng Wang, nd, bruce.richardson, reshma.pattan, stable, nd

The ABI test failure is not related to this patch.
Thanks,
Honnappa

> -----Original Message-----
> From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Sent: Monday, March 7, 2022 4:40 PM
> To: dev@dpdk.org; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; lijuan.tu@intel.com;
> juraj.linkes@pantheon.tech; ohilyard@iol.unh.edu;
> david.marchand@redhat.com; thomas@monjalon.net; david.hunt@intel.com
> Cc: Ruifeng Wang <Ruifeng.Wang@arm.com>; nd <nd@arm.com>;
> bruce.richardson@intel.com; reshma.pattan@intel.com; stable@dpdk.org
> Subject: [PATCH] examples/distributor: one Tx queue is enough
> 
> Distributor application creates one Tx queue per core. However the transmit is
> done only from a single core. Hence creating one Tx queue is enough.
> 
> Fixes: 07db4a975094 ("examples/distributor: new sample app")
> Cc: bruce.richardson@intel.com
> Cc: reshma.pattan@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
> DTS test cases make this change to DPDK. However, I find that, one queue is
> enough. Hence we could make this change in DPDK.
> 
>  examples/distributor/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/examples/distributor/main.c b/examples/distributor/main.c index
> c681e237ea..02bf91f555 100644
> --- a/examples/distributor/main.c
> +++ b/examples/distributor/main.c
> @@ -108,7 +108,7 @@ static inline int
>  port_init(uint16_t port, struct rte_mempool *mbuf_pool)  {
>  	struct rte_eth_conf port_conf = port_conf_default;
> -	const uint16_t rxRings = 1, txRings = rte_lcore_count() - 1;
> +	const uint16_t rxRings = 1, txRings = 1;
>  	int retval;
>  	uint16_t q;
>  	uint16_t nb_rxd = RX_RING_SIZE;
> --
> 2.25.1


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 1/3] common/mlx5: add Netlink event helpers
  @ 2022-03-08 13:48  3%         ` Kevin Traynor
  2022-03-08 15:18  0%           ` Dmitry Kozlyuk
  0 siblings, 1 reply; 200+ results
From: Kevin Traynor @ 2022-03-08 13:48 UTC (permalink / raw)
  To: Dmitry Kozlyuk, Ferruh Yigit, dev, Luca Boccassi
  Cc: stable, Slava Ovsiienko, Matan Azrad, Ray Kinsella

On 02/03/2022 15:56, Dmitry Kozlyuk wrote:
> Hi Ferruh,
> 
>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
> [...]
>> Hi Dmitry,
>>
>> For clarification, this patch is not fix, but it is requested
>> to be backported to be able to backport fixes in this patchset,
>> right?
> 
> Yes.

The updated API is internal so that should be ok. I'm ok to take this on 
21.11 as long as you can confirm it's not breaking any user 
compatibility with external sw versions/ABI/API etc from 21.11.0 ?

Assuming that's ok, please send a rebased series for 21.11. I'm not 
comfortable rebasing the series with the amount of changes on dpdk main 
branch to same functions in mlx5_os.c.

P.S. Better to rebase on patch queue [0] to avoid conflicts with other 
backports not pushed to dpdk.org yet.

thanks,
Kevin.

[0] https://github.com/kevintraynor/dpdk-stable.git


^ permalink raw reply	[relevance 3%]

* Re: [PATCH 2/2] devtools: use libabigail rule for mlx glue drivers
  2022-03-02 10:16  3%   ` Ray Kinsella
@ 2022-03-08 14:04  0%     ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-03-08 14:04 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Ray Kinsella

02/03/2022 11:16, Ray Kinsella:
> 
> David Marchand <david.marchand@redhat.com> writes:
> 
> > Convert the existing exception in the ABI script into a libabigail
> > suppression rule.
> >
> > Note: file_name_regexp could be used to achive the same with versions of
> > libabigail < 1.7 but soname_regexp has been preferred here since it is
> > already used with a recent change on common/mlx5.
> >
> > While at it, fix indent from a recent change.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> >  devtools/check-abi.sh        | 7 -------
> >  devtools/libabigail.abignore | 8 ++++++--
> >  2 files changed, 6 insertions(+), 9 deletions(-)
> >
> 
> Minor niggle that changes to the check-abi.sh script should have been in
> the first patch?

No, first patch is about DLB, second is mlx.

> Acked-by: Ray Kinsella <mdr@ashroe.eu>

Series applied, thanks.



^ permalink raw reply	[relevance 0%]

* [PATCH v2 1/2] regexdev: fix section attribute of symbols
  @ 2022-03-08 14:24  4%   ` Thomas Monjalon
  2022-03-08 14:24  4%   ` [PATCH v2 2/2] build: hide local symbols in shared libraries Thomas Monjalon
  1 sibling, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-03-08 14:24 UTC (permalink / raw)
  To: dev
  Cc: david.marchand, stable, Ori Kam, Ray Kinsella, Pavan Nikhilesh,
	Jerin Jacob

The functions used by the drivers must be internal,
while the function and variables used in inline functions
must be experimental.

These are the changes done in the shared library:
- DF .text  Base          rte_regexdev_get_device_by_name
+ DF .text  INTERNAL      rte_regexdev_get_device_by_name
- DF .text  Base          rte_regexdev_register
+ DF .text  INTERNAL      rte_regexdev_register
- DF .text  Base          rte_regexdev_unregister
+ DF .text  INTERNAL      rte_regexdev_unregister
- DF .text  Base          rte_regexdev_is_valid_dev
+ DF .text  EXPERIMENTAL  rte_regexdev_is_valid_dev
- DO .bss   Base          rte_regex_devices
+ DO .bss   EXPERIMENTAL  rte_regex_devices
- DO .bss   Base          rte_regexdev_logtype
+ DO .bss   EXPERIMENTAL  rte_regexdev_logtype

Because these symbols were exported in the default section in DPDK 21.11,
any change in these functions would be seen as incompatible
by the ABI compatibility check.
An exception rule is added for this experimental library,
so the ABI check will skip it until the next ABI version.

Fixes: bab9497ef78b ("regexdev: introduce API")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ori Kam <orika@nvidia.com>
---
 devtools/libabigail.abignore       | 4 ++++
 lib/regexdev/rte_regexdev.h        | 4 ++++
 lib/regexdev/rte_regexdev_driver.h | 3 +++
 lib/regexdev/version.map           | 9 +++++++++
 4 files changed, 20 insertions(+)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 9c921c47d4..18c11c80c6 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -25,6 +25,10 @@
 [suppress_type]
         name = rte_crypto_asym_op
 
+; Ignore section attribute fixes in experimental regexdev library
+[suppress_file]
+        soname_regexp = ^librte_regexdev\.
+
 ; Ignore changes in common mlx5 driver, should be all internal
 [suppress_file]
         soname_regexp = ^librte_common_mlx5\.
diff --git a/lib/regexdev/rte_regexdev.h b/lib/regexdev/rte_regexdev.h
index 4ba67b0c25..3bce8090f6 100644
--- a/lib/regexdev/rte_regexdev.h
+++ b/lib/regexdev/rte_regexdev.h
@@ -225,6 +225,9 @@ extern int rte_regexdev_logtype;
 } while (0)
 
 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
  * Check if dev_id is ready.
  *
  * @param dev_id
@@ -234,6 +237,7 @@ extern int rte_regexdev_logtype;
  *   - 0 if device state is not in ready state.
  *   - 1 if device state is ready state.
  */
+__rte_experimental
 int rte_regexdev_is_valid_dev(uint16_t dev_id);
 
 /**
diff --git a/lib/regexdev/rte_regexdev_driver.h b/lib/regexdev/rte_regexdev_driver.h
index 64742016c0..6246b144a6 100644
--- a/lib/regexdev/rte_regexdev_driver.h
+++ b/lib/regexdev/rte_regexdev_driver.h
@@ -32,6 +32,7 @@ extern "C" {
  *   A pointer to the RegEx device slot case of success,
  *   NULL otherwise.
  */
+__rte_internal
 struct rte_regexdev *rte_regexdev_register(const char *name);
 
 /**
@@ -41,6 +42,7 @@ struct rte_regexdev *rte_regexdev_register(const char *name);
  * @param dev
  *   Device to be released.
  */
+__rte_internal
 void rte_regexdev_unregister(struct rte_regexdev *dev);
 
 /**
@@ -50,6 +52,7 @@ void rte_regexdev_unregister(struct rte_regexdev *dev);
  * @param name
  *   The device name.
  */
+__rte_internal
 struct rte_regexdev *rte_regexdev_get_device_by_name(const char *name);
 
 #ifdef __cplusplus
diff --git a/lib/regexdev/version.map b/lib/regexdev/version.map
index 8db9b17018..988b909638 100644
--- a/lib/regexdev/version.map
+++ b/lib/regexdev/version.map
@@ -1,6 +1,7 @@
 EXPERIMENTAL {
 	global:
 
+	rte_regex_devices;
 	rte_regexdev_attr_get;
 	rte_regexdev_attr_set;
 	rte_regexdev_close;
@@ -11,6 +12,8 @@ EXPERIMENTAL {
 	rte_regexdev_enqueue_burst;
 	rte_regexdev_get_dev_id;
 	rte_regexdev_info_get;
+	rte_regexdev_is_valid_dev;
+	rte_regexdev_logtype;
 	rte_regexdev_queue_pair_setup;
 	rte_regexdev_rule_db_compile_activate;
 	rte_regexdev_rule_db_export;
@@ -24,3 +27,9 @@ EXPERIMENTAL {
 	rte_regexdev_xstats_names_get;
 	rte_regexdev_xstats_reset;
 };
+
+INTERNAL {
+	rte_regexdev_get_device_by_name;
+	rte_regexdev_register;
+	rte_regexdev_unregister;
+};
-- 
2.34.1


^ permalink raw reply	[relevance 4%]

* [PATCH v2 2/2] build: hide local symbols in shared libraries
    2022-03-08 14:24  4%   ` [PATCH v2 1/2] regexdev: fix section attribute of symbols Thomas Monjalon
@ 2022-03-08 14:24  4%   ` Thomas Monjalon
  2022-03-09 10:58  0%     ` Kevin Traynor
  2022-04-15 14:56  0%     ` Ray Kinsella
  1 sibling, 2 replies; 200+ results
From: Thomas Monjalon @ 2022-03-08 14:24 UTC (permalink / raw)
  To: dev
  Cc: david.marchand, stable, Ray Kinsella, Parav Pandit, Xueming Li,
	Elena Agostini, Ori Kam, Andrew Rybchenko

The symbols which are not listed in the version script
are exported by default.
Adding a local section with a wildcard make non-listed functions
and variables as hidden, as it should be in all version.map files.

These are the changes done in the shared libraries:
- DF .text  Base          auxiliary_add_device
- DF .text  Base          auxiliary_dev_exists
- DF .text  Base          auxiliary_dev_iterate
- DF .text  Base          auxiliary_insert_device
- DF .text  Base          auxiliary_is_ignored_device
- DF .text  Base          auxiliary_match
- DF .text  Base          auxiliary_on_scan
- DF .text  Base          auxiliary_scan
- DO .bss   Base          auxiliary_bus_logtype
- DO .data  Base          auxiliary_bus
- DO .bss   Base          gpu_logtype

There is no impact on regexdev library.

Because these local symbols were exported as non-internal
in DPDK 21.11, any change in these functions would break the ABI.
Exception rules are added for these experimental libraries,
so the ABI check will skip them until the next ABI version.

A check is added to avoid such miss in future.

Fixes: 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")
Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/check-symbol-maps.sh     | 7 +++++++
 devtools/libabigail.abignore      | 8 ++++++++
 drivers/bus/auxiliary/version.map | 2 ++
 lib/gpudev/version.map            | 2 ++
 lib/regexdev/version.map          | 2 ++
 5 files changed, 21 insertions(+)

diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh
index 5bd290ac97..8266fdf9ea 100755
--- a/devtools/check-symbol-maps.sh
+++ b/devtools/check-symbol-maps.sh
@@ -53,4 +53,11 @@ if [ -n "$duplicate_symbols" ] ; then
     ret=1
 fi
 
+local_miss_maps=$(grep -L 'local: \*;' $@)
+if [ -n "$local_miss_maps" ] ; then
+    echo "Found maps without local catch-all:"
+    echo "$local_miss_maps"
+    ret=1
+fi
+
 exit $ret
diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 18c11c80c6..c618f20032 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -32,3 +32,11 @@
 ; Ignore changes in common mlx5 driver, should be all internal
 [suppress_file]
         soname_regexp = ^librte_common_mlx5\.
+
+; Ignore visibility fix of local functions in experimental auxiliary driver
+[suppress_file]
+        soname_regexp = ^librte_bus_auxiliary\.
+
+; Ignore visibility fix of local functions in experimental gpudev library
+[suppress_file]
+        soname_regexp = ^librte_gpudev\.
diff --git a/drivers/bus/auxiliary/version.map b/drivers/bus/auxiliary/version.map
index a52260657c..dc993e84ff 100644
--- a/drivers/bus/auxiliary/version.map
+++ b/drivers/bus/auxiliary/version.map
@@ -4,4 +4,6 @@ EXPERIMENTAL {
 	# added in 21.08
 	rte_auxiliary_register;
 	rte_auxiliary_unregister;
+
+	local: *;
 };
diff --git a/lib/gpudev/version.map b/lib/gpudev/version.map
index b23e3fd6eb..a2c8ce5759 100644
--- a/lib/gpudev/version.map
+++ b/lib/gpudev/version.map
@@ -39,4 +39,6 @@ INTERNAL {
 	rte_gpu_get_by_name;
 	rte_gpu_notify;
 	rte_gpu_release;
+
+	local: *;
 };
diff --git a/lib/regexdev/version.map b/lib/regexdev/version.map
index 988b909638..3c6e9fffa1 100644
--- a/lib/regexdev/version.map
+++ b/lib/regexdev/version.map
@@ -26,6 +26,8 @@ EXPERIMENTAL {
 	rte_regexdev_xstats_get;
 	rte_regexdev_xstats_names_get;
 	rte_regexdev_xstats_reset;
+
+	local: *;
 };
 
 INTERNAL {
-- 
2.34.1


^ permalink raw reply	[relevance 4%]

* RE: [PATCH v2 1/3] common/mlx5: add Netlink event helpers
  2022-03-08 13:48  3%         ` Kevin Traynor
@ 2022-03-08 15:18  0%           ` Dmitry Kozlyuk
  0 siblings, 0 replies; 200+ results
From: Dmitry Kozlyuk @ 2022-03-08 15:18 UTC (permalink / raw)
  To: Kevin Traynor, Ferruh Yigit, dev, Luca Boccassi
  Cc: stable, Slava Ovsiienko, Matan Azrad, Ray Kinsella

Hi Kevin,

> -----Original Message-----
> From: Kevin Traynor <ktraynor@redhat.com>
[...]
> The updated API is internal so that should be ok. I'm ok to take this
> on
> 21.11 as long as you can confirm it's not breaking any user
> compatibility with external sw versions/ABI/API etc from 21.11.0 ?
> 
> Assuming that's ok, please send a rebased series for 21.11. I'm not
> comfortable rebasing the series with the amount of changes on dpdk
> main branch to same functions in mlx5_os.c.

Changes are not breaking any external SW.
Backport sent:
http://inbox.dpdk.org/stable/20220308151044.1012413-1-dkozlyuk@nvidia.com

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v1 1/2] bbdev: add device info on queue topology
  @ 2022-03-09  1:28  3%   ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2022-03-09  1:28 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: dev, gakhil, trix, hemant.agrawal, mingshan.zhang

On Tue,  8 Mar 2022 16:22:34 -0800
Nicolas Chautru <nicolas.chautru@intel.com> wrote:

> diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h
> index b88c881..10c06b6 100644
> --- a/lib/bbdev/rte_bbdev.h
> +++ b/lib/bbdev/rte_bbdev.h
> @@ -274,6 +274,10 @@ struct rte_bbdev_driver_info {
>  
>  	/** Maximum number of queues supported by the device */
>  	unsigned int max_num_queues;
> +	/** Maximum number of queues supported per operation type */
> +	unsigned int num_queues[RTE_BBDEV_OP_TYPE_COUNT];
> +	/** Priority level supported per operation type */
> +	unsigned int queue_priority[RTE_BBDEV_OP_TYPE_COUNT];
>  	/** Queue size limit (queue size must also be power of 2) */
>  	uint32_t queue_size_lim;
>  	/** Set if device off-loads operation to hardware  */

This breaks ABI of rte_bbdev_info_get.

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 2/2] build: hide local symbols in shared libraries
  2022-03-08 14:24  4%   ` [PATCH v2 2/2] build: hide local symbols in shared libraries Thomas Monjalon
@ 2022-03-09 10:58  0%     ` Kevin Traynor
  2022-03-09 18:54  0%       ` Thomas Monjalon
  2022-04-15 14:56  0%     ` Ray Kinsella
  1 sibling, 1 reply; 200+ results
From: Kevin Traynor @ 2022-03-09 10:58 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: david.marchand, stable, Ray Kinsella, Parav Pandit, Xueming Li,
	Elena Agostini, Ori Kam, Andrew Rybchenko, Michael Baum

Hi Thomas,

On 08/03/2022 14:24, Thomas Monjalon wrote:
> The symbols which are not listed in the version script
> are exported by default.
> Adding a local section with a wildcard make non-listed functions
> and variables as hidden, as it should be in all version.map files.
> 
> These are the changes done in the shared libraries:
> - DF .text  Base          auxiliary_add_device
> - DF .text  Base          auxiliary_dev_exists
> - DF .text  Base          auxiliary_dev_iterate
> - DF .text  Base          auxiliary_insert_device
> - DF .text  Base          auxiliary_is_ignored_device
> - DF .text  Base          auxiliary_match
> - DF .text  Base          auxiliary_on_scan
> - DF .text  Base          auxiliary_scan
> - DO .bss   Base          auxiliary_bus_logtype
> - DO .data  Base          auxiliary_bus
> - DO .bss   Base          gpu_logtype
> 
> There is no impact on regexdev library.
> 
> Because these local symbols were exported as non-internal
> in DPDK 21.11, any change in these functions would break the ABI.
> Exception rules are added for these experimental libraries,
> so the ABI check will skip them until the next ABI version.
> 
> A check is added to avoid such miss in future.
> 
> Fixes: 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")
> Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library")
> Cc: stable@dpdk.org
> 

If I take this 2/2 for 21.11.1, then I also need to backport [0] so I 
won't have errors for common_mlx5.

Any problem with taking both?

[0]
commit c2e3059a10f2389b791d5d485fe71e666984c193
Author: Michael Baum <michaelba@nvidia.com>
Date:   Fri Feb 25 01:25:06 2022 +0200

     common/mlx5: consider local functions as internal


> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>   devtools/check-symbol-maps.sh     | 7 +++++++
>   devtools/libabigail.abignore      | 8 ++++++++
>   drivers/bus/auxiliary/version.map | 2 ++
>   lib/gpudev/version.map            | 2 ++
>   lib/regexdev/version.map          | 2 ++
>   5 files changed, 21 insertions(+)
> 
> diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh
> index 5bd290ac97..8266fdf9ea 100755
> --- a/devtools/check-symbol-maps.sh
> +++ b/devtools/check-symbol-maps.sh
> @@ -53,4 +53,11 @@ if [ -n "$duplicate_symbols" ] ; then
>       ret=1
>   fi
>   
> +local_miss_maps=$(grep -L 'local: \*;' $@)
> +if [ -n "$local_miss_maps" ] ; then
> +    echo "Found maps without local catch-all:"
> +    echo "$local_miss_maps"
> +    ret=1
> +fi
> +
>   exit $ret
> diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> index 18c11c80c6..c618f20032 100644
> --- a/devtools/libabigail.abignore
> +++ b/devtools/libabigail.abignore
> @@ -32,3 +32,11 @@
>   ; Ignore changes in common mlx5 driver, should be all internal
>   [suppress_file]
>           soname_regexp = ^librte_common_mlx5\.
> +
> +; Ignore visibility fix of local functions in experimental auxiliary driver
> +[suppress_file]
> +        soname_regexp = ^librte_bus_auxiliary\.
> +
> +; Ignore visibility fix of local functions in experimental gpudev library
> +[suppress_file]
> +        soname_regexp = ^librte_gpudev\.
> diff --git a/drivers/bus/auxiliary/version.map b/drivers/bus/auxiliary/version.map
> index a52260657c..dc993e84ff 100644
> --- a/drivers/bus/auxiliary/version.map
> +++ b/drivers/bus/auxiliary/version.map
> @@ -4,4 +4,6 @@ EXPERIMENTAL {
>   	# added in 21.08
>   	rte_auxiliary_register;
>   	rte_auxiliary_unregister;
> +
> +	local: *;
>   };
> diff --git a/lib/gpudev/version.map b/lib/gpudev/version.map
> index b23e3fd6eb..a2c8ce5759 100644
> --- a/lib/gpudev/version.map
> +++ b/lib/gpudev/version.map
> @@ -39,4 +39,6 @@ INTERNAL {
>   	rte_gpu_get_by_name;
>   	rte_gpu_notify;
>   	rte_gpu_release;
> +
> +	local: *;
>   };
> diff --git a/lib/regexdev/version.map b/lib/regexdev/version.map
> index 988b909638..3c6e9fffa1 100644
> --- a/lib/regexdev/version.map
> +++ b/lib/regexdev/version.map
> @@ -26,6 +26,8 @@ EXPERIMENTAL {
>   	rte_regexdev_xstats_get;
>   	rte_regexdev_xstats_names_get;
>   	rte_regexdev_xstats_reset;
> +
> +	local: *;
>   };
>   
>   INTERNAL {


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/2] build: hide local symbols in shared libraries
  2022-03-09 10:58  0%     ` Kevin Traynor
@ 2022-03-09 18:54  0%       ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-03-09 18:54 UTC (permalink / raw)
  To: Kevin Traynor
  Cc: dev, david.marchand, stable, Ray Kinsella, Parav Pandit,
	Xueming Li, Elena Agostini, Ori Kam, Andrew Rybchenko,
	Michael Baum

09/03/2022 11:58, Kevin Traynor:
> Hi Thomas,
> 
> On 08/03/2022 14:24, Thomas Monjalon wrote:
> > The symbols which are not listed in the version script
> > are exported by default.
> > Adding a local section with a wildcard make non-listed functions
> > and variables as hidden, as it should be in all version.map files.
> > 
> > These are the changes done in the shared libraries:
> > - DF .text  Base          auxiliary_add_device
> > - DF .text  Base          auxiliary_dev_exists
> > - DF .text  Base          auxiliary_dev_iterate
> > - DF .text  Base          auxiliary_insert_device
> > - DF .text  Base          auxiliary_is_ignored_device
> > - DF .text  Base          auxiliary_match
> > - DF .text  Base          auxiliary_on_scan
> > - DF .text  Base          auxiliary_scan
> > - DO .bss   Base          auxiliary_bus_logtype
> > - DO .data  Base          auxiliary_bus
> > - DO .bss   Base          gpu_logtype
> > 
> > There is no impact on regexdev library.
> > 
> > Because these local symbols were exported as non-internal
> > in DPDK 21.11, any change in these functions would break the ABI.
> > Exception rules are added for these experimental libraries,
> > so the ABI check will skip them until the next ABI version.
> > 
> > A check is added to avoid such miss in future.
> > 
> > Fixes: 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")
> > Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library")
> > Cc: stable@dpdk.org
> > 
> 
> If I take this 2/2 for 21.11.1, then I also need to backport [0] so I 
> won't have errors for common_mlx5.
> 
> Any problem with taking both?
> 
> [0]
> commit c2e3059a10f2389b791d5d485fe71e666984c193
> Author: Michael Baum <michaelba@nvidia.com>
> Date:   Fri Feb 25 01:25:06 2022 +0200
> 
>      common/mlx5: consider local functions as internal

I think that's fine to backport this as well.





^ permalink raw reply	[relevance 0%]

* Re: [PATCH v1] bbdev: add new operation for FFT processing
  @ 2022-03-11  1:12  3%   ` Stephen Hemminger
  2022-03-17 18:42  3%     ` Chautru, Nicolas
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2022-03-11  1:12 UTC (permalink / raw)
  To: Nicolas Chautru
  Cc: dev, gakhil, trix, thomas, hemant.agrawal, mingshan.zhang,
	david.marchand

On Thu, 10 Mar 2022 15:49:17 -0800
Nicolas Chautru <nicolas.chautru@intel.com> wrote:

> diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c
> index aaee7b7..a72ecba 100644
> --- a/lib/bbdev/rte_bbdev.c
> +++ b/lib/bbdev/rte_bbdev.c
> @@ -850,6 +850,9 @@ struct rte_bbdev *
>  	case RTE_BBDEV_OP_LDPC_ENC:
>  		result = sizeof(struct rte_bbdev_enc_op);
>  		break;
> +	case RTE_BBDEV_OP_FFT:
> +		result = sizeof(struct rte_bbdev_fft_op);
> +		break;
>  	default:
>  		break;
>  	}
> @@ -873,6 +876,10 @@ struct rte_bbdev *
>  		struct rte_bbdev_enc_op *op = element;
>  		memset(op, 0, mempool->elt_size);
>  		op->mempool = mempool;
> +	} else if (type == RTE_BBDEV_OP_FFT) {
> +		struct rte_bbdev_fft_op *op = element;
> +		memset(op, 0, mempool->elt_size);
> +		op->mempool = mempool;
>  	}
>  }
>  
> @@ -1123,6 +1130,7 @@ struct rte_mempool *
>  		"RTE_BBDEV_OP_TURBO_ENC",
>  		"RTE_BBDEV_OP_LDPC_DEC",
>  		"RTE_BBDEV_OP_LDPC_ENC",
> +		"RTE_BBDEV_OP_FFT",
>  	};
>  
>  	if (op_type < RTE_BBDEV_OP_TYPE_COUNT)
> diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h
> index b88c881..e9ca673 100644
> --- a/lib/bbdev/rte_bbdev.h
> +++ b/lib/bbdev/rte_bbdev.h
> @@ -380,6 +380,12 @@ typedef uint16_t (*rte_bbdev_enqueue_dec_ops_t)(
>  		struct rte_bbdev_dec_op **ops,
>  		uint16_t num);
>  
> +/** @internal Enqueue fft operations for processing on queue of a device. */
> +typedef uint16_t (*rte_bbdev_enqueue_fft_ops_t)(
> +		struct rte_bbdev_queue_data *q_data,
> +		struct rte_bbdev_fft_op **ops,
> +		uint16_t num);
> +
>  /** @internal Dequeue encode operations from a queue of a device. */
>  typedef uint16_t (*rte_bbdev_dequeue_enc_ops_t)(
>  		struct rte_bbdev_queue_data *q_data,
> @@ -390,6 +396,11 @@ typedef uint16_t (*rte_bbdev_dequeue_dec_ops_t)(
>  		struct rte_bbdev_queue_data *q_data,
>  		struct rte_bbdev_dec_op **ops, uint16_t num);
>  
> +/** @internal Dequeue fft operations from a queue of a device. */
> +typedef uint16_t (*rte_bbdev_dequeue_fft_ops_t)(
> +		struct rte_bbdev_queue_data *q_data,
> +		struct rte_bbdev_fft_op **ops, uint16_t num);
> +
>  #define RTE_BBDEV_NAME_MAX_LEN  64  /**< Max length of device name */
>  
>  /**
> @@ -438,6 +449,10 @@ struct __rte_cache_aligned rte_bbdev {
>  	rte_bbdev_dequeue_enc_ops_t dequeue_ldpc_enc_ops;
>  	/** Dequeue decode function */
>  	rte_bbdev_dequeue_dec_ops_t dequeue_ldpc_dec_ops;
> +	/** Enqueue FFT function */
> +	rte_bbdev_enqueue_fft_ops_t enqueue_fft_ops;
> +	/** Dequeue FFT function */
> +	rte_bbdev_dequeue_fft_ops_t dequeue_fft_ops;
>  	const struct rte_bbdev_ops *dev_ops;  /**< Functions exported by PMD */
>  	struct rte_bbdev_data *data;  /**< Pointer to device data */
>  	enum rte_bbdev_state state;  /**< If device is currently used or not */


Since rte_bbdev is exposed in rte_bbdev.h it can not be changed without
breaking ABI. It would have been better if data structure was better hidden (hint).
But you can't change it now until 22.11

^ permalink raw reply	[relevance 3%]

* [PATCH v1] doc: announce changes in bbdev related to enum extension
@ 2022-03-17  0:11  3% Nicolas Chautru
  2022-03-17  0:11 10% ` Nicolas Chautru
  0 siblings, 1 reply; 200+ results
From: Nicolas Chautru @ 2022-03-17  0:11 UTC (permalink / raw)
  To: dev, gakhil, thomas
  Cc: trix, ray.kinsella, bruce.richardson, hemant.agrawal,
	mingshan.zhang, david.marchand, Nicolas Chautru

Realizing when submitting new bbdev operation in this patch
(https://patchwork.dpdk.org/project/dpdk/list/?series=22111) that this is not
workable in practice to extend this API into 22.07 without fundamental ABI breakage
even by using existing versionning framework.
Some existing learnings to be applied here to prevent extension being blocked,
hence accouncing changes in bbdev intended for 22.11 to make this more
future-proof, including dropping max value from enum, as well as deferring extension
of the API for FFT operation into DPDK 22.11.

Let me know if any comments or in case this should be captured differently.
Thanks
Nic

Nicolas Chautru (1):
  doc: announce changes in bbdev related to enum extension

 doc/guides/rel_notes/deprecation.rst | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
1.8.3.1


^ permalink raw reply	[relevance 3%]

* [PATCH v1] doc: announce changes in bbdev related to enum extension
  2022-03-17  0:11  3% [PATCH v1] doc: announce changes in bbdev related to enum extension Nicolas Chautru
@ 2022-03-17  0:11 10% ` Nicolas Chautru
  0 siblings, 0 replies; 200+ results
From: Nicolas Chautru @ 2022-03-17  0:11 UTC (permalink / raw)
  To: dev, gakhil, thomas
  Cc: trix, ray.kinsella, bruce.richardson, hemant.agrawal,
	mingshan.zhang, david.marchand, Nicolas Chautru

Intent to resolve in DPDK 22.11 historical usage which prevents
graceful extension of enum and API without troublesome ABI breakage
as well as extending API RTE_BBDEV_OP_FFT for new operation type
in bbdev.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 4e5b23c..238920e 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -112,6 +112,14 @@ Deprecation Notices
   session and the private data of session. An opaque pointer can be exposed
   directly to application which can be attached to the ``rte_crypto_op``.
 
+* bbdev: Will fix extending some enum breaking the ABI. Notably
+deprecating ``RTE_BBDEV_OP_TYPE_COUNT`` terminating the ``rte_bbdev_op_type``
+and use fixed array size when required to allow for future enum extension.
+Will also remove some of the inlining when causing ABI future-proof concerns.
+Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per this
+RFC https://patchwork.dpdk.org/project/dpdk/list/?series=22111
+This should be updated in DPDK 22.11.
+
 * security: Hide structure ``rte_security_session`` and expose an opaque
   pointer for the private data to the application which can be attached
   to the packet while enqueuing.
-- 
1.8.3.1


^ permalink raw reply	[relevance 10%]

* DPDK 22.03 released
@ 2022-03-17  9:54  3% Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-03-17  9:54 UTC (permalink / raw)
  To: announce

A new release is available:
	https://fast.dpdk.org/rel/dpdk-22.03.tar.xz

Winter release numbers are quite small as usual:
	956 commits from 181 authors
	2289 files changed, 83849 insertions(+), 97801 deletions(-)

It is not planned to start a maintenance branch for 22.03.
This version is ABI-compatible with 21.11.

Below are some new features:
	- fast restart by reusing hugepages
	- UDP/TCP checksum on multi-segments
	- IP reassembly offload
	- queue-based priority flow control
	- flow API for templates and async operations
	- private ethdev driver info dump
	- private user data in asymmetric crypto session

More details in the release notes:
	https://doc.dpdk.org/guides/rel_notes/release_22_03.html


There are 51 new contributors (including authors, reviewers and testers).
Welcome to Abhimanyu Saini, Adham Masarwah, Asaf Ravid, Bin Zheng,
Brian Dooley, Brick Yang, Bruce Merry, Christophe Fontaine,
Chuanshe Zhang, Dawid Gorecki, Daxue Gao, Geoffrey Le Gourriérec,
Gerry Gribbon, Harold Huang, Harshad Narayane, Igor Chauskin,
Jakub Poczatek, Jeff Daly, Jie Hai, Josh Soref, Kamalakannan R,
Karl Bonde Torp, Kevin Liu, Kumara Parameshwaran, Madhuker Mythri,
Markus Theil, Martijn Bakker, Maxime Gouin, Megha Ajmera, Michael Barker,
Michal Wilczynski, Nan Zhou, Nobuhiro Miki, Padraig Connolly, Peng Yu,
Peng Zhang, Qiao Liu, Rahul Bhansali, Stephen Douthit, Tianli Lai,
Tudor Brindus, Usama Arif, Wang Yunjian, Weiguo Li, Wenxiang Qian,
Wenxuan Wu, Yajun Wu, Yiding Zhou, Yingya Han, Yu Wenjun and Yuan Wang.

Below is the number of commits per employer (with authors count):
	242     Intel (53)
	209     Marvell (26)
	184     NVIDIA (27)
	 61     Huawei (7)
	 29     Microsoft (2)
	 27     Broadcom (5)
	 26     Red Hat (4)
	 24     NXP (8)
	 23     Semihalf (4)
	 21     Weiguo Li (1)
	 16     OKTET Labs (1)
	 12     Trustnet (1)
	 10     Arm (5)

A big thank to all courageous people who took on the non rewarding task
of reviewing other's job.
Based on Reviewed-by and Acked-by tags, the top non-PMD reviewers are:
	 41     Akhil Goyal <gakhil@marvell.com>
	 29     Bruce Richardson <bruce.richardson@intel.com>
	 26     Ferruh Yigit <ferruh.yigit@intel.com>
	 20     Ori Kam <orika@nvidia.com>
	 19     David Marchand <david.marchand@redhat.com>
	 16     Tyler Retzlaff <roretzla@linux.microsoft.com>
	 15     Viacheslav Ovsiienko <viacheslavo@nvidia.com>
	 15     Morten Brørup <mb@smartsharesystems.com>
	 15     Chenbo Xia <chenbo.xia@intel.com>
	 14     Stephen Hemminger <stephen@networkplumber.org>
	 14     Jerin Jacob <jerinj@marvell.com>
	 12     Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
	 11     Ruifeng Wang <ruifeng.wang@arm.com>
	 11     Maxime Coquelin <maxime.coquelin@redhat.com>


Next version will be 22.07 in July.
The new features for 22.07 can be submitted during the next 3 weeks:
	http://core.dpdk.org/roadmap#dates
Please share your roadmap.

Thanks everyone



^ permalink raw reply	[relevance 3%]

* [PATCH v2] doc: announce changes in bbdev related to enum extension
@ 2022-03-17 18:37  3% Nicolas Chautru
  2022-03-17 18:37 10% ` Nicolas Chautru
  0 siblings, 1 reply; 200+ results
From: Nicolas Chautru @ 2022-03-17 18:37 UTC (permalink / raw)
  To: dev, gakhil, thomas
  Cc: trix, ray.kinsella, bruce.richardson, hemant.agrawal,
	mingshan.zhang, david.marchand, stephen, Nicolas Chautru

v2: indentation fix

Realizing when submitting new bbdev operation in this patch
(https://patchwork.dpdk.org/project/dpdk/list/?series=22111) that this is not workable in practice to extend this API into 22.07 without fundamental ABI breakage even by using existing versionning framework.
Some existing learnings to be applied here to prevent extension being blocked, hence accouncing changes in bbdev intended for 22.11 to make this more future-proof, including dropping max value from enum, as well as deferring extension of the API for FFT operation into DPDK 22.11.

Let me know if any comments or in case this should be captured differently.
Thanks
Nic


Nicolas Chautru (1):
  doc: announce changes in bbdev related to enum extension

 doc/guides/rel_notes/deprecation.rst | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
1.8.3.1


^ permalink raw reply	[relevance 3%]

* [PATCH v2] doc: announce changes in bbdev related to enum extension
  2022-03-17 18:37  3% [PATCH v2] doc: announce changes in bbdev related to enum extension Nicolas Chautru
@ 2022-03-17 18:37 10% ` Nicolas Chautru
  0 siblings, 0 replies; 200+ results
From: Nicolas Chautru @ 2022-03-17 18:37 UTC (permalink / raw)
  To: dev, gakhil, thomas
  Cc: trix, ray.kinsella, bruce.richardson, hemant.agrawal,
	mingshan.zhang, david.marchand, stephen, Nicolas Chautru

Intent to resolve in DPDK 22.11 historical usage which prevents
graceful extension of enum and API without troublesome ABI breakage
as well as extending API RTE_BBDEV_OP_FFT for new operation type
in bbdev.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 4e5b23c..ff161c5 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -112,6 +112,14 @@ Deprecation Notices
   session and the private data of session. An opaque pointer can be exposed
   directly to application which can be attached to the ``rte_crypto_op``.
 
+* bbdev: Will fix extending some enum breaking the ABI. Notably
+  deprecating ``RTE_BBDEV_OP_TYPE_COUNT`` terminating the ``rte_bbdev_op_type``
+  and use fixed array size when required to allow for future enum extension.
+  Will also remove some of the inlining when causing ABI future-proof concerns.
+  Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per this
+  RFC https://patchwork.dpdk.org/project/dpdk/list/?series=22111
+  This should be updated in DPDK 22.11.
+
 * security: Hide structure ``rte_security_session`` and expose an opaque
   pointer for the private data to the application which can be attached
   to the packet while enqueuing.
-- 
1.8.3.1


^ permalink raw reply	[relevance 10%]

* RE: [PATCH v1] bbdev: add new operation for FFT processing
  2022-03-11  1:12  3%   ` Stephen Hemminger
@ 2022-03-17 18:42  3%     ` Chautru, Nicolas
  0 siblings, 0 replies; 200+ results
From: Chautru, Nicolas @ 2022-03-17 18:42 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, gakhil, trix, thomas, hemant.agrawal, Zhang, Mingshan,
	david.marchand

Hi Stephen,

Yes I am deferring thispatch  to 22.11 due to ABI breakage that cannot be resolved using versioning in a few places. 
Still that patch can be used in anticipation of 22.11 to get early comments on the API extension. I have marked it as deferred in patchwork. 

For 22.07 I have pushed this notice to highlight change in 22.11 so that to clean some of this to be more future proof and extend the API. Ie. no actual change of API in 22.07. 
=> https://patches.dpdk.org/project/dpdk/patch/1647542252-35727-2-git-send-email-nicolas.chautru@intel.com/

Thanks
Nic

> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Thursday, March 10, 2022 5:13 PM
> To: Chautru, Nicolas <nicolas.chautru@intel.com>
> Cc: dev@dpdk.org; gakhil@marvell.com; trix@redhat.com;
> thomas@monjalon.net; hemant.agrawal@nxp.com; Zhang, Mingshan
> <mingshan.zhang@intel.com>; david.marchand@redhat.com
> Subject: Re: [PATCH v1] bbdev: add new operation for FFT processing
> 
> On Thu, 10 Mar 2022 15:49:17 -0800
> Nicolas Chautru <nicolas.chautru@intel.com> wrote:
> 
> > diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c index
> > aaee7b7..a72ecba 100644
> > --- a/lib/bbdev/rte_bbdev.c
> > +++ b/lib/bbdev/rte_bbdev.c
> > @@ -850,6 +850,9 @@ struct rte_bbdev *
> >  	case RTE_BBDEV_OP_LDPC_ENC:
> >  		result = sizeof(struct rte_bbdev_enc_op);
> >  		break;
> > +	case RTE_BBDEV_OP_FFT:
> > +		result = sizeof(struct rte_bbdev_fft_op);
> > +		break;
> >  	default:
> >  		break;
> >  	}
> > @@ -873,6 +876,10 @@ struct rte_bbdev *
> >  		struct rte_bbdev_enc_op *op = element;
> >  		memset(op, 0, mempool->elt_size);
> >  		op->mempool = mempool;
> > +	} else if (type == RTE_BBDEV_OP_FFT) {
> > +		struct rte_bbdev_fft_op *op = element;
> > +		memset(op, 0, mempool->elt_size);
> > +		op->mempool = mempool;
> >  	}
> >  }
> >
> > @@ -1123,6 +1130,7 @@ struct rte_mempool *
> >  		"RTE_BBDEV_OP_TURBO_ENC",
> >  		"RTE_BBDEV_OP_LDPC_DEC",
> >  		"RTE_BBDEV_OP_LDPC_ENC",
> > +		"RTE_BBDEV_OP_FFT",
> >  	};
> >
> >  	if (op_type < RTE_BBDEV_OP_TYPE_COUNT) diff --git
> > a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h index b88c881..e9ca673
> > 100644
> > --- a/lib/bbdev/rte_bbdev.h
> > +++ b/lib/bbdev/rte_bbdev.h
> > @@ -380,6 +380,12 @@ typedef uint16_t
> (*rte_bbdev_enqueue_dec_ops_t)(
> >  		struct rte_bbdev_dec_op **ops,
> >  		uint16_t num);
> >
> > +/** @internal Enqueue fft operations for processing on queue of a
> > +device. */ typedef uint16_t (*rte_bbdev_enqueue_fft_ops_t)(
> > +		struct rte_bbdev_queue_data *q_data,
> > +		struct rte_bbdev_fft_op **ops,
> > +		uint16_t num);
> > +
> >  /** @internal Dequeue encode operations from a queue of a device. */
> > typedef uint16_t (*rte_bbdev_dequeue_enc_ops_t)(
> >  		struct rte_bbdev_queue_data *q_data, @@ -390,6 +396,11
> @@ typedef
> > uint16_t (*rte_bbdev_dequeue_dec_ops_t)(
> >  		struct rte_bbdev_queue_data *q_data,
> >  		struct rte_bbdev_dec_op **ops, uint16_t num);
> >
> > +/** @internal Dequeue fft operations from a queue of a device. */
> > +typedef uint16_t (*rte_bbdev_dequeue_fft_ops_t)(
> > +		struct rte_bbdev_queue_data *q_data,
> > +		struct rte_bbdev_fft_op **ops, uint16_t num);
> > +
> >  #define RTE_BBDEV_NAME_MAX_LEN  64  /**< Max length of device name
> */
> >
> >  /**
> > @@ -438,6 +449,10 @@ struct __rte_cache_aligned rte_bbdev {
> >  	rte_bbdev_dequeue_enc_ops_t dequeue_ldpc_enc_ops;
> >  	/** Dequeue decode function */
> >  	rte_bbdev_dequeue_dec_ops_t dequeue_ldpc_dec_ops;
> > +	/** Enqueue FFT function */
> > +	rte_bbdev_enqueue_fft_ops_t enqueue_fft_ops;
> > +	/** Dequeue FFT function */
> > +	rte_bbdev_dequeue_fft_ops_t dequeue_fft_ops;
> >  	const struct rte_bbdev_ops *dev_ops;  /**< Functions exported by
> PMD */
> >  	struct rte_bbdev_data *data;  /**< Pointer to device data */
> >  	enum rte_bbdev_state state;  /**< If device is currently used or not
> > */
> 
> 
> Since rte_bbdev is exposed in rte_bbdev.h it can not be changed without
> breaking ABI. It would have been better if data structure was better hidden
> (hint).
> But you can't change it now until 22.11

^ permalink raw reply	[relevance 3%]

* [PATCH] version: 22.07-rc0
@ 2022-03-18 14:35 10% David Marchand
  2022-03-18 15:46  0% ` Aaron Conole
  2022-03-21 13:01  0% ` Thomas Monjalon
  0 siblings, 2 replies; 200+ results
From: David Marchand @ 2022-03-18 14:35 UTC (permalink / raw)
  To: dev; +Cc: thomas, Aaron Conole, Michael Santana

Start a new release cycle with empty release notes.
Bump version and ABI minor.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
 .github/workflows/build.yml            |   2 +-
 .travis.yml                            |   2 +-
 ABI_VERSION                            |   2 +-
 VERSION                                |   2 +-
 doc/guides/rel_notes/index.rst         |   1 +
 doc/guides/rel_notes/release_22_07.rst | 138 +++++++++++++++++++++++++
 6 files changed, 143 insertions(+), 4 deletions(-)
 create mode 100644 doc/guides/rel_notes/release_22_07.rst

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d30cfd08d7..02819aa5de 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -23,7 +23,7 @@ jobs:
       LIBABIGAIL_VERSION: libabigail-1.8
       MINI: ${{ matrix.config.mini != '' }}
       PPC64LE: ${{ matrix.config.cross == 'ppc64le' }}
-      REF_GIT_TAG: v21.11
+      REF_GIT_TAG: v22.03
       RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
 
     strategy:
diff --git a/.travis.yml b/.travis.yml
index 0838f80d3c..5f46dccb54 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,7 +42,7 @@ script: ./.ci/${TRAVIS_OS_NAME}-build.sh
 env:
   global:
     - LIBABIGAIL_VERSION=libabigail-1.8
-    - REF_GIT_TAG=v21.11
+    - REF_GIT_TAG=v22.03
 
 jobs:
   include:
diff --git a/ABI_VERSION b/ABI_VERSION
index 70a91e23ec..95af471221 100644
--- a/ABI_VERSION
+++ b/ABI_VERSION
@@ -1 +1 @@
-22.1
+22.2
diff --git a/VERSION b/VERSION
index f9be6be181..3da485c34d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-22.03.0
+22.07.0-rc0
diff --git a/doc/guides/rel_notes/index.rst b/doc/guides/rel_notes/index.rst
index 876ffd28f6..93a3f7e5da 100644
--- a/doc/guides/rel_notes/index.rst
+++ b/doc/guides/rel_notes/index.rst
@@ -8,6 +8,7 @@ Release Notes
     :maxdepth: 1
     :numbered:
 
+    release_22_07
     release_22_03
     release_21_11
     release_21_08
diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
new file mode 100644
index 0000000000..42a5f2d990
--- /dev/null
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -0,0 +1,138 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+   Copyright 2022 The DPDK contributors
+
+.. include:: <isonum.txt>
+
+DPDK Release 22.07
+==================
+
+.. **Read this first.**
+
+   The text in the sections below explains how to update the release notes.
+
+   Use proper spelling, capitalization and punctuation in all sections.
+
+   Variable and config names should be quoted as fixed width text:
+   ``LIKE_THIS``.
+
+   Build the docs and view the output file to ensure the changes are correct::
+
+      ninja -C build doc
+      xdg-open build/doc/guides/html/rel_notes/release_22_07.html
+
+
+New Features
+------------
+
+.. This section should contain new features added in this release.
+   Sample format:
+
+   * **Add a title in the past tense with a full stop.**
+
+     Add a short 1-2 sentence description in the past tense.
+     The description should be enough to allow someone scanning
+     the release notes to understand the new feature.
+
+     If the feature adds a lot of sub-features you can use a bullet list
+     like this:
+
+     * Added feature foo to do something.
+     * Enhanced feature bar to do something else.
+
+     Refer to the previous release notes for examples.
+
+     Suggested order in release notes items:
+     * Core libs (EAL, mempool, ring, mbuf, buses)
+     * Device abstraction libs and PMDs (ordered alphabetically by vendor name)
+       - ethdev (lib, PMDs)
+       - cryptodev (lib, PMDs)
+       - eventdev (lib, PMDs)
+       - etc
+     * Other libs
+     * Apps, Examples, Tools (if significant)
+
+     This section is a comment. Do not overwrite or remove it.
+     Also, make sure to start the actual text at the margin.
+     =======================================================
+
+
+Removed Items
+-------------
+
+.. This section should contain removed items in this release. Sample format:
+
+   * Add a short 1-2 sentence description of the removed item
+     in the past tense.
+
+   This section is a comment. Do not overwrite or remove it.
+   Also, make sure to start the actual text at the margin.
+   =======================================================
+
+
+API Changes
+-----------
+
+.. This section should contain API changes. Sample format:
+
+   * sample: Add a short 1-2 sentence description of the API change
+     which was announced in the previous releases and made in this release.
+     Start with a scope label like "ethdev:".
+     Use fixed width quotes for ``function_names`` or ``struct_names``.
+     Use the past tense.
+
+   This section is a comment. Do not overwrite or remove it.
+   Also, make sure to start the actual text at the margin.
+   =======================================================
+
+
+ABI Changes
+-----------
+
+.. This section should contain ABI changes. Sample format:
+
+   * sample: Add a short 1-2 sentence description of the ABI change
+     which was announced in the previous releases and made in this release.
+     Start with a scope label like "ethdev:".
+     Use fixed width quotes for ``function_names`` or ``struct_names``.
+     Use the past tense.
+
+   This section is a comment. Do not overwrite or remove it.
+   Also, make sure to start the actual text at the margin.
+   =======================================================
+
+* No ABI change that would break compatibility with 21.11.
+
+
+Known Issues
+------------
+
+.. This section should contain new known issues in this release. Sample format:
+
+   * **Add title in present tense with full stop.**
+
+     Add a short 1-2 sentence description of the known issue
+     in the present tense. Add information on any known workarounds.
+
+   This section is a comment. Do not overwrite or remove it.
+   Also, make sure to start the actual text at the margin.
+   =======================================================
+
+
+Tested Platforms
+----------------
+
+.. This section should contain a list of platforms that were tested
+   with this release.
+
+   The format is:
+
+   * <vendor> platform with <vendor> <type of devices> combinations
+
+     * List of CPU
+     * List of OS
+     * List of devices
+     * Other relevant details...
+
+   This section is a comment. Do not overwrite or remove it.
+   Also, make sure to start the actual text at the margin.
+   =======================================================
-- 
2.23.0


^ permalink raw reply	[relevance 10%]

* Re: [PATCH] version: 22.07-rc0
  2022-03-18 14:35 10% [PATCH] version: 22.07-rc0 David Marchand
@ 2022-03-18 15:46  0% ` Aaron Conole
  2022-03-21 15:41  0%   ` Thomas Monjalon
  2022-03-21 13:01  0% ` Thomas Monjalon
  1 sibling, 1 reply; 200+ results
From: Aaron Conole @ 2022-03-18 15:46 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, thomas, Michael Santana

David Marchand <david.marchand@redhat.com> writes:

> Start a new release cycle with empty release notes.
> Bump version and ABI minor.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> ---

Acked-by: Aaron Conole <aconole@redhat.com>


^ permalink raw reply	[relevance 0%]

* Re: [PATCH] version: 22.07-rc0
  2022-03-18 14:35 10% [PATCH] version: 22.07-rc0 David Marchand
  2022-03-18 15:46  0% ` Aaron Conole
@ 2022-03-21 13:01  0% ` Thomas Monjalon
  2022-03-21 14:09  3%   ` David Marchand
  1 sibling, 1 reply; 200+ results
From: Thomas Monjalon @ 2022-03-21 13:01 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Aaron Conole, Michael Santana

18/03/2022 15:35, David Marchand:
> +ABI Changes
> +-----------
> +
> +.. This section should contain ABI changes. Sample format:
> +
> +   * sample: Add a short 1-2 sentence description of the ABI change
> +     which was announced in the previous releases and made in this release.
> +     Start with a scope label like "ethdev:".
> +     Use fixed width quotes for ``function_names`` or ``struct_names``.
> +     Use the past tense.
> +
> +   This section is a comment. Do not overwrite or remove it.
> +   Also, make sure to start the actual text at the margin.
> +   =======================================================
> +
> +* No ABI change that would break compatibility with 21.11.

Should we say 21.11 and 22.03?




^ permalink raw reply	[relevance 0%]

* Re: [PATCH] version: 22.07-rc0
  2022-03-21 13:01  0% ` Thomas Monjalon
@ 2022-03-21 14:09  3%   ` David Marchand
  2022-03-22  9:15  0%     ` Ray Kinsella
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2022-03-21 14:09 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Aaron Conole, Michael Santana, Ray Kinsella

On Mon, Mar 21, 2022 at 2:01 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 18/03/2022 15:35, David Marchand:
> > +ABI Changes
> > +-----------
> > +
> > +.. This section should contain ABI changes. Sample format:
> > +
> > +   * sample: Add a short 1-2 sentence description of the ABI change
> > +     which was announced in the previous releases and made in this release.
> > +     Start with a scope label like "ethdev:".
> > +     Use fixed width quotes for ``function_names`` or ``struct_names``.
> > +     Use the past tense.
> > +
> > +   This section is a comment. Do not overwrite or remove it.
> > +   Also, make sure to start the actual text at the margin.
> > +   =======================================================
> > +
> > +* No ABI change that would break compatibility with 21.11.
>
> Should we say 21.11 and 22.03?

In practice, compatibility is probably maintained, but we are
committed to maintain ABI compatibility with v21.11 only.
So I would leave this as is.

http://inbox.dpdk.org/dev/27c97b09-0b78-ccbc-db1e-860ac6012aec@ashroe.eu/


-- 
David Marchand


^ permalink raw reply	[relevance 3%]

* Re: [PATCH] version: 22.07-rc0
  2022-03-18 15:46  0% ` Aaron Conole
@ 2022-03-21 15:41  0%   ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-03-21 15:41 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Michael Santana, Aaron Conole

18/03/2022 16:46, Aaron Conole:
> David Marchand <david.marchand@redhat.com> writes:
> 
> > Start a new release cycle with empty release notes.
> > Bump version and ABI minor.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > Acked-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Aaron Conole <aconole@redhat.com>

Applied, thanks




^ permalink raw reply	[relevance 0%]

* Re: [PATCH] version: 22.07-rc0
  2022-03-21 14:09  3%   ` David Marchand
@ 2022-03-22  9:15  0%     ` Ray Kinsella
  2022-03-22 10:35  0%       ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: Ray Kinsella @ 2022-03-22  9:15 UTC (permalink / raw)
  To: David Marchand; +Cc: Thomas Monjalon, dev, Aaron Conole, Michael Santana


David Marchand <david.marchand@redhat.com> writes:

> On Mon, Mar 21, 2022 at 2:01 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>>
>> 18/03/2022 15:35, David Marchand:
>> > +ABI Changes
>> > +-----------
>> > +
>> > +.. This section should contain ABI changes. Sample format:
>> > +
>> > +   * sample: Add a short 1-2 sentence description of the ABI change
>> > +     which was announced in the previous releases and made in this release.
>> > +     Start with a scope label like "ethdev:".
>> > +     Use fixed width quotes for ``function_names`` or ``struct_names``.
>> > +     Use the past tense.
>> > +
>> > +   This section is a comment. Do not overwrite or remove it.
>> > +   Also, make sure to start the actual text at the margin.
>> > +   =======================================================
>> > +
>> > +* No ABI change that would break compatibility with 21.11.
>>
>> Should we say 21.11 and 22.03?
>
> In practice, compatibility is probably maintained, but we are
> committed to maintain ABI compatibility with v21.11 only.
> So I would leave this as is.
>
> http://inbox.dpdk.org/dev/27c97b09-0b78-ccbc-db1e-860ac6012aec@ashroe.eu/

Agreed  +1 - our only commitment is to v21.11.
Otherwise things would start to get very complicated. :-)


-- 
Regards, Ray K

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] version: 22.07-rc0
  2022-03-22  9:15  0%     ` Ray Kinsella
@ 2022-03-22 10:35  0%       ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-03-22 10:35 UTC (permalink / raw)
  To: David Marchand, Ray Kinsella; +Cc: dev, Aaron Conole, Michael Santana

22/03/2022 10:15, Ray Kinsella:
> David Marchand <david.marchand@redhat.com> writes:
> > On Mon, Mar 21, 2022 at 2:01 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >> 18/03/2022 15:35, David Marchand:
> >> > +* No ABI change that would break compatibility with 21.11.
> >>
> >> Should we say 21.11 and 22.03?
> >
> > In practice, compatibility is probably maintained, but we are
> > committed to maintain ABI compatibility with v21.11 only.
> > So I would leave this as is.
> >
> > http://inbox.dpdk.org/dev/27c97b09-0b78-ccbc-db1e-860ac6012aec@ashroe.eu/
> 
> Agreed  +1 - our only commitment is to v21.11.
> Otherwise things would start to get very complicated. :-)

I don't think it would be more complicated.
In reality, we are already testing compatibility with minor versions,
and there is no issue.



^ permalink raw reply	[relevance 0%]

* [PATCH] devtools: document ABI suppression rules
@ 2022-03-23  9:24 13% David Marchand
  2022-03-29  9:37  4% ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2022-03-23  9:24 UTC (permalink / raw)
  To: dev; +Cc: thomas, Ray Kinsella

Suppression rules are being added during the life of an ABI and cleaned
when bumping the major version.
Sort and document those rules to avoid pruning rules that should be
kept.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/libabigail.abignore | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index c618f20032..587cc5c381 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -1,3 +1,7 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Core suppression rules: DO NOT TOUCH;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
 [suppress_function]
         symbol_version = EXPERIMENTAL
 [suppress_variable]
@@ -16,15 +20,23 @@
 [suppress_file]
         soname_regexp = ^librte_.*mlx.*glue\.
 
-; Ignore fields inserted in place of reserved_opts of rte_security_ipsec_sa_options
-[suppress_type]
-        name = rte_security_ipsec_sa_options
-        has_data_member_inserted_between = {offset_of(reserved_opts), end}
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Experimental APIs exceptions ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ; Ignore changes to rte_crypto_asym_op, asymmetric crypto API is experimental
 [suppress_type]
         name = rte_crypto_asym_op
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Temporary exceptions till next major ABI version ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; Ignore fields inserted in place of reserved_opts of rte_security_ipsec_sa_options
+[suppress_type]
+        name = rte_security_ipsec_sa_options
+        has_data_member_inserted_between = {offset_of(reserved_opts), end}
+
 ; Ignore section attribute fixes in experimental regexdev library
 [suppress_file]
         soname_regexp = ^librte_regexdev\.
-- 
2.23.0


^ permalink raw reply	[relevance 13%]

* Re: [PATCH] devtools: document ABI suppression rules
  2022-03-23  9:24 13% [PATCH] devtools: document ABI suppression rules David Marchand
@ 2022-03-29  9:37  4% ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2022-03-29  9:37 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Ray Kinsella

23/03/2022 10:24, David Marchand:
> Suppression rules are being added during the life of an ABI and cleaned
> when bumping the major version.
> Sort and document those rules to avoid pruning rules that should be
> kept.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Good idea.
Applied, thanks.




^ permalink raw reply	[relevance 4%]

* [PATCH 0/6] Extend and set event queue attributes at runtime
@ 2022-03-29 13:10  3% Shijith Thotton
                     ` (3 more replies)
  0 siblings, 4 replies; 200+ results
From: Shijith Thotton @ 2022-03-29 13:10 UTC (permalink / raw)
  To: dev, jerinj; +Cc: Shijith Thotton, pbhagavatula

This series adds support for setting event queue attributes at runtime
and adds two new event queue attributes weight and affinity. Eventdev
capability RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR is added to expose the
capability to set attributes at runtime and rte_event_queue_attr_set()
API is used to set the attributes.

Attributes weight and affinity are not yet added to rte_event_queue_conf
structure to avoid ABI break and will be added in 22.11. Till then, PMDs
using the new attributes are expected to manage them.

Test application changes and example implementation are added as last
three patches.

Pavan Nikhilesh (1):
  common/cnxk: use lock when accessing mbox of SSO

Shijith Thotton (5):
  eventdev: support to set queue attributes at runtime
  eventdev: add weight and affinity to queue attributes
  doc: announce change in event queue conf structure
  test/event: test cases to test runtime queue attribute
  event/cnxk: support to set runtime queue attributes

 app/test/test_eventdev.c                  | 146 ++++++++++++++++++
 doc/guides/eventdevs/features/cnxk.ini    |   1 +
 doc/guides/eventdevs/features/default.ini |   1 +
 doc/guides/rel_notes/deprecation.rst      |   3 +
 drivers/common/cnxk/roc_sso.c             | 174 ++++++++++++++++------
 drivers/common/cnxk/roc_sso_priv.h        |   1 +
 drivers/common/cnxk/roc_tim.c             | 134 +++++++++++------
 drivers/event/cnxk/cn10k_eventdev.c       |   4 +
 drivers/event/cnxk/cn9k_eventdev.c        |   4 +
 drivers/event/cnxk/cnxk_eventdev.c        |  81 +++++++++-
 drivers/event/cnxk/cnxk_eventdev.h        |  16 ++
 lib/eventdev/eventdev_pmd.h               |  44 ++++++
 lib/eventdev/rte_eventdev.c               |  43 ++++++
 lib/eventdev/rte_eventdev.h               |  75 +++++++++-
 lib/eventdev/version.map                  |   3 +
 15 files changed, 627 insertions(+), 103 deletions(-)

-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [PATCH 2/6] eventdev: add weight and affinity to queue attributes
  2022-03-29 13:10  3% [PATCH 0/6] Extend and set event queue attributes at runtime Shijith Thotton
  @ 2022-03-29 13:11  3% ` Shijith Thotton
  2022-03-30 12:12  0%   ` Mattias Rönnblom
  2022-03-29 18:49  0% ` [PATCH 0/6] Extend and set event queue attributes at runtime Jerin Jacob
  2022-04-05  5:40  3% ` [PATCH v2 " Shijith Thotton
  3 siblings, 1 reply; 200+ results
From: Shijith Thotton @ 2022-03-29 13:11 UTC (permalink / raw)
  To: dev, jerinj; +Cc: Shijith Thotton, pbhagavatula

Extended eventdev queue QoS attributes to support weight and affinity.
If queues are of same priority, events from the queue with highest
weight will be scheduled first. Affinity indicates the number of times,
the subsequent schedule calls from an event port will use the same event
queue. Schedule call selects another queue if current queue goes empty
or schedule count reaches affinity count.

To avoid ABI break, weight and affinity attributes are not yet added to
queue config structure and relies on PMD for managing it. New eventdev
op queue_attr_get can be used to get it from the PMD.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 lib/eventdev/eventdev_pmd.h | 22 ++++++++++++++++++++
 lib/eventdev/rte_eventdev.c | 12 +++++++++++
 lib/eventdev/rte_eventdev.h | 41 +++++++++++++++++++++++++++++++++----
 3 files changed, 71 insertions(+), 4 deletions(-)

diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
index 6182749503..f19df98a7a 100644
--- a/lib/eventdev/eventdev_pmd.h
+++ b/lib/eventdev/eventdev_pmd.h
@@ -341,6 +341,26 @@ typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev,
 typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
 		uint8_t queue_id);
 
+/**
+ * Get an event queue attribute at runtime.
+ *
+ * @param dev
+ *   Event device pointer
+ * @param queue_id
+ *   Event queue index
+ * @param attr_id
+ *   Event queue attribute id
+ * @param[out] attr_value
+ *   Event queue attribute value
+ *
+ * @return
+ *  - 0: Success.
+ *  - <0: Error code on failure.
+ */
+typedef int (*eventdev_queue_attr_get_t)(struct rte_eventdev *dev,
+					 uint8_t queue_id, uint32_t attr_id,
+					 uint32_t *attr_value);
+
 /**
  * Set an event queue attribute at runtime.
  *
@@ -1231,6 +1251,8 @@ struct eventdev_ops {
 	/**< Set up an event queue. */
 	eventdev_queue_release_t queue_release;
 	/**< Release an event queue. */
+	eventdev_queue_attr_get_t queue_attr_get;
+	/**< Get an event queue attribute. */
 	eventdev_queue_attr_set_t queue_attr_set;
 	/**< Set an event queue attribute. */
 
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 13c8af877e..37f0e54bf3 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -838,6 +838,18 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
 
 		*attr_value = conf->schedule_type;
 		break;
+	case RTE_EVENT_QUEUE_ATTR_WEIGHT:
+		*attr_value = RTE_EVENT_QUEUE_WEIGHT_LOWEST;
+		if (dev->dev_ops->queue_attr_get)
+			return (*dev->dev_ops->queue_attr_get)(
+				dev, queue_id, attr_id, attr_value);
+		break;
+	case RTE_EVENT_QUEUE_ATTR_AFFINITY:
+		*attr_value = RTE_EVENT_QUEUE_AFFINITY_LOWEST;
+		if (dev->dev_ops->queue_attr_get)
+			return (*dev->dev_ops->queue_attr_get)(
+				dev, queue_id, attr_id, attr_value);
+		break;
 	default:
 		return -EINVAL;
 	};
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index 19710cd0c5..fa16fc5dcb 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -222,8 +222,14 @@ struct rte_event;
 
 /* Event device capability bitmap flags */
 #define RTE_EVENT_DEV_CAP_QUEUE_QOS           (1ULL << 0)
-/**< Event scheduling prioritization is based on the priority associated with
- *  each event queue.
+/**< Event scheduling prioritization is based on the priority and weight
+ * associated with each event queue. Events from a queue with highest priority
+ * is scheduled first. If the queues are of same priority, a queue with highest
+ * weight is selected. Subsequent schedules from an event port could see events
+ * from the same event queue if the queue is configured with an affinity count.
+ * Affinity count of a queue indicates the number of times, the subsequent
+ * schedule calls from an event port should use the same queue if the queue is
+ * non-empty.
  *
  *  @see rte_event_queue_setup(), rte_event_queue_attr_set()
  */
@@ -331,6 +337,26 @@ struct rte_event;
  * @see rte_event_port_link()
  */
 
+/* Event queue scheduling weights */
+#define RTE_EVENT_QUEUE_WEIGHT_HIGHEST   255
+/**< Highest weight of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+#define RTE_EVENT_QUEUE_WEIGHT_LOWEST    0
+/**< Lowest weight of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+
+/* Event queue scheduling affinity */
+#define RTE_EVENT_QUEUE_AFFINITY_HIGHEST   255
+/**< Highest scheduling affinity of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+#define RTE_EVENT_QUEUE_AFFINITY_LOWEST    0
+/**< Lowest scheduling affinity of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+
 /**
  * Get the total number of event devices that have been successfully
  * initialised.
@@ -684,11 +710,18 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * The schedule type of the queue.
  */
 #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
-
+/**
+ * The weight of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_WEIGHT 5
+/**
+ * Affinity of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_AFFINITY 6
 /**
  * Maximum supported attribute ID.
  */
-#define RTE_EVENT_QUEUE_ATTR_MAX RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE
+#define RTE_EVENT_QUEUE_ATTR_MAX RTE_EVENT_QUEUE_ATTR_AFFINITY
 
 /**
  * Get an attribute from a queue.
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* Re: [PATCH 0/6] Extend and set event queue attributes at runtime
  2022-03-29 13:10  3% [PATCH 0/6] Extend and set event queue attributes at runtime Shijith Thotton
    2022-03-29 13:11  3% ` [PATCH 2/6] eventdev: add weight and affinity to queue attributes Shijith Thotton
@ 2022-03-29 18:49  0% ` Jerin Jacob
  2022-03-30 10:52  4%   ` Van Haaren, Harry
  2022-04-05  5:40  3% ` [PATCH v2 " Shijith Thotton
  3 siblings, 1 reply; 200+ results
From: Jerin Jacob @ 2022-03-29 18:49 UTC (permalink / raw)
  To: Shijith Thotton, Van Haaren, Harry, Jayatheerthan, Jay,
	Erik Gabriel Carrillo, Gujjar, Abhinandan S, McDaniel, Timothy,
	Hemant Agrawal, Nipun Gupta, Mattias Rönnblom, Ray Kinsella
  Cc: dpdk-dev, Jerin Jacob, Pavan Nikhilesh, Liang Ma

On Tue, Mar 29, 2022 at 6:42 PM Shijith Thotton <sthotton@marvell.com> wrote:
>
> This series adds support for setting event queue attributes at runtime
> and adds two new event queue attributes weight and affinity. Eventdev
> capability RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR is added to expose the
> capability to set attributes at runtime and rte_event_queue_attr_set()
> API is used to set the attributes.
>
> Attributes weight and affinity are not yet added to rte_event_queue_conf
> structure to avoid ABI break and will be added in 22.11. Till then, PMDs
> using the new attributes are expected to manage them.
>
> Test application changes and example implementation are added as last
> three patches.


+ @Van Haaren, Harry  @Jayatheerthan, Jay  @Erik Gabriel Carrillo
@Gujjar, Abhinandan S  @McDaniel, Timothy  @Hemant Agrawal  @Nipun
Gupta  @Mattias Rönnblom  @lingma @Ray Kinsella

> Pavan Nikhilesh (1):
>   common/cnxk: use lock when accessing mbox of SSO
>
> Shijith Thotton (5):
>   eventdev: support to set queue attributes at runtime
>   eventdev: add weight and affinity to queue attributes
>   doc: announce change in event queue conf structure
>   test/event: test cases to test runtime queue attribute
>   event/cnxk: support to set runtime queue attributes
>
>  app/test/test_eventdev.c                  | 146 ++++++++++++++++++
>  doc/guides/eventdevs/features/cnxk.ini    |   1 +
>  doc/guides/eventdevs/features/default.ini |   1 +
>  doc/guides/rel_notes/deprecation.rst      |   3 +
>  drivers/common/cnxk/roc_sso.c             | 174 ++++++++++++++++------
>  drivers/common/cnxk/roc_sso_priv.h        |   1 +
>  drivers/common/cnxk/roc_tim.c             | 134 +++++++++++------
>  drivers/event/cnxk/cn10k_eventdev.c       |   4 +
>  drivers/event/cnxk/cn9k_eventdev.c        |   4 +
>  drivers/event/cnxk/cnxk_eventdev.c        |  81 +++++++++-
>  drivers/event/cnxk/cnxk_eventdev.h        |  16 ++
>  lib/eventdev/eventdev_pmd.h               |  44 ++++++
>  lib/eventdev/rte_eventdev.c               |  43 ++++++
>  lib/eventdev/rte_eventdev.h               |  75 +++++++++-
>  lib/eventdev/version.map                  |   3 +
>  15 files changed, 627 insertions(+), 103 deletions(-)
>
> --
> 2.25.1
>

^ permalink raw reply	[relevance 0%]

* RE: [PATCH 0/6] Extend and set event queue attributes at runtime
  2022-03-29 18:49  0% ` [PATCH 0/6] Extend and set event queue attributes at runtime Jerin Jacob
@ 2022-03-30 10:52  4%   ` Van Haaren, Harry
  2022-04-04  7:57  0%     ` Shijith Thotton
  0 siblings, 1 reply; 200+ results
From: Van Haaren, Harry @ 2022-03-30 10:52 UTC (permalink / raw)
  To: Jerin Jacob, Shijith Thotton, Jayatheerthan, Jay, Carrillo,
	Erik G, Gujjar, Abhinandan S, McDaniel, Timothy, Hemant Agrawal,
	Nipun Gupta, mattias.ronnblom, Ray Kinsella
  Cc: dpdk-dev, Jerin Jacob, Pavan Nikhilesh, Liang Ma

> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Tuesday, March 29, 2022 7:50 PM
> To: Shijith Thotton <sthotton@marvell.com>; Van Haaren, Harry
> <harry.van.haaren@intel.com>; Jayatheerthan, Jay
> <jay.jayatheerthan@intel.com>; Carrillo, Erik G <erik.g.carrillo@intel.com>;
> Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; McDaniel, Timothy
> <timothy.mcdaniel@intel.com>; Hemant Agrawal <hemant.agrawal@nxp.com>;
> Nipun Gupta <nipun.gupta@nxp.com>; mattias.ronnblom
> <mattias.ronnblom@ericsson.com>; Ray Kinsella <mdr@ashroe.eu>
> Cc: dpdk-dev <dev@dpdk.org>; Jerin Jacob <jerinj@marvell.com>; Pavan
> Nikhilesh <pbhagavatula@marvell.com>; Liang Ma <liangma@liangbit.com>
> Subject: Re: [PATCH 0/6] Extend and set event queue attributes at runtime
> 
> On Tue, Mar 29, 2022 at 6:42 PM Shijith Thotton <sthotton@marvell.com> wrote:
> >
> > This series adds support for setting event queue attributes at runtime
> > and adds two new event queue attributes weight and affinity. Eventdev
> > capability RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR is added to expose
> the
> > capability to set attributes at runtime and rte_event_queue_attr_set()
> > API is used to set the attributes.
> >
> > Attributes weight and affinity are not yet added to rte_event_queue_conf
> > structure to avoid ABI break and will be added in 22.11. Till then, PMDs
> > using the new attributes are expected to manage them.

When the new attributes are added to queue_conf structure in 22.11, will the attr_get() function have any real use?

If the attr_get() function is not useful post 22.11 (aka, returns const-integers?), we should consider if waiting
for ABI-break in 22.11 is a better solution as it doesn't add public API/ABI functions that only have limited time value..?

<snip>
 
> + @Van Haaren, Harry  @Jayatheerthan, Jay  @Erik Gabriel Carrillo
> @Gujjar, Abhinandan S  @McDaniel, Timothy  @Hemant Agrawal  @Nipun
> Gupta  @Mattias Rönnblom  @lingma @Ray Kinsella

Thanks for flagging Jerin, indeed I hadn't looked at this patchset yet.

From event/sw point of view, the new runtime queue attribute capability is not
available, so the feature flag will not be set.

<snip>

Some code comments inline on the impl patches comping up. Regards, -Harry

^ permalink raw reply	[relevance 4%]

* Re: [PATCH 2/6] eventdev: add weight and affinity to queue attributes
  2022-03-29 13:11  3% ` [PATCH 2/6] eventdev: add weight and affinity to queue attributes Shijith Thotton
@ 2022-03-30 12:12  0%   ` Mattias Rönnblom
  2022-04-04  9:33  0%     ` Shijith Thotton
  0 siblings, 1 reply; 200+ results
From: Mattias Rönnblom @ 2022-03-30 12:12 UTC (permalink / raw)
  To: Shijith Thotton, dev, jerinj; +Cc: pbhagavatula

On 2022-03-29 15:11, Shijith Thotton wrote:
> Extended eventdev queue QoS attributes to support weight and affinity.
> If queues are of same priority, events from the queue with highest
> weight will be scheduled first. Affinity indicates the number of times,
> the subsequent schedule calls from an event port will use the same event
> queue. Schedule call selects another queue if current queue goes empty
> or schedule count reaches affinity count.
>
> To avoid ABI break, weight and affinity attributes are not yet added to
> queue config structure and relies on PMD for managing it. New eventdev
> op queue_attr_get can be used to get it from the PMD.

Have you considered using a PMD-specific command line parameter as a 
stop-gap until you can extend the config struct?

> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> ---
>   lib/eventdev/eventdev_pmd.h | 22 ++++++++++++++++++++
>   lib/eventdev/rte_eventdev.c | 12 +++++++++++
>   lib/eventdev/rte_eventdev.h | 41 +++++++++++++++++++++++++++++++++----
>   3 files changed, 71 insertions(+), 4 deletions(-)
>
> diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
> index 6182749503..f19df98a7a 100644
> --- a/lib/eventdev/eventdev_pmd.h
> +++ b/lib/eventdev/eventdev_pmd.h
> @@ -341,6 +341,26 @@ typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev,
>   typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
>   		uint8_t queue_id);
>   
> +/**
> + * Get an event queue attribute at runtime.
> + *
> + * @param dev
> + *   Event device pointer
> + * @param queue_id
> + *   Event queue index
> + * @param attr_id
> + *   Event queue attribute id
> + * @param[out] attr_value
> + *   Event queue attribute value
> + *
> + * @return
> + *  - 0: Success.
> + *  - <0: Error code on failure.
> + */
> +typedef int (*eventdev_queue_attr_get_t)(struct rte_eventdev *dev,
> +					 uint8_t queue_id, uint32_t attr_id,
> +					 uint32_t *attr_value);
> +
>   /**
>    * Set an event queue attribute at runtime.
>    *
> @@ -1231,6 +1251,8 @@ struct eventdev_ops {
>   	/**< Set up an event queue. */
>   	eventdev_queue_release_t queue_release;
>   	/**< Release an event queue. */
> +	eventdev_queue_attr_get_t queue_attr_get;
> +	/**< Get an event queue attribute. */
>   	eventdev_queue_attr_set_t queue_attr_set;
>   	/**< Set an event queue attribute. */
>   
> diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
> index 13c8af877e..37f0e54bf3 100644
> --- a/lib/eventdev/rte_eventdev.c
> +++ b/lib/eventdev/rte_eventdev.c
> @@ -838,6 +838,18 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
>   
>   		*attr_value = conf->schedule_type;
>   		break;
> +	case RTE_EVENT_QUEUE_ATTR_WEIGHT:
> +		*attr_value = RTE_EVENT_QUEUE_WEIGHT_LOWEST;
> +		if (dev->dev_ops->queue_attr_get)
> +			return (*dev->dev_ops->queue_attr_get)(
> +				dev, queue_id, attr_id, attr_value);
> +		break;
> +	case RTE_EVENT_QUEUE_ATTR_AFFINITY:
> +		*attr_value = RTE_EVENT_QUEUE_AFFINITY_LOWEST;
> +		if (dev->dev_ops->queue_attr_get)
> +			return (*dev->dev_ops->queue_attr_get)(
> +				dev, queue_id, attr_id, attr_value);
> +		break;
>   	default:
>   		return -EINVAL;
>   	};
> diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
> index 19710cd0c5..fa16fc5dcb 100644
> --- a/lib/eventdev/rte_eventdev.h
> +++ b/lib/eventdev/rte_eventdev.h
> @@ -222,8 +222,14 @@ struct rte_event;
>   
>   /* Event device capability bitmap flags */
>   #define RTE_EVENT_DEV_CAP_QUEUE_QOS           (1ULL << 0)
> -/**< Event scheduling prioritization is based on the priority associated with
> - *  each event queue.
> +/**< Event scheduling prioritization is based on the priority and weight
> + * associated with each event queue. Events from a queue with highest priority
> + * is scheduled first. If the queues are of same priority, a queue with highest
> + * weight is selected. Subsequent schedules from an event port could see events
> + * from the same event queue if the queue is configured with an affinity count.
> + * Affinity count of a queue indicates the number of times, the subsequent
> + * schedule calls from an event port should use the same queue if the queue is
> + * non-empty.

Is this specifying something else than WRR scheduling for equal-priority 
queues?

What is a schedule call? I must say I don't understand this description. 
Is affinity the per-port batch size from the queue that is "next in 
line" for an opportunity to be scheduled to a port?

>    *
>    *  @see rte_event_queue_setup(), rte_event_queue_attr_set()
>    */
> @@ -331,6 +337,26 @@ struct rte_event;
>    * @see rte_event_port_link()
>    */
>   
> +/* Event queue scheduling weights */
> +#define RTE_EVENT_QUEUE_WEIGHT_HIGHEST   255
> +/**< Highest weight of an event queue
> + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
> + */
> +#define RTE_EVENT_QUEUE_WEIGHT_LOWEST    0
> +/**< Lowest weight of an event queue
> + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
> + */
> +
> +/* Event queue scheduling affinity */
> +#define RTE_EVENT_QUEUE_AFFINITY_HIGHEST   255
> +/**< Highest scheduling affinity of an event queue
> + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
> + */
> +#define RTE_EVENT_QUEUE_AFFINITY_LOWEST    0
> +/**< Lowest scheduling affinity of an event queue
> + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
> + */
> +
>   /**
>    * Get the total number of event devices that have been successfully
>    * initialised.
> @@ -684,11 +710,18 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
>    * The schedule type of the queue.
>    */
>   #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
> -
> +/**
> + * The weight of the queue.
> + */
> +#define RTE_EVENT_QUEUE_ATTR_WEIGHT 5
> +/**
> + * Affinity of the queue.
> + */
> +#define RTE_EVENT_QUEUE_ATTR_AFFINITY 6
>   /**
>    * Maximum supported attribute ID.
>    */
> -#define RTE_EVENT_QUEUE_ATTR_MAX RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE
> +#define RTE_EVENT_QUEUE_ATTR_MAX RTE_EVENT_QUEUE_ATTR_AFFINITY
>   

>   /**
>    * Get an attribute from a queue.


^ permalink raw reply	[relevance 0%]

* Re: [PATCH 1/6] eventdev: support to set queue attributes at runtime
    @ 2022-03-30 12:14  3%   ` Mattias Rönnblom
  2022-04-04 11:45  0%     ` Shijith Thotton
  1 sibling, 1 reply; 200+ results
From: Mattias Rönnblom @ 2022-03-30 12:14 UTC (permalink / raw)
  To: Shijith Thotton, dev, jerinj; +Cc: pbhagavatula, Ray Kinsella

On 2022-03-29 15:11, Shijith Thotton wrote:
> Added a new eventdev API rte_event_queue_attr_set(), to set event queue
> attributes at runtime from the values set during initialization using
> rte_event_queue_setup(). PMD's supporting this feature should expose the
> capability RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR.
>
> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> ---
>   doc/guides/eventdevs/features/default.ini |  1 +
>   lib/eventdev/eventdev_pmd.h               | 22 +++++++++++++
>   lib/eventdev/rte_eventdev.c               | 31 ++++++++++++++++++
>   lib/eventdev/rte_eventdev.h               | 38 ++++++++++++++++++++++-
>   lib/eventdev/version.map                  |  3 ++
>   5 files changed, 94 insertions(+), 1 deletion(-)
>
> diff --git a/doc/guides/eventdevs/features/default.ini b/doc/guides/eventdevs/features/default.ini
> index 2ea233463a..00360f60c6 100644
> --- a/doc/guides/eventdevs/features/default.ini
> +++ b/doc/guides/eventdevs/features/default.ini
> @@ -17,6 +17,7 @@ runtime_port_link          =
>   multiple_queue_port        =
>   carry_flow_id              =
>   maintenance_free           =
> +runtime_queue_attr         =
>   
>   ;
>   ; Features of a default Ethernet Rx adapter.
> diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
> index ce469d47a6..6182749503 100644
> --- a/lib/eventdev/eventdev_pmd.h
> +++ b/lib/eventdev/eventdev_pmd.h
> @@ -341,6 +341,26 @@ typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev,
>   typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
>   		uint8_t queue_id);
>   
> +/**
> + * Set an event queue attribute at runtime.
> + *
> + * @param dev
> + *   Event device pointer
> + * @param queue_id
> + *   Event queue index
> + * @param attr_id
> + *   Event queue attribute id
> + * @param attr_value
> + *   Event queue attribute value
> + *
> + * @return
> + *  - 0: Success.
> + *  - <0: Error code on failure.
> + */
> +typedef int (*eventdev_queue_attr_set_t)(struct rte_eventdev *dev,
> +					 uint8_t queue_id, uint32_t attr_id,
> +					 uint32_t attr_value);
> +
>   /**
>    * Retrieve the default event port configuration.
>    *
> @@ -1211,6 +1231,8 @@ struct eventdev_ops {
>   	/**< Set up an event queue. */
>   	eventdev_queue_release_t queue_release;
>   	/**< Release an event queue. */
> +	eventdev_queue_attr_set_t queue_attr_set;
> +	/**< Set an event queue attribute. */
>   
>   	eventdev_port_default_conf_get_t port_def_conf;
>   	/**< Get default port configuration. */
> diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
> index 532a253553..13c8af877e 100644
> --- a/lib/eventdev/rte_eventdev.c
> +++ b/lib/eventdev/rte_eventdev.c
> @@ -844,6 +844,37 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
>   	return 0;
>   }
>   
> +int
> +rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
> +			 uint32_t attr_value)
> +{
> +	struct rte_eventdev *dev;
> +
> +	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
> +	dev = &rte_eventdevs[dev_id];
> +	if (!is_valid_queue(dev, queue_id)) {
> +		RTE_EDEV_LOG_ERR("Invalid queue_id=%" PRIu8, queue_id);
> +		return -EINVAL;
> +	}
> +
> +	if (attr_id > RTE_EVENT_QUEUE_ATTR_MAX) {
> +		RTE_EDEV_LOG_ERR("Invalid attribute ID %" PRIu8, attr_id);
> +		return -EINVAL;
> +	}
> +
> +	if (!(dev->data->event_dev_cap &
> +	      RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR)) {
> +		RTE_EDEV_LOG_ERR(
> +			"Device %" PRIu8 "does not support changing queue attributes at runtime",
> +			dev_id);
> +		return -ENOTSUP;
> +	}
> +
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_attr_set, -ENOTSUP);
> +	return (*dev->dev_ops->queue_attr_set)(dev, queue_id, attr_id,
> +					       attr_value);
> +}
> +
>   int
>   rte_event_port_link(uint8_t dev_id, uint8_t port_id,
>   		    const uint8_t queues[], const uint8_t priorities[],
> diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
> index 42a5660169..19710cd0c5 100644
> --- a/lib/eventdev/rte_eventdev.h
> +++ b/lib/eventdev/rte_eventdev.h
> @@ -225,7 +225,7 @@ struct rte_event;
>   /**< Event scheduling prioritization is based on the priority associated with
>    *  each event queue.
>    *
> - *  @see rte_event_queue_setup()
> + *  @see rte_event_queue_setup(), rte_event_queue_attr_set()
>    */
>   #define RTE_EVENT_DEV_CAP_EVENT_QOS           (1ULL << 1)
>   /**< Event scheduling prioritization is based on the priority associated with
> @@ -307,6 +307,13 @@ struct rte_event;
>    * global pool, or process signaling related to load balancing.
>    */
>   
> +#define RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR (1ULL << 11)
> +/**< Event device is capable of changing the queue attributes at runtime i.e after
> + * rte_event_queue_setup() or rte_event_start() call sequence. If this flag is
> + * not set, eventdev queue attributes can only be configured during
> + * rte_event_queue_setup().
> + */
> +
>   /* Event device priority levels */
>   #define RTE_EVENT_DEV_PRIORITY_HIGHEST   0
>   /**< Highest priority expressed across eventdev subsystem
> @@ -678,6 +685,11 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
>    */
>   #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
>   
> +/**
> + * Maximum supported attribute ID.
> + */
> +#define RTE_EVENT_QUEUE_ATTR_MAX RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE
> +

This #define will assure that every new attribute breaks the ABI. Is 
that intentional?

>   /**
>    * Get an attribute from a queue.
>    *
> @@ -702,6 +714,30 @@ int
>   rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
>   			uint32_t *attr_value);
>   
> +/**
> + * Set an event queue attribute.
> + *
> + * @param dev_id
> + *   Eventdev id
> + * @param queue_id
> + *   Eventdev queue id
> + * @param attr_id
> + *   The attribute ID to set
> + * @param attr_value
> + *   The attribute value to set
> + *
> + * @return
> + *   - 0: Successfully set attribute.
> + *   - -EINVAL: invalid device, queue or attr_id.
> + *   - -ENOTSUP: device does not support setting event attribute.
> + *   - -EBUSY: device is in running state
> + *   - <0: failed to set event queue attribute
> + */
> +__rte_experimental
> +int
> +rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
> +			 uint32_t attr_value);
> +
>   /* Event port specific APIs */
>   
>   /* Event port configuration bitmap flags */
> diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map
> index cd5dada07f..c581b75c18 100644
> --- a/lib/eventdev/version.map
> +++ b/lib/eventdev/version.map
> @@ -108,6 +108,9 @@ EXPERIMENTAL {
>   
>   	# added in 22.03
>   	rte_event_eth_rx_adapter_event_port_get;
> +
> +	# added in 22.07
> +	rte_event_queue_attr_set;
>   };
>   
>   INTERNAL {


^ permalink raw reply	[relevance 3%]

* [PATCH 2/3] doc: fix API index Markdown syntax
  @ 2022-03-31 21:28  6% ` Dmitry Kozlyuk
    1 sibling, 0 replies; 200+ results
From: Dmitry Kozlyuk @ 2022-03-31 21:28 UTC (permalink / raw)
  To: dev
  Cc: Vipin Varghese, Dmitry Kozlyuk, Olivier Matz, Thomas Monjalon,
	David Marchand

API documentation index had spaces between link caption and URL,
which may be unsupported by some Markdown implementations.
That is, "[caption](URL)" is valid but "[caption] (URL)" is not.
The problematic behavior is observed with Doxygen on Windows.
Remove the spaces.
Unfortunately, Markdown syntax is not formally specified.

Fixes: 9bf486e606b0 ("doc: generate HTML for API with doxygen")

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
I believe there's no need for this patch in stable releases,
because it was never an issue until an attempt to build on Windows.

 doc/api/doxy-api-index.md | 366 +++++++++++++++++++-------------------
 1 file changed, 183 insertions(+), 183 deletions(-)

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 4245b9635c..baecb2e52e 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -9,222 +9,222 @@ API
 The public API headers are grouped by topics:
 
 - **device**:
-  [dev]                (@ref rte_dev.h),
-  [ethdev]             (@ref rte_ethdev.h),
-  [ethctrl]            (@ref rte_eth_ctrl.h),
-  [rte_flow]           (@ref rte_flow.h),
-  [rte_tm]             (@ref rte_tm.h),
-  [rte_mtr]            (@ref rte_mtr.h),
-  [bbdev]              (@ref rte_bbdev.h),
-  [cryptodev]          (@ref rte_cryptodev.h),
-  [security]           (@ref rte_security.h),
-  [compressdev]        (@ref rte_compressdev.h),
-  [compress]           (@ref rte_comp.h),
-  [regexdev]           (@ref rte_regexdev.h),
-  [dmadev]             (@ref rte_dmadev.h),
-  [eventdev]           (@ref rte_eventdev.h),
-  [event_eth_rx_adapter]   (@ref rte_event_eth_rx_adapter.h),
-  [event_eth_tx_adapter]   (@ref rte_event_eth_tx_adapter.h),
-  [event_timer_adapter]    (@ref rte_event_timer_adapter.h),
-  [event_crypto_adapter]   (@ref rte_event_crypto_adapter.h),
-  [rawdev]             (@ref rte_rawdev.h),
-  [metrics]            (@ref rte_metrics.h),
-  [bitrate]            (@ref rte_bitrate.h),
-  [latency]            (@ref rte_latencystats.h),
-  [devargs]            (@ref rte_devargs.h),
-  [PCI]                (@ref rte_pci.h),
-  [vdev]               (@ref rte_bus_vdev.h),
-  [vfio]               (@ref rte_vfio.h)
+  [dev](@ref rte_dev.h),
+  [ethdev](@ref rte_ethdev.h),
+  [ethctrl](@ref rte_eth_ctrl.h),
+  [rte_flow](@ref rte_flow.h),
+  [rte_tm](@ref rte_tm.h),
+  [rte_mtr](@ref rte_mtr.h),
+  [bbdev](@ref rte_bbdev.h),
+  [cryptodev](@ref rte_cryptodev.h),
+  [security](@ref rte_security.h),
+  [compressdev](@ref rte_compressdev.h),
+  [compress](@ref rte_comp.h),
+  [regexdev](@ref rte_regexdev.h),
+  [dmadev](@ref rte_dmadev.h),
+  [eventdev](@ref rte_eventdev.h),
+  [event_eth_rx_adapter](@ref rte_event_eth_rx_adapter.h),
+  [event_eth_tx_adapter](@ref rte_event_eth_tx_adapter.h),
+  [event_timer_adapter](@ref rte_event_timer_adapter.h),
+  [event_crypto_adapter](@ref rte_event_crypto_adapter.h),
+  [rawdev](@ref rte_rawdev.h),
+  [metrics](@ref rte_metrics.h),
+  [bitrate](@ref rte_bitrate.h),
+  [latency](@ref rte_latencystats.h),
+  [devargs](@ref rte_devargs.h),
+  [PCI](@ref rte_pci.h),
+  [vdev](@ref rte_bus_vdev.h),
+  [vfio](@ref rte_vfio.h)
 
 - **device specific**:
-  [softnic]            (@ref rte_eth_softnic.h),
-  [bond]               (@ref rte_eth_bond.h),
-  [vhost]              (@ref rte_vhost.h),
-  [vdpa]               (@ref rte_vdpa.h),
-  [KNI]                (@ref rte_kni.h),
-  [ixgbe]              (@ref rte_pmd_ixgbe.h),
-  [i40e]               (@ref rte_pmd_i40e.h),
-  [ice]                (@ref rte_pmd_ice.h),
-  [iavf]               (@ref rte_pmd_iavf.h),
-  [ioat]               (@ref rte_ioat_rawdev.h),
-  [bnxt]               (@ref rte_pmd_bnxt.h),
-  [dpaa]               (@ref rte_pmd_dpaa.h),
-  [dpaa2]              (@ref rte_pmd_dpaa2.h),
-  [mlx5]               (@ref rte_pmd_mlx5.h),
-  [dpaa2_mempool]      (@ref rte_dpaa2_mempool.h),
-  [dpaa2_cmdif]        (@ref rte_pmd_dpaa2_cmdif.h),
-  [dpaa2_qdma]         (@ref rte_pmd_dpaa2_qdma.h),
-  [crypto_scheduler]   (@ref rte_cryptodev_scheduler.h),
-  [dlb2]               (@ref rte_pmd_dlb2.h),
-  [ifpga]              (@ref rte_pmd_ifpga.h)
+  [softnic](@ref rte_eth_softnic.h),
+  [bond](@ref rte_eth_bond.h),
+  [vhost](@ref rte_vhost.h),
+  [vdpa](@ref rte_vdpa.h),
+  [KNI](@ref rte_kni.h),
+  [ixgbe](@ref rte_pmd_ixgbe.h),
+  [i40e](@ref rte_pmd_i40e.h),
+  [ice](@ref rte_pmd_ice.h),
+  [iavf](@ref rte_pmd_iavf.h),
+  [ioat](@ref rte_ioat_rawdev.h),
+  [bnxt](@ref rte_pmd_bnxt.h),
+  [dpaa](@ref rte_pmd_dpaa.h),
+  [dpaa2](@ref rte_pmd_dpaa2.h),
+  [mlx5](@ref rte_pmd_mlx5.h),
+  [dpaa2_mempool](@ref rte_dpaa2_mempool.h),
+  [dpaa2_cmdif](@ref rte_pmd_dpaa2_cmdif.h),
+  [dpaa2_qdma](@ref rte_pmd_dpaa2_qdma.h),
+  [crypto_scheduler](@ref rte_cryptodev_scheduler.h),
+  [dlb2](@ref rte_pmd_dlb2.h),
+  [ifpga](@ref rte_pmd_ifpga.h)
 
 - **memory**:
-  [memseg]             (@ref rte_memory.h),
-  [memzone]            (@ref rte_memzone.h),
-  [mempool]            (@ref rte_mempool.h),
-  [malloc]             (@ref rte_malloc.h),
-  [memcpy]             (@ref rte_memcpy.h)
+  [memseg](@ref rte_memory.h),
+  [memzone](@ref rte_memzone.h),
+  [mempool](@ref rte_mempool.h),
+  [malloc](@ref rte_malloc.h),
+  [memcpy](@ref rte_memcpy.h)
 
 - **timers**:
-  [cycles]             (@ref rte_cycles.h),
-  [timer]              (@ref rte_timer.h),
-  [alarm]              (@ref rte_alarm.h)
+  [cycles](@ref rte_cycles.h),
+  [timer](@ref rte_timer.h),
+  [alarm](@ref rte_alarm.h)
 
 - **locks**:
-  [atomic]             (@ref rte_atomic.h),
-  [mcslock]            (@ref rte_mcslock.h),
-  [pflock]             (@ref rte_pflock.h),
-  [rwlock]             (@ref rte_rwlock.h),
-  [spinlock]           (@ref rte_spinlock.h),
-  [ticketlock]         (@ref rte_ticketlock.h),
-  [RCU]                (@ref rte_rcu_qsbr.h)
+  [atomic](@ref rte_atomic.h),
+  [mcslock](@ref rte_mcslock.h),
+  [pflock](@ref rte_pflock.h),
+  [rwlock](@ref rte_rwlock.h),
+  [spinlock](@ref rte_spinlock.h),
+  [ticketlock](@ref rte_ticketlock.h),
+  [RCU](@ref rte_rcu_qsbr.h)
 
 - **CPU arch**:
-  [branch prediction]  (@ref rte_branch_prediction.h),
-  [cache prefetch]     (@ref rte_prefetch.h),
-  [SIMD]               (@ref rte_vect.h),
-  [byte order]         (@ref rte_byteorder.h),
-  [CPU flags]          (@ref rte_cpuflags.h),
-  [CPU pause]          (@ref rte_pause.h),
-  [I/O access]         (@ref rte_io.h),
-  [power management]   (@ref rte_power_intrinsics.h)
+  [branch prediction](@ref rte_branch_prediction.h),
+  [cache prefetch](@ref rte_prefetch.h),
+  [SIMD](@ref rte_vect.h),
+  [byte order](@ref rte_byteorder.h),
+  [CPU flags](@ref rte_cpuflags.h),
+  [CPU pause](@ref rte_pause.h),
+  [I/O access](@ref rte_io.h),
+  [power management](@ref rte_power_intrinsics.h)
 
 - **CPU multicore**:
-  [interrupts]         (@ref rte_interrupts.h),
-  [launch]             (@ref rte_launch.h),
-  [lcore]              (@ref rte_lcore.h),
-  [per-lcore]          (@ref rte_per_lcore.h),
-  [service cores]      (@ref rte_service.h),
-  [keepalive]          (@ref rte_keepalive.h),
-  [power/freq]         (@ref rte_power.h),
-  [PMD power]          (@ref rte_power_pmd_mgmt.h)
+  [interrupts](@ref rte_interrupts.h),
+  [launch](@ref rte_launch.h),
+  [lcore](@ref rte_lcore.h),
+  [per-lcore](@ref rte_per_lcore.h),
+  [service cores](@ref rte_service.h),
+  [keepalive](@ref rte_keepalive.h),
+  [power/freq](@ref rte_power.h),
+  [PMD power](@ref rte_power_pmd_mgmt.h)
 
 - **layers**:
-  [ethernet]           (@ref rte_ether.h),
-  [ARP]                (@ref rte_arp.h),
-  [HIGIG]              (@ref rte_higig.h),
-  [ICMP]               (@ref rte_icmp.h),
-  [ESP]                (@ref rte_esp.h),
-  [IPsec]              (@ref rte_ipsec.h),
-  [IPsec group]        (@ref rte_ipsec_group.h),
-  [IPsec SA]           (@ref rte_ipsec_sa.h),
-  [IPsec SAD]          (@ref rte_ipsec_sad.h),
-  [IP]                 (@ref rte_ip.h),
-  [frag/reass]         (@ref rte_ip_frag.h),
-  [SCTP]               (@ref rte_sctp.h),
-  [TCP]                (@ref rte_tcp.h),
-  [UDP]                (@ref rte_udp.h),
-  [GTP]                (@ref rte_gtp.h),
-  [GRO]                (@ref rte_gro.h),
-  [GSO]                (@ref rte_gso.h),
-  [GRE]                (@ref rte_gre.h),
-  [MPLS]               (@ref rte_mpls.h),
-  [VXLAN]              (@ref rte_vxlan.h),
-  [Geneve]             (@ref rte_geneve.h),
-  [eCPRI]              (@ref rte_ecpri.h),
-  [L2TPv2]             (@ref rte_l2tpv2.h),
-  [PPP]                (@ref rte_ppp.h)
+  [ethernet](@ref rte_ether.h),
+  [ARP](@ref rte_arp.h),
+  [HIGIG](@ref rte_higig.h),
+  [ICMP](@ref rte_icmp.h),
+  [ESP](@ref rte_esp.h),
+  [IPsec](@ref rte_ipsec.h),
+  [IPsec group](@ref rte_ipsec_group.h),
+  [IPsec SA](@ref rte_ipsec_sa.h),
+  [IPsec SAD](@ref rte_ipsec_sad.h),
+  [IP](@ref rte_ip.h),
+  [frag/reass](@ref rte_ip_frag.h),
+  [SCTP](@ref rte_sctp.h),
+  [TCP](@ref rte_tcp.h),
+  [UDP](@ref rte_udp.h),
+  [GTP](@ref rte_gtp.h),
+  [GRO](@ref rte_gro.h),
+  [GSO](@ref rte_gso.h),
+  [GRE](@ref rte_gre.h),
+  [MPLS](@ref rte_mpls.h),
+  [VXLAN](@ref rte_vxlan.h),
+  [Geneve](@ref rte_geneve.h),
+  [eCPRI](@ref rte_ecpri.h),
+  [L2TPv2](@ref rte_l2tpv2.h),
+  [PPP](@ref rte_ppp.h)
 
 - **QoS**:
-  [metering]           (@ref rte_meter.h),
-  [scheduler]          (@ref rte_sched.h),
-  [RED congestion]     (@ref rte_red.h)
+  [metering](@ref rte_meter.h),
+  [scheduler](@ref rte_sched.h),
+  [RED congestion](@ref rte_red.h)
 
 - **routing**:
-  [LPM IPv4 route]     (@ref rte_lpm.h),
-  [LPM IPv6 route]     (@ref rte_lpm6.h),
-  [RIB IPv4]           (@ref rte_rib.h),
-  [RIB IPv6]           (@ref rte_rib6.h),
-  [FIB IPv4]           (@ref rte_fib.h),
-  [FIB IPv6]           (@ref rte_fib6.h)
+  [LPM IPv4 route](@ref rte_lpm.h),
+  [LPM IPv6 route](@ref rte_lpm6.h),
+  [RIB IPv4](@ref rte_rib.h),
+  [RIB IPv6](@ref rte_rib6.h),
+  [FIB IPv4](@ref rte_fib.h),
+  [FIB IPv6](@ref rte_fib6.h)
 
 - **hashes**:
-  [hash]               (@ref rte_hash.h),
-  [jhash]              (@ref rte_jhash.h),
-  [thash]              (@ref rte_thash.h),
-  [thash_gfni]         (@ref rte_thash_gfni.h),
-  [FBK hash]           (@ref rte_fbk_hash.h),
-  [CRC hash]           (@ref rte_hash_crc.h)
+  [hash](@ref rte_hash.h),
+  [jhash](@ref rte_jhash.h),
+  [thash](@ref rte_thash.h),
+  [thash_gfni](@ref rte_thash_gfni.h),
+  [FBK hash](@ref rte_fbk_hash.h),
+  [CRC hash](@ref rte_hash_crc.h)
 
 - **classification**
-  [reorder]            (@ref rte_reorder.h),
-  [distributor]        (@ref rte_distributor.h),
-  [EFD]                (@ref rte_efd.h),
-  [ACL]                (@ref rte_acl.h),
-  [member]             (@ref rte_member.h),
-  [flow classify]      (@ref rte_flow_classify.h),
-  [BPF]                (@ref rte_bpf.h)
+  [reorder](@ref rte_reorder.h),
+  [distributor](@ref rte_distributor.h),
+  [EFD](@ref rte_efd.h),
+  [ACL](@ref rte_acl.h),
+  [member](@ref rte_member.h),
+  [flow classify](@ref rte_flow_classify.h),
+  [BPF](@ref rte_bpf.h)
 
 - **containers**:
-  [mbuf]               (@ref rte_mbuf.h),
-  [mbuf pool ops]      (@ref rte_mbuf_pool_ops.h),
-  [ring]               (@ref rte_ring.h),
-  [stack]              (@ref rte_stack.h),
-  [tailq]              (@ref rte_tailq.h),
-  [bitmap]             (@ref rte_bitmap.h)
+  [mbuf](@ref rte_mbuf.h),
+  [mbuf pool ops](@ref rte_mbuf_pool_ops.h),
+  [ring](@ref rte_ring.h),
+  [stack](@ref rte_stack.h),
+  [tailq](@ref rte_tailq.h),
+  [bitmap](@ref rte_bitmap.h)
 
 - **packet framework**:
-  * [port]             (@ref rte_port.h):
-    [ethdev]           (@ref rte_port_ethdev.h),
-    [ring]             (@ref rte_port_ring.h),
-    [frag]             (@ref rte_port_frag.h),
-    [reass]            (@ref rte_port_ras.h),
-    [sched]            (@ref rte_port_sched.h),
-    [kni]              (@ref rte_port_kni.h),
-    [src/sink]         (@ref rte_port_source_sink.h)
-  * [table]            (@ref rte_table.h):
-    [lpm IPv4]         (@ref rte_table_lpm.h),
-    [lpm IPv6]         (@ref rte_table_lpm_ipv6.h),
-    [ACL]              (@ref rte_table_acl.h),
-    [hash]             (@ref rte_table_hash.h),
-    [array]            (@ref rte_table_array.h),
-    [stub]             (@ref rte_table_stub.h)
-  * [pipeline]         (@ref rte_pipeline.h)
-    [port_in_action]   (@ref rte_port_in_action.h)
-    [table_action]     (@ref rte_table_action.h)
+  * [port](@ref rte_port.h):
+    [ethdev](@ref rte_port_ethdev.h),
+    [ring](@ref rte_port_ring.h),
+    [frag](@ref rte_port_frag.h),
+    [reass](@ref rte_port_ras.h),
+    [sched](@ref rte_port_sched.h),
+    [kni](@ref rte_port_kni.h),
+    [src/sink](@ref rte_port_source_sink.h)
+  * [table](@ref rte_table.h):
+    [lpm IPv4](@ref rte_table_lpm.h),
+    [lpm IPv6](@ref rte_table_lpm_ipv6.h),
+    [ACL](@ref rte_table_acl.h),
+    [hash](@ref rte_table_hash.h),
+    [array](@ref rte_table_array.h),
+    [stub](@ref rte_table_stub.h)
+  * [pipeline](@ref rte_pipeline.h)
+    [port_in_action](@ref rte_port_in_action.h)
+    [table_action](@ref rte_table_action.h)
   * SWX pipeline:
-    [control]          (@ref rte_swx_ctl.h),
-    [extern]           (@ref rte_swx_extern.h),
-    [pipeline]         (@ref rte_swx_pipeline.h)
+    [control](@ref rte_swx_ctl.h),
+    [extern](@ref rte_swx_extern.h),
+    [pipeline](@ref rte_swx_pipeline.h)
   * SWX port:
-    [port]             (@ref rte_swx_port.h),
-    [ethdev]           (@ref rte_swx_port_ethdev.h),
-    [fd]               (@ref rte_swx_port_fd.h),
-    [ring]             (@ref rte_swx_port_ring.h),
-    [src/sink]         (@ref rte_swx_port_source_sink.h)
+    [port](@ref rte_swx_port.h),
+    [ethdev](@ref rte_swx_port_ethdev.h),
+    [fd](@ref rte_swx_port_fd.h),
+    [ring](@ref rte_swx_port_ring.h),
+    [src/sink](@ref rte_swx_port_source_sink.h)
   * SWX table:
-    [table]            (@ref rte_swx_table.h),
-    [table_em]         (@ref rte_swx_table_em.h)
-    [table_wm]         (@ref rte_swx_table_wm.h)
-  * [graph]            (@ref rte_graph.h):
-    [graph_worker]     (@ref rte_graph_worker.h)
+    [table](@ref rte_swx_table.h),
+    [table_em](@ref rte_swx_table_em.h)
+    [table_wm](@ref rte_swx_table_wm.h)
+  * [graph](@ref rte_graph.h):
+    [graph_worker](@ref rte_graph_worker.h)
   * graph_nodes:
-    [eth_node]         (@ref rte_node_eth_api.h),
-    [ip4_node]         (@ref rte_node_ip4_api.h)
+    [eth_node](@ref rte_node_eth_api.h),
+    [ip4_node](@ref rte_node_ip4_api.h)
 
 - **basic**:
-  [bitops]             (@ref rte_bitops.h),
-  [approx fraction]    (@ref rte_approx.h),
-  [random]             (@ref rte_random.h),
-  [config file]        (@ref rte_cfgfile.h),
-  [key/value args]     (@ref rte_kvargs.h),
-  [string]             (@ref rte_string_fns.h)
+  [bitops](@ref rte_bitops.h),
+  [approx fraction](@ref rte_approx.h),
+  [random](@ref rte_random.h),
+  [config file](@ref rte_cfgfile.h),
+  [key/value args](@ref rte_kvargs.h),
+  [string](@ref rte_string_fns.h)
 
 - **debug**:
-  [jobstats]           (@ref rte_jobstats.h),
-  [telemetry]          (@ref rte_telemetry.h),
-  [pcapng]             (@ref rte_pcapng.h),
-  [pdump]              (@ref rte_pdump.h),
-  [hexdump]            (@ref rte_hexdump.h),
-  [debug]              (@ref rte_debug.h),
-  [log]                (@ref rte_log.h),
-  [errno]              (@ref rte_errno.h),
-  [trace]              (@ref rte_trace.h),
-  [trace_point]        (@ref rte_trace_point.h)
+  [jobstats](@ref rte_jobstats.h),
+  [telemetry](@ref rte_telemetry.h),
+  [pcapng](@ref rte_pcapng.h),
+  [pdump](@ref rte_pdump.h),
+  [hexdump](@ref rte_hexdump.h),
+  [debug](@ref rte_debug.h),
+  [log](@ref rte_log.h),
+  [errno](@ref rte_errno.h),
+  [trace](@ref rte_trace.h),
+  [trace_point](@ref rte_trace_point.h)
 
 - **misc**:
-  [EAL config]         (@ref rte_eal.h),
-  [common]             (@ref rte_common.h),
-  [experimental APIs]  (@ref rte_compat.h),
-  [ABI versioning]     (@ref rte_function_versioning.h),
-  [version]            (@ref rte_version.h)
+  [EAL config](@ref rte_eal.h),
+  [common](@ref rte_common.h),
+  [experimental APIs](@ref rte_compat.h),
+  [ABI versioning](@ref rte_function_versioning.h),
+  [version](@ref rte_version.h)
-- 
2.29.3


^ permalink raw reply	[relevance 6%]

* 21.11.1 patches review and test
@ 2022-04-01 10:22  2% Kevin Traynor
  2022-04-11  3:03  0% ` Pei Zhang
  2022-04-11  6:58  0% ` Christian Ehrhardt
  0 siblings, 2 replies; 200+ results
From: Kevin Traynor @ 2022-04-01 10:22 UTC (permalink / raw)
  To: stable
  Cc: dev, Abhishek Marathe, Ali Alnubani, benjamin.walker,
	David Christensen, hariprasad.govindharajan, Hemant Agrawal,
	Ian Stokes, Jerin Jacob, John McNamara, Ju-Hyoung Lee,
	Kevin Traynor, Luca Boccassi, Pei Zhang, qian.q.xu,
	Raslan Darawsheh, Thomas Monjalon, yuan.peng, zhaoyan.chen

Hi all,

Here is a list of patches targeted for stable release 21.11.1.

Please try and complete validation by April 13th.

Please help with testing and validation of your use cases and report
any issues/results with reply-all to this mail. For the final release
the fixes and reported validations will be added to the release notes.

A release candidate tarball can be found at:

    https://dpdk.org/browse/dpdk-stable/tag/?id=v21.11.1-rc1

These patches are located at branch 21.11 of dpdk-stable repo:
    https://dpdk.org/browse/dpdk-stable/

Thanks.

Kevin

---
Adham Masarwah (2):
      net/mlx5: fix destroying empty matchers list
      app/testpmd: fix show RSS RETA on Windows

Ajit Khaparde (7):
      net/bnxt: fix ring teardown
      net/bnxt: fix PAM4 mask setting
      net/bnxt: fix crash by validating pointer
      net/bnxt: check VF representor pointer before access
      net/bnxt: fix VF resource allocation strategy
      net/bnxt: set HW coalescing parameters
      net/bnxt: fix ring calculation for representors

Alexander Kozyrev (4):
      net/mlx5: fix maximum packet headers size for TSO
      net/mlx5: fix MPRQ WQE size assertion
      net/mlx5: fix committed bucket size
      net/mlx5: fix meter capabilities reporting

Ali Alnubani (1):
      doc: fix typos and punctuation in flow API guide

Anatoly Burakov (1):
      net/qede: fix redundant condition in debug code

Andy Pei (1):
      vdpa/ifc: fix log info mismatch

Ankur Dwivedi (1):
      common/cnxk: fix NPC key extraction validation

Anoob Joseph (4):
      common/cnxk: fix reset of fields
      crypto/cnxk: fix inflight count calculation
      crypto/cnxk: fix extend tail calculation
      crypto/cnxk: fix update of number of descriptors

Arek Kusztal (1):
      cryptodev: fix RSA key type name

Asaf Ravid (1):
      net/cnxk: fix promiscuous mode in multicast enable flow

Ashwin Sekhar T K (1):
      mempool/cnxk: fix batch allocation failure path

Bin Zheng (1):
      net/ixgbe: add vector Rx parameter check

Bing Zhao (5):
      common/mlx5: fix probing failure code
      app/testpmd: fix raw encap of GENEVE option
      net/mlx5: fix matcher priority with ICMP or ICMPv6
      net/mlx5: remove unused reference counter
      net/mlx5: fix configuration without Rx queue

Brian Dooley (13):
      eal: add missing C++ guards
      telemetry: add missing C++ guards
      ethdev: add missing C++ guards
      metrics: add missing C++ guards
      acl: add missing C++ guards
      compressdev: add missing C++ guards
      eventdev: add missing C++ guards
      kni: add missing C++ guards
      vhost: add missing C++ guards
      bpf: add missing C++ guards
      cryptodev: add missing C++ guards
      examples/l2fwd-crypto: fix port mask overflow
      crypto/virtio: fix out-of-bounds access

Bruce Richardson (23):
      doc: remove dependency on findutils on FreeBSD
      dma/idxd: fix burst capacity calculation
      dma/idxd: fix paths to driver sysfs directory
      dma/idxd: fix wrap-around in burst capacity calculation
      build: fix warnings when running external commands
      build: remove deprecated Meson functions
      eal: fix C++ include
      eventdev: fix C++ include
      graph: fix C++ include
      ipsec: fix C++ include
      table: fix C++ include
      vhost: fix C++ include
      ethdev: fix cast for C++ compatibility
      test/dma: fix missing checks for device capacity
      dma/idxd: configure maximum batch size to high value
      doc: improve configuration examples in idxd guide
      distributor: fix potential overflow
      eal/freebsd: add missing C++ include guards
      compressdev: fix missing space in log macro
      cryptodev: fix clang C++ include
      eventdev: fix clang C++ include
      doc: replace characters for (R) symbol in Linux guide
      doc: fix missing note on UIO module in Linux guide

Chandubabu Namburu (1):
      net/axgbe: use PCI root complex device to distinguish device

Chenbo Xia (1):
      vhost: fix queue number check when setting inflight FD

Chengchang Tang (1):
      net/bonding: fix offloading configuration

Chengwen Feng (2):
      net/hns3: delete duplicated RSS type
      dma/hisilicon: use common PCI device naming

Chuanshe Zhang (1):
      examples/flow_classify: fix failure message

Ciara Loftus (2):
      net/af_xdp: fix build with -Wunused-function
      net/af_xdp: ensure socket is deleted on Rx queue setup error

Ciara Power (4):
      crypto/ipsec_mb: fix queue setup null pointer dereference
      crypto/ipsec_mb: fix queue cleanup null pointer dereference
      crypto/ipsec_mb: fix tainted data for session
      crypto/ipsec_mb: remove useless check

Cristian Dumitrescu (2):
      pipeline: fix annotation checks
      pipeline: fix table state memory allocation

Dapeng Yu (2):
      net/ice: track DCF state of PF
      net/i40e: enable maximum frame size at port level

Dariusz Sosnowski (3):
      net/mlx5: fix inline length for multi-segment TSO
      net/mlx5: fix MPLS/GRE Verbs spec ordering
      net/mlx5: fix VLAN push action validation

David Marchand (8):
      devtools: fix comment detection in forbidden token check
      stack: fix stubs header export
      test/mbuf: fix mbuf data content check
      ethdev: fix MAC address in telemetry device info
      net/af_xdp: add missing trailing newline in logs
      devtools: remove event/dlb exception in ABI check
      vhost: fix FD leak with inflight messages
      bpf: fix build with some libpcap version on FreeBSD

Dawid Gorecki (2):
      net/ena: fix reset reason being overwritten
      net/ena: check memory BAR before initializing LLQ

Devendra Singh Rawat (3):
      net/qede: fix Tx completion
      net/qede: fix Rx bulk
      net/qede: fix maximum Rx packet length

Dmitry Kozlyuk (8):
      net/mlx5: fix GCC uninitialized variable warning
      net/mlx5: relax headroom assertion
      app/testpmd: fix external buffer allocation
      common/mlx5: fix MR lookup for non-contiguous mempool
      common/mlx5: add Netlink event helpers
      net/mlx5: fix link status change detection
      net/mlx5: fix initial link status detection
      net/mlx5: fix modify port action validation

Elena Agostini (3):
      gpu/cuda: fix memory list cleanup
      doc: add CUDA driver features
      gpu/cuda: fix dependency loading path

Ferruh Yigit (2):
      net/bonding: fix MTU set for slaves
      ethdev: fix doxygen comments for device info struct

Geoffrey Le Gourriérec (1):
      net/bnxt: restore dependency on kernel modules

Gerry Gribbon (1):
      app/regex: fix number of matches

Gowrishankar Muthukrishnan (6):
      event/cnxk: fix variables casting
      event/cnxk: fix uninitialized local variables
      common/cnxk: add missing checks of return values
      common/cnxk fix unintended sign extension
      common/cnxk: fix uninitialized pointer read
      net/cnxk: fix uninitialized local variable

Gregory Etelson (10):
      net/mlx5: fix RSS expansion with explicit next protocol
      net/mlx5: fix GRE protocol type translation for Verbs
      net/mlx5: fix GRE item translation in Verbs
      net/mlx5: reduce flex item flow handle size
      net/mlx5: fix flex item header length translation
      net/mlx5: fix inet IPIP protocol type
      net/mlx5: fix next protocol RSS expansion
      net/mlx5: fix flex item availability
      app/testpmd: fix GTP header parsing in checksum engine
      app/testpmd: fix flow rule with flex input link

Haiyue Wang (2):
      net/iavf: remove git residue symbol
      doc: fix KNI PMD name typo

Harman Kalra (3):
      common/cnxk: reset stale values on error debug registers
      common/cnxk: always use single interrupt ID with NIX
      common/cnxk: fix mbuf data offset for VF

Harold Huang (2):
      net/virtio-user: fix resource leak on probing failure
      net/kni: fix config initialization

Heinrich Kuhn (1):
      net/nfp: free HW ring memzone on queue release

Hemant Agrawal (1):
      crypto/dpaax_sec: fix auth/cipher xform chain checks

Honnappa Nagarahalli (3):
      examples/distributor: reduce Tx queue number to 1
      examples/l3fwd: share queue size variables
      examples/l3fwd: make Rx and Tx queue size configurable

Huisong Li (10):
      net/hns3: fix mailbox wait time
      net/hns3: fix using enum as boolean
      net/hns3: fix max packet size rollback in PF
      net/hns3: fix insecure way to query MAC statistics
      net/hns3: fix double decrement of secondary count
      net/hns3: fix operating queue when TCAM table is invalid
      kni: fix freeing order in device release
      net/hns3: fix RSS TC mode entry
      net/hns3: fix VF RSS TC mode entry
      net/hns3: increase time waiting for PF reset completion

Ivan Malov (8):
      net/sfc: validate queue span when parsing flow action RSS
      net/sfc: fix lock releases
      net/sfc: do not push fast free offload to default TxQ config
      net/sfc: demand Tx fast free offload on EF10 simple datapath
      common/sfc_efx/base: fix recirculation ID set in outer rules
      common/sfc_efx/base: add missing handler for 1-byte fields
      net/sfc: fix flow tunnel support detection
      net/sfc: reduce log level of tunnel restore info error

Jakub Poczatek (1):
      doc: fix FIPS guide

Jiawei Wang (4):
      net/mlx5: fix NIC egress flow mismatch in switchdev mode
      net/mlx5: fix sample flow action on trusted device
      net/mlx5: fix implicit tag insertion with sample action
      net/mlx5: fix port matching in sample flow rule

Jiawen Wu (8):
      net/ngbe: fix Rx by initializing packet buffer early
      net/ngbe: fix missed link interrupt
      net/ngbe: fix Tx hang on queue disable
      net/ngbe: fix packet statistics
      net/txgbe: fix link up and down
      net/txgbe: fix KR auto-negotiation
      net/ngbe: fix debug logs
      net/txgbe: fix debug logs

Jie Hai (1):
      net/hns3: remove duplicate macro definition

Jie Wang (1):
      net: fix L2TPv2 common header

Jie Zhou (2):
      eal/windows: fix error code for not supported API
      test/mem: fix error check

Josh Soref (1):
      fix spelling in comments and strings

Junfeng Guo (3):
      net/ice: fix pattern check for flow director parser
      net/ice: fix pattern check in flow director
      raw/ntb: clear all valid doorbell bits on init

Junjie Wan (1):
      net/bonding: fix slaves initializing on MTU setting

Junxiao Shi (1):
      net/af_xdp: fix custom program loading with multiple queues

Juraj Linkeš (1):
      config/arm: add values for native armv7

Kai Ji (2):
      test/crypto: fix out-of-place SGL in raw datapath
      crypto/qat: fix GEN4 AEAD job in raw data path

Kalesh AP (15):
      net/bnxt: fix multicast address set
      net/bnxt: fix multicast MAC restore during reset recovery
      net/bnxt: fix queue stop operation
      net/bnxt: restore RSS configuration after reset recovery
      net/bnxt: fix restoring VLAN filtering after recovery
      net/bnxt: cap maximum number of unicast MAC addresses
      net/bnxt: set fast-path pointers only if recovery succeeds
      net/bnxt: add null check for mark table
      net/bnxt: fix flow create when RSS is disabled
      net/bnxt: get maximum supported multicast filters count
      net/bnxt: fix handling of VF configuration change
      net/bnxt: fix xstats query
      net/bnxt: fix check for autoneg enablement
      net/bnxt: handle ring cleanup in case of error
      net/bnxt: fix memzone allocation per VNIC

Karl Bonde Torp (1):
      build: fix build on FreeBSD with Meson 0.61.1

Kathleen Capella (2):
      net/iavf: count continuous DD bits for Arm
      net/iavf: count continuous DD bits for Arm in flex Rx

Kevin Liu (2):
      net/ice: fix Tx checksum offload
      net/ice: fix Tx offload path choice

Kevin Traynor (4):
      maintainers: update for stable branches
      build: suppress rte_crypto_asym_op abi check
      Revert "crypto/ipsec_mb: fix length and offset settings"
      Revert "net/mlx5: fix flex item availability"

Kumara Parameshwaran (2):
      ethdev: add internal function to device struct from name
      net/tap: fix to populate FDs in secondary process

Lance Richardson (2):
      buildtools: fix AVX512 check for Python 3.5
      net/bnxt: fix xstats names query overrun

Leyi Rong (1):
      net/iavf: fix potential out-of-bounds access

Lijun Ou (1):
      net/hns3: fix RSS key with null

Lior Margalit (1):
      net/mlx5: fix assertion on flags set in packet mbuf

Madhuker Mythri (1):
      devargs: fix crash with uninitialized parsing

Martijn Bakker (1):
      pflock: fix header file installation

Martin Spinler (2):
      net/nfb: fix array indexes in deinit functions
      net/nfb: fix multicast/promiscuous mode switching

Marvin Liu (1):
      net/virtio: fix slots number when indirect feature on

Matan Azrad (1):
      vdpa/mlx5: workaround queue stop with traffic

Maxime Coquelin (1):
      vhost: fix unsafe vring addresses modifications

Maxime Gouin (3):
      bus/ifpga: remove useless check while browsing devices
      net/nfp: remove duplicated check when setting MAC address
      net/nfp: remove useless range checks

Megha Ajmera (1):
      examples/qos_sched: fix core mask overflow

Michael Baum (17):
      common/mlx5: add minimum WQE size for striding RQ
      net/mlx5: improve stride parameter names
      net/mlx5: fix MPRQ stride devargs adjustment
      common/mlx5: fix error handling in multi-class probe
      net/mlx5: fix memory socket selection in ASO management
      common/mlx5: fix missing validation in devargs parsing
      net/mlx5: fix sibling device config check
      net/mlx5: fix ineffective metadata argument adjustment
      net/mlx5: fix ASO CT object release
      net/mlx5: fix errno update in shared context creation
      net/mlx5: fix entry in shared Rx queues list
      doc: remove obsolete vector Tx explanations from mlx5 guide
      doc: replace broken links in mlx guides
      doc: correct name of BlueField-2 in mlx5 guide
      net/mlx5: fix shared counter flag in flow validation
      net/mlx5: fix check in count action validation
      common/mlx5: consider local functions as internal

Michal Krawczyk (6):
      net/ena: remove unused enumeration
      net/ena: remove unused offload variables
      net/ena: skip timer if reset is triggered
      net/ena: fix meta descriptor DF flag setup
      net/ena: fix checksum flag for L4
      bus/pci: assign driver pointer before mapping

Michal Wilczynski (1):
      net/ice: fix overwriting of LSE bit by DCF

Min Hu (Connor) (6):
      net/hns3: fix Rx/Tx functions update
      net/hns3: fix vector Rx/Tx when PTP enabled
      net/bonding: fix promiscuous and allmulticast state
      net/bonding: fix reference count on mbufs
      app/testpmd: fix bonding mode set
      app/testpmd: check starting port is not in bonding

Naga Harish K S V (2):
      eventdev/eth_tx: fix queue add error code
      eventdev/eth_rx: fix queue config query

Nicolas Chautru (1):
      baseband/acc100: avoid out-of-bounds access

Nipun Gupta (1):
      examples/l3fwd: fix Rx burst size for event mode

Nithin Dabilpuram (11):
      examples/ipsec-secgw: fix eventdev start sequence
      examples/ipsec-secgw: fix default flow rule creation
      common/cnxk: fix shift offset for TL3 length disable
      common/cnxk: fix byte order of frag sizes and infos
      common/cnxk: fix null pointer dereferences
      common/cnxk: fix uninitialized variables
      examples/ipsec-secgw: fix buffer freeing in vector mode
      net/cnxk: fix inline device RQ tag mask
      net/cnxk: register callback early to handle initial packets
      net/cnxk: fix inline IPsec security error handling
      common/cnxk: fix bitmap usage for TM

Pablo de Lara (9):
      crypto/ipsec_mb: fix buffer overrun
      crypto/ipsec_mb: check missing operation types
      crypto/ipsec_mb: fix ZUC authentication verify
      crypto/ipsec_mb: fix ZUC operation overwrite
      crypto/ipsec_mb: fix length and offset settings
      test/efd: fix sockets mask size
      efd: fix uninitialized structure
      crypto/ipsec_mb: fix length and offset settings
      crypto/ipsec_mb: fix GMAC parameters setting

Pavan Nikhilesh (6):
      eventdev/eth_rx: fix missing internal port checks
      event/cnxk: fix QoS devargs parsing
      common/cnxk: add workaround for vWQE flush
      config: align mempool elements to 128 bytes on CN10K
      event/cnxk: fix sub-event clearing mask length
      event/cnxk: fix Rx adapter config check

Peng Yu (1):
      vhost: fix linker script syntax

Piotr Bronowski (2):
      crypto/ipsec_mb: fix premature dereference
      crypto/ipsec_mb: fix GCM requested digest length

Qi Zhang (2):
      net/ice: fix Tx checksum offload capability
      doc: update matching versions in ice guide

Radu Nicolau (5):
      examples/ipsec-secgw: fix offload flag used for TSO IPv6
      net/iavf: fix segmentation offload condition
      net/iavf: fix segmentation offload buffer size
      net/iavf: support NAT-T / UDP encapsulation
      net/iavf: fix AES-GMAC IV size

Rahul Bhansali (2):
      net/cnxk: fix mbuf data length
      examples/l3fwd: fix buffer overflow in Tx

Rahul Lakkireddy (1):
      net/cxgbe: fix dangling pointer by mailbox access rework

Raja Zidane (8):
      net/mlx5: fix mark enabling for Rx
      app/testpmd: fix GENEVE parsing in checksum mode
      app/compress-perf: fix cycle count operations allocation
      app/compress-perf: optimize operations pool allocation
      compress/mlx5: support out-of-space status
      app/compress-perf: fix socket ID type during init
      app/compress-perf: fix number of queue pairs to setup
      compressdev: fix socket ID type

Rakesh Kudurumalla (2):
      net/cnxk: fix build with GCC 12
      net/cnxk: fix RSS RETA table update

Rashmi Shetty (1):
      doc: fix dlb2 guide

Reshma Pattan (1):
      app/pdump: abort on multi-core capture limit

Rongwei Liu (3):
      net/mlx5: fix shared RSS destroy
      net/mlx5: fix meter creation default state
      net/mlx5: forbid multiple ASO actions in a single rule

Ruifeng Wang (1):
      config: add arch define for Arm

Satheesh Paul (5):
      common/cnxk: fix nibble parsing order when dumping MCAM
      common/cnxk: fix flow deletion
      common/cnxk: fix log level during MCAM allocation
      common/cnxk: fix base rule merge
      net/cnxk: fix Rx/Tx function update

Sean Morrissey (2):
      app/testpmd: fix dereference before null check
      doc: fix telemetry example in cryptodev guide

Shijith Thotton (1):
      crypto/cnxk: enable allocated queues only

Shun Hao (3):
      net/mlx5: fix meter sub-policy creation
      net/mlx5: fix E-Switch manager vport ID
      net/mlx5: fix meter policy creation assert

Simei Su (1):
      net/ice: fix mbuf offload flag for Rx timestamp

Srikanth Yalavarthi (1):
      dma/cnxk: fix installing internal headers

Stephen Douthit (1):
      net/ixgbe: fix FSP check for X550EM devices

Stephen Hemminger (7):
      eal/linux: log hugepage create errors with filename
      net/memif: remove unnecessary Rx interrupt stub
      ipc: end multiprocess thread during cleanup
      vfio: cleanup the multiprocess sync handle
      pcapng: handle failure of link status query
      test/bpf: skip dump if conversion fails
      app/dumpcap: check for failure to set promiscuous

Steve Yang (4):
      app/testpmd: fix stack overflow for EEPROM display
      net/i40e: fix unintentional integer overflow
      eal/linux: fix illegal memory access in uevent handler
      net/iavf: fix function pointer in multi-process

Suanming Mou (3):
      net/mlx5: set flow error for hash list create
      net/mlx5: remove unused function
      net/mlx5: fix indexed pool fetch overlap

Thinh Tran (1):
      net/mlx5: fix CPU socket ID for Rx queue creation

Thomas Monjalon (6):
      doc: replace deprecated distutils version parsing
      dmadev: add missing header include
      app/testpmd: fix build without drivers
      regexdev: fix section attribute of symbols
      build: hide local symbols in shared libraries
      devtools: fix symbols check

Tianfei Zhang (2):
      raw/ifpga/base: fix SPI transaction
      raw/ifpga: fix thread closing

Tianli Lai (1):
      examples/kni: add missing trailing newline in log

Timothy McDaniel (3):
      event/dlb2: update rolling mask used for dequeue
      event/dlb2: poll HW CQ inflights before mapping queue
      event/dlb2: add shift value check in sparse dequeue

Vanshika Shukla (2):
      net/dpaa2: fix unregistering interrupt handler
      net/dpaa2: fix timestamping for IEEE1588

Viacheslav Ovsiienko (4):
      net/mlx5: fix modify field MAC address offset
      app/testpmd: fix Tx scheduling interval
      net/mlx5: fix metadata endianness in modify field action
      doc: fix modify field action description for mlx5

Vladimir Medvedkin (1):
      app/fib: fix division by zero

Wei Huang (5):
      raw/ifpga/base: fix port feature ID
      raw/ifpga: fix variable initialization in probing
      raw/ifpga: fix interrupt handle allocation
      raw/ifpga: fix monitor thread
      raw/ifpga: fix build with optimization

Weiguo Li (14):
      common/cnxk: fix error checking
      net/enic: fix dereference before null check
      net/dpaa2: fix null pointer dereference
      regex/mlx5: fix memory allocation check
      net/memif: remove pointer deference before null check
      net/iavf: fix null pointer dereference
      vdpa/sfc: fix null dereference during config
      vdpa/sfc: fix null dereference during removal
      compress/octeontx: fix null pointer dereference
      eventdev/eth_rx: fix parameters parsing memory leak
      net/sfc: fix memory allocation size for cache
      net/txgbe: fix queue statistics mapping
      sched: remove useless malloc in PIE data init
      net/bnxt: fix null dereference in session cleanup

Wenwu Ma (1):
      examples/vhost: fix launch with physical port

Wenxuan Wu (1):
      eal/linux: fix device monitor stop return

Xiaoyu Min (1):
      net/mlx5: reject jump to root table

Xuan Ding (2):
      vhost: fix field naming in guest page struct
      vhost: fix physical address mapping

Xueming Li (1):
      net/virtio: fix Tx queue 0 overriden by queue 128

Yajun Wu (1):
      common/mlx5: fix queue pair ack timeout configuration

Yiding Zhou (1):
      net/ice: fix build with 16-byte Rx descriptor

Yu Wenjun (1):
      net/bonding: fix RSS with early configure

Yuan Wang (1):
      vhost: fix guest to host physical address mapping

Yunjian Wang (12):
      net/bonding: fix mode type mismatch
      ethdev: fix Rx queue telemetry memory leak on failure
      net/ice: fix link up when starting device
      net/virtio-user: check FD flags getting failure
      net/virtio: fix uninitialized RSS key
      ring: fix error code when creating ring
      net/ixgbe: check filter init failure
      mem: check allocation in dynamic hugepage init
      ethdev: remove unnecessary null check
      net/ixgbe: reset security context pointer on close
      net/txgbe: reset security context pointer on close
      net/iavf: reset security context pointer on stop

Yuying Zhang (1):
      net/ice/base: add profile validation on switch filter

Zhihong Wang (1):
      ring: fix overflow in memory size calculation


^ permalink raw reply	[relevance 2%]

* RE: [PATCH 0/6] Extend and set event queue attributes at runtime
  2022-03-30 10:52  4%   ` Van Haaren, Harry
@ 2022-04-04  7:57  0%     ` Shijith Thotton
  0 siblings, 0 replies; 200+ results
From: Shijith Thotton @ 2022-04-04  7:57 UTC (permalink / raw)
  To: Van Haaren, Harry, Jerin Jacob, Jayatheerthan, Jay, Carrillo,
	Erik G, Gujjar, Abhinandan S, McDaniel, Timothy, Hemant Agrawal,
	Nipun Gupta, mattias.ronnblom, Ray Kinsella
  Cc: dpdk-dev, Jerin Jacob Kollanukkaran, Pavan Nikhilesh Bhagavatula,
	Liang Ma

>> >
>> > This series adds support for setting event queue attributes at runtime
>> > and adds two new event queue attributes weight and affinity. Eventdev
>> > capability RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR is added to expose
>> the
>> > capability to set attributes at runtime and rte_event_queue_attr_set()
>> > API is used to set the attributes.
>> >
>> > Attributes weight and affinity are not yet added to rte_event_queue_conf
>> > structure to avoid ABI break and will be added in 22.11. Till then, PMDs
>> > using the new attributes are expected to manage them.
>
>When the new attributes are added to queue_conf structure in 22.11, will the
>attr_get() function have any real use?
>
>If the attr_get() function is not useful post 22.11 (aka, returns const-integers?), we
>should consider if waiting
>for ABI-break in 22.11 is a better solution as it doesn't add public API/ABI functions
>that only have limited time value..?
>

queue_attr_get is an internal op and is not called if the op is not set by the
PMD. So no changes are needed from other PMDs to incorporate this. It is useful
to the PMDs needing the new attributes before they are added to
rte_event_queue_conf struct in 22.11.

><snip>
>
>> + @Van Haaren, Harry  @Jayatheerthan, Jay  @Erik Gabriel Carrillo
>> @Gujjar, Abhinandan S  @McDaniel, Timothy  @Hemant Agrawal  @Nipun
>> Gupta  @Mattias Rönnblom  @lingma @Ray Kinsella
>
>Thanks for flagging Jerin, indeed I hadn't looked at this patchset yet.
>
>From event/sw point of view, the new runtime queue attribute capability is not
>available, so the feature flag will not be set.
>
><snip>
>
>Some code comments inline on the impl patches comping up. Regards, -Harry

^ permalink raw reply	[relevance 0%]

* RE: [PATCH 2/6] eventdev: add weight and affinity to queue attributes
  2022-03-30 12:12  0%   ` Mattias Rönnblom
@ 2022-04-04  9:33  0%     ` Shijith Thotton
  0 siblings, 0 replies; 200+ results
From: Shijith Thotton @ 2022-04-04  9:33 UTC (permalink / raw)
  To: Mattias Rönnblom, dev, Jerin Jacob Kollanukkaran
  Cc: Pavan Nikhilesh Bhagavatula

>> Extended eventdev queue QoS attributes to support weight and affinity.
>> If queues are of same priority, events from the queue with highest
>> weight will be scheduled first. Affinity indicates the number of times,
>> the subsequent schedule calls from an event port will use the same event
>> queue. Schedule call selects another queue if current queue goes empty
>> or schedule count reaches affinity count.
>>
>> To avoid ABI break, weight and affinity attributes are not yet added to
>> queue config structure and relies on PMD for managing it. New eventdev
>> op queue_attr_get can be used to get it from the PMD.
>
>Have you considered using a PMD-specific command line parameter as a
>stop-gap until you can extend the config struct?
>
>> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
>> ---
>>   lib/eventdev/eventdev_pmd.h | 22 ++++++++++++++++++++
>>   lib/eventdev/rte_eventdev.c | 12 +++++++++++
>>   lib/eventdev/rte_eventdev.h | 41 +++++++++++++++++++++++++++++++++-
>---
>>   3 files changed, 71 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
>> index 6182749503..f19df98a7a 100644
>> --- a/lib/eventdev/eventdev_pmd.h
>> +++ b/lib/eventdev/eventdev_pmd.h
>> @@ -341,6 +341,26 @@ typedef int (*eventdev_queue_setup_t)(struct
>rte_eventdev *dev,
>>   typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
>>   		uint8_t queue_id);
>>
>> +/**
>> + * Get an event queue attribute at runtime.
>> + *
>> + * @param dev
>> + *   Event device pointer
>> + * @param queue_id
>> + *   Event queue index
>> + * @param attr_id
>> + *   Event queue attribute id
>> + * @param[out] attr_value
>> + *   Event queue attribute value
>> + *
>> + * @return
>> + *  - 0: Success.
>> + *  - <0: Error code on failure.
>> + */
>> +typedef int (*eventdev_queue_attr_get_t)(struct rte_eventdev *dev,
>> +					 uint8_t queue_id, uint32_t attr_id,
>> +					 uint32_t *attr_value);
>> +
>>   /**
>>    * Set an event queue attribute at runtime.
>>    *
>> @@ -1231,6 +1251,8 @@ struct eventdev_ops {
>>   	/**< Set up an event queue. */
>>   	eventdev_queue_release_t queue_release;
>>   	/**< Release an event queue. */
>> +	eventdev_queue_attr_get_t queue_attr_get;
>> +	/**< Get an event queue attribute. */
>>   	eventdev_queue_attr_set_t queue_attr_set;
>>   	/**< Set an event queue attribute. */
>>
>> diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
>> index 13c8af877e..37f0e54bf3 100644
>> --- a/lib/eventdev/rte_eventdev.c
>> +++ b/lib/eventdev/rte_eventdev.c
>> @@ -838,6 +838,18 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t
>queue_id, uint32_t attr_id,
>>
>>   		*attr_value = conf->schedule_type;
>>   		break;
>> +	case RTE_EVENT_QUEUE_ATTR_WEIGHT:
>> +		*attr_value = RTE_EVENT_QUEUE_WEIGHT_LOWEST;
>> +		if (dev->dev_ops->queue_attr_get)
>> +			return (*dev->dev_ops->queue_attr_get)(
>> +				dev, queue_id, attr_id, attr_value);
>> +		break;
>> +	case RTE_EVENT_QUEUE_ATTR_AFFINITY:
>> +		*attr_value = RTE_EVENT_QUEUE_AFFINITY_LOWEST;
>> +		if (dev->dev_ops->queue_attr_get)
>> +			return (*dev->dev_ops->queue_attr_get)(
>> +				dev, queue_id, attr_id, attr_value);
>> +		break;
>>   	default:
>>   		return -EINVAL;
>>   	};
>> diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
>> index 19710cd0c5..fa16fc5dcb 100644
>> --- a/lib/eventdev/rte_eventdev.h
>> +++ b/lib/eventdev/rte_eventdev.h
>> @@ -222,8 +222,14 @@ struct rte_event;
>>
>>   /* Event device capability bitmap flags */
>>   #define RTE_EVENT_DEV_CAP_QUEUE_QOS           (1ULL << 0)
>> -/**< Event scheduling prioritization is based on the priority associated with
>> - *  each event queue.
>> +/**< Event scheduling prioritization is based on the priority and weight
>> + * associated with each event queue. Events from a queue with highest priority
>> + * is scheduled first. If the queues are of same priority, a queue with highest
>> + * weight is selected. Subsequent schedules from an event port could see
>events
>> + * from the same event queue if the queue is configured with an affinity count.
>> + * Affinity count of a queue indicates the number of times, the subsequent
>> + * schedule calls from an event port should use the same queue if the queue is
>> + * non-empty.
>
>Is this specifying something else than WRR scheduling for equal-priority
>queues?
>

It is WRR for equal-priority queues. I will update the text as follows. Please check.

/**< Event scheduling prioritization is based on the priority and weight
 * associated with each event queue. Events from a queue with highest priority
 * is scheduled first. If the queues are of same priority, weight of the queues
 * are used to select a queue in a weighted round robin fashion. Subsequent
 * dequeue calls from an event port could see events from the same event queue
 * if the queue is configured with an affinity count. Affinity count of a queue
 * indicates the number of subsequent dequeue calls from an event port which
 * should use the same queue if the queue is non-empty.

>What is a schedule call? I must say I don't understand this description.
 
Schedule call indicates a dequeue call. I have updated the text to avoid confusion.

>Is affinity the per-port batch size from the queue that is "next in
>line" for an opportunity to be scheduled to a port?
>

Not exactly batch size. It is the number of subsequent dequeue calls which
should use the same queue. So the subsequent dequeue calls could return a max of
affinity * batch_size number of events from the same queue.

 >>    *
>>    *  @see rte_event_queue_setup(), rte_event_queue_attr_set()
>>    */
>> @@ -331,6 +337,26 @@ struct rte_event;
>>    * @see rte_event_port_link()
>>    */
>>
>> +/* Event queue scheduling weights */
>> +#define RTE_EVENT_QUEUE_WEIGHT_HIGHEST   255
>> +/**< Highest weight of an event queue
>> + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
>> + */
>> +#define RTE_EVENT_QUEUE_WEIGHT_LOWEST    0
>> +/**< Lowest weight of an event queue
>> + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
>> + */
>> +
>> +/* Event queue scheduling affinity */
>> +#define RTE_EVENT_QUEUE_AFFINITY_HIGHEST   255
>> +/**< Highest scheduling affinity of an event queue
>> + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
>> + */
>> +#define RTE_EVENT_QUEUE_AFFINITY_LOWEST    0
>> +/**< Lowest scheduling affinity of an event queue
>> + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
>> + */
>> +
>>   /**
>>    * Get the total number of event devices that have been successfully
>>    * initialised.
>> @@ -684,11 +710,18 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t
>queue_id,
>>    * The schedule type of the queue.
>>    */
>>   #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
>> -
>> +/**
>> + * The weight of the queue.
>> + */
>> +#define RTE_EVENT_QUEUE_ATTR_WEIGHT 5
>> +/**
>> + * Affinity of the queue.
>> + */
>> +#define RTE_EVENT_QUEUE_ATTR_AFFINITY 6
>>   /**
>>    * Maximum supported attribute ID.
>>    */
>> -#define RTE_EVENT_QUEUE_ATTR_MAX
>RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE
>> +#define RTE_EVENT_QUEUE_ATTR_MAX RTE_EVENT_QUEUE_ATTR_AFFINITY
>>
>
>>   /**
>>    * Get an attribute from a queue.


^ permalink raw reply	[relevance 0%]

* RE: [PATCH 1/6] eventdev: support to set queue attributes at runtime
  @ 2022-04-04  9:35  3%     ` Shijith Thotton
  2022-04-04  9:45  4%       ` Van Haaren, Harry
  0 siblings, 1 reply; 200+ results
From: Shijith Thotton @ 2022-04-04  9:35 UTC (permalink / raw)
  To: Van Haaren, Harry, dev, Jerin Jacob Kollanukkaran
  Cc: Pavan Nikhilesh Bhagavatula, Ray Kinsella

><snip>
>
>> +/**
>> + * Set an event queue attribute at runtime.
>> + *
>> + * @param dev
>> + *   Event device pointer
>> + * @param queue_id
>> + *   Event queue index
>> + * @param attr_id
>> + *   Event queue attribute id
>> + * @param attr_value
>> + *   Event queue attribute value
>> + *
>> + * @return
>> + *  - 0: Success.
>> + *  - <0: Error code on failure.
>> + */
>> +typedef int (*eventdev_queue_attr_set_t)(struct rte_eventdev *dev,
>> +					 uint8_t queue_id, uint32_t attr_id,
>> +					 uint32_t attr_value);
>
>Is using a uint64_t a better type for attr_value? Given there might be more in
>future,
>limiting to 32-bits now may cause headaches later, and uint64_t doesn't cost
>extra?
>
>I think 32-bits of attr_id is enough :)
>
>Same comment on the _get() API in patch 2/6, a uint64_t * would be a better fit
>there in my opinion.
>
><snip>
 
Changing size of attr_value will an ABI break. Can we wait till a need arises ?

^ permalink raw reply	[relevance 3%]

* RE: [PATCH 1/6] eventdev: support to set queue attributes at runtime
  2022-04-04  9:35  3%     ` Shijith Thotton
@ 2022-04-04  9:45  4%       ` Van Haaren, Harry
  0 siblings, 0 replies; 200+ results
From: Van Haaren, Harry @ 2022-04-04  9:45 UTC (permalink / raw)
  To: Shijith Thotton, dev, Jerin Jacob Kollanukkaran
  Cc: Pavan Nikhilesh Bhagavatula, Ray Kinsella

> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Monday, April 4, 2022 10:36 AM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>; dev@dpdk.org; Jerin Jacob
> Kollanukkaran <jerinj@marvell.com>
> Cc: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Ray Kinsella
> <mdr@ashroe.eu>
> Subject: RE: [PATCH 1/6] eventdev: support to set queue attributes at runtime
> 
> ><snip>
> >
> >> +/**
> >> + * Set an event queue attribute at runtime.
> >> + *
> >> + * @param dev
> >> + *   Event device pointer
> >> + * @param queue_id
> >> + *   Event queue index
> >> + * @param attr_id
> >> + *   Event queue attribute id
> >> + * @param attr_value
> >> + *   Event queue attribute value
> >> + *
> >> + * @return
> >> + *  - 0: Success.
> >> + *  - <0: Error code on failure.
> >> + */
> >> +typedef int (*eventdev_queue_attr_set_t)(struct rte_eventdev *dev,
> >> +					 uint8_t queue_id, uint32_t attr_id,
> >> +					 uint32_t attr_value);
> >
> >Is using a uint64_t a better type for attr_value? Given there might be more in
> >future,
> >limiting to 32-bits now may cause headaches later, and uint64_t doesn't cost
> >extra?
> >
> >I think 32-bits of attr_id is enough :)
> >
> >Same comment on the _get() API in patch 2/6, a uint64_t * would be a better fit
> >there in my opinion.
> >
> ><snip>
> 
> Changing size of attr_value will an ABI break. Can we wait till a need arises ?

Ah, I forgot that the _get() function is already upstream in DPDK today.

Its actually an API *and* ABI break, which is worse, as user code would have to
change (not just a re-compile against the newer DPDK version...). Any application
attempting source-compatibility with 21.11 and 22.11 would have to #ifdef the
parameter, switching uint32_t* and uint64_t*... or use some magic void* hacks.

Yes I suppose that waiting until a u64 is required for a real-world use-case is probably
better than breaking existing users code today (or in next ABI breaking release) with the
intent of getting to "perfect" API/ABIs...

Suggest to use a u64 for _set() to avoid getting into this same situation again,
but leave _get() as is, until it is required to change for a real use-case?


^ permalink raw reply	[relevance 4%]

* RE: [PATCH 1/2] security: introduce per session event metadata
  @ 2022-04-04  9:48  3%     ` Akhil Goyal
  2022-04-04 10:42  0%       ` Gujjar, Abhinandan S
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2022-04-04  9:48 UTC (permalink / raw)
  To: Gujjar, Abhinandan S, Volodymyr Fialko, dev
  Cc: Jerin Jacob Kollanukkaran, Anoob Joseph

Hi Abhinandan,
> ----------------------------------------------------------------------
> Acked-by: Abhinandan Gujjar <Abhinandan.gujjar@intel.com>
> 
This change would be an ABI breakage. So to avoid that, we are planning to
Propose a better solution compared to this patch.
We plan to add a new cryptodev op to set the event metadata. A single API
which can be used in all cases - sym/asym/security sessions.

As currently in case of sym crypto, userdata is being used for storing the event
Metadata and it is then dereferenced in the PMD which is wrong.
User data is meant only for user to use and PMD should not dereference it.

Hence a new cryptodev op can be used to set session event metadata
explicitly if event mode is enabled.

I will be sending the proposal soon. Would need your help in testing the
Intel usecases.

Regards,
Akhil
> > -----Original Message-----
> > From: Volodymyr Fialko <vfialko@marvell.com>
> > Sent: Friday, March 25, 2022 4:46 PM
> > To: dev@dpdk.org; Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> Akhil
> > Goyal <gakhil@marvell.com>
> > Cc: jerinj@marvell.com; Volodymyr Fialko <vfialko@marvell.com>; Anoob
> > Joseph <anoobj@marvell.com>
> > Subject: [PATCH 1/2] security: introduce per session event metadata
> >
> > Implement API to set/get event data per security session.
> >
> > Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> > Acked-by: Akhil Goyal <gakhil@marvell.com>
> > Acked-by: Anoob Joseph <anoobj@marvell.com>
> > ---
> >  .../prog_guide/event_crypto_adapter.rst       |  4 +-
> >  lib/security/rte_security.h                   | 43 +++++++++++++++++++
> >  2 files changed, 45 insertions(+), 2 deletions(-)
> >
> > diff --git a/doc/guides/prog_guide/event_crypto_adapter.rst
> > b/doc/guides/prog_guide/event_crypto_adapter.rst
> > index 4fb5c688e0..227b36b4b7 100644
> > --- a/doc/guides/prog_guide/event_crypto_adapter.rst
> > +++ b/doc/guides/prog_guide/event_crypto_adapter.rst
> > @@ -246,9 +246,9 @@ by ``rte_cryptodev_sym_session_get_user_data()``
> API.
> > The  RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA capability
> > indicates  whether HW or SW supports this feature.
> >
> > -For security session, ``rte_security_session_set_private_data()`` API
> > +For security session, ``rte_security_session_set_event_mdata()`` API
> >  will be used to set request/response data. The same data will be obtained -by
> > ``rte_security_session_get_private_data()`` API.
> > +by ``rte_security_session_get_event_mdata()`` API.
> >
> >  For session-less it is mandatory to place the request/response data with  the
> > ``rte_crypto_op``.
> > diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h index
> > b080d10c2c..29ec514504 100644
> > --- a/lib/security/rte_security.h
> > +++ b/lib/security/rte_security.h
> > @@ -526,6 +526,8 @@ struct rte_security_session {
> >  	/**< Private session material */
> >  	uint64_t opaque_data;
> >  	/**< Opaque user defined data */
> > +	void *event_mdata;
> > +	/**< Event request/response information */
> >  };
> >
> >  /**
> > @@ -729,6 +731,47 @@ set_sec_session_private_data(struct
> > rte_security_session *sess,
> >  	sess->sess_private_data = private_data;  }
> >
> > +/**
> > + * Get event meta data attached to a security session.
> > + *
> > + * @param	sess		Session pointer allocated by
> > + *				*rte_security_session_create*.
> > + *
> > + * @return
> > + *  - On success return pointer to the event crypto meta data which is set
> > + *    using *rte_security_session_set_event_mdata*
> > + *  - On failure returns NULL.
> > + */
> > +__rte_experimental
> > +static inline void *
> > +rte_security_session_get_event_mdata(const struct rte_security_session
> > +*sess) {
> > +	return sess->event_mdata;
> > +}
> > +
> > +/**
> > + * Attach event crypto meta data to a security session.
> > + *
> > + * Application can allocate memory for *rte_event_crypto_metadata* and
> > +set the
> > + * reference pointer using this API which the PMD can retrieve using
> > + * *rte_security_session_get_event_mdata*
> > + *
> > + * The API should be used only in case session is used for event crypto
> > + * adapter.
> > + *
> > + * @param	sess		Session pointer allocated by
> > + *				*rte_security_session_create*.
> > + * @param	ev_mdata	Pointer to the event crypto meta data
> > + *				(aka *union rte_event_crypto_metadata*)
> > + */
> > +__rte_experimental
> > +static inline void
> > +rte_security_session_set_event_mdata(struct rte_security_session *sess,
> > +				     void *ev_mdata)
> > +{
> > +	sess->event_mdata = ev_mdata;
> > +}
> > +
> >  /**
> >   * Attach a session to a crypto operation.
> >   * This API is needed only in case of
> > RTE_SECURITY_SESS_CRYPTO_PROTO_OFFLOAD
> > --
> > 2.25.1


^ permalink raw reply	[relevance 3%]

* RE: [PATCH 1/2] security: introduce per session event metadata
  2022-04-04  9:48  3%     ` Akhil Goyal
@ 2022-04-04 10:42  0%       ` Gujjar, Abhinandan S
  2022-04-13  7:13  3%         ` Akhil Goyal
  0 siblings, 1 reply; 200+ results
From: Gujjar, Abhinandan S @ 2022-04-04 10:42 UTC (permalink / raw)
  To: Akhil Goyal, Volodymyr Fialko, dev, Jayatheerthan, Jay, Vangati,
	Narender
  Cc: Jerin Jacob Kollanukkaran, Anoob Joseph

+ @Jayatheerthan, Jay & @Vangati, Narender

> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Monday, April 4, 2022 3:19 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; Volodymyr Fialko
> <vfialko@marvell.com>; dev@dpdk.org
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>
> Subject: RE: [PATCH 1/2] security: introduce per session event metadata
> 
> Hi Abhinandan,
> > ----------------------------------------------------------------------
> > Acked-by: Abhinandan Gujjar <Abhinandan.gujjar@intel.com>
> >
> This change would be an ABI breakage. So to avoid that, we are planning to
> Propose a better solution compared to this patch.
> We plan to add a new cryptodev op to set the event metadata. A single API
> which can be used in all cases - sym/asym/security sessions.
> 
> As currently in case of sym crypto, userdata is being used for storing the event
> Metadata and it is then dereferenced in the PMD which is wrong.
> User data is meant only for user to use and PMD should not dereference it.
> 
> Hence a new cryptodev op can be used to set session event metadata explicitly
> if event mode is enabled.
> 
> I will be sending the proposal soon. Would need your help in testing the Intel
> usecases.
> 
> Regards,
> Akhil
> > > -----Original Message-----
> > > From: Volodymyr Fialko <vfialko@marvell.com>
> > > Sent: Friday, March 25, 2022 4:46 PM
> > > To: dev@dpdk.org; Gujjar, Abhinandan S
> > > <abhinandan.gujjar@intel.com>;
> > Akhil
> > > Goyal <gakhil@marvell.com>
> > > Cc: jerinj@marvell.com; Volodymyr Fialko <vfialko@marvell.com>;
> > > Anoob Joseph <anoobj@marvell.com>
> > > Subject: [PATCH 1/2] security: introduce per session event metadata
> > >
> > > Implement API to set/get event data per security session.
> > >
> > > Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> > > Acked-by: Akhil Goyal <gakhil@marvell.com>
> > > Acked-by: Anoob Joseph <anoobj@marvell.com>
> > > ---
> > >  .../prog_guide/event_crypto_adapter.rst       |  4 +-
> > >  lib/security/rte_security.h                   | 43 +++++++++++++++++++
> > >  2 files changed, 45 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/doc/guides/prog_guide/event_crypto_adapter.rst
> > > b/doc/guides/prog_guide/event_crypto_adapter.rst
> > > index 4fb5c688e0..227b36b4b7 100644
> > > --- a/doc/guides/prog_guide/event_crypto_adapter.rst
> > > +++ b/doc/guides/prog_guide/event_crypto_adapter.rst
> > > @@ -246,9 +246,9 @@ by ``rte_cryptodev_sym_session_get_user_data()``
> > API.
> > > The  RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA
> capability
> > > indicates  whether HW or SW supports this feature.
> > >
> > > -For security session, ``rte_security_session_set_private_data()``
> > > API
> > > +For security session, ``rte_security_session_set_event_mdata()``
> > > +API
> > >  will be used to set request/response data. The same data will be
> > > obtained -by ``rte_security_session_get_private_data()`` API.
> > > +by ``rte_security_session_get_event_mdata()`` API.
> > >
> > >  For session-less it is mandatory to place the request/response data
> > > with  the ``rte_crypto_op``.
> > > diff --git a/lib/security/rte_security.h
> > > b/lib/security/rte_security.h index
> > > b080d10c2c..29ec514504 100644
> > > --- a/lib/security/rte_security.h
> > > +++ b/lib/security/rte_security.h
> > > @@ -526,6 +526,8 @@ struct rte_security_session {
> > >  	/**< Private session material */
> > >  	uint64_t opaque_data;
> > >  	/**< Opaque user defined data */
> > > +	void *event_mdata;
> > > +	/**< Event request/response information */
> > >  };
> > >
> > >  /**
> > > @@ -729,6 +731,47 @@ set_sec_session_private_data(struct
> > > rte_security_session *sess,
> > >  	sess->sess_private_data = private_data;  }
> > >
> > > +/**
> > > + * Get event meta data attached to a security session.
> > > + *
> > > + * @param	sess		Session pointer allocated by
> > > + *				*rte_security_session_create*.
> > > + *
> > > + * @return
> > > + *  - On success return pointer to the event crypto meta data which is set
> > > + *    using *rte_security_session_set_event_mdata*
> > > + *  - On failure returns NULL.
> > > + */
> > > +__rte_experimental
> > > +static inline void *
> > > +rte_security_session_get_event_mdata(const struct
> > > +rte_security_session
> > > +*sess) {
> > > +	return sess->event_mdata;
> > > +}
> > > +
> > > +/**
> > > + * Attach event crypto meta data to a security session.
> > > + *
> > > + * Application can allocate memory for *rte_event_crypto_metadata*
> > > +and set the
> > > + * reference pointer using this API which the PMD can retrieve
> > > +using
> > > + * *rte_security_session_get_event_mdata*
> > > + *
> > > + * The API should be used only in case session is used for event
> > > +crypto
> > > + * adapter.
> > > + *
> > > + * @param	sess		Session pointer allocated by
> > > + *				*rte_security_session_create*.
> > > + * @param	ev_mdata	Pointer to the event crypto meta data
> > > + *				(aka *union rte_event_crypto_metadata*)
> > > + */
> > > +__rte_experimental
> > > +static inline void
> > > +rte_security_session_set_event_mdata(struct rte_security_session *sess,
> > > +				     void *ev_mdata)
> > > +{
> > > +	sess->event_mdata = ev_mdata;
> > > +}
> > > +
> > >  /**
> > >   * Attach a session to a crypto operation.
> > >   * This API is needed only in case of
> > > RTE_SECURITY_SESS_CRYPTO_PROTO_OFFLOAD
> > > --
> > > 2.25.1


^ permalink raw reply	[relevance 0%]

* RE: [PATCH 1/6] eventdev: support to set queue attributes at runtime
  2022-03-30 12:14  3%   ` Mattias Rönnblom
@ 2022-04-04 11:45  0%     ` Shijith Thotton
  0 siblings, 0 replies; 200+ results
From: Shijith Thotton @ 2022-04-04 11:45 UTC (permalink / raw)
  To: Mattias Rönnblom, dev, Jerin Jacob Kollanukkaran
  Cc: Pavan Nikhilesh Bhagavatula, Ray Kinsella

>> Added a new eventdev API rte_event_queue_attr_set(), to set event queue
>> attributes at runtime from the values set during initialization using
>> rte_event_queue_setup(). PMD's supporting this feature should expose the
>> capability RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR.
>>
>> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
>> ---
>>   doc/guides/eventdevs/features/default.ini |  1 +
>>   lib/eventdev/eventdev_pmd.h               | 22 +++++++++++++
>>   lib/eventdev/rte_eventdev.c               | 31 ++++++++++++++++++
>>   lib/eventdev/rte_eventdev.h               | 38 ++++++++++++++++++++++-
>>   lib/eventdev/version.map                  |  3 ++
>>   5 files changed, 94 insertions(+), 1 deletion(-)
>>
>> diff --git a/doc/guides/eventdevs/features/default.ini
>b/doc/guides/eventdevs/features/default.ini
>> index 2ea233463a..00360f60c6 100644
>> --- a/doc/guides/eventdevs/features/default.ini
>> +++ b/doc/guides/eventdevs/features/default.ini
>> @@ -17,6 +17,7 @@ runtime_port_link          =
>>   multiple_queue_port        =
>>   carry_flow_id              =
>>   maintenance_free           =
>> +runtime_queue_attr         =
>>
>>   ;
>>   ; Features of a default Ethernet Rx adapter.
>> diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
>> index ce469d47a6..6182749503 100644
>> --- a/lib/eventdev/eventdev_pmd.h
>> +++ b/lib/eventdev/eventdev_pmd.h
>> @@ -341,6 +341,26 @@ typedef int (*eventdev_queue_setup_t)(struct
>rte_eventdev *dev,
>>   typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
>>   		uint8_t queue_id);
>>
>> +/**
>> + * Set an event queue attribute at runtime.
>> + *
>> + * @param dev
>> + *   Event device pointer
>> + * @param queue_id
>> + *   Event queue index
>> + * @param attr_id
>> + *   Event queue attribute id
>> + * @param attr_value
>> + *   Event queue attribute value
>> + *
>> + * @return
>> + *  - 0: Success.
>> + *  - <0: Error code on failure.
>> + */
>> +typedef int (*eventdev_queue_attr_set_t)(struct rte_eventdev *dev,
>> +					 uint8_t queue_id, uint32_t attr_id,
>> +					 uint32_t attr_value);
>> +
>>   /**
>>    * Retrieve the default event port configuration.
>>    *
>> @@ -1211,6 +1231,8 @@ struct eventdev_ops {
>>   	/**< Set up an event queue. */
>>   	eventdev_queue_release_t queue_release;
>>   	/**< Release an event queue. */
>> +	eventdev_queue_attr_set_t queue_attr_set;
>> +	/**< Set an event queue attribute. */
>>
>>   	eventdev_port_default_conf_get_t port_def_conf;
>>   	/**< Get default port configuration. */
>> diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
>> index 532a253553..13c8af877e 100644
>> --- a/lib/eventdev/rte_eventdev.c
>> +++ b/lib/eventdev/rte_eventdev.c
>> @@ -844,6 +844,37 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t
>queue_id, uint32_t attr_id,
>>   	return 0;
>>   }
>>
>> +int
>> +rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
>> +			 uint32_t attr_value)
>> +{
>> +	struct rte_eventdev *dev;
>> +
>> +	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
>> +	dev = &rte_eventdevs[dev_id];
>> +	if (!is_valid_queue(dev, queue_id)) {
>> +		RTE_EDEV_LOG_ERR("Invalid queue_id=%" PRIu8, queue_id);
>> +		return -EINVAL;
>> +	}
>> +
>> +	if (attr_id > RTE_EVENT_QUEUE_ATTR_MAX) {
>> +		RTE_EDEV_LOG_ERR("Invalid attribute ID %" PRIu8, attr_id);
>> +		return -EINVAL;
>> +	}
>> +
>> +	if (!(dev->data->event_dev_cap &
>> +	      RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR)) {
>> +		RTE_EDEV_LOG_ERR(
>> +			"Device %" PRIu8 "does not support changing queue
>attributes at runtime",
>> +			dev_id);
>> +		return -ENOTSUP;
>> +	}
>> +
>> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_attr_set, -
>ENOTSUP);
>> +	return (*dev->dev_ops->queue_attr_set)(dev, queue_id, attr_id,
>> +					       attr_value);
>> +}
>> +
>>   int
>>   rte_event_port_link(uint8_t dev_id, uint8_t port_id,
>>   		    const uint8_t queues[], const uint8_t priorities[],
>> diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
>> index 42a5660169..19710cd0c5 100644
>> --- a/lib/eventdev/rte_eventdev.h
>> +++ b/lib/eventdev/rte_eventdev.h
>> @@ -225,7 +225,7 @@ struct rte_event;
>>   /**< Event scheduling prioritization is based on the priority associated with
>>    *  each event queue.
>>    *
>> - *  @see rte_event_queue_setup()
>> + *  @see rte_event_queue_setup(), rte_event_queue_attr_set()
>>    */
>>   #define RTE_EVENT_DEV_CAP_EVENT_QOS           (1ULL << 1)
>>   /**< Event scheduling prioritization is based on the priority associated with
>> @@ -307,6 +307,13 @@ struct rte_event;
>>    * global pool, or process signaling related to load balancing.
>>    */
>>
>> +#define RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR (1ULL << 11)
>> +/**< Event device is capable of changing the queue attributes at runtime i.e
>after
>> + * rte_event_queue_setup() or rte_event_start() call sequence. If this flag is
>> + * not set, eventdev queue attributes can only be configured during
>> + * rte_event_queue_setup().
>> + */
>> +
>>   /* Event device priority levels */
>>   #define RTE_EVENT_DEV_PRIORITY_HIGHEST   0
>>   /**< Highest priority expressed across eventdev subsystem
>> @@ -678,6 +685,11 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t
>queue_id,
>>    */
>>   #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
>>
>> +/**
>> + * Maximum supported attribute ID.
>> + */
>> +#define RTE_EVENT_QUEUE_ATTR_MAX
>RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE
>> +
>
>This #define will assure that every new attribute breaks the ABI. Is
>that intentional?
>
 
Will remove .

>>   /**
>>    * Get an attribute from a queue.
>>    *
>> @@ -702,6 +714,30 @@ int
>>   rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
>>   			uint32_t *attr_value);
>>
>> +/**
>> + * Set an event queue attribute.
>> + *
>> + * @param dev_id
>> + *   Eventdev id
>> + * @param queue_id
>> + *   Eventdev queue id
>> + * @param attr_id
>> + *   The attribute ID to set
>> + * @param attr_value
>> + *   The attribute value to set
>> + *
>> + * @return
>> + *   - 0: Successfully set attribute.
>> + *   - -EINVAL: invalid device, queue or attr_id.
>> + *   - -ENOTSUP: device does not support setting event attribute.
>> + *   - -EBUSY: device is in running state
>> + *   - <0: failed to set event queue attribute
>> + */
>> +__rte_experimental
>> +int
>> +rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
>> +			 uint32_t attr_value);
>> +
>>   /* Event port specific APIs */
>>
>>   /* Event port configuration bitmap flags */
>> diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map
>> index cd5dada07f..c581b75c18 100644
>> --- a/lib/eventdev/version.map
>> +++ b/lib/eventdev/version.map
>> @@ -108,6 +108,9 @@ EXPERIMENTAL {
>>
>>   	# added in 22.03
>>   	rte_event_eth_rx_adapter_event_port_get;
>> +
>> +	# added in 22.07
>> +	rte_event_queue_attr_set;
>>   };
>>
>>   INTERNAL {


^ permalink raw reply	[relevance 0%]

* [PATCH v2 0/6] Extend and set event queue attributes at runtime
  2022-03-29 13:10  3% [PATCH 0/6] Extend and set event queue attributes at runtime Shijith Thotton
                   ` (2 preceding siblings ...)
  2022-03-29 18:49  0% ` [PATCH 0/6] Extend and set event queue attributes at runtime Jerin Jacob
@ 2022-04-05  5:40  3% ` Shijith Thotton
  2022-04-05  5:40  3%   ` [PATCH v2 2/6] eventdev: add weight and affinity to queue attributes Shijith Thotton
  2022-04-11 11:07  3%   ` [PATCH v2 0/6] Extend and set event queue attributes at runtime Shijith Thotton
  3 siblings, 2 replies; 200+ results
From: Shijith Thotton @ 2022-04-05  5:40 UTC (permalink / raw)
  To: dev, jerinj
  Cc: Shijith Thotton, pbhagavatula, harry.van.haaren, mattias.ronnblom

This series adds support for setting event queue attributes at runtime
and adds two new event queue attributes weight and affinity. Eventdev
capability RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR is added to expose the
capability to set attributes at runtime and rte_event_queue_attr_set()
API is used to set the attributes.

Attributes weight and affinity are not yet added to rte_event_queue_conf
structure to avoid ABI break and will be added in 22.11. Till then, PMDs
using the new attributes are expected to manage them.

Test application changes and example implementation are added as last
three patches.

v2:
* Modified attr_value type from u32 to u64 for set().
* Removed RTE_EVENT_QUEUE_ATTR_MAX macro.
* Fixed return value in implementation.

Pavan Nikhilesh (1):
  common/cnxk: use lock when accessing mbox of SSO

Shijith Thotton (5):
  eventdev: support to set queue attributes at runtime
  eventdev: add weight and affinity to queue attributes
  doc: announce change in event queue conf structure
  test/event: test cases to test runtime queue attribute
  event/cnxk: support to set runtime queue attributes

 app/test/test_eventdev.c                  | 149 ++++++++++++++++++
 doc/guides/eventdevs/features/cnxk.ini    |   1 +
 doc/guides/eventdevs/features/default.ini |   1 +
 doc/guides/rel_notes/deprecation.rst      |   3 +
 drivers/common/cnxk/roc_sso.c             | 174 ++++++++++++++++------
 drivers/common/cnxk/roc_sso_priv.h        |   1 +
 drivers/common/cnxk/roc_tim.c             | 134 +++++++++++------
 drivers/event/cnxk/cn10k_eventdev.c       |   4 +
 drivers/event/cnxk/cn9k_eventdev.c        |   4 +
 drivers/event/cnxk/cnxk_eventdev.c        |  91 ++++++++++-
 drivers/event/cnxk/cnxk_eventdev.h        |  16 ++
 lib/eventdev/eventdev_pmd.h               |  44 ++++++
 lib/eventdev/rte_eventdev.c               |  38 +++++
 lib/eventdev/rte_eventdev.h               |  71 ++++++++-
 lib/eventdev/version.map                  |   3 +
 15 files changed, 631 insertions(+), 103 deletions(-)

-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [PATCH v2 2/6] eventdev: add weight and affinity to queue attributes
  2022-04-05  5:40  3% ` [PATCH v2 " Shijith Thotton
@ 2022-04-05  5:40  3%   ` Shijith Thotton
  2022-04-11 11:07  3%   ` [PATCH v2 0/6] Extend and set event queue attributes at runtime Shijith Thotton
  1 sibling, 0 replies; 200+ results
From: Shijith Thotton @ 2022-04-05  5:40 UTC (permalink / raw)
  To: dev, jerinj
  Cc: Shijith Thotton, pbhagavatula, harry.van.haaren, mattias.ronnblom

Extended eventdev queue QoS attributes to support weight and affinity.
If queues are of same priority, events from the queue with highest
weight will be scheduled first. Affinity indicates the number of times,
the subsequent schedule calls from an event port will use the same event
queue. Schedule call selects another queue if current queue goes empty
or schedule count reaches affinity count.

To avoid ABI break, weight and affinity attributes are not yet added to
queue config structure and relies on PMD for managing it. New eventdev
op queue_attr_get can be used to get it from the PMD.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 lib/eventdev/eventdev_pmd.h | 22 +++++++++++++++++++++
 lib/eventdev/rte_eventdev.c | 12 ++++++++++++
 lib/eventdev/rte_eventdev.h | 38 +++++++++++++++++++++++++++++++++++--
 3 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
index 3b85d9f7a5..5495aee4f6 100644
--- a/lib/eventdev/eventdev_pmd.h
+++ b/lib/eventdev/eventdev_pmd.h
@@ -341,6 +341,26 @@ typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev,
 typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
 		uint8_t queue_id);
 
+/**
+ * Get an event queue attribute at runtime.
+ *
+ * @param dev
+ *   Event device pointer
+ * @param queue_id
+ *   Event queue index
+ * @param attr_id
+ *   Event queue attribute id
+ * @param[out] attr_value
+ *   Event queue attribute value
+ *
+ * @return
+ *  - 0: Success.
+ *  - <0: Error code on failure.
+ */
+typedef int (*eventdev_queue_attr_get_t)(struct rte_eventdev *dev,
+					 uint8_t queue_id, uint32_t attr_id,
+					 uint32_t *attr_value);
+
 /**
  * Set an event queue attribute at runtime.
  *
@@ -1231,6 +1251,8 @@ struct eventdev_ops {
 	/**< Set up an event queue. */
 	eventdev_queue_release_t queue_release;
 	/**< Release an event queue. */
+	eventdev_queue_attr_get_t queue_attr_get;
+	/**< Get an event queue attribute. */
 	eventdev_queue_attr_set_t queue_attr_set;
 	/**< Set an event queue attribute. */
 
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index a31e99be02..12b261f923 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -838,6 +838,18 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
 
 		*attr_value = conf->schedule_type;
 		break;
+	case RTE_EVENT_QUEUE_ATTR_WEIGHT:
+		*attr_value = RTE_EVENT_QUEUE_WEIGHT_LOWEST;
+		if (dev->dev_ops->queue_attr_get)
+			return (*dev->dev_ops->queue_attr_get)(
+				dev, queue_id, attr_id, attr_value);
+		break;
+	case RTE_EVENT_QUEUE_ATTR_AFFINITY:
+		*attr_value = RTE_EVENT_QUEUE_AFFINITY_LOWEST;
+		if (dev->dev_ops->queue_attr_get)
+			return (*dev->dev_ops->queue_attr_get)(
+				dev, queue_id, attr_id, attr_value);
+		break;
 	default:
 		return -EINVAL;
 	};
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index 16e9d5fb5b..a6fbaf1c11 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -222,8 +222,14 @@ struct rte_event;
 
 /* Event device capability bitmap flags */
 #define RTE_EVENT_DEV_CAP_QUEUE_QOS           (1ULL << 0)
-/**< Event scheduling prioritization is based on the priority associated with
- *  each event queue.
+/**< Event scheduling prioritization is based on the priority and weight
+ * associated with each event queue. Events from a queue with highest priority
+ * is scheduled first. If the queues are of same priority, weight of the queues
+ * are considered to select a queue in a weighted round robin fashion.
+ * Subsequent dequeue calls from an event port could see events from the same
+ * event queue, if the queue is configured with an affinity count. Affinity
+ * count is the number of subsequent dequeue calls, in which an event port
+ * should use the same event queue if the queue is non-empty
  *
  *  @see rte_event_queue_setup(), rte_event_queue_attr_set()
  */
@@ -331,6 +337,26 @@ struct rte_event;
  * @see rte_event_port_link()
  */
 
+/* Event queue scheduling weights */
+#define RTE_EVENT_QUEUE_WEIGHT_HIGHEST   255
+/**< Highest weight of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+#define RTE_EVENT_QUEUE_WEIGHT_LOWEST    0
+/**< Lowest weight of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+
+/* Event queue scheduling affinity */
+#define RTE_EVENT_QUEUE_AFFINITY_HIGHEST   255
+/**< Highest scheduling affinity of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+#define RTE_EVENT_QUEUE_AFFINITY_LOWEST    0
+/**< Lowest scheduling affinity of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+
 /**
  * Get the total number of event devices that have been successfully
  * initialised.
@@ -684,6 +710,14 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * The schedule type of the queue.
  */
 #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
+/**
+ * The weight of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_WEIGHT 5
+/**
+ * Affinity of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_AFFINITY 6
 
 /**
  * Get an attribute from a queue.
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 2/2] eal: factorize lcore main loop
  @ 2022-04-05  7:05  3%     ` David Marchand
  0 siblings, 0 replies; 200+ results
From: David Marchand @ 2022-04-05  7:05 UTC (permalink / raw)
  To: dev
  Cc: Thomas Monjalon, Morten Brørup, Tyler Retzlaff,
	Bruce Richardson, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam, Dodji Seketeli

On Fri, Apr 1, 2022 at 10:44 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> All OS implementations provide the same main loop.
> Introduce helpers (shared for Linux and FreeBSD) to handle synchronisation
> between main and threads and factorize the rest as common code.
> Thread id are now logged as string in a common format across OS.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
> Changes since v1:
> - rebased on top of Tyler fix for Windows and new cleanup,

FYI, this series needs a respin to fix Windows build (/me hides..).
There is also a false positive ABI breakage reported by libabigail
that Dodji is looking into.


-- 
David Marchand


^ permalink raw reply	[relevance 3%]

* [PATCH v3 2/2] eal: factorize lcore main loop
  @ 2022-04-05 16:34  2%   ` David Marchand
  2022-04-14 11:48  0%     ` David Marchand
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2022-04-05 16:34 UTC (permalink / raw)
  To: dev
  Cc: thomas, Morten Brørup, Tyler Retzlaff, Ray Kinsella,
	Bruce Richardson, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam

All OS implementations provide the same main loop.
Introduce helpers (shared for Linux and FreeBSD) to handle synchronisation
between main and threads and factorize the rest as common code.
Thread id are now logged as string in a common format across OS.

Note: libabigail flags this change as breaking ABI in clang builds:

1 function with some indirect sub-type change:

  [C] 'function int rte_eal_remote_launch(int (void*)*, void*, unsigned
      int)' at eal_common_launch.c:35:1 has some indirect sub-type
      changes:
    parameter 1 of type 'int (void*)*' changed:
      in pointed to type 'function type int (void*)' at rte_launch.h:31:1:
        entity changed from 'function type int (void*)' to 'typedef
          lcore_function_t' at rte_launch.h:31:1
        type size hasn't changed

This is being investigated on libabigail side.
For now, we don't have much choice but to waive reports on this symbol.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
Changes since v2:
- aligned rte_eal_remote_launch definition to prototype,
- waived false positive ABI breakage for clang builds,

Changes since v1:
- rebased on top of Tyler fix for Windows and new cleanup,

---
 devtools/libabigail.abignore       |   4 +
 lib/eal/common/eal_common_launch.c |  36 +++++++-
 lib/eal/common/eal_common_thread.c |  63 ++++++++++++++
 lib/eal/common/eal_thread.h        |  27 ++++++
 lib/eal/freebsd/eal.c              |   7 +-
 lib/eal/freebsd/eal_thread.c       | 128 ----------------------------
 lib/eal/linux/eal.c                |   4 +-
 lib/eal/linux/eal_thread.c         | 130 +----------------------------
 lib/eal/unix/eal_unix_thread.c     |  63 ++++++++++++++
 lib/eal/unix/meson.build           |   5 +-
 lib/eal/windows/eal_thread.c       | 126 +++++++---------------------
 11 files changed, 231 insertions(+), 362 deletions(-)
 create mode 100644 lib/eal/unix/eal_unix_thread.c

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 5be5c28dc3..79ff15dc4e 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -52,3 +52,7 @@
 ; Ignore visibility fix of local functions in experimental gpudev library
 [suppress_file]
         soname_regexp = ^librte_gpudev\.
+
+; Ignore libabigail false-positive in clang builds, after moving code.
+[suppress_function]
+	name = rte_eal_remote_launch
diff --git a/lib/eal/common/eal_common_launch.c b/lib/eal/common/eal_common_launch.c
index 9f393b9bda..992f8e4631 100644
--- a/lib/eal/common/eal_common_launch.c
+++ b/lib/eal/common/eal_common_launch.c
@@ -5,11 +5,13 @@
 #include <errno.h>
 
 #include <rte_launch.h>
+#include <rte_eal_trace.h>
 #include <rte_atomic.h>
 #include <rte_pause.h>
 #include <rte_lcore.h>
 
 #include "eal_private.h"
+#include "eal_thread.h"
 
 /*
  * Wait until a lcore finished its job.
@@ -18,12 +20,44 @@ int
 rte_eal_wait_lcore(unsigned worker_id)
 {
 	while (__atomic_load_n(&lcore_config[worker_id].state,
-					__ATOMIC_ACQUIRE) != WAIT)
+			__ATOMIC_ACQUIRE) != WAIT)
 		rte_pause();
 
 	return lcore_config[worker_id].ret;
 }
 
+/*
+ * Send a message to a worker lcore identified by worker_id to call a
+ * function f with argument arg. Once the execution is done, the
+ * remote lcore switches to WAIT state.
+ */
+int
+rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int worker_id)
+{
+	int rc = -EBUSY;
+
+	/* Check if the worker is in 'WAIT' state. Use acquire order
+	 * since 'state' variable is used as the guard variable.
+	 */
+	if (__atomic_load_n(&lcore_config[worker_id].state,
+			__ATOMIC_ACQUIRE) != WAIT)
+		goto finish;
+
+	lcore_config[worker_id].arg = arg;
+	/* Ensure that all the memory operations are completed
+	 * before the worker thread starts running the function.
+	 * Use worker thread function as the guard variable.
+	 */
+	__atomic_store_n(&lcore_config[worker_id].f, f, __ATOMIC_RELEASE);
+
+	eal_thread_wake_worker(worker_id);
+	rc = 0;
+
+finish:
+	rte_eal_trace_thread_remote_launch(f, arg, worker_id, rc);
+	return rc;
+}
+
 /*
  * Check that every WORKER lcores are in WAIT state, then call
  * rte_eal_remote_launch() for all of them. If call_main is true
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index 684bea166c..962b7e9ac4 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -9,6 +9,7 @@
 #include <assert.h>
 #include <string.h>
 
+#include <rte_eal_trace.h>
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
@@ -163,6 +164,68 @@ __rte_thread_uninit(void)
 	RTE_PER_LCORE(_lcore_id) = LCORE_ID_ANY;
 }
 
+/* main loop of threads */
+__rte_noreturn void *
+eal_thread_loop(void *arg)
+{
+	unsigned int lcore_id = (uintptr_t)arg;
+	char cpuset[RTE_CPU_AFFINITY_STR_LEN];
+	int ret;
+
+	__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
+
+	ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
+	RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
+		lcore_id, (uintptr_t)pthread_self(), cpuset,
+		ret == 0 ? "" : "...");
+
+	rte_eal_trace_thread_lcore_ready(lcore_id, cpuset);
+
+	/* read on our pipe to get commands */
+	while (1) {
+		lcore_function_t *f;
+		void *fct_arg;
+
+		eal_thread_wait_command();
+
+		/* Set the state to 'RUNNING'. Use release order
+		 * since 'state' variable is used as the guard variable.
+		 */
+		__atomic_store_n(&lcore_config[lcore_id].state, RUNNING,
+			__ATOMIC_RELEASE);
+
+		eal_thread_ack_command();
+
+		/* Load 'f' with acquire order to ensure that
+		 * the memory operations from the main thread
+		 * are accessed only after update to 'f' is visible.
+		 * Wait till the update to 'f' is visible to the worker.
+		 */
+		while ((f = __atomic_load_n(&lcore_config[lcore_id].f,
+				__ATOMIC_ACQUIRE)) == NULL)
+			rte_pause();
+
+		/* call the function and store the return value */
+		fct_arg = lcore_config[lcore_id].arg;
+		ret = f(fct_arg);
+		lcore_config[lcore_id].ret = ret;
+		lcore_config[lcore_id].f = NULL;
+		lcore_config[lcore_id].arg = NULL;
+
+		/* Store the state with release order to ensure that
+		 * the memory operations from the worker thread
+		 * are completed before the state is updated.
+		 * Use 'state' as the guard variable.
+		 */
+		__atomic_store_n(&lcore_config[lcore_id].state, WAIT,
+			__ATOMIC_RELEASE);
+	}
+
+	/* never reached */
+	/* pthread_exit(NULL); */
+	/* return NULL; */
+}
+
 enum __rte_ctrl_thread_status {
 	CTRL_THREAD_LAUNCHING, /* Yet to call pthread_create function */
 	CTRL_THREAD_RUNNING, /* Control thread is running successfully */
diff --git a/lib/eal/common/eal_thread.h b/lib/eal/common/eal_thread.h
index 3c84efd553..ca3378d463 100644
--- a/lib/eal/common/eal_thread.h
+++ b/lib/eal/common/eal_thread.h
@@ -58,4 +58,31 @@ eal_thread_dump_affinity(rte_cpuset_t *cpuset, char *str, unsigned int size);
 int
 eal_thread_dump_current_affinity(char *str, unsigned int size);
 
+/**
+ * Called by the main thread to wake up a worker in 'WAIT' state.
+ * This function blocks until the worker acknowledge it started processing a
+ * new command.
+ * This function is private to EAL.
+ *
+ * @param worker_id
+ *   The lcore_id of a worker thread.
+ */
+void
+eal_thread_wake_worker(unsigned int worker_id);
+
+/**
+ * Called by a worker thread to sleep after entering 'WAIT' state.
+ * This function is private to EAL.
+ */
+void
+eal_thread_wait_command(void);
+
+/**
+ * Called by a worker thread to acknowledge new command after leaving 'WAIT'
+ * state.
+ * This function is private to EAL.
+ */
+void
+eal_thread_ack_command(void);
+
 #endif /* EAL_THREAD_H */
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index e233e57184..a6b20960f2 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -579,7 +579,6 @@ int
 rte_eal_init(int argc, char **argv)
 {
 	int i, fctret, ret;
-	pthread_t thread_id;
 	static uint32_t run_once;
 	uint32_t has_run = 0;
 	char cpuset[RTE_CPU_AFFINITY_STR_LEN];
@@ -604,8 +603,6 @@ rte_eal_init(int argc, char **argv)
 		return -1;
 	}
 
-	thread_id = pthread_self();
-
 	eal_reset_internal_config(internal_conf);
 
 	/* clone argv to report out later in telemetry */
@@ -794,8 +791,8 @@ rte_eal_init(int argc, char **argv)
 
 	ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
 
-	RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
-		config->main_lcore, thread_id, cpuset,
+	RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
+		config->main_lcore, (uintptr_t)pthread_self(), cpuset,
 		ret == 0 ? "" : "...");
 
 	RTE_LCORE_FOREACH_WORKER(i) {
diff --git a/lib/eal/freebsd/eal_thread.c b/lib/eal/freebsd/eal_thread.c
index 9044d70ef7..ab81b527bc 100644
--- a/lib/eal/freebsd/eal_thread.c
+++ b/lib/eal/freebsd/eal_thread.c
@@ -20,138 +20,10 @@
 #include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
-#include <rte_eal_trace.h>
 
 #include "eal_private.h"
 #include "eal_thread.h"
 
-/*
- * Send a message to a worker lcore identified by worker_id to call a
- * function f with argument arg. Once the execution is done, the
- * remote lcore switches to WAIT state.
- */
-int
-rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned worker_id)
-{
-	int n;
-	char c = 0;
-	int m2w = lcore_config[worker_id].pipe_main2worker[1];
-	int w2m = lcore_config[worker_id].pipe_worker2main[0];
-	int rc = -EBUSY;
-
-	/* Check if the worker is in 'WAIT' state. Use acquire order
-	 * since 'state' variable is used as the guard variable.
-	 */
-	if (__atomic_load_n(&lcore_config[worker_id].state,
-					__ATOMIC_ACQUIRE) != WAIT)
-		goto finish;
-
-	lcore_config[worker_id].arg = arg;
-	/* Ensure that all the memory operations are completed
-	 * before the worker thread starts running the function.
-	 * Use worker thread function as the guard variable.
-	 */
-	__atomic_store_n(&lcore_config[worker_id].f, f, __ATOMIC_RELEASE);
-
-	/* send message */
-	n = 0;
-	while (n == 0 || (n < 0 && errno == EINTR))
-		n = write(m2w, &c, 1);
-	if (n < 0)
-		rte_panic("cannot write on configuration pipe\n");
-
-	/* wait ack */
-	do {
-		n = read(w2m, &c, 1);
-	} while (n < 0 && errno == EINTR);
-
-	if (n <= 0)
-		rte_panic("cannot read on configuration pipe\n");
-
-	rc = 0;
-finish:
-	rte_eal_trace_thread_remote_launch(f, arg, worker_id, rc);
-	return rc;
-}
-
-/* main loop of threads */
-__rte_noreturn void *
-eal_thread_loop(void *arg)
-{
-	unsigned int lcore_id = (uintptr_t)arg;
-	char c;
-	int n, ret;
-	unsigned lcore_id;
-	int m2w, w2m;
-	char cpuset[RTE_CPU_AFFINITY_STR_LEN];
-
-	m2w = lcore_config[lcore_id].pipe_main2worker[0];
-	w2m = lcore_config[lcore_id].pipe_worker2main[1];
-
-	__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
-
-	ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
-	RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
-		lcore_id, pthread_self(), cpuset, ret == 0 ? "" : "...");
-
-	rte_eal_trace_thread_lcore_ready(lcore_id, cpuset);
-
-	/* read on our pipe to get commands */
-	while (1) {
-		lcore_function_t *f;
-		void *fct_arg;
-
-		/* wait command */
-		do {
-			n = read(m2w, &c, 1);
-		} while (n < 0 && errno == EINTR);
-
-		if (n <= 0)
-			rte_panic("cannot read on configuration pipe\n");
-
-		/* Set the state to 'RUNNING'. Use release order
-		 * since 'state' variable is used as the guard variable.
-		 */
-		__atomic_store_n(&lcore_config[lcore_id].state, RUNNING,
-					__ATOMIC_RELEASE);
-
-		/* send ack */
-		n = 0;
-		while (n == 0 || (n < 0 && errno == EINTR))
-			n = write(w2m, &c, 1);
-		if (n < 0)
-			rte_panic("cannot write on configuration pipe\n");
-
-		/* Load 'f' with acquire order to ensure that
-		 * the memory operations from the main thread
-		 * are accessed only after update to 'f' is visible.
-		 * Wait till the update to 'f' is visible to the worker.
-		 */
-		while ((f = __atomic_load_n(&lcore_config[lcore_id].f,
-			__ATOMIC_ACQUIRE)) == NULL)
-			rte_pause();
-
-		/* call the function and store the return value */
-		fct_arg = lcore_config[lcore_id].arg;
-		ret = f(fct_arg);
-		lcore_config[lcore_id].ret = ret;
-		lcore_config[lcore_id].f = NULL;
-		lcore_config[lcore_id].arg = NULL;
-
-		/* Store the state with release order to ensure that
-		 * the memory operations from the worker thread
-		 * are completed before the state is updated.
-		 * Use 'state' as the guard variable.
-		 */
-		__atomic_store_n(&lcore_config[lcore_id].state, WAIT,
-					__ATOMIC_RELEASE);
-	}
-
-	/* never reached */
-	/* pthread_exit(NULL); */
-	/* return NULL; */
-}
-
 /* require calling thread tid by gettid() */
 int rte_sys_gettid(void)
 {
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 98c6838026..1ef263434a 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -862,7 +862,6 @@ int
 rte_eal_init(int argc, char **argv)
 {
 	int i, fctret, ret;
-	pthread_t thread_id;
 	static uint32_t run_once;
 	uint32_t has_run = 0;
 	const char *p;
@@ -890,7 +889,6 @@ rte_eal_init(int argc, char **argv)
 
 	p = strrchr(argv[0], '/');
 	strlcpy(logid, p ? p + 1 : argv[0], sizeof(logid));
-	thread_id = pthread_self();
 
 	eal_reset_internal_config(internal_conf);
 
@@ -1129,7 +1127,7 @@ rte_eal_init(int argc, char **argv)
 
 	ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
 	RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
-		config->main_lcore, (uintptr_t)thread_id, cpuset,
+		config->main_lcore, (uintptr_t)pthread_self(), cpuset,
 		ret == 0 ? "" : "...");
 
 	RTE_LCORE_FOREACH_WORKER(i) {
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index 26b0a7d48a..820cc905e0 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -14,139 +14,11 @@
 #include <rte_log.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
-#include <rte_eal_trace.h>
+#include <rte_string_fns.h>
 
 #include "eal_private.h"
 #include "eal_thread.h"
 
-/*
- * Send a message to a worker lcore identified by worker_id to call a
- * function f with argument arg. Once the execution is done, the
- * remote lcore switches to WAIT state.
- */
-int
-rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned int worker_id)
-{
-	int n;
-	char c = 0;
-	int m2w = lcore_config[worker_id].pipe_main2worker[1];
-	int w2m = lcore_config[worker_id].pipe_worker2main[0];
-	int rc = -EBUSY;
-
-	/* Check if the worker is in 'WAIT' state. Use acquire order
-	 * since 'state' variable is used as the guard variable.
-	 */
-	if (__atomic_load_n(&lcore_config[worker_id].state,
-					__ATOMIC_ACQUIRE) != WAIT)
-		goto finish;
-
-	lcore_config[worker_id].arg = arg;
-	/* Ensure that all the memory operations are completed
-	 * before the worker thread starts running the function.
-	 * Use worker thread function pointer as the guard variable.
-	 */
-	__atomic_store_n(&lcore_config[worker_id].f, f, __ATOMIC_RELEASE);
-
-	/* send message */
-	n = 0;
-	while (n == 0 || (n < 0 && errno == EINTR))
-		n = write(m2w, &c, 1);
-	if (n < 0)
-		rte_panic("cannot write on configuration pipe\n");
-
-	/* wait ack */
-	do {
-		n = read(w2m, &c, 1);
-	} while (n < 0 && errno == EINTR);
-
-	if (n <= 0)
-		rte_panic("cannot read on configuration pipe\n");
-
-	rc = 0;
-finish:
-	rte_eal_trace_thread_remote_launch(f, arg, worker_id, rc);
-	return rc;
-}
-
-/* main loop of threads */
-__rte_noreturn void *
-eal_thread_loop(void *arg)
-{
-	unsigned int lcore_id = (uintptr_t)arg;
-	char c;
-	int n, ret;
-	int m2w, w2m;
-	char cpuset[RTE_CPU_AFFINITY_STR_LEN];
-
-
-	m2w = lcore_config[lcore_id].pipe_main2worker[0];
-	w2m = lcore_config[lcore_id].pipe_worker2main[1];
-
-	__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
-
-	ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
-	RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
-		lcore_id, (uintptr_t)pthread_self(), cpuset,
-		ret == 0 ? "" : "...");
-
-	rte_eal_trace_thread_lcore_ready(lcore_id, cpuset);
-
-	/* read on our pipe to get commands */
-	while (1) {
-		lcore_function_t *f;
-		void *fct_arg;
-
-		/* wait command */
-		do {
-			n = read(m2w, &c, 1);
-		} while (n < 0 && errno == EINTR);
-
-		if (n <= 0)
-			rte_panic("cannot read on configuration pipe\n");
-
-		/* Set the state to 'RUNNING'. Use release order
-		 * since 'state' variable is used as the guard variable.
-		 */
-		__atomic_store_n(&lcore_config[lcore_id].state, RUNNING,
-					__ATOMIC_RELEASE);
-
-		/* send ack */
-		n = 0;
-		while (n == 0 || (n < 0 && errno == EINTR))
-			n = write(w2m, &c, 1);
-		if (n < 0)
-			rte_panic("cannot write on configuration pipe\n");
-
-		/* Load 'f' with acquire order to ensure that
-		 * the memory operations from the main thread
-		 * are accessed only after update to 'f' is visible.
-		 * Wait till the update to 'f' is visible to the worker.
-		 */
-		while ((f = __atomic_load_n(&lcore_config[lcore_id].f,
-			__ATOMIC_ACQUIRE)) == NULL)
-			rte_pause();
-
-		/* call the function and store the return value */
-		fct_arg = lcore_config[lcore_id].arg;
-		ret = f(fct_arg);
-		lcore_config[lcore_id].ret = ret;
-		lcore_config[lcore_id].f = NULL;
-		lcore_config[lcore_id].arg = NULL;
-
-		/* Store the state with release order to ensure that
-		 * the memory operations from the worker thread
-		 * are completed before the state is updated.
-		 * Use 'state' as the guard variable.
-		 */
-		__atomic_store_n(&lcore_config[lcore_id].state, WAIT,
-					__ATOMIC_RELEASE);
-	}
-
-	/* never reached */
-	/* pthread_exit(NULL); */
-	/* return NULL; */
-}
-
 /* require calling thread tid by gettid() */
 int rte_sys_gettid(void)
 {
diff --git a/lib/eal/unix/eal_unix_thread.c b/lib/eal/unix/eal_unix_thread.c
new file mode 100644
index 0000000000..70b5ba6b98
--- /dev/null
+++ b/lib/eal/unix/eal_unix_thread.c
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2022 Red Hat, Inc.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <rte_debug.h>
+
+#include "eal_private.h"
+
+void
+eal_thread_wake_worker(unsigned int worker_id)
+{
+	int m2w = lcore_config[worker_id].pipe_main2worker[1];
+	int w2m = lcore_config[worker_id].pipe_worker2main[0];
+	char c = 0;
+	int n;
+
+	do {
+		n = write(m2w, &c, 1);
+	} while (n == 0 || (n < 0 && errno == EINTR));
+	if (n < 0)
+		rte_panic("cannot write on configuration pipe\n");
+
+	do {
+		n = read(w2m, &c, 1);
+	} while (n < 0 && errno == EINTR);
+	if (n <= 0)
+		rte_panic("cannot read on configuration pipe\n");
+}
+
+void
+eal_thread_wait_command(void)
+{
+	unsigned int lcore_id = rte_lcore_id();
+	int m2w;
+	char c;
+	int n;
+
+	m2w = lcore_config[lcore_id].pipe_main2worker[0];
+	do {
+		n = read(m2w, &c, 1);
+	} while (n < 0 && errno == EINTR);
+	if (n <= 0)
+		rte_panic("cannot read on configuration pipe\n");
+}
+
+void
+eal_thread_ack_command(void)
+{
+	unsigned int lcore_id = rte_lcore_id();
+	char c = 0;
+	int w2m;
+	int n;
+
+	w2m = lcore_config[lcore_id].pipe_worker2main[1];
+	do {
+		n = write(w2m, &c, 1);
+	} while (n == 0 || (n < 0 && errno == EINTR));
+	if (n < 0)
+		rte_panic("cannot write on configuration pipe\n");
+}
diff --git a/lib/eal/unix/meson.build b/lib/eal/unix/meson.build
index a22ea7cabc..781505ca90 100644
--- a/lib/eal/unix/meson.build
+++ b/lib/eal/unix/meson.build
@@ -3,9 +3,10 @@
 
 sources += files(
         'eal_file.c',
+        'eal_filesystem.c',
+        'eal_firmware.c',
         'eal_unix_memory.c',
+        'eal_unix_thread.c',
         'eal_unix_timer.c',
-        'eal_firmware.c',
-        'eal_filesystem.c',
         'rte_thread.c',
 )
diff --git a/lib/eal/windows/eal_thread.c b/lib/eal/windows/eal_thread.c
index 95e96548de..f3c61b4456 100644
--- a/lib/eal/windows/eal_thread.c
+++ b/lib/eal/windows/eal_thread.c
@@ -11,124 +11,62 @@
 #include <rte_per_lcore.h>
 #include <rte_common.h>
 #include <rte_memory.h>
-#include <eal_thread.h>
 
 #include "eal_private.h"
+#include "eal_thread.h"
 #include "eal_windows.h"
 
-/*
- * Send a message to a worker lcore identified by worker_id to call a
- * function f with argument arg. Once the execution is done, the
- * remote lcore switches to WAIT state.
- */
-int
-rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int worker_id)
+void
+eal_thread_wake_worker(unsigned int worker_id)
 {
-	int n;
-	char c = 0;
 	int m2w = lcore_config[worker_id].pipe_main2worker[1];
 	int w2m = lcore_config[worker_id].pipe_worker2main[0];
+	char c = 0;
+	int n;
 
-	/* Check if the worker is in 'WAIT' state. Use acquire order
-	 * since 'state' variable is used as the guard variable.
-	 */
-	if (__atomic_load_n(&lcore_config[worker_id].state,
-					__ATOMIC_ACQUIRE) != WAIT)
-		return -EBUSY;
-
-	lcore_config[worker_id].arg = arg;
-	/* Ensure that all the memory operations are completed
-	 * before the worker thread starts running the function.
-	 * Use worker thread function as the guard variable.
-	 */
-	__atomic_store_n(&lcore_config[worker_id].f, f, __ATOMIC_RELEASE);
-
-	/* send message */
-	n = 0;
-	while (n == 0 || (n < 0 && errno == EINTR))
+	do {
 		n = _write(m2w, &c, 1);
+	} while (n == 0 || (n < 0 && errno == EINTR));
 	if (n < 0)
 		rte_panic("cannot write on configuration pipe\n");
 
-	/* wait ack */
 	do {
 		n = _read(w2m, &c, 1);
 	} while (n < 0 && errno == EINTR);
-
 	if (n <= 0)
 		rte_panic("cannot read on configuration pipe\n");
-
-	return 0;
 }
 
-/* main loop of threads */
-void *
-eal_thread_loop(void *arg)
+void
+eal_thread_wait_command(void)
 {
-	unsigned int lcore_id = (uintptr_t)arg;
+	unsigned int lcore_id = rte_lcore_id();
+	int m2w;
 	char c;
-	int n, ret;
-	int m2w, w2m;
-	char cpuset[RTE_CPU_AFFINITY_STR_LEN];
+	int n;
 
 	m2w = lcore_config[lcore_id].pipe_main2worker[0];
-	w2m = lcore_config[lcore_id].pipe_worker2main[1];
+	do {
+		n = _read(m2w, &c, 1);
+	} while (n < 0 && errno == EINTR);
+	if (n <= 0)
+		rte_panic("cannot read on configuration pipe\n");
+}
 
-	__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
-
-	RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%zx;cpuset=[%s])\n",
-		lcore_id, (uintptr_t)pthread_self(), cpuset);
-
-	/* read on our pipe to get commands */
-	while (1) {
-		lcore_function_t *f;
-		void *fct_arg;
-
-		/* wait command */
-		do {
-			n = _read(m2w, &c, 1);
-		} while (n < 0 && errno == EINTR);
-
-		if (n <= 0)
-			rte_panic("cannot read on configuration pipe\n");
-
-		/* Set the state to 'RUNNING'. Use release order
-		 * since 'state' variable is used as the guard variable.
-		 */
-		__atomic_store_n(&lcore_config[lcore_id].state, RUNNING,
-					__ATOMIC_RELEASE);
-
-		/* send ack */
-		n = 0;
-		while (n == 0 || (n < 0 && errno == EINTR))
-			n = _write(w2m, &c, 1);
-		if (n < 0)
-			rte_panic("cannot write on configuration pipe\n");
-
-		/* Load 'f' with acquire order to ensure that
-		 * the memory operations from the main thread
-		 * are accessed only after update to 'f' is visible.
-		 * Wait till the update to 'f' is visible to the worker.
-		 */
-		while ((f = __atomic_load_n(&lcore_config[lcore_id].f,
-			__ATOMIC_ACQUIRE)) == NULL)
-			rte_pause();
-
-		/* call the function and store the return value */
-		fct_arg = lcore_config[lcore_id].arg;
-		ret = f(fct_arg);
-		lcore_config[lcore_id].ret = ret;
-		lcore_config[lcore_id].f = NULL;
-		lcore_config[lcore_id].arg = NULL;
-
-		/* Store the state with release order to ensure that
-		 * the memory operations from the worker thread
-		 * are completed before the state is updated.
-		 * Use 'state' as the guard variable.
-		 */
-		__atomic_store_n(&lcore_config[lcore_id].state, WAIT,
-					__ATOMIC_RELEASE);
-	}
+void
+eal_thread_ack_command(void)
+{
+	unsigned int lcore_id = rte_lcore_id();
+	char c = 0;
+	int w2m;
+	int n;
+
+	w2m = lcore_config[lcore_id].pipe_worker2main[1];
+	do {
+		n = _write(w2m, &c, 1);
+	} while (n == 0 || (n < 0 && errno == EINTR));
+	if (n < 0)
+		rte_panic("cannot write on configuration pipe\n");
 }
 
 /* function to create threads */
-- 
2.23.0


^ permalink raw reply	[relevance 2%]

* [RFC PATCH v1 02/18] dts: merge DTS framework/dut.py to DPDK
  @ 2022-04-06 15:04  1% ` Juraj Linkeš
  0 siblings, 0 replies; 200+ results
From: Juraj Linkeš @ 2022-04-06 15:04 UTC (permalink / raw)
  To: thomas, david.marchand, Honnappa.Nagarahalli, ohilyard, lijuan.tu
  Cc: dev, Juraj Linkeš

---
 dts/framework/dut.py | 1727 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 1727 insertions(+)
 create mode 100644 dts/framework/dut.py

diff --git a/dts/framework/dut.py b/dts/framework/dut.py
new file mode 100644
index 0000000000..a2a9373448
--- /dev/null
+++ b/dts/framework/dut.py
@@ -0,0 +1,1727 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import re
+import threading
+import time
+from typing import Dict, List, Optional, Union
+from uuid import uuid4
+
+import framework.settings as settings
+from nics.net_device import GetNicObj
+
+from .config import AppNameConf, PortConf
+from .crb import Crb
+from .exception import ParameterInvalidException
+from .settings import LOG_NAME_SEP, NICS
+from .ssh_connection import SSHConnection
+from .test_result import ResultTable
+from .utils import RED, remove_old_rsa_key
+from .virt_resource import VirtResource
+
+
+class Dut(Crb):
+
+    """
+    A connection to the CRB under test.
+    This class sends commands to the CRB and validates the responses. It is
+    implemented using either ssh for linuxapp or the terminal server for
+    baremetal.
+    All operations are in fact delegated to an instance of either CRBLinuxApp
+    or CRBBareMetal.
+    """
+
+    PORT_MAP_CACHE_KEY = "dut_port_map"
+    PORT_INFO_CACHE_KEY = "dut_port_info"
+    NUMBER_CORES_CACHE_KEY = "dut_number_cores"
+    CORE_LIST_CACHE_KEY = "dut_core_list"
+    PCI_DEV_CACHE_KEY = "dut_pci_dev_info"
+
+    def __init__(self, crb, serializer, dut_id=0, name=None, alt_session=True):
+        if not name:
+            name = "dut" + LOG_NAME_SEP + "%s" % crb["My IP"]
+            self.NAME = name
+        super(Dut, self).__init__(crb, serializer, dut_id, name, alt_session)
+        self.host_init_flag = False
+        self.number_of_cores = 0
+        self.tester = None
+        self.cores = []
+        self.architecture = None
+        self.conf = PortConf()
+        self.ports_map = []
+        self.virt_pool = None
+        # hypervisor pid list, used for cleanup
+        self.virt_pids = []
+        self.prefix_subfix = (
+            str(os.getpid()) + "_" + time.strftime("%Y%m%d%H%M%S", time.localtime())
+        )
+        self.hugepage_path = None
+        self.apps_name_conf = {}
+        self.apps_name = {}
+        self.dpdk_version = ""
+        self.nic = None
+
+    def filter_cores_from_crb_cfg(self):
+        # get core list from crbs.cfg
+        core_list = []
+        all_core_list = [str(core["core"]) for core in self.cores]
+        core_list_str = self.crb["dut_cores"]
+        if core_list_str == "":
+            core_list = all_core_list
+        split_by_comma = core_list_str.split(",")
+        range_cores = []
+        for item in split_by_comma:
+            if "-" in item:
+                tmp = item.split("-")
+                range_cores.extend(
+                    [str(i) for i in range(int(tmp[0]), int(tmp[1]) + 1)]
+                )
+            else:
+                core_list.append(item)
+        core_list.extend(range_cores)
+
+        abnormal_core_list = []
+        for core in core_list:
+            if core not in all_core_list:
+                abnormal_core_list.append(core)
+
+        if abnormal_core_list:
+            self.logger.info(
+                "those %s cores are out of range system, all core list of system are %s"
+                % (abnormal_core_list, all_core_list)
+            )
+            raise Exception("configured cores out of range system")
+
+        core_list = [core for core in self.cores if str(core["core"]) in core_list]
+        self.cores = core_list
+        self.number_of_cores = len(self.cores)
+
+    def create_eal_parameters(
+        self,
+        fixed_prefix: bool = False,
+        socket: Optional[int] = None,
+        cores: Union[str, List[int], List[str]] = "default",
+        ports: Union[List[str], List[int]] = None,
+        port_options: Dict[Union[str, int], str] = None,
+        prefix: str = "",
+        no_pci: bool = False,
+        b_ports: Union[List[str], List[int]] = None,
+        vdevs: List[str] = None,
+        other_eal_param: str = "",
+    ) -> str:
+        """
+        generate eal parameters character string;
+        :param fixed_prefix: use fixed file-prefix or not, when it is true,
+                             the file-prefix will not be added a timestamp
+        :param socket: the physical CPU socket index, -1 means no care cpu socket;
+        :param cores: set the core info, eg:
+                        cores=[0,1,2,3],
+                        cores=['0', '1', '2', '3'],
+                        cores='default',
+                        cores='1S/4C/1T',
+                        cores='all';
+        :param ports: set PCI allow list, eg:
+                        ports=['0000:1a:00.0', '0000:1a:00.1'],
+                        ports=[0, 1];
+        :param port_options: set options of port, eg:
+                        port_options={'0000:1a:00.0': "proto_xtr=vlan"},
+                        port_options={0: "cap=dcf"};
+        :param prefix: set file prefix string, eg:
+                        prefix='vf';
+        :param no_pci: switch of disable PCI bus eg:
+                        no_pci=True;
+        :param b_ports: skip probing a PCI device to prevent EAL from using it, eg:
+                        b_ports=['0000:1a:00.0'],
+                        b_ports=[0];
+        :param vdevs: virtual device list, eg:
+                        vdevs=['net_ring0', 'net_ring1'];
+        :param other_eal_param: user defined DPDK eal parameters, eg:
+                        other_eal_param='--single-file-segments';
+        :return: eal param string, eg:
+                '-c 0xf -a 0000:88:00.0 --file-prefix=dpdk_1112_20190809143420';
+        if DPDK version < 20.11-rc4, eal_str eg:
+                '-c 0xf -w 0000:88:00.0 --file-prefix=dpdk_1112_20190809143420';
+        """
+        if ports is None:
+            ports = []
+
+        if port_options is None:
+            port_options = {}
+
+        if b_ports is None:
+            b_ports = []
+
+        if vdevs is None:
+            vdevs = []
+
+        if socket is None:
+            socket = -1
+
+        config = {
+            "cores": cores,
+            "ports": ports,
+            "port_options": port_options,
+            "prefix": prefix,
+            "no_pci": no_pci,
+            "b_ports": b_ports,
+            "vdevs": vdevs,
+            "other_eal_param": other_eal_param,
+        }
+
+        eal_parameter_creator = _EalParameter(
+            dut=self, fixed_prefix=fixed_prefix, socket=socket, **config
+        )
+        eal_str = eal_parameter_creator.make_eal_param()
+
+        return eal_str
+
+    def get_eal_of_prefix(self, prefix=None):
+
+        if prefix:
+            file_prefix = [
+                prefix_name for prefix_name in self.prefix_list if prefix in prefix_name
+            ]
+        else:
+            file_prefix = "dpdk" + "_" + self.prefix_subfix
+
+        return file_prefix
+
+    def init_host_session(self, vm_name):
+        """
+        Create session for each VM, session will be handled by VM instance
+        """
+        self.host_session = SSHConnection(
+            self.get_ip_address(),
+            vm_name + "_host",
+            self.get_username(),
+            self.get_password(),
+        )
+        self.host_session.init_log(self.logger)
+        self.logger.info(
+            "[%s] create new session for VM" % (threading.current_thread().name)
+        )
+
+    def new_session(self, suite=""):
+        """
+        Create new session for dut instance. Session name will be unique.
+        """
+        if len(suite):
+            session_name = self.NAME + "_" + suite
+        else:
+            session_name = self.NAME + "_" + str(uuid4())
+        session = self.create_session(name=session_name)
+        if suite != "":
+            session.logger.config_suite(suite, self.NAME)
+        else:
+            session.logger.config_execution(self.NAME)
+
+        if getattr(self, "base_dir", None):
+            session.send_expect("cd %s" % self.base_dir, "# ")
+
+        return session
+
+    def close_session(self, session):
+        """
+        close new session in dut instance
+        """
+        self.destroy_session(session)
+
+    def change_config_option(self, target, parameter, value):
+        """
+        This function change option in the config file
+        """
+        self.send_expect(
+            "sed -i 's/%s=.*$/%s=%s/'  config/defconfig_%s"
+            % (parameter, parameter, value, target),
+            "# ",
+        )
+
+    def set_nic_type(self, nic_type):
+        """
+        Set CRB NICS ready to validated.
+        """
+        self.nic_type = nic_type
+        if "cfg" in nic_type:
+            self.conf.load_ports_config(self.get_ip_address())
+
+    def set_toolchain(self, target):
+        """
+        This looks at the current target and instantiates an attribute to
+        be either a CRBLinuxApp or CRBBareMetal object. These latter two
+        classes are private and should not be used directly by client code.
+        """
+        self.kill_all()
+        self.target = target
+        [arch, _, _, toolchain] = target.split("-")
+
+        if toolchain == "icc":
+            icc_vars = os.getenv("ICC_VARS", "/opt/intel/composer_xe_2013/bin/")
+            icc_vars += "compilervars.sh"
+
+            if arch == "x86_64":
+                icc_arch = "intel64"
+            elif arch == "i686":
+                icc_arch = "ia32"
+            self.send_expect("source " + icc_vars + " " + icc_arch, "# ")
+
+        self.architecture = arch
+
+    def mount_procfs(self):
+        """
+        Mount proc file system.
+        """
+        mount_procfs = getattr(self, "mount_procfs_%s" % self.get_os_type())
+        mount_procfs()
+
+    def mount_procfs_linux(self):
+        pass
+
+    def mount_procfs_freebsd(self):
+        """
+        Mount proc file system in Freebsd.
+        """
+        self.send_expect("mount -t procfs proc /proc", "# ")
+
+    def get_ip_address(self):
+        """
+        Get DUT's ip address.
+        """
+        return self.crb["IP"]
+
+    def get_password(self):
+        """
+        Get DUT's login password.
+        """
+        return self.crb["pass"]
+
+    def get_username(self):
+        """
+        Get DUT's login username.
+        """
+        return self.crb["user"]
+
+    def dut_prerequisites(self):
+        """
+        Prerequest function should be called before execute any test case.
+        Will call function to scan all lcore's information which on DUT.
+        Then call pci scan function to collect nic device information.
+        At last setup DUT' environment for validation.
+        """
+        out = self.send_expect("cd %s" % self.base_dir, "# ")
+        assert "No such file or directory" not in out, "Can't switch to dpdk folder!!!"
+        out = self.send_expect("cat VERSION", "# ")
+        if "No such file or directory" in out:
+            self.logger.error("Can't get DPDK version due to VERSION not exist!!!")
+        else:
+            self.dpdk_version = out
+        self.send_expect("alias ls='ls --color=none'", "#")
+
+        if self.get_os_type() == "freebsd":
+            self.send_expect("alias make=gmake", "# ")
+            self.send_expect("alias sed=gsed", "# ")
+
+        self.init_core_list()
+        self.filter_cores_from_crb_cfg()
+        self.pci_devices_information()
+        # make sure ipv6 enable before scan
+        self.enable_tester_ipv6()
+        # scan ports before restore interface
+        self.scan_ports()
+        # restore dut ports to kernel
+        self.restore_interfaces()
+        # rescan ports after interface up
+        self.rescan_ports()
+        # load port information from config file
+        self.load_portconf()
+        self.mount_procfs()
+        # auto detect network topology
+        self.map_available_ports()
+        # disable tester port ipv6
+        self.disable_tester_ipv6()
+        self.get_nic_configurations()
+
+        # print latest ports_info
+        for port_info in self.ports_info:
+            self.logger.info(port_info)
+
+        if self.ports_map is None or len(self.ports_map) == 0:
+            self.logger.warning("ports_map should not be empty, please check all links")
+
+        # initialize virtualization resource pool
+        self.virt_pool = VirtResource(self)
+
+        # load app name conf
+        name_cfg = AppNameConf()
+        self.apps_name_conf = name_cfg.load_app_name_conf()
+
+    def get_nic_configurations(self):
+        retry_times = 3
+        if self.ports_info:
+            self.nic = self.ports_info[0]["port"]
+            self.nic.get_driver_firmware()
+            if self.nic.default_driver == "ice":
+                self.get_nic_pkg(retry_times)
+
+    def get_nic_pkg(self, retry_times=3):
+        self.nic.pkg = self.nic.get_nic_pkg()
+        while not self.nic.pkg.get("type") and retry_times > 0:
+            self.restore_interfaces()
+            self.nic.pkg = self.nic.get_nic_pkg()
+            retry_times = retry_times - 1
+        self.logger.info("pkg: {}".format(self.nic.pkg))
+        if not self.nic.pkg:
+            raise Exception("Get nic pkg failed")
+
+    def restore_interfaces(self):
+        """
+        Restore all ports's interfaces.
+        """
+        # no need to restore for all info has been recorded
+        if self.read_cache:
+            return
+
+        restore_interfaces = getattr(self, "restore_interfaces_%s" % self.get_os_type())
+        return restore_interfaces()
+
+    def restore_interfaces_freebsd(self):
+        """
+        Restore FreeBSD interfaces.
+        """
+        self.send_expect("kldunload nic_uio.ko", "#")
+        self.send_expect("kldunload contigmem.ko", "#")
+        self.send_expect("kldload if_ixgbe.ko", "#", 20)
+
+    def stop_ports(self):
+        """
+        After all execution done, the nic should be stop
+        """
+        for (pci_bus, pci_id) in self.pci_devices_info:
+            driver = settings.get_nic_driver(pci_id)
+            if driver is not None:
+                # unbind device driver
+                addr_array = pci_bus.split(":")
+                domain_id = addr_array[0]
+                bus_id = addr_array[1]
+                devfun_id = addr_array[2]
+                port = GetNicObj(self, domain_id, bus_id, devfun_id)
+                port.stop()
+
+    def restore_interfaces_linux(self):
+        """
+        Restore Linux interfaces.
+        """
+        for port in self.ports_info:
+            pci_bus = port["pci"]
+            pci_id = port["type"]
+            # get device driver
+            driver = settings.get_nic_driver(pci_id)
+            if driver is not None:
+                # unbind device driver
+                addr_array = pci_bus.split(":")
+                domain_id = addr_array[0]
+                bus_id = addr_array[1]
+                devfun_id = addr_array[2]
+
+                port = GetNicObj(self, domain_id, bus_id, devfun_id)
+
+                self.send_expect(
+                    "echo %s > /sys/bus/pci/devices/%s\:%s\:%s/driver/unbind"
+                    % (pci_bus, domain_id, bus_id, devfun_id),
+                    "# ",
+                    timeout=30,
+                )
+                # bind to linux kernel driver
+                self.send_expect("modprobe %s" % driver, "# ")
+                self.send_expect(
+                    "echo %s > /sys/bus/pci/drivers/%s/bind" % (pci_bus, driver), "# "
+                )
+                pull_retries = 5
+                itf = "N/A"
+                while pull_retries > 0:
+                    itf = port.get_interface_name()
+                    if not itf or itf == "N/A":
+                        time.sleep(1)
+                        pull_retries -= 1
+                    else:
+                        break
+                else:
+                    # try to bind nic with iavf
+                    if driver == "iavf":
+                        self.send_expect("modprobe %s" % driver, "# ")
+                        self.send_expect(
+                            "echo %s > /sys/bus/pci/drivers/%s/bind"
+                            % (pci_bus, driver),
+                            "# ",
+                        )
+                        pull_retries = 5
+                        itf = "N/A"
+                        while pull_retries > 0:
+                            itf = port.get_interface_name()
+                            if not itf or itf == "N/A":
+                                time.sleep(1)
+                                pull_retries -= 1
+                            else:
+                                break
+                if itf == "N/A":
+                    self.logger.warning("Fail to bind the device with the linux driver")
+                else:
+                    self.send_expect("ifconfig %s up" % itf, "# ")
+            else:
+                self.logger.info(
+                    "NOT FOUND DRIVER FOR PORT (%s|%s)!!!" % (pci_bus, pci_id)
+                )
+
+    def setup_memory(self, hugepages=-1):
+        """
+        Setup hugepage on DUT.
+        """
+        try:
+            function_name = "setup_memory_%s" % self.get_os_type()
+            setup_memory = getattr(self, function_name)
+            setup_memory(hugepages)
+        except AttributeError:
+            self.logger.error("%s is not implemented" % function_name)
+
+    def get_def_rte_config(self, config):
+        """
+        Get RTE configuration from config/defconfig_*.
+        """
+        out = self.send_expect(
+            "cat config/defconfig_%s | sed '/^#/d' | sed '/^\s*$/d'" % self.target, "# "
+        )
+
+        def_rte_config = re.findall(config + "=(\S+)", out)
+        if def_rte_config:
+            return def_rte_config[0]
+        else:
+            return None
+
+    def setup_memory_linux(self, hugepages=-1):
+        """
+        Setup Linux hugepages.
+        """
+        if self.virttype == "XEN":
+            return
+        hugepages_size = self.send_expect(
+            "awk '/Hugepagesize/ {print $2}' /proc/meminfo", "# "
+        )
+        total_huge_pages = self.get_total_huge_pages()
+        numa_nodes = self.send_expect("ls /sys/devices/system/node | grep node*", "# ")
+        if not numa_nodes:
+            total_numa_nodes = -1
+        else:
+            numa_nodes = numa_nodes.splitlines()
+            total_numa_nodes = len(numa_nodes)
+            self.logger.info(numa_nodes)
+
+        force_socket = False
+
+        if int(hugepages_size) < (1024 * 1024):
+            if self.architecture == "x86_64":
+                arch_huge_pages = hugepages if hugepages > 0 else 4096
+            elif self.architecture == "i686":
+                arch_huge_pages = hugepages if hugepages > 0 else 512
+                force_socket = True
+            # set huge pagesize for x86_x32 abi target
+            elif self.architecture == "x86_x32":
+                arch_huge_pages = hugepages if hugepages > 0 else 256
+                force_socket = True
+            elif self.architecture == "ppc_64":
+                arch_huge_pages = hugepages if hugepages > 0 else 512
+            elif self.architecture == "arm64":
+                if int(hugepages_size) >= (512 * 1024):
+                    arch_huge_pages = hugepages if hugepages > 0 else 8
+                else:
+                    arch_huge_pages = hugepages if hugepages > 0 else 2048
+
+            if total_huge_pages != arch_huge_pages:
+                if total_numa_nodes == -1:
+                    self.set_huge_pages(arch_huge_pages)
+                else:
+                    # before all hugepage average distribution  by all socket,
+                    # but sometimes create mbuf pool on socket 0 failed when
+                    # setup testpmd, so set all huge page on first socket
+                    if force_socket:
+                        self.set_huge_pages(arch_huge_pages, numa_nodes[0])
+                        self.logger.info("force_socket on %s" % numa_nodes[0])
+                    else:
+                        numa_service_num = self.get_def_rte_config(
+                            "CONFIG_RTE_MAX_NUMA_NODES"
+                        )
+                        if numa_service_num is not None:
+                            total_numa_nodes = min(
+                                total_numa_nodes, int(numa_service_num)
+                            )
+
+                        # set huge pages to configured total_numa_nodes
+                        for numa_node in numa_nodes[:total_numa_nodes]:
+                            self.set_huge_pages(arch_huge_pages, numa_node)
+
+        self.mount_huge_pages()
+        self.hugepage_path = self.strip_hugepage_path()
+
+    def setup_memory_freebsd(self, hugepages=-1):
+        """
+        Setup Freebsd hugepages.
+        """
+        if hugepages == -1:
+            hugepages = 4096
+
+        num_buffers = hugepages / 1024
+        if num_buffers:
+            self.send_expect("kenv hw.contigmem.num_buffers=%d" % num_buffers, "#")
+
+        self.send_expect("kldunload contigmem.ko", "#")
+        self.send_expect("kldload ./%s/kmod/contigmem.ko" % self.target, "#")
+
+    def taskset(self, core):
+        if self.get_os_type() != "linux":
+            return ""
+
+        return "taskset %s " % core
+
+    def is_ssh_session_port(self, pci_bus):
+        """
+        Check if the pci device is the dut SSH session port.
+        """
+        port = None
+        for port_info in self.ports_info:
+            if pci_bus == port_info["pci"]:
+                port = port_info["port"]
+                break
+        if port and port.get_ipv4_addr() == self.get_ip_address().strip():
+            return True
+        else:
+            return False
+
+    def get_dpdk_bind_script(self):
+        op = self.send_expect("ls", "#")
+        if "usertools" in op:
+            res = "usertools/dpdk-devbind.py"
+        else:
+            op = self.send_expect("ls tools", "#")
+            if "dpdk_nic_bind.py" in op:
+                res = "tools/dpdk_nic_bind.py"
+            else:
+                res = "tools/dpdk-devbind.py"
+        return res
+
+    def bind_interfaces_linux(self, driver="igb_uio", nics_to_bind=None):
+        """
+        Bind the interfaces to the selected driver. nics_to_bind can be None
+        to bind all interfaces or an array with the port indexes
+        """
+
+        binding_list = "--bind=%s " % driver
+
+        current_nic = 0
+        for (pci_bus, pci_id) in self.pci_devices_info:
+            if settings.accepted_nic(pci_id):
+                if self.is_ssh_session_port(pci_bus):
+                    continue
+
+                if nics_to_bind is None or current_nic in nics_to_bind:
+                    binding_list += "%s " % (pci_bus)
+
+                current_nic += 1
+        if current_nic == 0:
+            self.logger.info("Not nic need bind driver: %s" % driver)
+            return
+        bind_script_path = self.get_dpdk_bind_script()
+        self.send_expect("%s --force %s" % (bind_script_path, binding_list), "# ")
+
+    def unbind_interfaces_linux(self, nics_to_bind=None):
+        """
+        Unbind the interfaces.
+        """
+
+        binding_list = "-u "
+
+        current_nic = 0
+        for (pci_bus, pci_id) in self.pci_devices_info:
+            if settings.accepted_nic(pci_id):
+                if self.is_ssh_session_port(pci_bus):
+                    continue
+
+                if nics_to_bind is None or current_nic in nics_to_bind:
+                    binding_list += "%s " % (pci_bus)
+
+                current_nic += 1
+
+        if current_nic == 0:
+            self.logger.info("Not nic need unbind driver")
+            return
+
+        bind_script_path = self.get_dpdk_bind_script()
+        self.send_expect("%s --force %s" % (bind_script_path, binding_list), "# ")
+
+    def bind_eventdev_port(self, driver="vfio-pci", port_to_bind=None):
+        """
+        Bind the eventdev interfaces to the selected driver. port_to_bind set to default, can be
+        changed at run time
+        """
+
+        binding_list = "--bind=%s %s" % (driver, port_to_bind)
+        bind_script_path = self.get_dpdk_bind_script()
+        self.send_expect("%s --force %s" % (bind_script_path, binding_list), "# ")
+
+    def set_eventdev_port_limits(self, device_id, port):
+        """
+        Setting the eventdev port SSO and SS0W limits.
+        """
+
+        bind_script_path = self.get_dpdk_bind_script()
+        eventdev_ports = self.send_expect(
+            '%s -s |grep -e %s | cut -d " " -f1' % (bind_script_path, device_id), "#"
+        )
+        eventdev_ports = eventdev_ports.split("\r\n")
+        for eventdev_port in eventdev_ports:
+            self.send_expect(
+                "echo 0 >  /sys/bus/pci/devices/%s/limits/sso" % (eventdev_port), "#"
+            )
+            self.send_expect(
+                "echo 0 >  /sys/bus/pci/devices/%s/limits/ssow" % (eventdev_port), "#"
+            )
+        for eventdev_port in eventdev_ports:
+            if eventdev_port == port:
+                self.send_expect(
+                    "echo 1 >  /sys/bus/pci/devices/%s/limits/tim" % (eventdev_port),
+                    "#",
+                )
+                self.send_expect(
+                    "echo 1 >  /sys/bus/pci/devices/%s/limits/npa" % (eventdev_port),
+                    "#",
+                )
+                self.send_expect(
+                    "echo 10 >  /sys/bus/pci/devices/%s/limits/sso" % (eventdev_port),
+                    "#",
+                )
+                self.send_expect(
+                    "echo 32 >  /sys/bus/pci/devices/%s/limits/ssow" % (eventdev_port),
+                    "#",
+                )
+
+    def unbind_eventdev_port(self, port_to_unbind=None):
+        """
+        Unbind the eventdev interfaces to the selected driver. port_to_unbind set to None, can be
+        changed at run time
+        """
+
+        binding_list = "-u  %s" % (port_to_unbind)
+        bind_script_path = self.get_dpdk_bind_script()
+        self.send_expect("%s  %s" % (bind_script_path, binding_list), "# ")
+
+    def get_ports(self, nic_type="any", perf=None, socket=None):
+        """
+        Return DUT port list with the filter of NIC type, whether run IXIA
+        performance test, whether request specified socket.
+        """
+        ports = []
+        candidates = []
+
+        nictypes = []
+        if nic_type == "any":
+            for portid in range(len(self.ports_info)):
+                ports.append(portid)
+            return ports
+        elif nic_type == "cfg":
+            for portid in range(len(self.ports_info)):
+                if self.ports_info[portid]["source"] == "cfg":
+                    if (
+                        socket is None
+                        or self.ports_info[portid]["numa"] == -1
+                        or socket == self.ports_info[portid]["numa"]
+                    ):
+                        ports.append(portid)
+            return ports
+        else:
+            for portid in range(len(self.ports_info)):
+                port_info = self.ports_info[portid]
+                # match nic type
+                if port_info["type"] == NICS[nic_type]:
+                    # match numa or none numa awareness
+                    if (
+                        socket is None
+                        or port_info["numa"] == -1
+                        or socket == port_info["numa"]
+                    ):
+                        # port has link,
+                        if self.tester.get_local_port(portid) != -1:
+                            ports.append(portid)
+            return ports
+
+    def get_ports_performance(
+        self,
+        nic_type="any",
+        perf=None,
+        socket=None,
+        force_same_socket=True,
+        force_different_nic=True,
+    ):
+        """
+        Return the maximum available number of ports meeting the parameters.
+        Focuses on getting ports with same/different NUMA node and/or
+        same/different NIC.
+        """
+
+        available_ports = self.get_ports(nic_type, perf, socket)
+        accepted_sets = []
+
+        while len(available_ports) > 0:
+            accepted_ports = []
+            # first available port is the reference port
+            accepted_ports.append(available_ports[0])
+
+            # check from second port according to parameter
+            for port in available_ports[1:]:
+
+                if force_same_socket and socket is None:
+                    if (
+                        self.ports_info[port]["numa"]
+                        != self.ports_info[accepted_ports[0]]["numa"]
+                    ):
+                        continue
+                if force_different_nic:
+                    if (
+                        self.ports_info[port]["pci"][:-1]
+                        == self.ports_info[accepted_ports[0]]["pci"][:-1]
+                    ):
+                        continue
+
+                accepted_ports.append(port)
+
+            for port in accepted_ports:
+                available_ports.remove(port)
+
+            accepted_sets.append(accepted_ports)
+
+        biggest_set = max(accepted_sets, key=lambda s: len(s))
+
+        return biggest_set
+
+    def get_peer_pci(self, port_num):
+        """
+        return the peer pci address of dut port
+        """
+        if "peer" not in self.ports_info[port_num]:
+            return None
+        else:
+            return self.ports_info[port_num]["peer"]
+
+    def get_mac_address(self, port_num):
+        """
+        return the port mac on dut
+        """
+        return self.ports_info[port_num]["mac"]
+
+    def get_ipv6_address(self, port_num):
+        """
+        return the IPv6 address on dut
+        """
+        return self.ports_info[port_num]["ipv6"]
+
+    def get_numa_id(self, port_num):
+        """
+        return the Numa Id of port
+        """
+        if self.ports_info[port_num]["numa"] == -1:
+            self.logger.warning("NUMA not supported")
+
+        return self.ports_info[port_num]["numa"]
+
+    def lcore_table_print(self, horizontal=False):
+        if not horizontal:
+            result_table = ResultTable(["Socket", "Core", "Thread"])
+
+            for lcore in self.cores:
+                result_table.add_row([lcore["socket"], lcore["core"], lcore["thread"]])
+            result_table.table_print()
+        else:
+            result_table = ResultTable(["X"] + [""] * len(self.cores))
+            result_table.add_row(["Thread"] + [n["thread"] for n in self.cores])
+            result_table.add_row(["Core"] + [n["core"] for n in self.cores])
+            result_table.add_row(["Socket"] + [n["socket"] for n in self.cores])
+            result_table.table_print()
+
+    def get_memory_channels(self):
+        n = self.crb["memory channels"]
+        if n is not None and n > 0:
+            return n
+        else:
+            return 1
+
+    def check_ports_available(self, pci_bus, pci_id):
+        """
+        Check that whether auto scanned ports ready to use
+        """
+        pci_addr = "%s:%s" % (pci_bus, pci_id)
+        if self.nic_type == "any":
+            return True
+        elif self.nic_type == "cfg":
+            if self.conf.check_port_available(pci_bus) is True:
+                return True
+        elif self.nic_type not in list(NICS.keys()):
+            self.logger.warning("NOT SUPPORTED NIC TYPE: %s" % self.nic_type)
+        else:
+            codename = NICS[self.nic_type]
+            if pci_id == codename:
+                return True
+
+        return False
+
+    def rescan_ports(self):
+        """
+        Rescan ports information
+        """
+        if self.read_cache:
+            return
+
+        if self.ports_info:
+            self.rescan_ports_uncached()
+            self.save_serializer_ports()
+
+    def rescan_ports_uncached(self):
+        """
+        rescan ports and update port's mac address, intf, ipv6 address.
+        """
+        rescan_ports_uncached = getattr(
+            self, "rescan_ports_uncached_%s" % self.get_os_type()
+        )
+        return rescan_ports_uncached()
+
+    def rescan_ports_uncached_linux(self):
+        unknow_interface = RED("Skipped: unknow_interface")
+
+        for port_info in self.ports_info:
+            port = port_info["port"]
+            intf = port.get_interface_name()
+            port_info["intf"] = intf
+            out = self.send_expect("ip link show %s" % intf, "# ")
+            if "DOWN" in out:
+                self.send_expect("ip link set %s up" % intf, "# ")
+                time.sleep(5)
+            port_info["mac"] = port.get_mac_addr()
+            out = self.send_expect(
+                "ip -family inet6 address show dev %s | awk '/inet6/ { print $2 }'"
+                % intf,
+                "# ",
+            )
+            ipv6 = out.split("/")[0]
+            # Unconnected ports don't have IPv6
+            if ":" not in ipv6:
+                ipv6 = "Not connected"
+
+            out = self.send_expect(
+                "ip -family inet address show dev %s | awk '/inet/ { print $2 }'"
+                % intf,
+                "# ",
+            )
+            ipv4 = out.split("/")[0]
+
+            port_info["ipv6"] = ipv6
+            port_info["ipv4"] = ipv4
+
+    def rescan_ports_uncached_freebsd(self):
+        unknow_interface = RED("Skipped: unknow_interface")
+
+        for port_info in self.ports_info:
+            port = port_info["port"]
+            intf = port.get_interface_name()
+            if "No such file" in intf:
+                self.logger.info("DUT: [%s] %s" % (port_info["pci"], unknow_interface))
+                continue
+            self.send_expect("ifconfig %s up" % intf, "# ")
+            time.sleep(5)
+            macaddr = port.get_mac_addr()
+            ipv6 = port.get_ipv6_addr()
+            # Unconnected ports don't have IPv6
+            if ipv6 is None:
+                ipv6 = "Not connected"
+
+            port_info["mac"] = macaddr
+            port_info["intf"] = intf
+            port_info["ipv6"] = ipv6
+
+    def load_serializer_ports(self):
+        cached_ports_info = self.serializer.load(self.PORT_INFO_CACHE_KEY)
+        if cached_ports_info is None:
+            return None
+
+        self.ports_info = cached_ports_info
+
+    def save_serializer_ports(self):
+        cached_ports_info = []
+        for port in self.ports_info:
+            port_info = {}
+            for key in list(port.keys()):
+                if type(port[key]) is str:
+                    port_info[key] = port[key]
+            cached_ports_info.append(port_info)
+        self.serializer.save(self.PORT_INFO_CACHE_KEY, cached_ports_info)
+
+    def scan_ports(self):
+        """
+        Scan ports information or just read it from cache file.
+        """
+        if self.read_cache:
+            self.load_serializer_ports()
+            self.scan_ports_cached()
+
+        if not self.read_cache or self.ports_info is None:
+            self.scan_ports_uncached()
+
+    def scan_ports_cached(self):
+        """
+        Scan cached ports, instantiate tester port
+        """
+        scan_ports_cached = getattr(self, "scan_ports_cached_%s" % self.get_os_type())
+        return scan_ports_cached()
+
+    def scan_ports_cached_linux(self):
+        """
+        Scan Linux ports and instantiate tester port
+        """
+        if self.ports_info is None:
+            return
+
+        for port_info in self.ports_info:
+            addr_array = port_info["pci"].split(":")
+            domain_id = addr_array[0]
+            bus_id = addr_array[1]
+            devfun_id = addr_array[2]
+
+            port = GetNicObj(self, domain_id, bus_id, devfun_id)
+            port_info["port"] = port
+
+            self.logger.info(
+                "DUT cached: [%s %s] %s"
+                % (port_info["pci"], port_info["type"], port_info["intf"])
+            )
+
+    def scan_ports_uncached(self):
+        """
+        Scan ports and collect port's pci id, mac address, ipv6 address.
+        """
+        scan_ports_uncached = getattr(
+            self, "scan_ports_uncached_%s" % self.get_os_type()
+        )
+        return scan_ports_uncached()
+
+    def scan_ports_uncached_linux(self):
+        """
+        Scan Linux ports and collect port's pci id, mac address, ipv6 address.
+        """
+        self.ports_info = []
+
+        skipped = RED("Skipped: Unknown/not selected")
+        unknow_interface = RED("Skipped: unknow_interface")
+
+        for (pci_bus, pci_id) in self.pci_devices_info:
+            if self.check_ports_available(pci_bus, pci_id) is False:
+                self.logger.info("DUT: [%s %s] %s" % (pci_bus, pci_id, skipped))
+                continue
+
+            addr_array = pci_bus.split(":")
+            domain_id = addr_array[0]
+            bus_id = addr_array[1]
+            devfun_id = addr_array[2]
+
+            port = GetNicObj(self, domain_id, bus_id, devfun_id)
+            intf = port.get_interface_name()
+            if "No such file" in intf:
+                self.logger.info("DUT: [%s] %s" % (pci_bus, unknow_interface))
+                continue
+
+            macaddr = port.get_mac_addr()
+            if "No such file" in intf:
+                self.logger.info("DUT: [%s] %s" % (pci_bus, unknow_interface))
+                continue
+
+            numa = port.socket
+            # store the port info to port mapping
+            self.ports_info.append(
+                {
+                    "port": port,
+                    "pci": pci_bus,
+                    "type": pci_id,
+                    "numa": numa,
+                    "intf": intf,
+                    "mac": macaddr,
+                }
+            )
+
+            if not port.get_interface2_name():
+                continue
+
+            intf = port.get_interface2_name()
+            macaddr = port.get_intf2_mac_addr()
+            numa = port.socket
+            # store the port info to port mapping
+            self.ports_info.append(
+                {
+                    "port": port,
+                    "pci": pci_bus,
+                    "type": pci_id,
+                    "numa": numa,
+                    "intf": intf,
+                    "mac": macaddr,
+                }
+            )
+
+    def scan_ports_uncached_freebsd(self):
+        """
+        Scan Freebsd ports and collect port's pci id, mac address, ipv6 address.
+        """
+        self.ports_info = []
+
+        skipped = RED("Skipped: Unknown/not selected")
+
+        for (pci_bus, pci_id) in self.pci_devices_info:
+
+            if not settings.accepted_nic(pci_id):
+                self.logger.info("DUT: [%s %s] %s" % (pci_bus, pci_id, skipped))
+                continue
+            addr_array = pci_bus.split(":")
+            domain_id = addr_array[0]
+            bus_id = addr_array[1]
+            devfun_id = addr_array[2]
+            port = GetNicObj(self, domain_id, bus_id, devfun_id)
+            port.pci_id = pci_id
+            port.name = settings.get_nic_name(pci_id)
+            port.default_driver = settings.get_nic_driver(pci_id)
+            intf = port.get_interface_name()
+
+            macaddr = port.get_mac_addr()
+            ipv6 = port.get_ipv6_addr()
+
+            if ipv6 is None:
+                ipv6 = "Not available"
+
+            self.logger.warning("NUMA not available on FreeBSD")
+
+            self.logger.info("DUT: [%s %s] %s %s" % (pci_bus, pci_id, intf, ipv6))
+
+            # convert bsd format to linux format
+            pci_split = pci_bus.split(":")
+            pci_bus_id = hex(int(pci_split[0]))[2:]
+            if len(pci_split[1]) == 1:
+                pci_dev_str = "0" + pci_split[1]
+            else:
+                pci_dev_str = pci_split[1]
+
+            pci_str = "%s:%s.%s" % (pci_bus_id, pci_dev_str, pci_split[2])
+
+            # store the port info to port mapping
+            self.ports_info.append(
+                {
+                    "port": port,
+                    "pci": pci_str,
+                    "type": pci_id,
+                    "intf": intf,
+                    "mac": macaddr,
+                    "ipv6": ipv6,
+                    "numa": -1,
+                }
+            )
+
+    def setup_virtenv(self, virttype):
+        """
+        Setup current virtualization hypervisor type and remove elder VM ssh keys
+        """
+        self.virttype = virttype
+        # remove VM rsa keys from tester
+        remove_old_rsa_key(self.tester, self.crb["My IP"])
+
+    def generate_sriov_vfs_by_port(self, port_id, vf_num, driver="default"):
+        """
+        Generate SRIOV VFs with default driver it is bound now or specified driver.
+        """
+        port = self.ports_info[port_id]["port"]
+        port_driver = port.get_nic_driver()
+
+        if driver == "default":
+            if not port_driver:
+                self.logger.info(
+                    "No driver on specified port, can not generate SRIOV VF."
+                )
+                return None
+        else:
+            if port_driver != driver:
+                port.bind_driver(driver)
+        port.generate_sriov_vfs(vf_num)
+
+        # append the VF PCIs into the ports_info
+        sriov_vfs_pci = port.get_sriov_vfs_pci()
+        self.ports_info[port_id]["sriov_vfs_pci"] = sriov_vfs_pci
+
+        # instantiate the VF
+        vfs_port = []
+        for vf_pci in sriov_vfs_pci:
+            addr_array = vf_pci.split(":")
+            domain_id = addr_array[0]
+            bus_id = addr_array[1]
+            devfun_id = addr_array[2]
+            vf_port = GetNicObj(self, domain_id, bus_id, devfun_id)
+            vfs_port.append(vf_port)
+        self.ports_info[port_id]["vfs_port"] = vfs_port
+
+        pci = self.ports_info[port_id]["pci"]
+        self.virt_pool.add_vf_on_pf(pf_pci=pci, vflist=sriov_vfs_pci)
+
+    def destroy_sriov_vfs_by_port(self, port_id):
+        port = self.ports_info[port_id]["port"]
+        vflist = []
+        port_driver = port.get_nic_driver()
+        if (
+            "sriov_vfs_pci" in self.ports_info[port_id]
+            and self.ports_info[port_id]["sriov_vfs_pci"]
+        ):
+            vflist = self.ports_info[port_id]["sriov_vfs_pci"]
+        else:
+            if not port.get_sriov_vfs_pci():
+                return
+
+        if not port_driver:
+            self.logger.info("No driver on specified port, skip destroy SRIOV VF.")
+        else:
+            sriov_vfs_pci = port.destroy_sriov_vfs()
+        self.ports_info[port_id]["sriov_vfs_pci"] = []
+        self.ports_info[port_id]["vfs_port"] = []
+
+        pci = self.ports_info[port_id]["pci"]
+        self.virt_pool.del_vf_on_pf(pf_pci=pci, vflist=vflist)
+
+    def destroy_all_sriov_vfs(self):
+
+        if self.ports_info == None:
+            return
+        for port_id in range(len(self.ports_info)):
+            self.destroy_sriov_vfs_by_port(port_id)
+
+    def load_portconf(self):
+        """
+        Load port configurations for ports_info. If manually configured info
+        not same as auto scanned, still use information in configuration file.
+        """
+        for port in self.ports_info:
+            pci_bus = port["pci"]
+            ports_cfg = self.conf.get_ports_config()
+            if pci_bus in ports_cfg:
+                port_cfg = ports_cfg[pci_bus]
+                port_cfg["source"] = "cfg"
+            else:
+                port_cfg = {}
+
+            for key in ["intf", "mac", "peer", "source"]:
+                if key in port_cfg:
+                    if key in port and port_cfg[key].lower() != port[key].lower():
+                        self.logger.warning(
+                            "CONFIGURED %s NOT SAME AS SCANNED!!!" % (key.upper())
+                        )
+                    port[key] = port_cfg[key].lower()
+            if "numa" in port_cfg:
+                if port_cfg["numa"] != port["numa"]:
+                    self.logger.warning("CONFIGURED NUMA NOT SAME AS SCANNED!!!")
+                port["numa"] = port_cfg["numa"]
+
+    def map_available_ports(self):
+        """
+        Load or generate network connection mapping list.
+        """
+        if self.read_cache:
+            self.ports_map = self.serializer.load(self.PORT_MAP_CACHE_KEY)
+
+        if not self.read_cache or self.ports_map is None:
+            self.map_available_ports_uncached()
+            self.serializer.save(self.PORT_MAP_CACHE_KEY, self.ports_map)
+
+        self.logger.warning("DUT PORT MAP: " + str(self.ports_map))
+
+    def map_available_ports_uncached(self):
+        """
+        Generate network connection mapping list.
+        """
+        nrPorts = len(self.ports_info)
+        if nrPorts == 0:
+            return
+
+        remove = []
+        self.ports_map = [-1] * nrPorts
+
+        hits = [False] * len(self.tester.ports_info)
+
+        for dutPort in range(nrPorts):
+            peer = self.get_peer_pci(dutPort)
+            dutpci = self.ports_info[dutPort]["pci"]
+            if peer is not None:
+                for remotePort in range(len(self.tester.ports_info)):
+                    if self.tester.ports_info[remotePort]["type"].lower() == "trex":
+                        if (
+                            self.tester.ports_info[remotePort]["intf"].lower()
+                            == peer.lower()
+                            or self.tester.ports_info[remotePort]["pci"].lower()
+                            == peer.lower()
+                        ):
+                            hits[remotePort] = True
+                            self.ports_map[dutPort] = remotePort
+                            break
+                    elif (
+                        self.tester.ports_info[remotePort]["pci"].lower()
+                        == peer.lower()
+                    ):
+                        hits[remotePort] = True
+                        self.ports_map[dutPort] = remotePort
+                        break
+                if self.ports_map[dutPort] == -1:
+                    self.logger.error("CONFIGURED TESTER PORT CANNOT BE FOUND!!!")
+                else:
+                    continue  # skip ping6 map
+
+            for remotePort in range(len(self.tester.ports_info)):
+                if hits[remotePort]:
+                    continue
+
+                # skip ping self port
+                remotepci = self.tester.ports_info[remotePort]["pci"]
+                if (self.crb["IP"] == self.crb["tester IP"]) and (dutpci == remotepci):
+                    continue
+
+                # skip ping those not connected port
+                ipv6 = self.get_ipv6_address(dutPort)
+                if ipv6 == "Not connected":
+                    if "ipv4" in self.tester.ports_info[remotePort]:
+                        out = self.tester.send_ping(
+                            dutPort,
+                            self.tester.ports_info[remotePort]["ipv4"],
+                            self.get_mac_address(dutPort),
+                        )
+                    else:
+                        continue
+                else:
+                    if getattr(self, "send_ping6", None):
+                        out = self.send_ping6(
+                            dutPort,
+                            self.tester.ports_info[remotePort]["ipv6"],
+                            self.get_mac_address(dutPort),
+                        )
+                    else:
+                        out = self.tester.send_ping6(
+                            remotePort, ipv6, self.get_mac_address(dutPort)
+                        )
+
+                    if out and "64 bytes from" in out:
+                        self.logger.info(
+                            "PORT MAP: [dut %d: tester %d]" % (dutPort, remotePort)
+                        )
+                        self.ports_map[dutPort] = remotePort
+                        hits[remotePort] = True
+                        if self.crb["IP"] == self.crb["tester IP"]:
+                            # remove dut port act as tester port
+                            remove_port = self.get_port_info(remotepci)
+                            if remove_port is not None:
+                                remove.append(remove_port)
+                            # skip ping from those port already act as dut port
+                            testerPort = self.tester.get_local_index(dutpci)
+                            if testerPort != -1:
+                                hits[testerPort] = True
+                        break
+
+        for port in remove:
+            self.ports_info.remove(port)
+
+    def disable_tester_ipv6(self):
+        for tester_port in self.ports_map:
+            if self.tester.ports_info[tester_port]["type"].lower() not in (
+                "ixia",
+                "trex",
+            ):
+                port = self.tester.ports_info[tester_port]["port"]
+                port.disable_ipv6()
+
+    def enable_tester_ipv6(self):
+        for tester_port in range(len(self.tester.ports_info)):
+            if self.tester.ports_info[tester_port]["type"].lower() not in (
+                "ixia",
+                "trex",
+            ):
+                port = self.tester.ports_info[tester_port]["port"]
+                port.enable_ipv6()
+
+    def check_port_occupied(self, port):
+        out = self.alt_session.send_expect("lsof -i:%d" % port, "# ")
+        if out == "":
+            return False
+        else:
+            return True
+
+    def get_maximal_vnc_num(self):
+        out = self.send_expect("ps aux | grep '\-vnc' | grep -v grep", "# ")
+        if out:
+            ports = re.findall(r"-vnc .*?:(\d+)", out)
+            for num in range(len(ports)):
+                ports[num] = int(ports[num])
+                ports.sort()
+        else:
+            ports = [
+                0,
+            ]
+        return ports[-1]
+
+    def close(self):
+        """
+        Close ssh session of DUT.
+        """
+        if self.session:
+            self.session.close()
+            self.session = None
+        if self.alt_session:
+            self.alt_session.close()
+            self.alt_session = None
+        if self.host_init_flag:
+            self.host_session.close()
+
+    def virt_exit(self):
+        """
+        Stop all unstopped hypervisors process
+        """
+        # try to kill all hypervisor process
+        for pid in self.virt_pids:
+            self.send_expect("kill -s SIGTERM %d" % pid, "# ", alt_session=True)
+            time.sleep(3)
+        self.virt_pids = []
+
+    def crb_exit(self):
+        """
+        Recover all resource before crb exit
+        """
+        self.enable_tester_ipv6()
+        self.close()
+        self.logger.logger_exit()
+
+
+class _EalParameter(object):
+    def __init__(
+        self,
+        dut: Dut,
+        fixed_prefix: bool,
+        socket: int,
+        cores: Union[str, List[int], List[str]],
+        ports: Union[List[str], List[int]],
+        port_options: Dict[Union[str, int], str],
+        prefix: str,
+        no_pci: bool,
+        b_ports: Union[List[str], List[int]],
+        vdevs: List[str],
+        other_eal_param: str,
+    ):
+        """
+        generate eal parameters character string;
+        :param dut: dut device;
+        :param fixed_prefix: use fixed file-prefix or not, when it is true,
+                             the file-prefix will not be added a timestamp
+        :param socket: the physical CPU socket index, -1 means no care cpu socket;
+        :param cores: set the core info, eg:
+                        cores=[0,1,2,3],
+                        cores=['0','1','2','3'],
+                        cores='default',
+                        cores='1S/4C/1T',
+                        cores='all';
+        param ports: set PCI allow list, eg:
+                        ports=['0000:1a:00.0', '0000:1a:00.1'],
+                        ports=[0, 1];
+        param port_options: set options of port, eg:
+                        port_options={'0000:1a:00.0': "proto_xtr=vlan"},
+                        port_options={0: "cap=dcf"};
+        param prefix: set file prefix string, eg:
+                        prefix='vf';
+        param no_pci: switch of disable PCI bus eg:
+                        no_pci=True;
+        param b_ports: skip probing a PCI device to prevent EAL from using it, eg:
+                        b_ports=['0000:1a:00.0'],
+                        b_ports=[0];
+        param vdevs: virtual device list, eg:
+                        vdevs=['net_ring0', 'net_ring1'];
+        param other_eal_param: user defined DPDK eal parameters, eg:
+                        other_eal_param='--single-file-segments';
+        """
+        self.os_type = dut.get_os_type()
+        self.fixed_prefix = fixed_prefix
+        self.socket = socket
+        self.dut = dut
+        self.cores = self._validate_cores(cores)
+        self.ports = self._validate_ports(ports)
+        self.port_options: Dict = self._validate_port_options(port_options)
+        self.prefix = prefix
+        self.no_pci = no_pci
+        self.b_ports = self._validate_ports(b_ports)
+        self.vdevs = vdevs
+        self.other_eal_param = other_eal_param
+
+    _param_validate_exception_info_template = (
+        "Invalid parameter of %s about value of %s, Please reference API doc."
+    )
+
+    @staticmethod
+    def _validate_cores(cores: Union[str, List[int], List[str]]):
+        core_string_match = r"default|all|\d+S/\d+C/\d+T|$"
+        if isinstance(cores, list) and (
+            all(map(lambda _core: type(_core) == int, cores))
+            or all(map(lambda _core: type(_core) == str, cores))
+        ):
+            return cores
+        elif type(cores) == str and re.match(core_string_match, cores, re.I):
+            return cores
+        else:
+            raise ParameterInvalidException("cores", cores)
+
+    @staticmethod
+    def _validate_ports(ports: Union[List[str], List[int]]):
+        if not isinstance(ports, list):
+            raise ParameterInvalidException("ports", ports)
+        if not (
+            all(map(lambda _port: type(_port) == int, ports))
+            or all(map(lambda _port: type(_port) == str, ports))
+            and all(
+                map(
+                    lambda _port: re.match(r"^([\d\w]+:){1,2}[\d\w]+\.[\d\w]+$", _port),
+                    ports,
+                )
+            )
+        ):
+            raise ParameterInvalidException(
+                _EalParameter._param_validate_exception_info_template % ("ports", ports)
+            )
+        return ports
+
+    @staticmethod
+    def _validate_port_options(port_options: Dict[Union[str, int], str]):
+        if not isinstance(port_options, Dict):
+            raise ParameterInvalidException(
+                _EalParameter._param_validate_exception_info_template
+                % ("port_options", port_options)
+            )
+        port_list = port_options.keys()
+        _EalParameter._validate_ports(list(port_list))
+        return port_options
+
+    @staticmethod
+    def _validate_vdev(vdev: List[str]):
+        if not isinstance(vdev, list):
+            raise ParameterInvalidException(
+                _EalParameter._param_validate_exception_info_template % ("vdev", vdev)
+            )
+
+    def _make_cores_param(self) -> str:
+        is_use_default_cores = (
+            self.cores == ""
+            or isinstance(self.cores, str)
+            and self.cores.lower() == "default"
+        )
+        if is_use_default_cores:
+            default_cores = "1S/2C/1T"
+            core_list = self.dut.get_core_list(default_cores)
+        else:
+            core_list = self._get_cores()
+
+        def _get_consecutive_cores_range(_cores: List[int]):
+            _formated_core_list = []
+            _tmp_cores_list = list(sorted(map(int, _cores)))
+            _segment = _tmp_cores_list[:1]
+            for _core_num in _tmp_cores_list[1:]:
+                if _core_num - _segment[-1] == 1:
+                    _segment.append(_core_num)
+                else:
+                    _formated_core_list.append(
+                        f"{_segment[0]}-{_segment[-1]}"
+                        if len(_segment) > 1
+                        else f"{_segment[0]}"
+                    )
+                    _index = _tmp_cores_list.index(_core_num)
+                    _formated_core_list.extend(
+                        _get_consecutive_cores_range(_tmp_cores_list[_index:])
+                    )
+                    _segment.clear()
+                    break
+            if len(_segment) > 0:
+                _formated_core_list.append(
+                    f"{_segment[0]}-{_segment[-1]}"
+                    if len(_segment) > 1
+                    else f"{_segment[0]}"
+                )
+            return _formated_core_list
+
+        return f'-l {",".join(_get_consecutive_cores_range(core_list))}'
+
+    def _make_memory_channels(self) -> str:
+        param_template = "-n {}"
+        return param_template.format(self.dut.get_memory_channels())
+
+    def _make_ports_param(self) -> str:
+        no_port_config = (
+            len(self.ports) == 0 and len(self.b_ports) == 0 and not self.no_pci
+        )
+        port_config_not_in_eal_param = not (
+            "-a" in self.other_eal_param
+            or "-b" in self.other_eal_param
+            or "--no-pci" in self.other_eal_param
+        )
+        if no_port_config and port_config_not_in_eal_param:
+            return self._make_default_ports_param()
+        else:
+            return self._get_ports_and_wraped_port_with_port_options()
+
+    def _make_default_ports_param(self) -> str:
+        pci_list = []
+        allow_option = self._make_allow_option()
+        if len(self.dut.ports_info) != 0:
+            for port_info in self.dut.ports_info:
+                pci_list.append("%s %s" % (allow_option, port_info["pci"]))
+        self.dut.logger.info(pci_list)
+        return " ".join(pci_list)
+
+    def _make_b_ports_param(self) -> str:
+        b_pci_list = []
+        if len(self.b_ports) != 0:
+            for port in self.b_ports:
+                if type(port) == int:
+                    b_pci_list.append("-b %s" % self.dut.ports_info[port]["pci"])
+                else:
+                    b_pci_list = ["-b %s" % pci for pci in self.b_ports]
+        return " ".join(b_pci_list)
+
+    def _make_no_pci_param(self) -> str:
+        if self.no_pci is True:
+            return "--no-pci"
+        else:
+            return ""
+
+    def _make_prefix_param(self) -> str:
+        if self.prefix == "":
+            fixed_file_prefix = "dpdk" + "_" + self.dut.prefix_subfix
+        else:
+            fixed_file_prefix = self.prefix
+            if not self.fixed_prefix:
+                fixed_file_prefix = fixed_file_prefix + "_" + self.dut.prefix_subfix
+        fixed_file_prefix = self._do_os_handle_with_prefix_param(fixed_file_prefix)
+        return fixed_file_prefix
+
+    def _make_vdevs_param(self) -> str:
+        if len(self.vdevs) == 0:
+            return ""
+        else:
+            _vdevs = ["--vdev " + vdev for vdev in self.vdevs]
+            return " ".join(_vdevs)
+
+    def _make_share_library_path_param(self) -> str:
+        use_shared_lib = settings.load_global_setting(settings.HOST_SHARED_LIB_SETTING)
+        shared_lib_path = settings.load_global_setting(settings.HOST_SHARED_LIB_PATH)
+        if use_shared_lib == "true" and shared_lib_path and "Virt" not in str(self.dut):
+            return " -d {} ".format(shared_lib_path)
+        return ""
+
+    def _make_default_force_max_simd_bitwidth_param(self) -> str:
+        rx_mode = settings.load_global_setting(settings.DPDK_RXMODE_SETTING)
+        param_template = " --force-max-simd-bitwidth=%s "
+        bitwith_dict = {
+            "novector": "64",
+            "sse": "128",
+            "avx2": "256",
+            "avx512": "512",
+            "nolimit": "0",
+        }
+        if (
+            rx_mode in bitwith_dict
+            and "force-max-simd-bitwidth" not in self.other_eal_param
+        ):
+            return param_template % bitwith_dict.get(rx_mode)
+        else:
+            return ""
+
+    def _get_cores(self) -> List[int]:
+        if type(self.cores) == list:
+            return self.cores
+        elif isinstance(self.cores, str):
+            return self.dut.get_core_list(self.cores, socket=self.socket)
+
+    def _get_ports_and_wraped_port_with_port_options(self) -> str:
+        w_pci_list = []
+        for port in self.ports:
+            w_pci_list.append(self._add_port_options_to(port))
+        return " ".join(w_pci_list)
+
+    def _add_port_options_to(self, port: Union[str, int]) -> str:
+        allow_option = self._make_allow_option()
+        port_mac_addr = self.dut.ports_info[port]["pci"] if type(port) == int else port
+        port_param = f"{allow_option} {port_mac_addr}"
+        port_option = self._get_port_options_from_config(port)
+        if port_option:
+            port_param = f"{port_param},{port_option}"
+        return port_param
+
+    def _get_port_options_from_config(self, port: Union[str, int]) -> str:
+        if port in list(self.port_options.keys()):
+            return self.port_options[port]
+        else:
+            return ""
+
+    def _make_allow_option(self) -> str:
+        is_new_dpdk_version = (
+            self.dut.dpdk_version > "20.11.0-rc3" or self.dut.dpdk_version == "20.11.0"
+        )
+        return "-a" if is_new_dpdk_version else "-w"
+
+    def _do_os_handle_with_prefix_param(self, file_prefix: str) -> str:
+        if self.dut.get_os_type() == "freebsd":
+            self.dut.prefix_list = []
+            file_prefix = ""
+        else:
+            self.dut.prefix_list.append(file_prefix)
+            file_prefix = "--file-prefix=" + file_prefix
+        return file_prefix
+
+    def make_eal_param(self) -> str:
+        _eal_str = " ".join(
+            [
+                self._make_cores_param(),
+                self._make_memory_channels(),
+                self._make_ports_param(),
+                self._make_b_ports_param(),
+                self._make_prefix_param(),
+                self._make_no_pci_param(),
+                self._make_vdevs_param(),
+                self._make_share_library_path_param(),
+                self._make_default_force_max_simd_bitwidth_param(),
+                # append user defined eal parameters
+                self.other_eal_param,
+            ]
+        )
+        return _eal_str
-- 
2.20.1


^ permalink raw reply	[relevance 1%]

* [PATCH v2 2/3] doc: fix API index Markdown syntax
  @ 2022-04-06 17:10  6%   ` Dmitry Kozlyuk
  0 siblings, 0 replies; 200+ results
From: Dmitry Kozlyuk @ 2022-04-06 17:10 UTC (permalink / raw)
  To: dev
  Cc: Vipin Varghese, Dmitry Kozlyuk, Thomas Monjalon, Olivier Matz,
	David Marchand

API documentation index had spaces between link caption and URL,
which may be unsupported by some Markdown implementations.
That is, "[caption](URL)" is valid but "[caption] (URL)" is not.
The problematic behavior is observed with Doxygen on Windows.
Remove the spaces.
Unfortunately, Markdown syntax is not formally specified.

Fixes: 9bf486e606b0 ("doc: generate HTML for API with doxygen")

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 doc/api/doxy-api-index.md | 366 +++++++++++++++++++-------------------
 1 file changed, 183 insertions(+), 183 deletions(-)

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 4245b9635c..baecb2e52e 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -9,222 +9,222 @@ API
 The public API headers are grouped by topics:
 
 - **device**:
-  [dev]                (@ref rte_dev.h),
-  [ethdev]             (@ref rte_ethdev.h),
-  [ethctrl]            (@ref rte_eth_ctrl.h),
-  [rte_flow]           (@ref rte_flow.h),
-  [rte_tm]             (@ref rte_tm.h),
-  [rte_mtr]            (@ref rte_mtr.h),
-  [bbdev]              (@ref rte_bbdev.h),
-  [cryptodev]          (@ref rte_cryptodev.h),
-  [security]           (@ref rte_security.h),
-  [compressdev]        (@ref rte_compressdev.h),
-  [compress]           (@ref rte_comp.h),
-  [regexdev]           (@ref rte_regexdev.h),
-  [dmadev]             (@ref rte_dmadev.h),
-  [eventdev]           (@ref rte_eventdev.h),
-  [event_eth_rx_adapter]   (@ref rte_event_eth_rx_adapter.h),
-  [event_eth_tx_adapter]   (@ref rte_event_eth_tx_adapter.h),
-  [event_timer_adapter]    (@ref rte_event_timer_adapter.h),
-  [event_crypto_adapter]   (@ref rte_event_crypto_adapter.h),
-  [rawdev]             (@ref rte_rawdev.h),
-  [metrics]            (@ref rte_metrics.h),
-  [bitrate]            (@ref rte_bitrate.h),
-  [latency]            (@ref rte_latencystats.h),
-  [devargs]            (@ref rte_devargs.h),
-  [PCI]                (@ref rte_pci.h),
-  [vdev]               (@ref rte_bus_vdev.h),
-  [vfio]               (@ref rte_vfio.h)
+  [dev](@ref rte_dev.h),
+  [ethdev](@ref rte_ethdev.h),
+  [ethctrl](@ref rte_eth_ctrl.h),
+  [rte_flow](@ref rte_flow.h),
+  [rte_tm](@ref rte_tm.h),
+  [rte_mtr](@ref rte_mtr.h),
+  [bbdev](@ref rte_bbdev.h),
+  [cryptodev](@ref rte_cryptodev.h),
+  [security](@ref rte_security.h),
+  [compressdev](@ref rte_compressdev.h),
+  [compress](@ref rte_comp.h),
+  [regexdev](@ref rte_regexdev.h),
+  [dmadev](@ref rte_dmadev.h),
+  [eventdev](@ref rte_eventdev.h),
+  [event_eth_rx_adapter](@ref rte_event_eth_rx_adapter.h),
+  [event_eth_tx_adapter](@ref rte_event_eth_tx_adapter.h),
+  [event_timer_adapter](@ref rte_event_timer_adapter.h),
+  [event_crypto_adapter](@ref rte_event_crypto_adapter.h),
+  [rawdev](@ref rte_rawdev.h),
+  [metrics](@ref rte_metrics.h),
+  [bitrate](@ref rte_bitrate.h),
+  [latency](@ref rte_latencystats.h),
+  [devargs](@ref rte_devargs.h),
+  [PCI](@ref rte_pci.h),
+  [vdev](@ref rte_bus_vdev.h),
+  [vfio](@ref rte_vfio.h)
 
 - **device specific**:
-  [softnic]            (@ref rte_eth_softnic.h),
-  [bond]               (@ref rte_eth_bond.h),
-  [vhost]              (@ref rte_vhost.h),
-  [vdpa]               (@ref rte_vdpa.h),
-  [KNI]                (@ref rte_kni.h),
-  [ixgbe]              (@ref rte_pmd_ixgbe.h),
-  [i40e]               (@ref rte_pmd_i40e.h),
-  [ice]                (@ref rte_pmd_ice.h),
-  [iavf]               (@ref rte_pmd_iavf.h),
-  [ioat]               (@ref rte_ioat_rawdev.h),
-  [bnxt]               (@ref rte_pmd_bnxt.h),
-  [dpaa]               (@ref rte_pmd_dpaa.h),
-  [dpaa2]              (@ref rte_pmd_dpaa2.h),
-  [mlx5]               (@ref rte_pmd_mlx5.h),
-  [dpaa2_mempool]      (@ref rte_dpaa2_mempool.h),
-  [dpaa2_cmdif]        (@ref rte_pmd_dpaa2_cmdif.h),
-  [dpaa2_qdma]         (@ref rte_pmd_dpaa2_qdma.h),
-  [crypto_scheduler]   (@ref rte_cryptodev_scheduler.h),
-  [dlb2]               (@ref rte_pmd_dlb2.h),
-  [ifpga]              (@ref rte_pmd_ifpga.h)
+  [softnic](@ref rte_eth_softnic.h),
+  [bond](@ref rte_eth_bond.h),
+  [vhost](@ref rte_vhost.h),
+  [vdpa](@ref rte_vdpa.h),
+  [KNI](@ref rte_kni.h),
+  [ixgbe](@ref rte_pmd_ixgbe.h),
+  [i40e](@ref rte_pmd_i40e.h),
+  [ice](@ref rte_pmd_ice.h),
+  [iavf](@ref rte_pmd_iavf.h),
+  [ioat](@ref rte_ioat_rawdev.h),
+  [bnxt](@ref rte_pmd_bnxt.h),
+  [dpaa](@ref rte_pmd_dpaa.h),
+  [dpaa2](@ref rte_pmd_dpaa2.h),
+  [mlx5](@ref rte_pmd_mlx5.h),
+  [dpaa2_mempool](@ref rte_dpaa2_mempool.h),
+  [dpaa2_cmdif](@ref rte_pmd_dpaa2_cmdif.h),
+  [dpaa2_qdma](@ref rte_pmd_dpaa2_qdma.h),
+  [crypto_scheduler](@ref rte_cryptodev_scheduler.h),
+  [dlb2](@ref rte_pmd_dlb2.h),
+  [ifpga](@ref rte_pmd_ifpga.h)
 
 - **memory**:
-  [memseg]             (@ref rte_memory.h),
-  [memzone]            (@ref rte_memzone.h),
-  [mempool]            (@ref rte_mempool.h),
-  [malloc]             (@ref rte_malloc.h),
-  [memcpy]             (@ref rte_memcpy.h)
+  [memseg](@ref rte_memory.h),
+  [memzone](@ref rte_memzone.h),
+  [mempool](@ref rte_mempool.h),
+  [malloc](@ref rte_malloc.h),
+  [memcpy](@ref rte_memcpy.h)
 
 - **timers**:
-  [cycles]             (@ref rte_cycles.h),
-  [timer]              (@ref rte_timer.h),
-  [alarm]              (@ref rte_alarm.h)
+  [cycles](@ref rte_cycles.h),
+  [timer](@ref rte_timer.h),
+  [alarm](@ref rte_alarm.h)
 
 - **locks**:
-  [atomic]             (@ref rte_atomic.h),
-  [mcslock]            (@ref rte_mcslock.h),
-  [pflock]             (@ref rte_pflock.h),
-  [rwlock]             (@ref rte_rwlock.h),
-  [spinlock]           (@ref rte_spinlock.h),
-  [ticketlock]         (@ref rte_ticketlock.h),
-  [RCU]                (@ref rte_rcu_qsbr.h)
+  [atomic](@ref rte_atomic.h),
+  [mcslock](@ref rte_mcslock.h),
+  [pflock](@ref rte_pflock.h),
+  [rwlock](@ref rte_rwlock.h),
+  [spinlock](@ref rte_spinlock.h),
+  [ticketlock](@ref rte_ticketlock.h),
+  [RCU](@ref rte_rcu_qsbr.h)
 
 - **CPU arch**:
-  [branch prediction]  (@ref rte_branch_prediction.h),
-  [cache prefetch]     (@ref rte_prefetch.h),
-  [SIMD]               (@ref rte_vect.h),
-  [byte order]         (@ref rte_byteorder.h),
-  [CPU flags]          (@ref rte_cpuflags.h),
-  [CPU pause]          (@ref rte_pause.h),
-  [I/O access]         (@ref rte_io.h),
-  [power management]   (@ref rte_power_intrinsics.h)
+  [branch prediction](@ref rte_branch_prediction.h),
+  [cache prefetch](@ref rte_prefetch.h),
+  [SIMD](@ref rte_vect.h),
+  [byte order](@ref rte_byteorder.h),
+  [CPU flags](@ref rte_cpuflags.h),
+  [CPU pause](@ref rte_pause.h),
+  [I/O access](@ref rte_io.h),
+  [power management](@ref rte_power_intrinsics.h)
 
 - **CPU multicore**:
-  [interrupts]         (@ref rte_interrupts.h),
-  [launch]             (@ref rte_launch.h),
-  [lcore]              (@ref rte_lcore.h),
-  [per-lcore]          (@ref rte_per_lcore.h),
-  [service cores]      (@ref rte_service.h),
-  [keepalive]          (@ref rte_keepalive.h),
-  [power/freq]         (@ref rte_power.h),
-  [PMD power]          (@ref rte_power_pmd_mgmt.h)
+  [interrupts](@ref rte_interrupts.h),
+  [launch](@ref rte_launch.h),
+  [lcore](@ref rte_lcore.h),
+  [per-lcore](@ref rte_per_lcore.h),
+  [service cores](@ref rte_service.h),
+  [keepalive](@ref rte_keepalive.h),
+  [power/freq](@ref rte_power.h),
+  [PMD power](@ref rte_power_pmd_mgmt.h)
 
 - **layers**:
-  [ethernet]           (@ref rte_ether.h),
-  [ARP]                (@ref rte_arp.h),
-  [HIGIG]              (@ref rte_higig.h),
-  [ICMP]               (@ref rte_icmp.h),
-  [ESP]                (@ref rte_esp.h),
-  [IPsec]              (@ref rte_ipsec.h),
-  [IPsec group]        (@ref rte_ipsec_group.h),
-  [IPsec SA]           (@ref rte_ipsec_sa.h),
-  [IPsec SAD]          (@ref rte_ipsec_sad.h),
-  [IP]                 (@ref rte_ip.h),
-  [frag/reass]         (@ref rte_ip_frag.h),
-  [SCTP]               (@ref rte_sctp.h),
-  [TCP]                (@ref rte_tcp.h),
-  [UDP]                (@ref rte_udp.h),
-  [GTP]                (@ref rte_gtp.h),
-  [GRO]                (@ref rte_gro.h),
-  [GSO]                (@ref rte_gso.h),
-  [GRE]                (@ref rte_gre.h),
-  [MPLS]               (@ref rte_mpls.h),
-  [VXLAN]              (@ref rte_vxlan.h),
-  [Geneve]             (@ref rte_geneve.h),
-  [eCPRI]              (@ref rte_ecpri.h),
-  [L2TPv2]             (@ref rte_l2tpv2.h),
-  [PPP]                (@ref rte_ppp.h)
+  [ethernet](@ref rte_ether.h),
+  [ARP](@ref rte_arp.h),
+  [HIGIG](@ref rte_higig.h),
+  [ICMP](@ref rte_icmp.h),
+  [ESP](@ref rte_esp.h),
+  [IPsec](@ref rte_ipsec.h),
+  [IPsec group](@ref rte_ipsec_group.h),
+  [IPsec SA](@ref rte_ipsec_sa.h),
+  [IPsec SAD](@ref rte_ipsec_sad.h),
+  [IP](@ref rte_ip.h),
+  [frag/reass](@ref rte_ip_frag.h),
+  [SCTP](@ref rte_sctp.h),
+  [TCP](@ref rte_tcp.h),
+  [UDP](@ref rte_udp.h),
+  [GTP](@ref rte_gtp.h),
+  [GRO](@ref rte_gro.h),
+  [GSO](@ref rte_gso.h),
+  [GRE](@ref rte_gre.h),
+  [MPLS](@ref rte_mpls.h),
+  [VXLAN](@ref rte_vxlan.h),
+  [Geneve](@ref rte_geneve.h),
+  [eCPRI](@ref rte_ecpri.h),
+  [L2TPv2](@ref rte_l2tpv2.h),
+  [PPP](@ref rte_ppp.h)
 
 - **QoS**:
-  [metering]           (@ref rte_meter.h),
-  [scheduler]          (@ref rte_sched.h),
-  [RED congestion]     (@ref rte_red.h)
+  [metering](@ref rte_meter.h),
+  [scheduler](@ref rte_sched.h),
+  [RED congestion](@ref rte_red.h)
 
 - **routing**:
-  [LPM IPv4 route]     (@ref rte_lpm.h),
-  [LPM IPv6 route]     (@ref rte_lpm6.h),
-  [RIB IPv4]           (@ref rte_rib.h),
-  [RIB IPv6]           (@ref rte_rib6.h),
-  [FIB IPv4]           (@ref rte_fib.h),
-  [FIB IPv6]           (@ref rte_fib6.h)
+  [LPM IPv4 route](@ref rte_lpm.h),
+  [LPM IPv6 route](@ref rte_lpm6.h),
+  [RIB IPv4](@ref rte_rib.h),
+  [RIB IPv6](@ref rte_rib6.h),
+  [FIB IPv4](@ref rte_fib.h),
+  [FIB IPv6](@ref rte_fib6.h)
 
 - **hashes**:
-  [hash]               (@ref rte_hash.h),
-  [jhash]              (@ref rte_jhash.h),
-  [thash]              (@ref rte_thash.h),
-  [thash_gfni]         (@ref rte_thash_gfni.h),
-  [FBK hash]           (@ref rte_fbk_hash.h),
-  [CRC hash]           (@ref rte_hash_crc.h)
+  [hash](@ref rte_hash.h),
+  [jhash](@ref rte_jhash.h),
+  [thash](@ref rte_thash.h),
+  [thash_gfni](@ref rte_thash_gfni.h),
+  [FBK hash](@ref rte_fbk_hash.h),
+  [CRC hash](@ref rte_hash_crc.h)
 
 - **classification**
-  [reorder]            (@ref rte_reorder.h),
-  [distributor]        (@ref rte_distributor.h),
-  [EFD]                (@ref rte_efd.h),
-  [ACL]                (@ref rte_acl.h),
-  [member]             (@ref rte_member.h),
-  [flow classify]      (@ref rte_flow_classify.h),
-  [BPF]                (@ref rte_bpf.h)
+  [reorder](@ref rte_reorder.h),
+  [distributor](@ref rte_distributor.h),
+  [EFD](@ref rte_efd.h),
+  [ACL](@ref rte_acl.h),
+  [member](@ref rte_member.h),
+  [flow classify](@ref rte_flow_classify.h),
+  [BPF](@ref rte_bpf.h)
 
 - **containers**:
-  [mbuf]               (@ref rte_mbuf.h),
-  [mbuf pool ops]      (@ref rte_mbuf_pool_ops.h),
-  [ring]               (@ref rte_ring.h),
-  [stack]              (@ref rte_stack.h),
-  [tailq]              (@ref rte_tailq.h),
-  [bitmap]             (@ref rte_bitmap.h)
+  [mbuf](@ref rte_mbuf.h),
+  [mbuf pool ops](@ref rte_mbuf_pool_ops.h),
+  [ring](@ref rte_ring.h),
+  [stack](@ref rte_stack.h),
+  [tailq](@ref rte_tailq.h),
+  [bitmap](@ref rte_bitmap.h)
 
 - **packet framework**:
-  * [port]             (@ref rte_port.h):
-    [ethdev]           (@ref rte_port_ethdev.h),
-    [ring]             (@ref rte_port_ring.h),
-    [frag]             (@ref rte_port_frag.h),
-    [reass]            (@ref rte_port_ras.h),
-    [sched]            (@ref rte_port_sched.h),
-    [kni]              (@ref rte_port_kni.h),
-    [src/sink]         (@ref rte_port_source_sink.h)
-  * [table]            (@ref rte_table.h):
-    [lpm IPv4]         (@ref rte_table_lpm.h),
-    [lpm IPv6]         (@ref rte_table_lpm_ipv6.h),
-    [ACL]              (@ref rte_table_acl.h),
-    [hash]             (@ref rte_table_hash.h),
-    [array]            (@ref rte_table_array.h),
-    [stub]             (@ref rte_table_stub.h)
-  * [pipeline]         (@ref rte_pipeline.h)
-    [port_in_action]   (@ref rte_port_in_action.h)
-    [table_action]     (@ref rte_table_action.h)
+  * [port](@ref rte_port.h):
+    [ethdev](@ref rte_port_ethdev.h),
+    [ring](@ref rte_port_ring.h),
+    [frag](@ref rte_port_frag.h),
+    [reass](@ref rte_port_ras.h),
+    [sched](@ref rte_port_sched.h),
+    [kni](@ref rte_port_kni.h),
+    [src/sink](@ref rte_port_source_sink.h)
+  * [table](@ref rte_table.h):
+    [lpm IPv4](@ref rte_table_lpm.h),
+    [lpm IPv6](@ref rte_table_lpm_ipv6.h),
+    [ACL](@ref rte_table_acl.h),
+    [hash](@ref rte_table_hash.h),
+    [array](@ref rte_table_array.h),
+    [stub](@ref rte_table_stub.h)
+  * [pipeline](@ref rte_pipeline.h)
+    [port_in_action](@ref rte_port_in_action.h)
+    [table_action](@ref rte_table_action.h)
   * SWX pipeline:
-    [control]          (@ref rte_swx_ctl.h),
-    [extern]           (@ref rte_swx_extern.h),
-    [pipeline]         (@ref rte_swx_pipeline.h)
+    [control](@ref rte_swx_ctl.h),
+    [extern](@ref rte_swx_extern.h),
+    [pipeline](@ref rte_swx_pipeline.h)
   * SWX port:
-    [port]             (@ref rte_swx_port.h),
-    [ethdev]           (@ref rte_swx_port_ethdev.h),
-    [fd]               (@ref rte_swx_port_fd.h),
-    [ring]             (@ref rte_swx_port_ring.h),
-    [src/sink]         (@ref rte_swx_port_source_sink.h)
+    [port](@ref rte_swx_port.h),
+    [ethdev](@ref rte_swx_port_ethdev.h),
+    [fd](@ref rte_swx_port_fd.h),
+    [ring](@ref rte_swx_port_ring.h),
+    [src/sink](@ref rte_swx_port_source_sink.h)
   * SWX table:
-    [table]            (@ref rte_swx_table.h),
-    [table_em]         (@ref rte_swx_table_em.h)
-    [table_wm]         (@ref rte_swx_table_wm.h)
-  * [graph]            (@ref rte_graph.h):
-    [graph_worker]     (@ref rte_graph_worker.h)
+    [table](@ref rte_swx_table.h),
+    [table_em](@ref rte_swx_table_em.h)
+    [table_wm](@ref rte_swx_table_wm.h)
+  * [graph](@ref rte_graph.h):
+    [graph_worker](@ref rte_graph_worker.h)
   * graph_nodes:
-    [eth_node]         (@ref rte_node_eth_api.h),
-    [ip4_node]         (@ref rte_node_ip4_api.h)
+    [eth_node](@ref rte_node_eth_api.h),
+    [ip4_node](@ref rte_node_ip4_api.h)
 
 - **basic**:
-  [bitops]             (@ref rte_bitops.h),
-  [approx fraction]    (@ref rte_approx.h),
-  [random]             (@ref rte_random.h),
-  [config file]        (@ref rte_cfgfile.h),
-  [key/value args]     (@ref rte_kvargs.h),
-  [string]             (@ref rte_string_fns.h)
+  [bitops](@ref rte_bitops.h),
+  [approx fraction](@ref rte_approx.h),
+  [random](@ref rte_random.h),
+  [config file](@ref rte_cfgfile.h),
+  [key/value args](@ref rte_kvargs.h),
+  [string](@ref rte_string_fns.h)
 
 - **debug**:
-  [jobstats]           (@ref rte_jobstats.h),
-  [telemetry]          (@ref rte_telemetry.h),
-  [pcapng]             (@ref rte_pcapng.h),
-  [pdump]              (@ref rte_pdump.h),
-  [hexdump]            (@ref rte_hexdump.h),
-  [debug]              (@ref rte_debug.h),
-  [log]                (@ref rte_log.h),
-  [errno]              (@ref rte_errno.h),
-  [trace]              (@ref rte_trace.h),
-  [trace_point]        (@ref rte_trace_point.h)
+  [jobstats](@ref rte_jobstats.h),
+  [telemetry](@ref rte_telemetry.h),
+  [pcapng](@ref rte_pcapng.h),
+  [pdump](@ref rte_pdump.h),
+  [hexdump](@ref rte_hexdump.h),
+  [debug](@ref rte_debug.h),
+  [log](@ref rte_log.h),
+  [errno](@ref rte_errno.h),
+  [trace](@ref rte_trace.h),
+  [trace_point](@ref rte_trace_point.h)
 
 - **misc**:
-  [EAL config]         (@ref rte_eal.h),
-  [common]             (@ref rte_common.h),
-  [experimental APIs]  (@ref rte_compat.h),
-  [ABI versioning]     (@ref rte_function_versioning.h),
-  [version]            (@ref rte_version.h)
+  [EAL config](@ref rte_eal.h),
+  [common](@ref rte_common.h),
+  [experimental APIs](@ref rte_compat.h),
+  [ABI versioning](@ref rte_function_versioning.h),
+  [version](@ref rte_version.h)
-- 
2.29.3


^ permalink raw reply	[relevance 6%]

* Re: [RFC 1/2] ethdev: port flags for pre-configuration flow hints
  @ 2022-04-07 15:04  3%   ` Stephen Hemminger
  2022-04-08  2:35  4%     ` Jack Min
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2022-04-07 15:04 UTC (permalink / raw)
  To: Xiaoyu Min; +Cc: Ori Kam, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, dev

On Thu, 7 Apr 2022 13:30:46 +0800
Xiaoyu Min <jackmin@nvidia.com> wrote:

>   * @b EXPERIMENTAL: this API may change without prior notice.
> @@ -4972,6 +4983,11 @@ struct rte_flow_port_attr {
>  	 * @see RTE_FLOW_ACTION_TYPE_METER
>  	 */
>  	uint32_t nb_meters;
> +	/**
> +	 * Port flags.
> +	 * @see enum rte_flow_port_flag
> +	 */
> +	enum rte_flow_port_flag flags;

This would have to wait until 22.11 because it is ABI breakage.
Also, how would this work with old users of API?

^ permalink raw reply	[relevance 3%]

* Re: [RFC 1/2] ethdev: port flags for pre-configuration flow hints
  2022-04-07 15:04  3%   ` Stephen Hemminger
@ 2022-04-08  2:35  4%     ` Jack Min
  0 siblings, 0 replies; 200+ results
From: Jack Min @ 2022-04-08  2:35 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Ori Kam, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, dev

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

On 4/7/22 23:04, Stephen Hemminger wrote:
> On Thu, 7 Apr 2022 13:30:46 +0800
> Xiaoyu Min<jackmin@nvidia.com>  wrote:
>
>>    * @b EXPERIMENTAL: this API may change without prior notice.
>> @@ -4972,6 +4983,11 @@ struct rte_flow_port_attr {
>>   	 * @see RTE_FLOW_ACTION_TYPE_METER
>>   	 */
>>   	uint32_t nb_meters;
>> +	/**
>> +	 * Port flags.
>> +	 * @see enum rte_flow_port_flag
>> +	 */
>> +	enum rte_flow_port_flag flags;
> This would have to wait until 22.11 because it is ABI breakage.
> Also, how would this work with old users of API?

I'm not familiar with DPKD API/ABI policy,

But as my understanding this one is marked as _experimental_ and also 
all related APIs

The experimental is not considered as part of ABI, and we can change 
them anytime, no?

[-- Attachment #2: Type: text/html, Size: 1373 bytes --]

^ permalink raw reply	[relevance 4%]

* Re: 21.11.1 patches review and test
  2022-04-01 10:22  2% 21.11.1 patches review and test Kevin Traynor
@ 2022-04-11  3:03  0% ` Pei Zhang
  2022-04-13  4:06  0%   ` YangHang Liu
  2022-04-11  6:58  0% ` Christian Ehrhardt
  1 sibling, 1 reply; 200+ results
From: Pei Zhang @ 2022-04-11  3:03 UTC (permalink / raw)
  To: Kevin Traynor
  Cc: stable, dev, Abhishek Marathe, Ali Alnubani, Walker, Benjamin,
	David Christensen, Govindharajan, Hariprasad, Hemant Agrawal,
	Ian Stokes, Jerin Jacob, John McNamara, Ju-Hyoung Lee,
	Luca Boccassi, xu, qian, Raslan Darawsheh, Thomas Monjalon, Peng,
	Yuan, Chen, Zhaoyan, YangHang Liu

[-- Attachment #1: Type: text/plain, Size: 25440 bytes --]

cc Yanghang Liu from RedHat, he will do this testing soon :)

Best regards,

Pei

On Fri, Apr 1, 2022 at 6:22 PM Kevin Traynor <ktraynor@redhat.com> wrote:

> Hi all,
>
> Here is a list of patches targeted for stable release 21.11.1.
>
> Please try and complete validation by April 13th.
>
> Please help with testing and validation of your use cases and report
> any issues/results with reply-all to this mail. For the final release
> the fixes and reported validations will be added to the release notes.
>
> A release candidate tarball can be found at:
>
>     https://dpdk.org/browse/dpdk-stable/tag/?id=v21.11.1-rc1
>
> These patches are located at branch 21.11 of dpdk-stable repo:
>     https://dpdk.org/browse/dpdk-stable/
>
> Thanks.
>
> Kevin
>
> ---
> Adham Masarwah (2):
>       net/mlx5: fix destroying empty matchers list
>       app/testpmd: fix show RSS RETA on Windows
>
> Ajit Khaparde (7):
>       net/bnxt: fix ring teardown
>       net/bnxt: fix PAM4 mask setting
>       net/bnxt: fix crash by validating pointer
>       net/bnxt: check VF representor pointer before access
>       net/bnxt: fix VF resource allocation strategy
>       net/bnxt: set HW coalescing parameters
>       net/bnxt: fix ring calculation for representors
>
> Alexander Kozyrev (4):
>       net/mlx5: fix maximum packet headers size for TSO
>       net/mlx5: fix MPRQ WQE size assertion
>       net/mlx5: fix committed bucket size
>       net/mlx5: fix meter capabilities reporting
>
> Ali Alnubani (1):
>       doc: fix typos and punctuation in flow API guide
>
> Anatoly Burakov (1):
>       net/qede: fix redundant condition in debug code
>
> Andy Pei (1):
>       vdpa/ifc: fix log info mismatch
>
> Ankur Dwivedi (1):
>       common/cnxk: fix NPC key extraction validation
>
> Anoob Joseph (4):
>       common/cnxk: fix reset of fields
>       crypto/cnxk: fix inflight count calculation
>       crypto/cnxk: fix extend tail calculation
>       crypto/cnxk: fix update of number of descriptors
>
> Arek Kusztal (1):
>       cryptodev: fix RSA key type name
>
> Asaf Ravid (1):
>       net/cnxk: fix promiscuous mode in multicast enable flow
>
> Ashwin Sekhar T K (1):
>       mempool/cnxk: fix batch allocation failure path
>
> Bin Zheng (1):
>       net/ixgbe: add vector Rx parameter check
>
> Bing Zhao (5):
>       common/mlx5: fix probing failure code
>       app/testpmd: fix raw encap of GENEVE option
>       net/mlx5: fix matcher priority with ICMP or ICMPv6
>       net/mlx5: remove unused reference counter
>       net/mlx5: fix configuration without Rx queue
>
> Brian Dooley (13):
>       eal: add missing C++ guards
>       telemetry: add missing C++ guards
>       ethdev: add missing C++ guards
>       metrics: add missing C++ guards
>       acl: add missing C++ guards
>       compressdev: add missing C++ guards
>       eventdev: add missing C++ guards
>       kni: add missing C++ guards
>       vhost: add missing C++ guards
>       bpf: add missing C++ guards
>       cryptodev: add missing C++ guards
>       examples/l2fwd-crypto: fix port mask overflow
>       crypto/virtio: fix out-of-bounds access
>
> Bruce Richardson (23):
>       doc: remove dependency on findutils on FreeBSD
>       dma/idxd: fix burst capacity calculation
>       dma/idxd: fix paths to driver sysfs directory
>       dma/idxd: fix wrap-around in burst capacity calculation
>       build: fix warnings when running external commands
>       build: remove deprecated Meson functions
>       eal: fix C++ include
>       eventdev: fix C++ include
>       graph: fix C++ include
>       ipsec: fix C++ include
>       table: fix C++ include
>       vhost: fix C++ include
>       ethdev: fix cast for C++ compatibility
>       test/dma: fix missing checks for device capacity
>       dma/idxd: configure maximum batch size to high value
>       doc: improve configuration examples in idxd guide
>       distributor: fix potential overflow
>       eal/freebsd: add missing C++ include guards
>       compressdev: fix missing space in log macro
>       cryptodev: fix clang C++ include
>       eventdev: fix clang C++ include
>       doc: replace characters for (R) symbol in Linux guide
>       doc: fix missing note on UIO module in Linux guide
>
> Chandubabu Namburu (1):
>       net/axgbe: use PCI root complex device to distinguish device
>
> Chenbo Xia (1):
>       vhost: fix queue number check when setting inflight FD
>
> Chengchang Tang (1):
>       net/bonding: fix offloading configuration
>
> Chengwen Feng (2):
>       net/hns3: delete duplicated RSS type
>       dma/hisilicon: use common PCI device naming
>
> Chuanshe Zhang (1):
>       examples/flow_classify: fix failure message
>
> Ciara Loftus (2):
>       net/af_xdp: fix build with -Wunused-function
>       net/af_xdp: ensure socket is deleted on Rx queue setup error
>
> Ciara Power (4):
>       crypto/ipsec_mb: fix queue setup null pointer dereference
>       crypto/ipsec_mb: fix queue cleanup null pointer dereference
>       crypto/ipsec_mb: fix tainted data for session
>       crypto/ipsec_mb: remove useless check
>
> Cristian Dumitrescu (2):
>       pipeline: fix annotation checks
>       pipeline: fix table state memory allocation
>
> Dapeng Yu (2):
>       net/ice: track DCF state of PF
>       net/i40e: enable maximum frame size at port level
>
> Dariusz Sosnowski (3):
>       net/mlx5: fix inline length for multi-segment TSO
>       net/mlx5: fix MPLS/GRE Verbs spec ordering
>       net/mlx5: fix VLAN push action validation
>
> David Marchand (8):
>       devtools: fix comment detection in forbidden token check
>       stack: fix stubs header export
>       test/mbuf: fix mbuf data content check
>       ethdev: fix MAC address in telemetry device info
>       net/af_xdp: add missing trailing newline in logs
>       devtools: remove event/dlb exception in ABI check
>       vhost: fix FD leak with inflight messages
>       bpf: fix build with some libpcap version on FreeBSD
>
> Dawid Gorecki (2):
>       net/ena: fix reset reason being overwritten
>       net/ena: check memory BAR before initializing LLQ
>
> Devendra Singh Rawat (3):
>       net/qede: fix Tx completion
>       net/qede: fix Rx bulk
>       net/qede: fix maximum Rx packet length
>
> Dmitry Kozlyuk (8):
>       net/mlx5: fix GCC uninitialized variable warning
>       net/mlx5: relax headroom assertion
>       app/testpmd: fix external buffer allocation
>       common/mlx5: fix MR lookup for non-contiguous mempool
>       common/mlx5: add Netlink event helpers
>       net/mlx5: fix link status change detection
>       net/mlx5: fix initial link status detection
>       net/mlx5: fix modify port action validation
>
> Elena Agostini (3):
>       gpu/cuda: fix memory list cleanup
>       doc: add CUDA driver features
>       gpu/cuda: fix dependency loading path
>
> Ferruh Yigit (2):
>       net/bonding: fix MTU set for slaves
>       ethdev: fix doxygen comments for device info struct
>
> Geoffrey Le Gourriérec (1):
>       net/bnxt: restore dependency on kernel modules
>
> Gerry Gribbon (1):
>       app/regex: fix number of matches
>
> Gowrishankar Muthukrishnan (6):
>       event/cnxk: fix variables casting
>       event/cnxk: fix uninitialized local variables
>       common/cnxk: add missing checks of return values
>       common/cnxk fix unintended sign extension
>       common/cnxk: fix uninitialized pointer read
>       net/cnxk: fix uninitialized local variable
>
> Gregory Etelson (10):
>       net/mlx5: fix RSS expansion with explicit next protocol
>       net/mlx5: fix GRE protocol type translation for Verbs
>       net/mlx5: fix GRE item translation in Verbs
>       net/mlx5: reduce flex item flow handle size
>       net/mlx5: fix flex item header length translation
>       net/mlx5: fix inet IPIP protocol type
>       net/mlx5: fix next protocol RSS expansion
>       net/mlx5: fix flex item availability
>       app/testpmd: fix GTP header parsing in checksum engine
>       app/testpmd: fix flow rule with flex input link
>
> Haiyue Wang (2):
>       net/iavf: remove git residue symbol
>       doc: fix KNI PMD name typo
>
> Harman Kalra (3):
>       common/cnxk: reset stale values on error debug registers
>       common/cnxk: always use single interrupt ID with NIX
>       common/cnxk: fix mbuf data offset for VF
>
> Harold Huang (2):
>       net/virtio-user: fix resource leak on probing failure
>       net/kni: fix config initialization
>
> Heinrich Kuhn (1):
>       net/nfp: free HW ring memzone on queue release
>
> Hemant Agrawal (1):
>       crypto/dpaax_sec: fix auth/cipher xform chain checks
>
> Honnappa Nagarahalli (3):
>       examples/distributor: reduce Tx queue number to 1
>       examples/l3fwd: share queue size variables
>       examples/l3fwd: make Rx and Tx queue size configurable
>
> Huisong Li (10):
>       net/hns3: fix mailbox wait time
>       net/hns3: fix using enum as boolean
>       net/hns3: fix max packet size rollback in PF
>       net/hns3: fix insecure way to query MAC statistics
>       net/hns3: fix double decrement of secondary count
>       net/hns3: fix operating queue when TCAM table is invalid
>       kni: fix freeing order in device release
>       net/hns3: fix RSS TC mode entry
>       net/hns3: fix VF RSS TC mode entry
>       net/hns3: increase time waiting for PF reset completion
>
> Ivan Malov (8):
>       net/sfc: validate queue span when parsing flow action RSS
>       net/sfc: fix lock releases
>       net/sfc: do not push fast free offload to default TxQ config
>       net/sfc: demand Tx fast free offload on EF10 simple datapath
>       common/sfc_efx/base: fix recirculation ID set in outer rules
>       common/sfc_efx/base: add missing handler for 1-byte fields
>       net/sfc: fix flow tunnel support detection
>       net/sfc: reduce log level of tunnel restore info error
>
> Jakub Poczatek (1):
>       doc: fix FIPS guide
>
> Jiawei Wang (4):
>       net/mlx5: fix NIC egress flow mismatch in switchdev mode
>       net/mlx5: fix sample flow action on trusted device
>       net/mlx5: fix implicit tag insertion with sample action
>       net/mlx5: fix port matching in sample flow rule
>
> Jiawen Wu (8):
>       net/ngbe: fix Rx by initializing packet buffer early
>       net/ngbe: fix missed link interrupt
>       net/ngbe: fix Tx hang on queue disable
>       net/ngbe: fix packet statistics
>       net/txgbe: fix link up and down
>       net/txgbe: fix KR auto-negotiation
>       net/ngbe: fix debug logs
>       net/txgbe: fix debug logs
>
> Jie Hai (1):
>       net/hns3: remove duplicate macro definition
>
> Jie Wang (1):
>       net: fix L2TPv2 common header
>
> Jie Zhou (2):
>       eal/windows: fix error code for not supported API
>       test/mem: fix error check
>
> Josh Soref (1):
>       fix spelling in comments and strings
>
> Junfeng Guo (3):
>       net/ice: fix pattern check for flow director parser
>       net/ice: fix pattern check in flow director
>       raw/ntb: clear all valid doorbell bits on init
>
> Junjie Wan (1):
>       net/bonding: fix slaves initializing on MTU setting
>
> Junxiao Shi (1):
>       net/af_xdp: fix custom program loading with multiple queues
>
> Juraj Linkeš (1):
>       config/arm: add values for native armv7
>
> Kai Ji (2):
>       test/crypto: fix out-of-place SGL in raw datapath
>       crypto/qat: fix GEN4 AEAD job in raw data path
>
> Kalesh AP (15):
>       net/bnxt: fix multicast address set
>       net/bnxt: fix multicast MAC restore during reset recovery
>       net/bnxt: fix queue stop operation
>       net/bnxt: restore RSS configuration after reset recovery
>       net/bnxt: fix restoring VLAN filtering after recovery
>       net/bnxt: cap maximum number of unicast MAC addresses
>       net/bnxt: set fast-path pointers only if recovery succeeds
>       net/bnxt: add null check for mark table
>       net/bnxt: fix flow create when RSS is disabled
>       net/bnxt: get maximum supported multicast filters count
>       net/bnxt: fix handling of VF configuration change
>       net/bnxt: fix xstats query
>       net/bnxt: fix check for autoneg enablement
>       net/bnxt: handle ring cleanup in case of error
>       net/bnxt: fix memzone allocation per VNIC
>
> Karl Bonde Torp (1):
>       build: fix build on FreeBSD with Meson 0.61.1
>
> Kathleen Capella (2):
>       net/iavf: count continuous DD bits for Arm
>       net/iavf: count continuous DD bits for Arm in flex Rx
>
> Kevin Liu (2):
>       net/ice: fix Tx checksum offload
>       net/ice: fix Tx offload path choice
>
> Kevin Traynor (4):
>       maintainers: update for stable branches
>       build: suppress rte_crypto_asym_op abi check
>       Revert "crypto/ipsec_mb: fix length and offset settings"
>       Revert "net/mlx5: fix flex item availability"
>
> Kumara Parameshwaran (2):
>       ethdev: add internal function to device struct from name
>       net/tap: fix to populate FDs in secondary process
>
> Lance Richardson (2):
>       buildtools: fix AVX512 check for Python 3.5
>       net/bnxt: fix xstats names query overrun
>
> Leyi Rong (1):
>       net/iavf: fix potential out-of-bounds access
>
> Lijun Ou (1):
>       net/hns3: fix RSS key with null
>
> Lior Margalit (1):
>       net/mlx5: fix assertion on flags set in packet mbuf
>
> Madhuker Mythri (1):
>       devargs: fix crash with uninitialized parsing
>
> Martijn Bakker (1):
>       pflock: fix header file installation
>
> Martin Spinler (2):
>       net/nfb: fix array indexes in deinit functions
>       net/nfb: fix multicast/promiscuous mode switching
>
> Marvin Liu (1):
>       net/virtio: fix slots number when indirect feature on
>
> Matan Azrad (1):
>       vdpa/mlx5: workaround queue stop with traffic
>
> Maxime Coquelin (1):
>       vhost: fix unsafe vring addresses modifications
>
> Maxime Gouin (3):
>       bus/ifpga: remove useless check while browsing devices
>       net/nfp: remove duplicated check when setting MAC address
>       net/nfp: remove useless range checks
>
> Megha Ajmera (1):
>       examples/qos_sched: fix core mask overflow
>
> Michael Baum (17):
>       common/mlx5: add minimum WQE size for striding RQ
>       net/mlx5: improve stride parameter names
>       net/mlx5: fix MPRQ stride devargs adjustment
>       common/mlx5: fix error handling in multi-class probe
>       net/mlx5: fix memory socket selection in ASO management
>       common/mlx5: fix missing validation in devargs parsing
>       net/mlx5: fix sibling device config check
>       net/mlx5: fix ineffective metadata argument adjustment
>       net/mlx5: fix ASO CT object release
>       net/mlx5: fix errno update in shared context creation
>       net/mlx5: fix entry in shared Rx queues list
>       doc: remove obsolete vector Tx explanations from mlx5 guide
>       doc: replace broken links in mlx guides
>       doc: correct name of BlueField-2 in mlx5 guide
>       net/mlx5: fix shared counter flag in flow validation
>       net/mlx5: fix check in count action validation
>       common/mlx5: consider local functions as internal
>
> Michal Krawczyk (6):
>       net/ena: remove unused enumeration
>       net/ena: remove unused offload variables
>       net/ena: skip timer if reset is triggered
>       net/ena: fix meta descriptor DF flag setup
>       net/ena: fix checksum flag for L4
>       bus/pci: assign driver pointer before mapping
>
> Michal Wilczynski (1):
>       net/ice: fix overwriting of LSE bit by DCF
>
> Min Hu (Connor) (6):
>       net/hns3: fix Rx/Tx functions update
>       net/hns3: fix vector Rx/Tx when PTP enabled
>       net/bonding: fix promiscuous and allmulticast state
>       net/bonding: fix reference count on mbufs
>       app/testpmd: fix bonding mode set
>       app/testpmd: check starting port is not in bonding
>
> Naga Harish K S V (2):
>       eventdev/eth_tx: fix queue add error code
>       eventdev/eth_rx: fix queue config query
>
> Nicolas Chautru (1):
>       baseband/acc100: avoid out-of-bounds access
>
> Nipun Gupta (1):
>       examples/l3fwd: fix Rx burst size for event mode
>
> Nithin Dabilpuram (11):
>       examples/ipsec-secgw: fix eventdev start sequence
>       examples/ipsec-secgw: fix default flow rule creation
>       common/cnxk: fix shift offset for TL3 length disable
>       common/cnxk: fix byte order of frag sizes and infos
>       common/cnxk: fix null pointer dereferences
>       common/cnxk: fix uninitialized variables
>       examples/ipsec-secgw: fix buffer freeing in vector mode
>       net/cnxk: fix inline device RQ tag mask
>       net/cnxk: register callback early to handle initial packets
>       net/cnxk: fix inline IPsec security error handling
>       common/cnxk: fix bitmap usage for TM
>
> Pablo de Lara (9):
>       crypto/ipsec_mb: fix buffer overrun
>       crypto/ipsec_mb: check missing operation types
>       crypto/ipsec_mb: fix ZUC authentication verify
>       crypto/ipsec_mb: fix ZUC operation overwrite
>       crypto/ipsec_mb: fix length and offset settings
>       test/efd: fix sockets mask size
>       efd: fix uninitialized structure
>       crypto/ipsec_mb: fix length and offset settings
>       crypto/ipsec_mb: fix GMAC parameters setting
>
> Pavan Nikhilesh (6):
>       eventdev/eth_rx: fix missing internal port checks
>       event/cnxk: fix QoS devargs parsing
>       common/cnxk: add workaround for vWQE flush
>       config: align mempool elements to 128 bytes on CN10K
>       event/cnxk: fix sub-event clearing mask length
>       event/cnxk: fix Rx adapter config check
>
> Peng Yu (1):
>       vhost: fix linker script syntax
>
> Piotr Bronowski (2):
>       crypto/ipsec_mb: fix premature dereference
>       crypto/ipsec_mb: fix GCM requested digest length
>
> Qi Zhang (2):
>       net/ice: fix Tx checksum offload capability
>       doc: update matching versions in ice guide
>
> Radu Nicolau (5):
>       examples/ipsec-secgw: fix offload flag used for TSO IPv6
>       net/iavf: fix segmentation offload condition
>       net/iavf: fix segmentation offload buffer size
>       net/iavf: support NAT-T / UDP encapsulation
>       net/iavf: fix AES-GMAC IV size
>
> Rahul Bhansali (2):
>       net/cnxk: fix mbuf data length
>       examples/l3fwd: fix buffer overflow in Tx
>
> Rahul Lakkireddy (1):
>       net/cxgbe: fix dangling pointer by mailbox access rework
>
> Raja Zidane (8):
>       net/mlx5: fix mark enabling for Rx
>       app/testpmd: fix GENEVE parsing in checksum mode
>       app/compress-perf: fix cycle count operations allocation
>       app/compress-perf: optimize operations pool allocation
>       compress/mlx5: support out-of-space status
>       app/compress-perf: fix socket ID type during init
>       app/compress-perf: fix number of queue pairs to setup
>       compressdev: fix socket ID type
>
> Rakesh Kudurumalla (2):
>       net/cnxk: fix build with GCC 12
>       net/cnxk: fix RSS RETA table update
>
> Rashmi Shetty (1):
>       doc: fix dlb2 guide
>
> Reshma Pattan (1):
>       app/pdump: abort on multi-core capture limit
>
> Rongwei Liu (3):
>       net/mlx5: fix shared RSS destroy
>       net/mlx5: fix meter creation default state
>       net/mlx5: forbid multiple ASO actions in a single rule
>
> Ruifeng Wang (1):
>       config: add arch define for Arm
>
> Satheesh Paul (5):
>       common/cnxk: fix nibble parsing order when dumping MCAM
>       common/cnxk: fix flow deletion
>       common/cnxk: fix log level during MCAM allocation
>       common/cnxk: fix base rule merge
>       net/cnxk: fix Rx/Tx function update
>
> Sean Morrissey (2):
>       app/testpmd: fix dereference before null check
>       doc: fix telemetry example in cryptodev guide
>
> Shijith Thotton (1):
>       crypto/cnxk: enable allocated queues only
>
> Shun Hao (3):
>       net/mlx5: fix meter sub-policy creation
>       net/mlx5: fix E-Switch manager vport ID
>       net/mlx5: fix meter policy creation assert
>
> Simei Su (1):
>       net/ice: fix mbuf offload flag for Rx timestamp
>
> Srikanth Yalavarthi (1):
>       dma/cnxk: fix installing internal headers
>
> Stephen Douthit (1):
>       net/ixgbe: fix FSP check for X550EM devices
>
> Stephen Hemminger (7):
>       eal/linux: log hugepage create errors with filename
>       net/memif: remove unnecessary Rx interrupt stub
>       ipc: end multiprocess thread during cleanup
>       vfio: cleanup the multiprocess sync handle
>       pcapng: handle failure of link status query
>       test/bpf: skip dump if conversion fails
>       app/dumpcap: check for failure to set promiscuous
>
> Steve Yang (4):
>       app/testpmd: fix stack overflow for EEPROM display
>       net/i40e: fix unintentional integer overflow
>       eal/linux: fix illegal memory access in uevent handler
>       net/iavf: fix function pointer in multi-process
>
> Suanming Mou (3):
>       net/mlx5: set flow error for hash list create
>       net/mlx5: remove unused function
>       net/mlx5: fix indexed pool fetch overlap
>
> Thinh Tran (1):
>       net/mlx5: fix CPU socket ID for Rx queue creation
>
> Thomas Monjalon (6):
>       doc: replace deprecated distutils version parsing
>       dmadev: add missing header include
>       app/testpmd: fix build without drivers
>       regexdev: fix section attribute of symbols
>       build: hide local symbols in shared libraries
>       devtools: fix symbols check
>
> Tianfei Zhang (2):
>       raw/ifpga/base: fix SPI transaction
>       raw/ifpga: fix thread closing
>
> Tianli Lai (1):
>       examples/kni: add missing trailing newline in log
>
> Timothy McDaniel (3):
>       event/dlb2: update rolling mask used for dequeue
>       event/dlb2: poll HW CQ inflights before mapping queue
>       event/dlb2: add shift value check in sparse dequeue
>
> Vanshika Shukla (2):
>       net/dpaa2: fix unregistering interrupt handler
>       net/dpaa2: fix timestamping for IEEE1588
>
> Viacheslav Ovsiienko (4):
>       net/mlx5: fix modify field MAC address offset
>       app/testpmd: fix Tx scheduling interval
>       net/mlx5: fix metadata endianness in modify field action
>       doc: fix modify field action description for mlx5
>
> Vladimir Medvedkin (1):
>       app/fib: fix division by zero
>
> Wei Huang (5):
>       raw/ifpga/base: fix port feature ID
>       raw/ifpga: fix variable initialization in probing
>       raw/ifpga: fix interrupt handle allocation
>       raw/ifpga: fix monitor thread
>       raw/ifpga: fix build with optimization
>
> Weiguo Li (14):
>       common/cnxk: fix error checking
>       net/enic: fix dereference before null check
>       net/dpaa2: fix null pointer dereference
>       regex/mlx5: fix memory allocation check
>       net/memif: remove pointer deference before null check
>       net/iavf: fix null pointer dereference
>       vdpa/sfc: fix null dereference during config
>       vdpa/sfc: fix null dereference during removal
>       compress/octeontx: fix null pointer dereference
>       eventdev/eth_rx: fix parameters parsing memory leak
>       net/sfc: fix memory allocation size for cache
>       net/txgbe: fix queue statistics mapping
>       sched: remove useless malloc in PIE data init
>       net/bnxt: fix null dereference in session cleanup
>
> Wenwu Ma (1):
>       examples/vhost: fix launch with physical port
>
> Wenxuan Wu (1):
>       eal/linux: fix device monitor stop return
>
> Xiaoyu Min (1):
>       net/mlx5: reject jump to root table
>
> Xuan Ding (2):
>       vhost: fix field naming in guest page struct
>       vhost: fix physical address mapping
>
> Xueming Li (1):
>       net/virtio: fix Tx queue 0 overriden by queue 128
>
> Yajun Wu (1):
>       common/mlx5: fix queue pair ack timeout configuration
>
> Yiding Zhou (1):
>       net/ice: fix build with 16-byte Rx descriptor
>
> Yu Wenjun (1):
>       net/bonding: fix RSS with early configure
>
> Yuan Wang (1):
>       vhost: fix guest to host physical address mapping
>
> Yunjian Wang (12):
>       net/bonding: fix mode type mismatch
>       ethdev: fix Rx queue telemetry memory leak on failure
>       net/ice: fix link up when starting device
>       net/virtio-user: check FD flags getting failure
>       net/virtio: fix uninitialized RSS key
>       ring: fix error code when creating ring
>       net/ixgbe: check filter init failure
>       mem: check allocation in dynamic hugepage init
>       ethdev: remove unnecessary null check
>       net/ixgbe: reset security context pointer on close
>       net/txgbe: reset security context pointer on close
>       net/iavf: reset security context pointer on stop
>
> Yuying Zhang (1):
>       net/ice/base: add profile validation on switch filter
>
> Zhihong Wang (1):
>       ring: fix overflow in memory size calculation
>
>

[-- Attachment #2: Type: text/html, Size: 28710 bytes --]

^ permalink raw reply	[relevance 0%]

* Re: 21.11.1 patches review and test
  2022-04-01 10:22  2% 21.11.1 patches review and test Kevin Traynor
  2022-04-11  3:03  0% ` Pei Zhang
@ 2022-04-11  6:58  0% ` Christian Ehrhardt
  2022-04-13  7:26  0%   ` Christian Ehrhardt
  2022-04-13 10:06  3%   ` Kevin Traynor
  1 sibling, 2 replies; 200+ results
From: Christian Ehrhardt @ 2022-04-11  6:58 UTC (permalink / raw)
  To: Kevin Traynor
  Cc: stable, dev, Abhishek Marathe, Ali Alnubani, benjamin.walker,
	David Christensen, hariprasad.govindharajan, Hemant Agrawal,
	Ian Stokes, Jerin Jacob, John McNamara, Ju-Hyoung Lee,
	Luca Boccassi, Pei Zhang, qian.q.xu, Raslan Darawsheh,
	Thomas Monjalon, yuan.peng, zhaoyan.chen

On Fri, Apr 1, 2022 at 12:22 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> Hi all,
>
> Here is a list of patches targeted for stable release 21.11.1.

Hi Kevin,
this breaks on me at build time due to symbol changes.
It is a wild mix of Base->Internal/Experimental, a few new symbols,
and even just removed ones (in gpu which is experimental, but still
would that need a minor soname bump?).
They might be intentional, but it felt too much to me without at least
discussing it.
Could you have a look if you think that they are all intentional, save
and correct for an LTS release?

dpkg-gensymbols: warning: some new symbols appeared in the symbols
file: see diff output below
dpkg-gensymbols: warning: debian/librte-common-cnxk22/DEBIAN/symbols
doesn't match completely debian/librte-common-cnxk22.symbols
--- debian/librte-common-cnxk22.symbols
(librte-common-cnxk22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
+++ dpkg-gensymbolsUuRb8d 2022-04-11 06:46:22.276766813 +0000
@@ -197,6 +197,7 @@
  roc_nix_ptp_clock_read@INTERNAL 21.08
  roc_nix_ptp_info_cb_register@INTERNAL 21.08
  roc_nix_ptp_info_cb_unregister@INTERNAL 21.08
+ roc_nix_ptp_is_enable@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
  roc_nix_ptp_rx_ena_dis@INTERNAL 21.08
  roc_nix_ptp_sync_time_adjust@INTERNAL 21.08
  roc_nix_ptp_tx_ena_dis@INTERNAL 21.08

dpkg-gensymbols: warning: some new symbols appeared in the symbols
file: see diff output below
dpkg-gensymbols: warning: debian/librte-ethdev22/DEBIAN/symbols
doesn't match completely debian/librte-ethdev22.symbols
--- debian/librte-ethdev22.symbols
(librte-ethdev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
+++ dpkg-gensymbolskEnokB 2022-04-11 06:46:25.252795157 +0000
@@ -37,6 +37,7 @@
  rte_eth_dev_flow_ctrl_get@DPDK_22 21.11
  rte_eth_dev_flow_ctrl_set@DPDK_22 21.11
  rte_eth_dev_fw_version_get@DPDK_22 21.11
+ rte_eth_dev_get_by_name@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
  rte_eth_dev_get_dcb_info@DPDK_22 21.11
  rte_eth_dev_get_eeprom@DPDK_22 21.11
  rte_eth_dev_get_eeprom_length@DPDK_22 21.11

dpkg-gensymbols: warning: some new symbols appeared in the symbols
file: see diff output below
dpkg-gensymbols: error: some symbols or patterns disappeared in the
symbols file: see diff output below
dpkg-gensymbols: warning: debian/librte-regexdev22/DEBIAN/symbols
doesn't match completely debian/librte-regexdev22.symbols
--- debian/librte-regexdev22.symbols
(librte-regexdev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
+++ dpkg-gensymbolsPD0Ygo 2022-04-11 06:46:33.368872490 +0000
@@ -1,6 +1,8 @@
 librte_regexdev.so.22 librte-regexdev22 #MINVER#
  EXPERIMENTAL@EXPERIMENTAL 20.11
- rte_regex_devices@Base 20.11
+ INTERNAL@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
+ rte_regex_devices@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
  rte_regexdev_attr_get@EXPERIMENTAL 20.11
  rte_regexdev_attr_set@EXPERIMENTAL 20.11
  rte_regexdev_close@EXPERIMENTAL 20.11
@@ -8,12 +10,16 @@
  rte_regexdev_count@EXPERIMENTAL 20.11
  rte_regexdev_dump@EXPERIMENTAL 20.11
  rte_regexdev_get_dev_id@EXPERIMENTAL 20.11
- rte_regexdev_get_device_by_name@Base 20.11
+ rte_regexdev_get_device_by_name@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
  rte_regexdev_info_get@EXPERIMENTAL 20.11
- rte_regexdev_is_valid_dev@Base 20.11
- rte_regexdev_logtype@Base 20.11
+ rte_regexdev_is_valid_dev@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
+ rte_regexdev_logtype@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
  rte_regexdev_queue_pair_setup@EXPERIMENTAL 20.11
- rte_regexdev_register@Base 20.11
+ rte_regexdev_register@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
  rte_regexdev_rule_db_compile_activate@EXPERIMENTAL 20.11
  rte_regexdev_rule_db_export@EXPERIMENTAL 20.11
  rte_regexdev_rule_db_import@EXPERIMENTAL 20.11
@@ -21,7 +27,8 @@
  rte_regexdev_selftest@EXPERIMENTAL 20.11
  rte_regexdev_start@EXPERIMENTAL 20.11
  rte_regexdev_stop@EXPERIMENTAL 20.11
- rte_regexdev_unregister@Base 20.11
+ rte_regexdev_unregister@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
  rte_regexdev_xstats_by_name_get@EXPERIMENTAL 20.11
  rte_regexdev_xstats_get@EXPERIMENTAL 20.11
  rte_regexdev_xstats_names_get@EXPERIMENTAL 20.11

dpkg-gensymbols: error: some symbols or patterns disappeared in the
symbols file: see diff output below
dpkg-gensymbols: warning: debian/librte-gpudev22/DEBIAN/symbols
doesn't match completely debian/librte-gpudev22.symbols
--- debian/librte-gpudev22.symbols
(librte-gpudev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
+++ dpkg-gensymbols4qkXdt 2022-04-11 06:46:34.552883776 +0000
@@ -1,7 +1,7 @@
 librte_gpudev.so.22 librte-gpudev22 #MINVER#
  EXPERIMENTAL@EXPERIMENTAL 21.11
  INTERNAL@INTERNAL 21.11
- gpu_logtype@Base 21.11
  rte_gpu_add_child@EXPERIMENTAL 21.11
  rte_gpu_allocate@INTERNAL 21.11
  rte_gpu_attach@INTERNAL 21.11


Full log:
https://launchpadlibrarian.net/596047842/buildlog_ubuntu-jammy-amd64.dpdk_21.11.1~rc1-0ubuntu1~jammyppa2_BUILDING.txt.gz

> Please try and complete validation by April 13th.
>
> Please help with testing and validation of your use cases and report
> any issues/results with reply-all to this mail. For the final release
> the fixes and reported validations will be added to the release notes.
>
> A release candidate tarball can be found at:
>
>     https://dpdk.org/browse/dpdk-stable/tag/?id=v21.11.1-rc1
>
> These patches are located at branch 21.11 of dpdk-stable repo:
>     https://dpdk.org/browse/dpdk-stable/
>
> Thanks.
>
> Kevin
>
> ---
> Adham Masarwah (2):
>       net/mlx5: fix destroying empty matchers list
>       app/testpmd: fix show RSS RETA on Windows
>
> Ajit Khaparde (7):
>       net/bnxt: fix ring teardown
>       net/bnxt: fix PAM4 mask setting
>       net/bnxt: fix crash by validating pointer
>       net/bnxt: check VF representor pointer before access
>       net/bnxt: fix VF resource allocation strategy
>       net/bnxt: set HW coalescing parameters
>       net/bnxt: fix ring calculation for representors
>
> Alexander Kozyrev (4):
>       net/mlx5: fix maximum packet headers size for TSO
>       net/mlx5: fix MPRQ WQE size assertion
>       net/mlx5: fix committed bucket size
>       net/mlx5: fix meter capabilities reporting
>
> Ali Alnubani (1):
>       doc: fix typos and punctuation in flow API guide
>
> Anatoly Burakov (1):
>       net/qede: fix redundant condition in debug code
>
> Andy Pei (1):
>       vdpa/ifc: fix log info mismatch
>
> Ankur Dwivedi (1):
>       common/cnxk: fix NPC key extraction validation
>
> Anoob Joseph (4):
>       common/cnxk: fix reset of fields
>       crypto/cnxk: fix inflight count calculation
>       crypto/cnxk: fix extend tail calculation
>       crypto/cnxk: fix update of number of descriptors
>
> Arek Kusztal (1):
>       cryptodev: fix RSA key type name
>
> Asaf Ravid (1):
>       net/cnxk: fix promiscuous mode in multicast enable flow
>
> Ashwin Sekhar T K (1):
>       mempool/cnxk: fix batch allocation failure path
>
> Bin Zheng (1):
>       net/ixgbe: add vector Rx parameter check
>
> Bing Zhao (5):
>       common/mlx5: fix probing failure code
>       app/testpmd: fix raw encap of GENEVE option
>       net/mlx5: fix matcher priority with ICMP or ICMPv6
>       net/mlx5: remove unused reference counter
>       net/mlx5: fix configuration without Rx queue
>
> Brian Dooley (13):
>       eal: add missing C++ guards
>       telemetry: add missing C++ guards
>       ethdev: add missing C++ guards
>       metrics: add missing C++ guards
>       acl: add missing C++ guards
>       compressdev: add missing C++ guards
>       eventdev: add missing C++ guards
>       kni: add missing C++ guards
>       vhost: add missing C++ guards
>       bpf: add missing C++ guards
>       cryptodev: add missing C++ guards
>       examples/l2fwd-crypto: fix port mask overflow
>       crypto/virtio: fix out-of-bounds access
>
> Bruce Richardson (23):
>       doc: remove dependency on findutils on FreeBSD
>       dma/idxd: fix burst capacity calculation
>       dma/idxd: fix paths to driver sysfs directory
>       dma/idxd: fix wrap-around in burst capacity calculation
>       build: fix warnings when running external commands
>       build: remove deprecated Meson functions
>       eal: fix C++ include
>       eventdev: fix C++ include
>       graph: fix C++ include
>       ipsec: fix C++ include
>       table: fix C++ include
>       vhost: fix C++ include
>       ethdev: fix cast for C++ compatibility
>       test/dma: fix missing checks for device capacity
>       dma/idxd: configure maximum batch size to high value
>       doc: improve configuration examples in idxd guide
>       distributor: fix potential overflow
>       eal/freebsd: add missing C++ include guards
>       compressdev: fix missing space in log macro
>       cryptodev: fix clang C++ include
>       eventdev: fix clang C++ include
>       doc: replace characters for (R) symbol in Linux guide
>       doc: fix missing note on UIO module in Linux guide
>
> Chandubabu Namburu (1):
>       net/axgbe: use PCI root complex device to distinguish device
>
> Chenbo Xia (1):
>       vhost: fix queue number check when setting inflight FD
>
> Chengchang Tang (1):
>       net/bonding: fix offloading configuration
>
> Chengwen Feng (2):
>       net/hns3: delete duplicated RSS type
>       dma/hisilicon: use common PCI device naming
>
> Chuanshe Zhang (1):
>       examples/flow_classify: fix failure message
>
> Ciara Loftus (2):
>       net/af_xdp: fix build with -Wunused-function
>       net/af_xdp: ensure socket is deleted on Rx queue setup error
>
> Ciara Power (4):
>       crypto/ipsec_mb: fix queue setup null pointer dereference
>       crypto/ipsec_mb: fix queue cleanup null pointer dereference
>       crypto/ipsec_mb: fix tainted data for session
>       crypto/ipsec_mb: remove useless check
>
> Cristian Dumitrescu (2):
>       pipeline: fix annotation checks
>       pipeline: fix table state memory allocation
>
> Dapeng Yu (2):
>       net/ice: track DCF state of PF
>       net/i40e: enable maximum frame size at port level
>
> Dariusz Sosnowski (3):
>       net/mlx5: fix inline length for multi-segment TSO
>       net/mlx5: fix MPLS/GRE Verbs spec ordering
>       net/mlx5: fix VLAN push action validation
>
> David Marchand (8):
>       devtools: fix comment detection in forbidden token check
>       stack: fix stubs header export
>       test/mbuf: fix mbuf data content check
>       ethdev: fix MAC address in telemetry device info
>       net/af_xdp: add missing trailing newline in logs
>       devtools: remove event/dlb exception in ABI check
>       vhost: fix FD leak with inflight messages
>       bpf: fix build with some libpcap version on FreeBSD
>
> Dawid Gorecki (2):
>       net/ena: fix reset reason being overwritten
>       net/ena: check memory BAR before initializing LLQ
>
> Devendra Singh Rawat (3):
>       net/qede: fix Tx completion
>       net/qede: fix Rx bulk
>       net/qede: fix maximum Rx packet length
>
> Dmitry Kozlyuk (8):
>       net/mlx5: fix GCC uninitialized variable warning
>       net/mlx5: relax headroom assertion
>       app/testpmd: fix external buffer allocation
>       common/mlx5: fix MR lookup for non-contiguous mempool
>       common/mlx5: add Netlink event helpers
>       net/mlx5: fix link status change detection
>       net/mlx5: fix initial link status detection
>       net/mlx5: fix modify port action validation
>
> Elena Agostini (3):
>       gpu/cuda: fix memory list cleanup
>       doc: add CUDA driver features
>       gpu/cuda: fix dependency loading path
>
> Ferruh Yigit (2):
>       net/bonding: fix MTU set for slaves
>       ethdev: fix doxygen comments for device info struct
>
> Geoffrey Le Gourriérec (1):
>       net/bnxt: restore dependency on kernel modules
>
> Gerry Gribbon (1):
>       app/regex: fix number of matches
>
> Gowrishankar Muthukrishnan (6):
>       event/cnxk: fix variables casting
>       event/cnxk: fix uninitialized local variables
>       common/cnxk: add missing checks of return values
>       common/cnxk fix unintended sign extension
>       common/cnxk: fix uninitialized pointer read
>       net/cnxk: fix uninitialized local variable
>
> Gregory Etelson (10):
>       net/mlx5: fix RSS expansion with explicit next protocol
>       net/mlx5: fix GRE protocol type translation for Verbs
>       net/mlx5: fix GRE item translation in Verbs
>       net/mlx5: reduce flex item flow handle size
>       net/mlx5: fix flex item header length translation
>       net/mlx5: fix inet IPIP protocol type
>       net/mlx5: fix next protocol RSS expansion
>       net/mlx5: fix flex item availability
>       app/testpmd: fix GTP header parsing in checksum engine
>       app/testpmd: fix flow rule with flex input link
>
> Haiyue Wang (2):
>       net/iavf: remove git residue symbol
>       doc: fix KNI PMD name typo
>
> Harman Kalra (3):
>       common/cnxk: reset stale values on error debug registers
>       common/cnxk: always use single interrupt ID with NIX
>       common/cnxk: fix mbuf data offset for VF
>
> Harold Huang (2):
>       net/virtio-user: fix resource leak on probing failure
>       net/kni: fix config initialization
>
> Heinrich Kuhn (1):
>       net/nfp: free HW ring memzone on queue release
>
> Hemant Agrawal (1):
>       crypto/dpaax_sec: fix auth/cipher xform chain checks
>
> Honnappa Nagarahalli (3):
>       examples/distributor: reduce Tx queue number to 1
>       examples/l3fwd: share queue size variables
>       examples/l3fwd: make Rx and Tx queue size configurable
>
> Huisong Li (10):
>       net/hns3: fix mailbox wait time
>       net/hns3: fix using enum as boolean
>       net/hns3: fix max packet size rollback in PF
>       net/hns3: fix insecure way to query MAC statistics
>       net/hns3: fix double decrement of secondary count
>       net/hns3: fix operating queue when TCAM table is invalid
>       kni: fix freeing order in device release
>       net/hns3: fix RSS TC mode entry
>       net/hns3: fix VF RSS TC mode entry
>       net/hns3: increase time waiting for PF reset completion
>
> Ivan Malov (8):
>       net/sfc: validate queue span when parsing flow action RSS
>       net/sfc: fix lock releases
>       net/sfc: do not push fast free offload to default TxQ config
>       net/sfc: demand Tx fast free offload on EF10 simple datapath
>       common/sfc_efx/base: fix recirculation ID set in outer rules
>       common/sfc_efx/base: add missing handler for 1-byte fields
>       net/sfc: fix flow tunnel support detection
>       net/sfc: reduce log level of tunnel restore info error
>
> Jakub Poczatek (1):
>       doc: fix FIPS guide
>
> Jiawei Wang (4):
>       net/mlx5: fix NIC egress flow mismatch in switchdev mode
>       net/mlx5: fix sample flow action on trusted device
>       net/mlx5: fix implicit tag insertion with sample action
>       net/mlx5: fix port matching in sample flow rule
>
> Jiawen Wu (8):
>       net/ngbe: fix Rx by initializing packet buffer early
>       net/ngbe: fix missed link interrupt
>       net/ngbe: fix Tx hang on queue disable
>       net/ngbe: fix packet statistics
>       net/txgbe: fix link up and down
>       net/txgbe: fix KR auto-negotiation
>       net/ngbe: fix debug logs
>       net/txgbe: fix debug logs
>
> Jie Hai (1):
>       net/hns3: remove duplicate macro definition
>
> Jie Wang (1):
>       net: fix L2TPv2 common header
>
> Jie Zhou (2):
>       eal/windows: fix error code for not supported API
>       test/mem: fix error check
>
> Josh Soref (1):
>       fix spelling in comments and strings
>
> Junfeng Guo (3):
>       net/ice: fix pattern check for flow director parser
>       net/ice: fix pattern check in flow director
>       raw/ntb: clear all valid doorbell bits on init
>
> Junjie Wan (1):
>       net/bonding: fix slaves initializing on MTU setting
>
> Junxiao Shi (1):
>       net/af_xdp: fix custom program loading with multiple queues
>
> Juraj Linkeš (1):
>       config/arm: add values for native armv7
>
> Kai Ji (2):
>       test/crypto: fix out-of-place SGL in raw datapath
>       crypto/qat: fix GEN4 AEAD job in raw data path
>
> Kalesh AP (15):
>       net/bnxt: fix multicast address set
>       net/bnxt: fix multicast MAC restore during reset recovery
>       net/bnxt: fix queue stop operation
>       net/bnxt: restore RSS configuration after reset recovery
>       net/bnxt: fix restoring VLAN filtering after recovery
>       net/bnxt: cap maximum number of unicast MAC addresses
>       net/bnxt: set fast-path pointers only if recovery succeeds
>       net/bnxt: add null check for mark table
>       net/bnxt: fix flow create when RSS is disabled
>       net/bnxt: get maximum supported multicast filters count
>       net/bnxt: fix handling of VF configuration change
>       net/bnxt: fix xstats query
>       net/bnxt: fix check for autoneg enablement
>       net/bnxt: handle ring cleanup in case of error
>       net/bnxt: fix memzone allocation per VNIC
>
> Karl Bonde Torp (1):
>       build: fix build on FreeBSD with Meson 0.61.1
>
> Kathleen Capella (2):
>       net/iavf: count continuous DD bits for Arm
>       net/iavf: count continuous DD bits for Arm in flex Rx
>
> Kevin Liu (2):
>       net/ice: fix Tx checksum offload
>       net/ice: fix Tx offload path choice
>
> Kevin Traynor (4):
>       maintainers: update for stable branches
>       build: suppress rte_crypto_asym_op abi check
>       Revert "crypto/ipsec_mb: fix length and offset settings"
>       Revert "net/mlx5: fix flex item availability"
>
> Kumara Parameshwaran (2):
>       ethdev: add internal function to device struct from name
>       net/tap: fix to populate FDs in secondary process
>
> Lance Richardson (2):
>       buildtools: fix AVX512 check for Python 3.5
>       net/bnxt: fix xstats names query overrun
>
> Leyi Rong (1):
>       net/iavf: fix potential out-of-bounds access
>
> Lijun Ou (1):
>       net/hns3: fix RSS key with null
>
> Lior Margalit (1):
>       net/mlx5: fix assertion on flags set in packet mbuf
>
> Madhuker Mythri (1):
>       devargs: fix crash with uninitialized parsing
>
> Martijn Bakker (1):
>       pflock: fix header file installation
>
> Martin Spinler (2):
>       net/nfb: fix array indexes in deinit functions
>       net/nfb: fix multicast/promiscuous mode switching
>
> Marvin Liu (1):
>       net/virtio: fix slots number when indirect feature on
>
> Matan Azrad (1):
>       vdpa/mlx5: workaround queue stop with traffic
>
> Maxime Coquelin (1):
>       vhost: fix unsafe vring addresses modifications
>
> Maxime Gouin (3):
>       bus/ifpga: remove useless check while browsing devices
>       net/nfp: remove duplicated check when setting MAC address
>       net/nfp: remove useless range checks
>
> Megha Ajmera (1):
>       examples/qos_sched: fix core mask overflow
>
> Michael Baum (17):
>       common/mlx5: add minimum WQE size for striding RQ
>       net/mlx5: improve stride parameter names
>       net/mlx5: fix MPRQ stride devargs adjustment
>       common/mlx5: fix error handling in multi-class probe
>       net/mlx5: fix memory socket selection in ASO management
>       common/mlx5: fix missing validation in devargs parsing
>       net/mlx5: fix sibling device config check
>       net/mlx5: fix ineffective metadata argument adjustment
>       net/mlx5: fix ASO CT object release
>       net/mlx5: fix errno update in shared context creation
>       net/mlx5: fix entry in shared Rx queues list
>       doc: remove obsolete vector Tx explanations from mlx5 guide
>       doc: replace broken links in mlx guides
>       doc: correct name of BlueField-2 in mlx5 guide
>       net/mlx5: fix shared counter flag in flow validation
>       net/mlx5: fix check in count action validation
>       common/mlx5: consider local functions as internal
>
> Michal Krawczyk (6):
>       net/ena: remove unused enumeration
>       net/ena: remove unused offload variables
>       net/ena: skip timer if reset is triggered
>       net/ena: fix meta descriptor DF flag setup
>       net/ena: fix checksum flag for L4
>       bus/pci: assign driver pointer before mapping
>
> Michal Wilczynski (1):
>       net/ice: fix overwriting of LSE bit by DCF
>
> Min Hu (Connor) (6):
>       net/hns3: fix Rx/Tx functions update
>       net/hns3: fix vector Rx/Tx when PTP enabled
>       net/bonding: fix promiscuous and allmulticast state
>       net/bonding: fix reference count on mbufs
>       app/testpmd: fix bonding mode set
>       app/testpmd: check starting port is not in bonding
>
> Naga Harish K S V (2):
>       eventdev/eth_tx: fix queue add error code
>       eventdev/eth_rx: fix queue config query
>
> Nicolas Chautru (1):
>       baseband/acc100: avoid out-of-bounds access
>
> Nipun Gupta (1):
>       examples/l3fwd: fix Rx burst size for event mode
>
> Nithin Dabilpuram (11):
>       examples/ipsec-secgw: fix eventdev start sequence
>       examples/ipsec-secgw: fix default flow rule creation
>       common/cnxk: fix shift offset for TL3 length disable
>       common/cnxk: fix byte order of frag sizes and infos
>       common/cnxk: fix null pointer dereferences
>       common/cnxk: fix uninitialized variables
>       examples/ipsec-secgw: fix buffer freeing in vector mode
>       net/cnxk: fix inline device RQ tag mask
>       net/cnxk: register callback early to handle initial packets
>       net/cnxk: fix inline IPsec security error handling
>       common/cnxk: fix bitmap usage for TM
>
> Pablo de Lara (9):
>       crypto/ipsec_mb: fix buffer overrun
>       crypto/ipsec_mb: check missing operation types
>       crypto/ipsec_mb: fix ZUC authentication verify
>       crypto/ipsec_mb: fix ZUC operation overwrite
>       crypto/ipsec_mb: fix length and offset settings
>       test/efd: fix sockets mask size
>       efd: fix uninitialized structure
>       crypto/ipsec_mb: fix length and offset settings
>       crypto/ipsec_mb: fix GMAC parameters setting
>
> Pavan Nikhilesh (6):
>       eventdev/eth_rx: fix missing internal port checks
>       event/cnxk: fix QoS devargs parsing
>       common/cnxk: add workaround for vWQE flush
>       config: align mempool elements to 128 bytes on CN10K
>       event/cnxk: fix sub-event clearing mask length
>       event/cnxk: fix Rx adapter config check
>
> Peng Yu (1):
>       vhost: fix linker script syntax
>
> Piotr Bronowski (2):
>       crypto/ipsec_mb: fix premature dereference
>       crypto/ipsec_mb: fix GCM requested digest length
>
> Qi Zhang (2):
>       net/ice: fix Tx checksum offload capability
>       doc: update matching versions in ice guide
>
> Radu Nicolau (5):
>       examples/ipsec-secgw: fix offload flag used for TSO IPv6
>       net/iavf: fix segmentation offload condition
>       net/iavf: fix segmentation offload buffer size
>       net/iavf: support NAT-T / UDP encapsulation
>       net/iavf: fix AES-GMAC IV size
>
> Rahul Bhansali (2):
>       net/cnxk: fix mbuf data length
>       examples/l3fwd: fix buffer overflow in Tx
>
> Rahul Lakkireddy (1):
>       net/cxgbe: fix dangling pointer by mailbox access rework
>
> Raja Zidane (8):
>       net/mlx5: fix mark enabling for Rx
>       app/testpmd: fix GENEVE parsing in checksum mode
>       app/compress-perf: fix cycle count operations allocation
>       app/compress-perf: optimize operations pool allocation
>       compress/mlx5: support out-of-space status
>       app/compress-perf: fix socket ID type during init
>       app/compress-perf: fix number of queue pairs to setup
>       compressdev: fix socket ID type
>
> Rakesh Kudurumalla (2):
>       net/cnxk: fix build with GCC 12
>       net/cnxk: fix RSS RETA table update
>
> Rashmi Shetty (1):
>       doc: fix dlb2 guide
>
> Reshma Pattan (1):
>       app/pdump: abort on multi-core capture limit
>
> Rongwei Liu (3):
>       net/mlx5: fix shared RSS destroy
>       net/mlx5: fix meter creation default state
>       net/mlx5: forbid multiple ASO actions in a single rule
>
> Ruifeng Wang (1):
>       config: add arch define for Arm
>
> Satheesh Paul (5):
>       common/cnxk: fix nibble parsing order when dumping MCAM
>       common/cnxk: fix flow deletion
>       common/cnxk: fix log level during MCAM allocation
>       common/cnxk: fix base rule merge
>       net/cnxk: fix Rx/Tx function update
>
> Sean Morrissey (2):
>       app/testpmd: fix dereference before null check
>       doc: fix telemetry example in cryptodev guide
>
> Shijith Thotton (1):
>       crypto/cnxk: enable allocated queues only
>
> Shun Hao (3):
>       net/mlx5: fix meter sub-policy creation
>       net/mlx5: fix E-Switch manager vport ID
>       net/mlx5: fix meter policy creation assert
>
> Simei Su (1):
>       net/ice: fix mbuf offload flag for Rx timestamp
>
> Srikanth Yalavarthi (1):
>       dma/cnxk: fix installing internal headers
>
> Stephen Douthit (1):
>       net/ixgbe: fix FSP check for X550EM devices
>
> Stephen Hemminger (7):
>       eal/linux: log hugepage create errors with filename
>       net/memif: remove unnecessary Rx interrupt stub
>       ipc: end multiprocess thread during cleanup
>       vfio: cleanup the multiprocess sync handle
>       pcapng: handle failure of link status query
>       test/bpf: skip dump if conversion fails
>       app/dumpcap: check for failure to set promiscuous
>
> Steve Yang (4):
>       app/testpmd: fix stack overflow for EEPROM display
>       net/i40e: fix unintentional integer overflow
>       eal/linux: fix illegal memory access in uevent handler
>       net/iavf: fix function pointer in multi-process
>
> Suanming Mou (3):
>       net/mlx5: set flow error for hash list create
>       net/mlx5: remove unused function
>       net/mlx5: fix indexed pool fetch overlap
>
> Thinh Tran (1):
>       net/mlx5: fix CPU socket ID for Rx queue creation
>
> Thomas Monjalon (6):
>       doc: replace deprecated distutils version parsing
>       dmadev: add missing header include
>       app/testpmd: fix build without drivers
>       regexdev: fix section attribute of symbols
>       build: hide local symbols in shared libraries
>       devtools: fix symbols check
>
> Tianfei Zhang (2):
>       raw/ifpga/base: fix SPI transaction
>       raw/ifpga: fix thread closing
>
> Tianli Lai (1):
>       examples/kni: add missing trailing newline in log
>
> Timothy McDaniel (3):
>       event/dlb2: update rolling mask used for dequeue
>       event/dlb2: poll HW CQ inflights before mapping queue
>       event/dlb2: add shift value check in sparse dequeue
>
> Vanshika Shukla (2):
>       net/dpaa2: fix unregistering interrupt handler
>       net/dpaa2: fix timestamping for IEEE1588
>
> Viacheslav Ovsiienko (4):
>       net/mlx5: fix modify field MAC address offset
>       app/testpmd: fix Tx scheduling interval
>       net/mlx5: fix metadata endianness in modify field action
>       doc: fix modify field action description for mlx5
>
> Vladimir Medvedkin (1):
>       app/fib: fix division by zero
>
> Wei Huang (5):
>       raw/ifpga/base: fix port feature ID
>       raw/ifpga: fix variable initialization in probing
>       raw/ifpga: fix interrupt handle allocation
>       raw/ifpga: fix monitor thread
>       raw/ifpga: fix build with optimization
>
> Weiguo Li (14):
>       common/cnxk: fix error checking
>       net/enic: fix dereference before null check
>       net/dpaa2: fix null pointer dereference
>       regex/mlx5: fix memory allocation check
>       net/memif: remove pointer deference before null check
>       net/iavf: fix null pointer dereference
>       vdpa/sfc: fix null dereference during config
>       vdpa/sfc: fix null dereference during removal
>       compress/octeontx: fix null pointer dereference
>       eventdev/eth_rx: fix parameters parsing memory leak
>       net/sfc: fix memory allocation size for cache
>       net/txgbe: fix queue statistics mapping
>       sched: remove useless malloc in PIE data init
>       net/bnxt: fix null dereference in session cleanup
>
> Wenwu Ma (1):
>       examples/vhost: fix launch with physical port
>
> Wenxuan Wu (1):
>       eal/linux: fix device monitor stop return
>
> Xiaoyu Min (1):
>       net/mlx5: reject jump to root table
>
> Xuan Ding (2):
>       vhost: fix field naming in guest page struct
>       vhost: fix physical address mapping
>
> Xueming Li (1):
>       net/virtio: fix Tx queue 0 overriden by queue 128
>
> Yajun Wu (1):
>       common/mlx5: fix queue pair ack timeout configuration
>
> Yiding Zhou (1):
>       net/ice: fix build with 16-byte Rx descriptor
>
> Yu Wenjun (1):
>       net/bonding: fix RSS with early configure
>
> Yuan Wang (1):
>       vhost: fix guest to host physical address mapping
>
> Yunjian Wang (12):
>       net/bonding: fix mode type mismatch
>       ethdev: fix Rx queue telemetry memory leak on failure
>       net/ice: fix link up when starting device
>       net/virtio-user: check FD flags getting failure
>       net/virtio: fix uninitialized RSS key
>       ring: fix error code when creating ring
>       net/ixgbe: check filter init failure
>       mem: check allocation in dynamic hugepage init
>       ethdev: remove unnecessary null check
>       net/ixgbe: reset security context pointer on close
>       net/txgbe: reset security context pointer on close
>       net/iavf: reset security context pointer on stop
>
> Yuying Zhang (1):
>       net/ice/base: add profile validation on switch filter
>
> Zhihong Wang (1):
>       ring: fix overflow in memory size calculation
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 0/6] Extend and set event queue attributes at runtime
  2022-04-05  5:40  3% ` [PATCH v2 " Shijith Thotton
  2022-04-05  5:40  3%   ` [PATCH v2 2/6] eventdev: add weight and affinity to queue attributes Shijith Thotton
@ 2022-04-11 11:07  3%   ` Shijith Thotton
  1 sibling, 0 replies; 200+ results
From: Shijith Thotton @ 2022-04-11 11:07 UTC (permalink / raw)
  To: dev, Jerin Jacob Kollanukkaran
  Cc: Pavan Nikhilesh Bhagavatula, harry.van.haaren, mattias.ronnblom

[-- Attachment #1: Type: text/plain, Size: 2623 bytes --]

Please review and let me know if any comments.
________________________________
From: Shijith Thotton <sthotton@marvell.com>
Sent: Tuesday, April 5, 2022 11:10 AM
To: dev@dpdk.org <dev@dpdk.org>; Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Cc: Shijith Thotton <sthotton@marvell.com>; Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; harry.van.haaren@intel.com <harry.van.haaren@intel.com>; mattias.ronnblom@ericsson.com <mattias.ronnblom@ericsson.com>
Subject: [PATCH v2 0/6] Extend and set event queue attributes at runtime

This series adds support for setting event queue attributes at runtime
and adds two new event queue attributes weight and affinity. Eventdev
capability RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR is added to expose the
capability to set attributes at runtime and rte_event_queue_attr_set()
API is used to set the attributes.

Attributes weight and affinity are not yet added to rte_event_queue_conf
structure to avoid ABI break and will be added in 22.11. Till then, PMDs
using the new attributes are expected to manage them.

Test application changes and example implementation are added as last
three patches.

v2:
* Modified attr_value type from u32 to u64 for set().
* Removed RTE_EVENT_QUEUE_ATTR_MAX macro.
* Fixed return value in implementation.

Pavan Nikhilesh (1):
  common/cnxk: use lock when accessing mbox of SSO

Shijith Thotton (5):
  eventdev: support to set queue attributes at runtime
  eventdev: add weight and affinity to queue attributes
  doc: announce change in event queue conf structure
  test/event: test cases to test runtime queue attribute
  event/cnxk: support to set runtime queue attributes

 app/test/test_eventdev.c                  | 149 ++++++++++++++++++
 doc/guides/eventdevs/features/cnxk.ini    |   1 +
 doc/guides/eventdevs/features/default.ini |   1 +
 doc/guides/rel_notes/deprecation.rst      |   3 +
 drivers/common/cnxk/roc_sso.c             | 174 ++++++++++++++++------
 drivers/common/cnxk/roc_sso_priv.h        |   1 +
 drivers/common/cnxk/roc_tim.c             | 134 +++++++++++------
 drivers/event/cnxk/cn10k_eventdev.c       |   4 +
 drivers/event/cnxk/cn9k_eventdev.c        |   4 +
 drivers/event/cnxk/cnxk_eventdev.c        |  91 ++++++++++-
 drivers/event/cnxk/cnxk_eventdev.h        |  16 ++
 lib/eventdev/eventdev_pmd.h               |  44 ++++++
 lib/eventdev/rte_eventdev.c               |  38 +++++
 lib/eventdev/rte_eventdev.h               |  71 ++++++++-
 lib/eventdev/version.map                  |   3 +
 15 files changed, 631 insertions(+), 103 deletions(-)

--
2.25.1


[-- Attachment #2: Type: text/html, Size: 4484 bytes --]

^ permalink raw reply	[relevance 3%]

* Re: 21.11.1 patches review and test
  2022-04-11  3:03  0% ` Pei Zhang
@ 2022-04-13  4:06  0%   ` YangHang Liu
  0 siblings, 0 replies; 200+ results
From: YangHang Liu @ 2022-04-13  4:06 UTC (permalink / raw)
  To: Kevin Traynor
  Cc: stable, dev, Abhishek Marathe, Ali Alnubani, Walker, Benjamin,
	David Christensen, Govindharajan, Hariprasad, Hemant Agrawal,
	Ian Stokes, Jerin Jacob, John McNamara, Ju-Hyoung Lee,
	Luca Boccassi, xu, qian, Raslan Darawsheh, Thomas Monjalon, Peng,
	Yuan, Chen, Zhaoyan, Pei Zhang

[-- Attachment #1: Type: text/plain, Size: 27842 bytes --]

Hi Kevin,

The dpdk 21.11.1-rc1 test result from Red Hat looks good.

We tested below 17 scenarios and all got PASS on RHEL8:

   - Guest with device assignment(PF) throughput testing(1G hugepage size):
   PASS
   - Guest with device assignment(PF) throughput testing(2M hugepage size)
   : PASS
   - Guest with device assignment(VF) throughput testing: PASS
   - PVP (host dpdk testpmd as vswitch) 1Q: throughput testing: PASS
   - PVP vhost-user 2Q throughput testing: PASS
   - PVP vhost-user 1Q - cross numa node throughput testing: PASS
   - Guest with vhost-user 2 queues throughput testing: PASS
   - vhost-user reconnect with dpdk-client, qemu-server: qemu reconnect:
   PASS
   - vhost-user reconnect with dpdk-client, qemu-server: ovs reconnect: PASS
   - PVP 1Q live migration testing: PASS
   - PVP 1Q cross numa node live migration testing: PASS
   - Guest with ovs+dpdk+vhost-user 1Q live migration testing: PASS
   - Guest with ovs+dpdk+vhost-user 1Q live migration testing (2M): PASS
   - Guest with ovs+dpdk+vhost-user 2Q live migration testing: PASS
   - Guest with ovs+dpdk+vhost-user 4Q live migration testing: PASS
   - Host PF + DPDK testing: PASS
   - Host VF + DPDK testing: PASS


Versions:

   - kernel 4.18
   - qemu 6.2
   - dpdk: git://dpdk.org/dpdk-stable branch: 21.11
      - # git log
      ...
      Author: Kevin Traynor <ktraynor@redhat.com>
      Date:   Fri Apr 1 10:16:46 2022 +0100
          version: 21.11.1-rc1
          Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
      - NICs: X540-AT2 NIC(ixgbe, 10G)



Best Regards,
YangHang Liu


On Mon, Apr 11, 2022 at 11:03 AM Pei Zhang <pezhang@redhat.com> wrote:

> cc Yanghang Liu from RedHat, he will do this testing soon :)
>
> Best regards,
>
> Pei
>
> On Fri, Apr 1, 2022 at 6:22 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
>> Hi all,
>>
>> Here is a list of patches targeted for stable release 21.11.1.
>>
>> Please try and complete validation by April 13th.
>>
>> Please help with testing and validation of your use cases and report
>> any issues/results with reply-all to this mail. For the final release
>> the fixes and reported validations will be added to the release notes.
>>
>> A release candidate tarball can be found at:
>>
>>     https://dpdk.org/browse/dpdk-stable/tag/?id=v21.11.1-rc1
>>
>> These patches are located at branch 21.11 of dpdk-stable repo:
>>     https://dpdk.org/browse/dpdk-stable/
>>
>> Thanks.
>>
>> Kevin
>>
>> ---
>> Adham Masarwah (2):
>>       net/mlx5: fix destroying empty matchers list
>>       app/testpmd: fix show RSS RETA on Windows
>>
>> Ajit Khaparde (7):
>>       net/bnxt: fix ring teardown
>>       net/bnxt: fix PAM4 mask setting
>>       net/bnxt: fix crash by validating pointer
>>       net/bnxt: check VF representor pointer before access
>>       net/bnxt: fix VF resource allocation strategy
>>       net/bnxt: set HW coalescing parameters
>>       net/bnxt: fix ring calculation for representors
>>
>> Alexander Kozyrev (4):
>>       net/mlx5: fix maximum packet headers size for TSO
>>       net/mlx5: fix MPRQ WQE size assertion
>>       net/mlx5: fix committed bucket size
>>       net/mlx5: fix meter capabilities reporting
>>
>> Ali Alnubani (1):
>>       doc: fix typos and punctuation in flow API guide
>>
>> Anatoly Burakov (1):
>>       net/qede: fix redundant condition in debug code
>>
>> Andy Pei (1):
>>       vdpa/ifc: fix log info mismatch
>>
>> Ankur Dwivedi (1):
>>       common/cnxk: fix NPC key extraction validation
>>
>> Anoob Joseph (4):
>>       common/cnxk: fix reset of fields
>>       crypto/cnxk: fix inflight count calculation
>>       crypto/cnxk: fix extend tail calculation
>>       crypto/cnxk: fix update of number of descriptors
>>
>> Arek Kusztal (1):
>>       cryptodev: fix RSA key type name
>>
>> Asaf Ravid (1):
>>       net/cnxk: fix promiscuous mode in multicast enable flow
>>
>> Ashwin Sekhar T K (1):
>>       mempool/cnxk: fix batch allocation failure path
>>
>> Bin Zheng (1):
>>       net/ixgbe: add vector Rx parameter check
>>
>> Bing Zhao (5):
>>       common/mlx5: fix probing failure code
>>       app/testpmd: fix raw encap of GENEVE option
>>       net/mlx5: fix matcher priority with ICMP or ICMPv6
>>       net/mlx5: remove unused reference counter
>>       net/mlx5: fix configuration without Rx queue
>>
>> Brian Dooley (13):
>>       eal: add missing C++ guards
>>       telemetry: add missing C++ guards
>>       ethdev: add missing C++ guards
>>       metrics: add missing C++ guards
>>       acl: add missing C++ guards
>>       compressdev: add missing C++ guards
>>       eventdev: add missing C++ guards
>>       kni: add missing C++ guards
>>       vhost: add missing C++ guards
>>       bpf: add missing C++ guards
>>       cryptodev: add missing C++ guards
>>       examples/l2fwd-crypto: fix port mask overflow
>>       crypto/virtio: fix out-of-bounds access
>>
>> Bruce Richardson (23):
>>       doc: remove dependency on findutils on FreeBSD
>>       dma/idxd: fix burst capacity calculation
>>       dma/idxd: fix paths to driver sysfs directory
>>       dma/idxd: fix wrap-around in burst capacity calculation
>>       build: fix warnings when running external commands
>>       build: remove deprecated Meson functions
>>       eal: fix C++ include
>>       eventdev: fix C++ include
>>       graph: fix C++ include
>>       ipsec: fix C++ include
>>       table: fix C++ include
>>       vhost: fix C++ include
>>       ethdev: fix cast for C++ compatibility
>>       test/dma: fix missing checks for device capacity
>>       dma/idxd: configure maximum batch size to high value
>>       doc: improve configuration examples in idxd guide
>>       distributor: fix potential overflow
>>       eal/freebsd: add missing C++ include guards
>>       compressdev: fix missing space in log macro
>>       cryptodev: fix clang C++ include
>>       eventdev: fix clang C++ include
>>       doc: replace characters for (R) symbol in Linux guide
>>       doc: fix missing note on UIO module in Linux guide
>>
>> Chandubabu Namburu (1):
>>       net/axgbe: use PCI root complex device to distinguish device
>>
>> Chenbo Xia (1):
>>       vhost: fix queue number check when setting inflight FD
>>
>> Chengchang Tang (1):
>>       net/bonding: fix offloading configuration
>>
>> Chengwen Feng (2):
>>       net/hns3: delete duplicated RSS type
>>       dma/hisilicon: use common PCI device naming
>>
>> Chuanshe Zhang (1):
>>       examples/flow_classify: fix failure message
>>
>> Ciara Loftus (2):
>>       net/af_xdp: fix build with -Wunused-function
>>       net/af_xdp: ensure socket is deleted on Rx queue setup error
>>
>> Ciara Power (4):
>>       crypto/ipsec_mb: fix queue setup null pointer dereference
>>       crypto/ipsec_mb: fix queue cleanup null pointer dereference
>>       crypto/ipsec_mb: fix tainted data for session
>>       crypto/ipsec_mb: remove useless check
>>
>> Cristian Dumitrescu (2):
>>       pipeline: fix annotation checks
>>       pipeline: fix table state memory allocation
>>
>> Dapeng Yu (2):
>>       net/ice: track DCF state of PF
>>       net/i40e: enable maximum frame size at port level
>>
>> Dariusz Sosnowski (3):
>>       net/mlx5: fix inline length for multi-segment TSO
>>       net/mlx5: fix MPLS/GRE Verbs spec ordering
>>       net/mlx5: fix VLAN push action validation
>>
>> David Marchand (8):
>>       devtools: fix comment detection in forbidden token check
>>       stack: fix stubs header export
>>       test/mbuf: fix mbuf data content check
>>       ethdev: fix MAC address in telemetry device info
>>       net/af_xdp: add missing trailing newline in logs
>>       devtools: remove event/dlb exception in ABI check
>>       vhost: fix FD leak with inflight messages
>>       bpf: fix build with some libpcap version on FreeBSD
>>
>> Dawid Gorecki (2):
>>       net/ena: fix reset reason being overwritten
>>       net/ena: check memory BAR before initializing LLQ
>>
>> Devendra Singh Rawat (3):
>>       net/qede: fix Tx completion
>>       net/qede: fix Rx bulk
>>       net/qede: fix maximum Rx packet length
>>
>> Dmitry Kozlyuk (8):
>>       net/mlx5: fix GCC uninitialized variable warning
>>       net/mlx5: relax headroom assertion
>>       app/testpmd: fix external buffer allocation
>>       common/mlx5: fix MR lookup for non-contiguous mempool
>>       common/mlx5: add Netlink event helpers
>>       net/mlx5: fix link status change detection
>>       net/mlx5: fix initial link status detection
>>       net/mlx5: fix modify port action validation
>>
>> Elena Agostini (3):
>>       gpu/cuda: fix memory list cleanup
>>       doc: add CUDA driver features
>>       gpu/cuda: fix dependency loading path
>>
>> Ferruh Yigit (2):
>>       net/bonding: fix MTU set for slaves
>>       ethdev: fix doxygen comments for device info struct
>>
>> Geoffrey Le Gourriérec (1):
>>       net/bnxt: restore dependency on kernel modules
>>
>> Gerry Gribbon (1):
>>       app/regex: fix number of matches
>>
>> Gowrishankar Muthukrishnan (6):
>>       event/cnxk: fix variables casting
>>       event/cnxk: fix uninitialized local variables
>>       common/cnxk: add missing checks of return values
>>       common/cnxk fix unintended sign extension
>>       common/cnxk: fix uninitialized pointer read
>>       net/cnxk: fix uninitialized local variable
>>
>> Gregory Etelson (10):
>>       net/mlx5: fix RSS expansion with explicit next protocol
>>       net/mlx5: fix GRE protocol type translation for Verbs
>>       net/mlx5: fix GRE item translation in Verbs
>>       net/mlx5: reduce flex item flow handle size
>>       net/mlx5: fix flex item header length translation
>>       net/mlx5: fix inet IPIP protocol type
>>       net/mlx5: fix next protocol RSS expansion
>>       net/mlx5: fix flex item availability
>>       app/testpmd: fix GTP header parsing in checksum engine
>>       app/testpmd: fix flow rule with flex input link
>>
>> Haiyue Wang (2):
>>       net/iavf: remove git residue symbol
>>       doc: fix KNI PMD name typo
>>
>> Harman Kalra (3):
>>       common/cnxk: reset stale values on error debug registers
>>       common/cnxk: always use single interrupt ID with NIX
>>       common/cnxk: fix mbuf data offset for VF
>>
>> Harold Huang (2):
>>       net/virtio-user: fix resource leak on probing failure
>>       net/kni: fix config initialization
>>
>> Heinrich Kuhn (1):
>>       net/nfp: free HW ring memzone on queue release
>>
>> Hemant Agrawal (1):
>>       crypto/dpaax_sec: fix auth/cipher xform chain checks
>>
>> Honnappa Nagarahalli (3):
>>       examples/distributor: reduce Tx queue number to 1
>>       examples/l3fwd: share queue size variables
>>       examples/l3fwd: make Rx and Tx queue size configurable
>>
>> Huisong Li (10):
>>       net/hns3: fix mailbox wait time
>>       net/hns3: fix using enum as boolean
>>       net/hns3: fix max packet size rollback in PF
>>       net/hns3: fix insecure way to query MAC statistics
>>       net/hns3: fix double decrement of secondary count
>>       net/hns3: fix operating queue when TCAM table is invalid
>>       kni: fix freeing order in device release
>>       net/hns3: fix RSS TC mode entry
>>       net/hns3: fix VF RSS TC mode entry
>>       net/hns3: increase time waiting for PF reset completion
>>
>> Ivan Malov (8):
>>       net/sfc: validate queue span when parsing flow action RSS
>>       net/sfc: fix lock releases
>>       net/sfc: do not push fast free offload to default TxQ config
>>       net/sfc: demand Tx fast free offload on EF10 simple datapath
>>       common/sfc_efx/base: fix recirculation ID set in outer rules
>>       common/sfc_efx/base: add missing handler for 1-byte fields
>>       net/sfc: fix flow tunnel support detection
>>       net/sfc: reduce log level of tunnel restore info error
>>
>> Jakub Poczatek (1):
>>       doc: fix FIPS guide
>>
>> Jiawei Wang (4):
>>       net/mlx5: fix NIC egress flow mismatch in switchdev mode
>>       net/mlx5: fix sample flow action on trusted device
>>       net/mlx5: fix implicit tag insertion with sample action
>>       net/mlx5: fix port matching in sample flow rule
>>
>> Jiawen Wu (8):
>>       net/ngbe: fix Rx by initializing packet buffer early
>>       net/ngbe: fix missed link interrupt
>>       net/ngbe: fix Tx hang on queue disable
>>       net/ngbe: fix packet statistics
>>       net/txgbe: fix link up and down
>>       net/txgbe: fix KR auto-negotiation
>>       net/ngbe: fix debug logs
>>       net/txgbe: fix debug logs
>>
>> Jie Hai (1):
>>       net/hns3: remove duplicate macro definition
>>
>> Jie Wang (1):
>>       net: fix L2TPv2 common header
>>
>> Jie Zhou (2):
>>       eal/windows: fix error code for not supported API
>>       test/mem: fix error check
>>
>> Josh Soref (1):
>>       fix spelling in comments and strings
>>
>> Junfeng Guo (3):
>>       net/ice: fix pattern check for flow director parser
>>       net/ice: fix pattern check in flow director
>>       raw/ntb: clear all valid doorbell bits on init
>>
>> Junjie Wan (1):
>>       net/bonding: fix slaves initializing on MTU setting
>>
>> Junxiao Shi (1):
>>       net/af_xdp: fix custom program loading with multiple queues
>>
>> Juraj Linkeš (1):
>>       config/arm: add values for native armv7
>>
>> Kai Ji (2):
>>       test/crypto: fix out-of-place SGL in raw datapath
>>       crypto/qat: fix GEN4 AEAD job in raw data path
>>
>> Kalesh AP (15):
>>       net/bnxt: fix multicast address set
>>       net/bnxt: fix multicast MAC restore during reset recovery
>>       net/bnxt: fix queue stop operation
>>       net/bnxt: restore RSS configuration after reset recovery
>>       net/bnxt: fix restoring VLAN filtering after recovery
>>       net/bnxt: cap maximum number of unicast MAC addresses
>>       net/bnxt: set fast-path pointers only if recovery succeeds
>>       net/bnxt: add null check for mark table
>>       net/bnxt: fix flow create when RSS is disabled
>>       net/bnxt: get maximum supported multicast filters count
>>       net/bnxt: fix handling of VF configuration change
>>       net/bnxt: fix xstats query
>>       net/bnxt: fix check for autoneg enablement
>>       net/bnxt: handle ring cleanup in case of error
>>       net/bnxt: fix memzone allocation per VNIC
>>
>> Karl Bonde Torp (1):
>>       build: fix build on FreeBSD with Meson 0.61.1
>>
>> Kathleen Capella (2):
>>       net/iavf: count continuous DD bits for Arm
>>       net/iavf: count continuous DD bits for Arm in flex Rx
>>
>> Kevin Liu (2):
>>       net/ice: fix Tx checksum offload
>>       net/ice: fix Tx offload path choice
>>
>> Kevin Traynor (4):
>>       maintainers: update for stable branches
>>       build: suppress rte_crypto_asym_op abi check
>>       Revert "crypto/ipsec_mb: fix length and offset settings"
>>       Revert "net/mlx5: fix flex item availability"
>>
>> Kumara Parameshwaran (2):
>>       ethdev: add internal function to device struct from name
>>       net/tap: fix to populate FDs in secondary process
>>
>> Lance Richardson (2):
>>       buildtools: fix AVX512 check for Python 3.5
>>       net/bnxt: fix xstats names query overrun
>>
>> Leyi Rong (1):
>>       net/iavf: fix potential out-of-bounds access
>>
>> Lijun Ou (1):
>>       net/hns3: fix RSS key with null
>>
>> Lior Margalit (1):
>>       net/mlx5: fix assertion on flags set in packet mbuf
>>
>> Madhuker Mythri (1):
>>       devargs: fix crash with uninitialized parsing
>>
>> Martijn Bakker (1):
>>       pflock: fix header file installation
>>
>> Martin Spinler (2):
>>       net/nfb: fix array indexes in deinit functions
>>       net/nfb: fix multicast/promiscuous mode switching
>>
>> Marvin Liu (1):
>>       net/virtio: fix slots number when indirect feature on
>>
>> Matan Azrad (1):
>>       vdpa/mlx5: workaround queue stop with traffic
>>
>> Maxime Coquelin (1):
>>       vhost: fix unsafe vring addresses modifications
>>
>> Maxime Gouin (3):
>>       bus/ifpga: remove useless check while browsing devices
>>       net/nfp: remove duplicated check when setting MAC address
>>       net/nfp: remove useless range checks
>>
>> Megha Ajmera (1):
>>       examples/qos_sched: fix core mask overflow
>>
>> Michael Baum (17):
>>       common/mlx5: add minimum WQE size for striding RQ
>>       net/mlx5: improve stride parameter names
>>       net/mlx5: fix MPRQ stride devargs adjustment
>>       common/mlx5: fix error handling in multi-class probe
>>       net/mlx5: fix memory socket selection in ASO management
>>       common/mlx5: fix missing validation in devargs parsing
>>       net/mlx5: fix sibling device config check
>>       net/mlx5: fix ineffective metadata argument adjustment
>>       net/mlx5: fix ASO CT object release
>>       net/mlx5: fix errno update in shared context creation
>>       net/mlx5: fix entry in shared Rx queues list
>>       doc: remove obsolete vector Tx explanations from mlx5 guide
>>       doc: replace broken links in mlx guides
>>       doc: correct name of BlueField-2 in mlx5 guide
>>       net/mlx5: fix shared counter flag in flow validation
>>       net/mlx5: fix check in count action validation
>>       common/mlx5: consider local functions as internal
>>
>> Michal Krawczyk (6):
>>       net/ena: remove unused enumeration
>>       net/ena: remove unused offload variables
>>       net/ena: skip timer if reset is triggered
>>       net/ena: fix meta descriptor DF flag setup
>>       net/ena: fix checksum flag for L4
>>       bus/pci: assign driver pointer before mapping
>>
>> Michal Wilczynski (1):
>>       net/ice: fix overwriting of LSE bit by DCF
>>
>> Min Hu (Connor) (6):
>>       net/hns3: fix Rx/Tx functions update
>>       net/hns3: fix vector Rx/Tx when PTP enabled
>>       net/bonding: fix promiscuous and allmulticast state
>>       net/bonding: fix reference count on mbufs
>>       app/testpmd: fix bonding mode set
>>       app/testpmd: check starting port is not in bonding
>>
>> Naga Harish K S V (2):
>>       eventdev/eth_tx: fix queue add error code
>>       eventdev/eth_rx: fix queue config query
>>
>> Nicolas Chautru (1):
>>       baseband/acc100: avoid out-of-bounds access
>>
>> Nipun Gupta (1):
>>       examples/l3fwd: fix Rx burst size for event mode
>>
>> Nithin Dabilpuram (11):
>>       examples/ipsec-secgw: fix eventdev start sequence
>>       examples/ipsec-secgw: fix default flow rule creation
>>       common/cnxk: fix shift offset for TL3 length disable
>>       common/cnxk: fix byte order of frag sizes and infos
>>       common/cnxk: fix null pointer dereferences
>>       common/cnxk: fix uninitialized variables
>>       examples/ipsec-secgw: fix buffer freeing in vector mode
>>       net/cnxk: fix inline device RQ tag mask
>>       net/cnxk: register callback early to handle initial packets
>>       net/cnxk: fix inline IPsec security error handling
>>       common/cnxk: fix bitmap usage for TM
>>
>> Pablo de Lara (9):
>>       crypto/ipsec_mb: fix buffer overrun
>>       crypto/ipsec_mb: check missing operation types
>>       crypto/ipsec_mb: fix ZUC authentication verify
>>       crypto/ipsec_mb: fix ZUC operation overwrite
>>       crypto/ipsec_mb: fix length and offset settings
>>       test/efd: fix sockets mask size
>>       efd: fix uninitialized structure
>>       crypto/ipsec_mb: fix length and offset settings
>>       crypto/ipsec_mb: fix GMAC parameters setting
>>
>> Pavan Nikhilesh (6):
>>       eventdev/eth_rx: fix missing internal port checks
>>       event/cnxk: fix QoS devargs parsing
>>       common/cnxk: add workaround for vWQE flush
>>       config: align mempool elements to 128 bytes on CN10K
>>       event/cnxk: fix sub-event clearing mask length
>>       event/cnxk: fix Rx adapter config check
>>
>> Peng Yu (1):
>>       vhost: fix linker script syntax
>>
>> Piotr Bronowski (2):
>>       crypto/ipsec_mb: fix premature dereference
>>       crypto/ipsec_mb: fix GCM requested digest length
>>
>> Qi Zhang (2):
>>       net/ice: fix Tx checksum offload capability
>>       doc: update matching versions in ice guide
>>
>> Radu Nicolau (5):
>>       examples/ipsec-secgw: fix offload flag used for TSO IPv6
>>       net/iavf: fix segmentation offload condition
>>       net/iavf: fix segmentation offload buffer size
>>       net/iavf: support NAT-T / UDP encapsulation
>>       net/iavf: fix AES-GMAC IV size
>>
>> Rahul Bhansali (2):
>>       net/cnxk: fix mbuf data length
>>       examples/l3fwd: fix buffer overflow in Tx
>>
>> Rahul Lakkireddy (1):
>>       net/cxgbe: fix dangling pointer by mailbox access rework
>>
>> Raja Zidane (8):
>>       net/mlx5: fix mark enabling for Rx
>>       app/testpmd: fix GENEVE parsing in checksum mode
>>       app/compress-perf: fix cycle count operations allocation
>>       app/compress-perf: optimize operations pool allocation
>>       compress/mlx5: support out-of-space status
>>       app/compress-perf: fix socket ID type during init
>>       app/compress-perf: fix number of queue pairs to setup
>>       compressdev: fix socket ID type
>>
>> Rakesh Kudurumalla (2):
>>       net/cnxk: fix build with GCC 12
>>       net/cnxk: fix RSS RETA table update
>>
>> Rashmi Shetty (1):
>>       doc: fix dlb2 guide
>>
>> Reshma Pattan (1):
>>       app/pdump: abort on multi-core capture limit
>>
>> Rongwei Liu (3):
>>       net/mlx5: fix shared RSS destroy
>>       net/mlx5: fix meter creation default state
>>       net/mlx5: forbid multiple ASO actions in a single rule
>>
>> Ruifeng Wang (1):
>>       config: add arch define for Arm
>>
>> Satheesh Paul (5):
>>       common/cnxk: fix nibble parsing order when dumping MCAM
>>       common/cnxk: fix flow deletion
>>       common/cnxk: fix log level during MCAM allocation
>>       common/cnxk: fix base rule merge
>>       net/cnxk: fix Rx/Tx function update
>>
>> Sean Morrissey (2):
>>       app/testpmd: fix dereference before null check
>>       doc: fix telemetry example in cryptodev guide
>>
>> Shijith Thotton (1):
>>       crypto/cnxk: enable allocated queues only
>>
>> Shun Hao (3):
>>       net/mlx5: fix meter sub-policy creation
>>       net/mlx5: fix E-Switch manager vport ID
>>       net/mlx5: fix meter policy creation assert
>>
>> Simei Su (1):
>>       net/ice: fix mbuf offload flag for Rx timestamp
>>
>> Srikanth Yalavarthi (1):
>>       dma/cnxk: fix installing internal headers
>>
>> Stephen Douthit (1):
>>       net/ixgbe: fix FSP check for X550EM devices
>>
>> Stephen Hemminger (7):
>>       eal/linux: log hugepage create errors with filename
>>       net/memif: remove unnecessary Rx interrupt stub
>>       ipc: end multiprocess thread during cleanup
>>       vfio: cleanup the multiprocess sync handle
>>       pcapng: handle failure of link status query
>>       test/bpf: skip dump if conversion fails
>>       app/dumpcap: check for failure to set promiscuous
>>
>> Steve Yang (4):
>>       app/testpmd: fix stack overflow for EEPROM display
>>       net/i40e: fix unintentional integer overflow
>>       eal/linux: fix illegal memory access in uevent handler
>>       net/iavf: fix function pointer in multi-process
>>
>> Suanming Mou (3):
>>       net/mlx5: set flow error for hash list create
>>       net/mlx5: remove unused function
>>       net/mlx5: fix indexed pool fetch overlap
>>
>> Thinh Tran (1):
>>       net/mlx5: fix CPU socket ID for Rx queue creation
>>
>> Thomas Monjalon (6):
>>       doc: replace deprecated distutils version parsing
>>       dmadev: add missing header include
>>       app/testpmd: fix build without drivers
>>       regexdev: fix section attribute of symbols
>>       build: hide local symbols in shared libraries
>>       devtools: fix symbols check
>>
>> Tianfei Zhang (2):
>>       raw/ifpga/base: fix SPI transaction
>>       raw/ifpga: fix thread closing
>>
>> Tianli Lai (1):
>>       examples/kni: add missing trailing newline in log
>>
>> Timothy McDaniel (3):
>>       event/dlb2: update rolling mask used for dequeue
>>       event/dlb2: poll HW CQ inflights before mapping queue
>>       event/dlb2: add shift value check in sparse dequeue
>>
>> Vanshika Shukla (2):
>>       net/dpaa2: fix unregistering interrupt handler
>>       net/dpaa2: fix timestamping for IEEE1588
>>
>> Viacheslav Ovsiienko (4):
>>       net/mlx5: fix modify field MAC address offset
>>       app/testpmd: fix Tx scheduling interval
>>       net/mlx5: fix metadata endianness in modify field action
>>       doc: fix modify field action description for mlx5
>>
>> Vladimir Medvedkin (1):
>>       app/fib: fix division by zero
>>
>> Wei Huang (5):
>>       raw/ifpga/base: fix port feature ID
>>       raw/ifpga: fix variable initialization in probing
>>       raw/ifpga: fix interrupt handle allocation
>>       raw/ifpga: fix monitor thread
>>       raw/ifpga: fix build with optimization
>>
>> Weiguo Li (14):
>>       common/cnxk: fix error checking
>>       net/enic: fix dereference before null check
>>       net/dpaa2: fix null pointer dereference
>>       regex/mlx5: fix memory allocation check
>>       net/memif: remove pointer deference before null check
>>       net/iavf: fix null pointer dereference
>>       vdpa/sfc: fix null dereference during config
>>       vdpa/sfc: fix null dereference during removal
>>       compress/octeontx: fix null pointer dereference
>>       eventdev/eth_rx: fix parameters parsing memory leak
>>       net/sfc: fix memory allocation size for cache
>>       net/txgbe: fix queue statistics mapping
>>       sched: remove useless malloc in PIE data init
>>       net/bnxt: fix null dereference in session cleanup
>>
>> Wenwu Ma (1):
>>       examples/vhost: fix launch with physical port
>>
>> Wenxuan Wu (1):
>>       eal/linux: fix device monitor stop return
>>
>> Xiaoyu Min (1):
>>       net/mlx5: reject jump to root table
>>
>> Xuan Ding (2):
>>       vhost: fix field naming in guest page struct
>>       vhost: fix physical address mapping
>>
>> Xueming Li (1):
>>       net/virtio: fix Tx queue 0 overriden by queue 128
>>
>> Yajun Wu (1):
>>       common/mlx5: fix queue pair ack timeout configuration
>>
>> Yiding Zhou (1):
>>       net/ice: fix build with 16-byte Rx descriptor
>>
>> Yu Wenjun (1):
>>       net/bonding: fix RSS with early configure
>>
>> Yuan Wang (1):
>>       vhost: fix guest to host physical address mapping
>>
>> Yunjian Wang (12):
>>       net/bonding: fix mode type mismatch
>>       ethdev: fix Rx queue telemetry memory leak on failure
>>       net/ice: fix link up when starting device
>>       net/virtio-user: check FD flags getting failure
>>       net/virtio: fix uninitialized RSS key
>>       ring: fix error code when creating ring
>>       net/ixgbe: check filter init failure
>>       mem: check allocation in dynamic hugepage init
>>       ethdev: remove unnecessary null check
>>       net/ixgbe: reset security context pointer on close
>>       net/txgbe: reset security context pointer on close
>>       net/iavf: reset security context pointer on stop
>>
>> Yuying Zhang (1):
>>       net/ice/base: add profile validation on switch filter
>>
>> Zhihong Wang (1):
>>       ring: fix overflow in memory size calculation
>>
>>

[-- Attachment #2: Type: text/html, Size: 31086 bytes --]

^ permalink raw reply	[relevance 0%]

* RE: [PATCH 1/2] security: introduce per session event metadata
  2022-04-04 10:42  0%       ` Gujjar, Abhinandan S
@ 2022-04-13  7:13  3%         ` Akhil Goyal
  0 siblings, 0 replies; 200+ results
From: Akhil Goyal @ 2022-04-13  7:13 UTC (permalink / raw)
  To: Gujjar, Abhinandan S, Volodymyr Fialko, dev, Jayatheerthan, Jay,
	Vangati, Narender
  Cc: Jerin Jacob Kollanukkaran, Anoob Joseph

Hi Abhinandan and others,
> + @Jayatheerthan, Jay & @Vangati, Narender
> 
> > This change would be an ABI breakage. So to avoid that, we are planning to
> > Propose a better solution compared to this patch.
> > We plan to add a new cryptodev op to set the event metadata. A single API
> > which can be used in all cases - sym/asym/security sessions.
> >
> > As currently in case of sym crypto, userdata is being used for storing the event
> > Metadata and it is then dereferenced in the PMD which is wrong.
> > User data is meant only for user to use and PMD should not dereference it.
> >
> > Hence a new cryptodev op can be used to set session event metadata explicitly
> > if event mode is enabled.
> >
> > I will be sending the proposal soon. Would need your help in testing the Intel
> > usecases.
> >

We may need to stick to the approach introduced in this patch only.
As if we propose, a new single API for all type of sessions, the driver would need to
Get the event metadata from the session private data. This is not possible with
Your use case which gets it inside the eventdev library for sw adapter case as it cannot
Get the session private data without knowing the cdev_id.

Hence, we will take this patch as is in next release for security sessions(as it is an ABI break)
And would also introduce a similar change for crypto sessions in next release.
This way we can get rid of using userdata which is wrong implementation.

Regards,
Akhil

^ permalink raw reply	[relevance 3%]

* Re: 21.11.1 patches review and test
  2022-04-11  6:58  0% ` Christian Ehrhardt
@ 2022-04-13  7:26  0%   ` Christian Ehrhardt
  2022-04-13 10:06  3%   ` Kevin Traynor
  1 sibling, 0 replies; 200+ results
From: Christian Ehrhardt @ 2022-04-13  7:26 UTC (permalink / raw)
  To: Kevin Traynor
  Cc: stable, dev, Abhishek Marathe, Ali Alnubani, benjamin.walker,
	David Christensen, hariprasad.govindharajan, Hemant Agrawal,
	Ian Stokes, Jerin Jacob, John McNamara, Ju-Hyoung Lee,
	Luca Boccassi, Pei Zhang, qian.q.xu, Raslan Darawsheh,
	Thomas Monjalon, yuan.peng, zhaoyan.chen

On Mon, Apr 11, 2022 at 8:58 AM Christian Ehrhardt
<christian.ehrhardt@canonical.com> wrote:
>
> On Fri, Apr 1, 2022 at 12:22 PM Kevin Traynor <ktraynor@redhat.com> wrote:
> >
> > Hi all,
> >
> > Here is a list of patches targeted for stable release 21.11.1.
>
> Hi Kevin,
> this breaks on me at build time due to symbol changes.
> It is a wild mix of Base->Internal/Experimental, a few new symbols,
> and even just removed ones (in gpu which is experimental, but still
> would that need a minor soname bump?).
> They might be intentional, but it felt too much to me without at least
> discussing it.
> Could you have a look if you think that they are all intentional, save
> and correct for an LTS release?

ping ^^ ?

> dpkg-gensymbols: warning: some new symbols appeared in the symbols
> file: see diff output below
> dpkg-gensymbols: warning: debian/librte-common-cnxk22/DEBIAN/symbols
> doesn't match completely debian/librte-common-cnxk22.symbols
> --- debian/librte-common-cnxk22.symbols
> (librte-common-cnxk22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> +++ dpkg-gensymbolsUuRb8d 2022-04-11 06:46:22.276766813 +0000
> @@ -197,6 +197,7 @@
>   roc_nix_ptp_clock_read@INTERNAL 21.08
>   roc_nix_ptp_info_cb_register@INTERNAL 21.08
>   roc_nix_ptp_info_cb_unregister@INTERNAL 21.08
> + roc_nix_ptp_is_enable@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>   roc_nix_ptp_rx_ena_dis@INTERNAL 21.08
>   roc_nix_ptp_sync_time_adjust@INTERNAL 21.08
>   roc_nix_ptp_tx_ena_dis@INTERNAL 21.08
>
> dpkg-gensymbols: warning: some new symbols appeared in the symbols
> file: see diff output below
> dpkg-gensymbols: warning: debian/librte-ethdev22/DEBIAN/symbols
> doesn't match completely debian/librte-ethdev22.symbols
> --- debian/librte-ethdev22.symbols
> (librte-ethdev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> +++ dpkg-gensymbolskEnokB 2022-04-11 06:46:25.252795157 +0000
> @@ -37,6 +37,7 @@
>   rte_eth_dev_flow_ctrl_get@DPDK_22 21.11
>   rte_eth_dev_flow_ctrl_set@DPDK_22 21.11
>   rte_eth_dev_fw_version_get@DPDK_22 21.11
> + rte_eth_dev_get_by_name@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>   rte_eth_dev_get_dcb_info@DPDK_22 21.11
>   rte_eth_dev_get_eeprom@DPDK_22 21.11
>   rte_eth_dev_get_eeprom_length@DPDK_22 21.11
>
> dpkg-gensymbols: warning: some new symbols appeared in the symbols
> file: see diff output below
> dpkg-gensymbols: error: some symbols or patterns disappeared in the
> symbols file: see diff output below
> dpkg-gensymbols: warning: debian/librte-regexdev22/DEBIAN/symbols
> doesn't match completely debian/librte-regexdev22.symbols
> --- debian/librte-regexdev22.symbols
> (librte-regexdev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> +++ dpkg-gensymbolsPD0Ygo 2022-04-11 06:46:33.368872490 +0000
> @@ -1,6 +1,8 @@
>  librte_regexdev.so.22 librte-regexdev22 #MINVER#
>   EXPERIMENTAL@EXPERIMENTAL 20.11
> - rte_regex_devices@Base 20.11
> + INTERNAL@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
> + rte_regex_devices@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
>   rte_regexdev_attr_get@EXPERIMENTAL 20.11
>   rte_regexdev_attr_set@EXPERIMENTAL 20.11
>   rte_regexdev_close@EXPERIMENTAL 20.11
> @@ -8,12 +10,16 @@
>   rte_regexdev_count@EXPERIMENTAL 20.11
>   rte_regexdev_dump@EXPERIMENTAL 20.11
>   rte_regexdev_get_dev_id@EXPERIMENTAL 20.11
> - rte_regexdev_get_device_by_name@Base 20.11
> + rte_regexdev_get_device_by_name@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>   rte_regexdev_info_get@EXPERIMENTAL 20.11
> - rte_regexdev_is_valid_dev@Base 20.11
> - rte_regexdev_logtype@Base 20.11
> + rte_regexdev_is_valid_dev@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
> + rte_regexdev_logtype@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
>   rte_regexdev_queue_pair_setup@EXPERIMENTAL 20.11
> - rte_regexdev_register@Base 20.11
> + rte_regexdev_register@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>   rte_regexdev_rule_db_compile_activate@EXPERIMENTAL 20.11
>   rte_regexdev_rule_db_export@EXPERIMENTAL 20.11
>   rte_regexdev_rule_db_import@EXPERIMENTAL 20.11
> @@ -21,7 +27,8 @@
>   rte_regexdev_selftest@EXPERIMENTAL 20.11
>   rte_regexdev_start@EXPERIMENTAL 20.11
>   rte_regexdev_stop@EXPERIMENTAL 20.11
> - rte_regexdev_unregister@Base 20.11
> + rte_regexdev_unregister@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>   rte_regexdev_xstats_by_name_get@EXPERIMENTAL 20.11
>   rte_regexdev_xstats_get@EXPERIMENTAL 20.11
>   rte_regexdev_xstats_names_get@EXPERIMENTAL 20.11
>
> dpkg-gensymbols: error: some symbols or patterns disappeared in the
> symbols file: see diff output below
> dpkg-gensymbols: warning: debian/librte-gpudev22/DEBIAN/symbols
> doesn't match completely debian/librte-gpudev22.symbols
> --- debian/librte-gpudev22.symbols
> (librte-gpudev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> +++ dpkg-gensymbols4qkXdt 2022-04-11 06:46:34.552883776 +0000
> @@ -1,7 +1,7 @@
>  librte_gpudev.so.22 librte-gpudev22 #MINVER#
>   EXPERIMENTAL@EXPERIMENTAL 21.11
>   INTERNAL@INTERNAL 21.11
> - gpu_logtype@Base 21.11
>   rte_gpu_add_child@EXPERIMENTAL 21.11
>   rte_gpu_allocate@INTERNAL 21.11
>   rte_gpu_attach@INTERNAL 21.11
>
>
> Full log:
> https://launchpadlibrarian.net/596047842/buildlog_ubuntu-jammy-amd64.dpdk_21.11.1~rc1-0ubuntu1~jammyppa2_BUILDING.txt.gz
>
> > Please try and complete validation by April 13th.
> >
> > Please help with testing and validation of your use cases and report
> > any issues/results with reply-all to this mail. For the final release
> > the fixes and reported validations will be added to the release notes.
> >
> > A release candidate tarball can be found at:
> >
> >     https://dpdk.org/browse/dpdk-stable/tag/?id=v21.11.1-rc1
> >
> > These patches are located at branch 21.11 of dpdk-stable repo:
> >     https://dpdk.org/browse/dpdk-stable/
> >
> > Thanks.
> >
> > Kevin
> >
> > ---
> > Adham Masarwah (2):
> >       net/mlx5: fix destroying empty matchers list
> >       app/testpmd: fix show RSS RETA on Windows
> >
> > Ajit Khaparde (7):
> >       net/bnxt: fix ring teardown
> >       net/bnxt: fix PAM4 mask setting
> >       net/bnxt: fix crash by validating pointer
> >       net/bnxt: check VF representor pointer before access
> >       net/bnxt: fix VF resource allocation strategy
> >       net/bnxt: set HW coalescing parameters
> >       net/bnxt: fix ring calculation for representors
> >
> > Alexander Kozyrev (4):
> >       net/mlx5: fix maximum packet headers size for TSO
> >       net/mlx5: fix MPRQ WQE size assertion
> >       net/mlx5: fix committed bucket size
> >       net/mlx5: fix meter capabilities reporting
> >
> > Ali Alnubani (1):
> >       doc: fix typos and punctuation in flow API guide
> >
> > Anatoly Burakov (1):
> >       net/qede: fix redundant condition in debug code
> >
> > Andy Pei (1):
> >       vdpa/ifc: fix log info mismatch
> >
> > Ankur Dwivedi (1):
> >       common/cnxk: fix NPC key extraction validation
> >
> > Anoob Joseph (4):
> >       common/cnxk: fix reset of fields
> >       crypto/cnxk: fix inflight count calculation
> >       crypto/cnxk: fix extend tail calculation
> >       crypto/cnxk: fix update of number of descriptors
> >
> > Arek Kusztal (1):
> >       cryptodev: fix RSA key type name
> >
> > Asaf Ravid (1):
> >       net/cnxk: fix promiscuous mode in multicast enable flow
> >
> > Ashwin Sekhar T K (1):
> >       mempool/cnxk: fix batch allocation failure path
> >
> > Bin Zheng (1):
> >       net/ixgbe: add vector Rx parameter check
> >
> > Bing Zhao (5):
> >       common/mlx5: fix probing failure code
> >       app/testpmd: fix raw encap of GENEVE option
> >       net/mlx5: fix matcher priority with ICMP or ICMPv6
> >       net/mlx5: remove unused reference counter
> >       net/mlx5: fix configuration without Rx queue
> >
> > Brian Dooley (13):
> >       eal: add missing C++ guards
> >       telemetry: add missing C++ guards
> >       ethdev: add missing C++ guards
> >       metrics: add missing C++ guards
> >       acl: add missing C++ guards
> >       compressdev: add missing C++ guards
> >       eventdev: add missing C++ guards
> >       kni: add missing C++ guards
> >       vhost: add missing C++ guards
> >       bpf: add missing C++ guards
> >       cryptodev: add missing C++ guards
> >       examples/l2fwd-crypto: fix port mask overflow
> >       crypto/virtio: fix out-of-bounds access
> >
> > Bruce Richardson (23):
> >       doc: remove dependency on findutils on FreeBSD
> >       dma/idxd: fix burst capacity calculation
> >       dma/idxd: fix paths to driver sysfs directory
> >       dma/idxd: fix wrap-around in burst capacity calculation
> >       build: fix warnings when running external commands
> >       build: remove deprecated Meson functions
> >       eal: fix C++ include
> >       eventdev: fix C++ include
> >       graph: fix C++ include
> >       ipsec: fix C++ include
> >       table: fix C++ include
> >       vhost: fix C++ include
> >       ethdev: fix cast for C++ compatibility
> >       test/dma: fix missing checks for device capacity
> >       dma/idxd: configure maximum batch size to high value
> >       doc: improve configuration examples in idxd guide
> >       distributor: fix potential overflow
> >       eal/freebsd: add missing C++ include guards
> >       compressdev: fix missing space in log macro
> >       cryptodev: fix clang C++ include
> >       eventdev: fix clang C++ include
> >       doc: replace characters for (R) symbol in Linux guide
> >       doc: fix missing note on UIO module in Linux guide
> >
> > Chandubabu Namburu (1):
> >       net/axgbe: use PCI root complex device to distinguish device
> >
> > Chenbo Xia (1):
> >       vhost: fix queue number check when setting inflight FD
> >
> > Chengchang Tang (1):
> >       net/bonding: fix offloading configuration
> >
> > Chengwen Feng (2):
> >       net/hns3: delete duplicated RSS type
> >       dma/hisilicon: use common PCI device naming
> >
> > Chuanshe Zhang (1):
> >       examples/flow_classify: fix failure message
> >
> > Ciara Loftus (2):
> >       net/af_xdp: fix build with -Wunused-function
> >       net/af_xdp: ensure socket is deleted on Rx queue setup error
> >
> > Ciara Power (4):
> >       crypto/ipsec_mb: fix queue setup null pointer dereference
> >       crypto/ipsec_mb: fix queue cleanup null pointer dereference
> >       crypto/ipsec_mb: fix tainted data for session
> >       crypto/ipsec_mb: remove useless check
> >
> > Cristian Dumitrescu (2):
> >       pipeline: fix annotation checks
> >       pipeline: fix table state memory allocation
> >
> > Dapeng Yu (2):
> >       net/ice: track DCF state of PF
> >       net/i40e: enable maximum frame size at port level
> >
> > Dariusz Sosnowski (3):
> >       net/mlx5: fix inline length for multi-segment TSO
> >       net/mlx5: fix MPLS/GRE Verbs spec ordering
> >       net/mlx5: fix VLAN push action validation
> >
> > David Marchand (8):
> >       devtools: fix comment detection in forbidden token check
> >       stack: fix stubs header export
> >       test/mbuf: fix mbuf data content check
> >       ethdev: fix MAC address in telemetry device info
> >       net/af_xdp: add missing trailing newline in logs
> >       devtools: remove event/dlb exception in ABI check
> >       vhost: fix FD leak with inflight messages
> >       bpf: fix build with some libpcap version on FreeBSD
> >
> > Dawid Gorecki (2):
> >       net/ena: fix reset reason being overwritten
> >       net/ena: check memory BAR before initializing LLQ
> >
> > Devendra Singh Rawat (3):
> >       net/qede: fix Tx completion
> >       net/qede: fix Rx bulk
> >       net/qede: fix maximum Rx packet length
> >
> > Dmitry Kozlyuk (8):
> >       net/mlx5: fix GCC uninitialized variable warning
> >       net/mlx5: relax headroom assertion
> >       app/testpmd: fix external buffer allocation
> >       common/mlx5: fix MR lookup for non-contiguous mempool
> >       common/mlx5: add Netlink event helpers
> >       net/mlx5: fix link status change detection
> >       net/mlx5: fix initial link status detection
> >       net/mlx5: fix modify port action validation
> >
> > Elena Agostini (3):
> >       gpu/cuda: fix memory list cleanup
> >       doc: add CUDA driver features
> >       gpu/cuda: fix dependency loading path
> >
> > Ferruh Yigit (2):
> >       net/bonding: fix MTU set for slaves
> >       ethdev: fix doxygen comments for device info struct
> >
> > Geoffrey Le Gourriérec (1):
> >       net/bnxt: restore dependency on kernel modules
> >
> > Gerry Gribbon (1):
> >       app/regex: fix number of matches
> >
> > Gowrishankar Muthukrishnan (6):
> >       event/cnxk: fix variables casting
> >       event/cnxk: fix uninitialized local variables
> >       common/cnxk: add missing checks of return values
> >       common/cnxk fix unintended sign extension
> >       common/cnxk: fix uninitialized pointer read
> >       net/cnxk: fix uninitialized local variable
> >
> > Gregory Etelson (10):
> >       net/mlx5: fix RSS expansion with explicit next protocol
> >       net/mlx5: fix GRE protocol type translation for Verbs
> >       net/mlx5: fix GRE item translation in Verbs
> >       net/mlx5: reduce flex item flow handle size
> >       net/mlx5: fix flex item header length translation
> >       net/mlx5: fix inet IPIP protocol type
> >       net/mlx5: fix next protocol RSS expansion
> >       net/mlx5: fix flex item availability
> >       app/testpmd: fix GTP header parsing in checksum engine
> >       app/testpmd: fix flow rule with flex input link
> >
> > Haiyue Wang (2):
> >       net/iavf: remove git residue symbol
> >       doc: fix KNI PMD name typo
> >
> > Harman Kalra (3):
> >       common/cnxk: reset stale values on error debug registers
> >       common/cnxk: always use single interrupt ID with NIX
> >       common/cnxk: fix mbuf data offset for VF
> >
> > Harold Huang (2):
> >       net/virtio-user: fix resource leak on probing failure
> >       net/kni: fix config initialization
> >
> > Heinrich Kuhn (1):
> >       net/nfp: free HW ring memzone on queue release
> >
> > Hemant Agrawal (1):
> >       crypto/dpaax_sec: fix auth/cipher xform chain checks
> >
> > Honnappa Nagarahalli (3):
> >       examples/distributor: reduce Tx queue number to 1
> >       examples/l3fwd: share queue size variables
> >       examples/l3fwd: make Rx and Tx queue size configurable
> >
> > Huisong Li (10):
> >       net/hns3: fix mailbox wait time
> >       net/hns3: fix using enum as boolean
> >       net/hns3: fix max packet size rollback in PF
> >       net/hns3: fix insecure way to query MAC statistics
> >       net/hns3: fix double decrement of secondary count
> >       net/hns3: fix operating queue when TCAM table is invalid
> >       kni: fix freeing order in device release
> >       net/hns3: fix RSS TC mode entry
> >       net/hns3: fix VF RSS TC mode entry
> >       net/hns3: increase time waiting for PF reset completion
> >
> > Ivan Malov (8):
> >       net/sfc: validate queue span when parsing flow action RSS
> >       net/sfc: fix lock releases
> >       net/sfc: do not push fast free offload to default TxQ config
> >       net/sfc: demand Tx fast free offload on EF10 simple datapath
> >       common/sfc_efx/base: fix recirculation ID set in outer rules
> >       common/sfc_efx/base: add missing handler for 1-byte fields
> >       net/sfc: fix flow tunnel support detection
> >       net/sfc: reduce log level of tunnel restore info error
> >
> > Jakub Poczatek (1):
> >       doc: fix FIPS guide
> >
> > Jiawei Wang (4):
> >       net/mlx5: fix NIC egress flow mismatch in switchdev mode
> >       net/mlx5: fix sample flow action on trusted device
> >       net/mlx5: fix implicit tag insertion with sample action
> >       net/mlx5: fix port matching in sample flow rule
> >
> > Jiawen Wu (8):
> >       net/ngbe: fix Rx by initializing packet buffer early
> >       net/ngbe: fix missed link interrupt
> >       net/ngbe: fix Tx hang on queue disable
> >       net/ngbe: fix packet statistics
> >       net/txgbe: fix link up and down
> >       net/txgbe: fix KR auto-negotiation
> >       net/ngbe: fix debug logs
> >       net/txgbe: fix debug logs
> >
> > Jie Hai (1):
> >       net/hns3: remove duplicate macro definition
> >
> > Jie Wang (1):
> >       net: fix L2TPv2 common header
> >
> > Jie Zhou (2):
> >       eal/windows: fix error code for not supported API
> >       test/mem: fix error check
> >
> > Josh Soref (1):
> >       fix spelling in comments and strings
> >
> > Junfeng Guo (3):
> >       net/ice: fix pattern check for flow director parser
> >       net/ice: fix pattern check in flow director
> >       raw/ntb: clear all valid doorbell bits on init
> >
> > Junjie Wan (1):
> >       net/bonding: fix slaves initializing on MTU setting
> >
> > Junxiao Shi (1):
> >       net/af_xdp: fix custom program loading with multiple queues
> >
> > Juraj Linkeš (1):
> >       config/arm: add values for native armv7
> >
> > Kai Ji (2):
> >       test/crypto: fix out-of-place SGL in raw datapath
> >       crypto/qat: fix GEN4 AEAD job in raw data path
> >
> > Kalesh AP (15):
> >       net/bnxt: fix multicast address set
> >       net/bnxt: fix multicast MAC restore during reset recovery
> >       net/bnxt: fix queue stop operation
> >       net/bnxt: restore RSS configuration after reset recovery
> >       net/bnxt: fix restoring VLAN filtering after recovery
> >       net/bnxt: cap maximum number of unicast MAC addresses
> >       net/bnxt: set fast-path pointers only if recovery succeeds
> >       net/bnxt: add null check for mark table
> >       net/bnxt: fix flow create when RSS is disabled
> >       net/bnxt: get maximum supported multicast filters count
> >       net/bnxt: fix handling of VF configuration change
> >       net/bnxt: fix xstats query
> >       net/bnxt: fix check for autoneg enablement
> >       net/bnxt: handle ring cleanup in case of error
> >       net/bnxt: fix memzone allocation per VNIC
> >
> > Karl Bonde Torp (1):
> >       build: fix build on FreeBSD with Meson 0.61.1
> >
> > Kathleen Capella (2):
> >       net/iavf: count continuous DD bits for Arm
> >       net/iavf: count continuous DD bits for Arm in flex Rx
> >
> > Kevin Liu (2):
> >       net/ice: fix Tx checksum offload
> >       net/ice: fix Tx offload path choice
> >
> > Kevin Traynor (4):
> >       maintainers: update for stable branches
> >       build: suppress rte_crypto_asym_op abi check
> >       Revert "crypto/ipsec_mb: fix length and offset settings"
> >       Revert "net/mlx5: fix flex item availability"
> >
> > Kumara Parameshwaran (2):
> >       ethdev: add internal function to device struct from name
> >       net/tap: fix to populate FDs in secondary process
> >
> > Lance Richardson (2):
> >       buildtools: fix AVX512 check for Python 3.5
> >       net/bnxt: fix xstats names query overrun
> >
> > Leyi Rong (1):
> >       net/iavf: fix potential out-of-bounds access
> >
> > Lijun Ou (1):
> >       net/hns3: fix RSS key with null
> >
> > Lior Margalit (1):
> >       net/mlx5: fix assertion on flags set in packet mbuf
> >
> > Madhuker Mythri (1):
> >       devargs: fix crash with uninitialized parsing
> >
> > Martijn Bakker (1):
> >       pflock: fix header file installation
> >
> > Martin Spinler (2):
> >       net/nfb: fix array indexes in deinit functions
> >       net/nfb: fix multicast/promiscuous mode switching
> >
> > Marvin Liu (1):
> >       net/virtio: fix slots number when indirect feature on
> >
> > Matan Azrad (1):
> >       vdpa/mlx5: workaround queue stop with traffic
> >
> > Maxime Coquelin (1):
> >       vhost: fix unsafe vring addresses modifications
> >
> > Maxime Gouin (3):
> >       bus/ifpga: remove useless check while browsing devices
> >       net/nfp: remove duplicated check when setting MAC address
> >       net/nfp: remove useless range checks
> >
> > Megha Ajmera (1):
> >       examples/qos_sched: fix core mask overflow
> >
> > Michael Baum (17):
> >       common/mlx5: add minimum WQE size for striding RQ
> >       net/mlx5: improve stride parameter names
> >       net/mlx5: fix MPRQ stride devargs adjustment
> >       common/mlx5: fix error handling in multi-class probe
> >       net/mlx5: fix memory socket selection in ASO management
> >       common/mlx5: fix missing validation in devargs parsing
> >       net/mlx5: fix sibling device config check
> >       net/mlx5: fix ineffective metadata argument adjustment
> >       net/mlx5: fix ASO CT object release
> >       net/mlx5: fix errno update in shared context creation
> >       net/mlx5: fix entry in shared Rx queues list
> >       doc: remove obsolete vector Tx explanations from mlx5 guide
> >       doc: replace broken links in mlx guides
> >       doc: correct name of BlueField-2 in mlx5 guide
> >       net/mlx5: fix shared counter flag in flow validation
> >       net/mlx5: fix check in count action validation
> >       common/mlx5: consider local functions as internal
> >
> > Michal Krawczyk (6):
> >       net/ena: remove unused enumeration
> >       net/ena: remove unused offload variables
> >       net/ena: skip timer if reset is triggered
> >       net/ena: fix meta descriptor DF flag setup
> >       net/ena: fix checksum flag for L4
> >       bus/pci: assign driver pointer before mapping
> >
> > Michal Wilczynski (1):
> >       net/ice: fix overwriting of LSE bit by DCF
> >
> > Min Hu (Connor) (6):
> >       net/hns3: fix Rx/Tx functions update
> >       net/hns3: fix vector Rx/Tx when PTP enabled
> >       net/bonding: fix promiscuous and allmulticast state
> >       net/bonding: fix reference count on mbufs
> >       app/testpmd: fix bonding mode set
> >       app/testpmd: check starting port is not in bonding
> >
> > Naga Harish K S V (2):
> >       eventdev/eth_tx: fix queue add error code
> >       eventdev/eth_rx: fix queue config query
> >
> > Nicolas Chautru (1):
> >       baseband/acc100: avoid out-of-bounds access
> >
> > Nipun Gupta (1):
> >       examples/l3fwd: fix Rx burst size for event mode
> >
> > Nithin Dabilpuram (11):
> >       examples/ipsec-secgw: fix eventdev start sequence
> >       examples/ipsec-secgw: fix default flow rule creation
> >       common/cnxk: fix shift offset for TL3 length disable
> >       common/cnxk: fix byte order of frag sizes and infos
> >       common/cnxk: fix null pointer dereferences
> >       common/cnxk: fix uninitialized variables
> >       examples/ipsec-secgw: fix buffer freeing in vector mode
> >       net/cnxk: fix inline device RQ tag mask
> >       net/cnxk: register callback early to handle initial packets
> >       net/cnxk: fix inline IPsec security error handling
> >       common/cnxk: fix bitmap usage for TM
> >
> > Pablo de Lara (9):
> >       crypto/ipsec_mb: fix buffer overrun
> >       crypto/ipsec_mb: check missing operation types
> >       crypto/ipsec_mb: fix ZUC authentication verify
> >       crypto/ipsec_mb: fix ZUC operation overwrite
> >       crypto/ipsec_mb: fix length and offset settings
> >       test/efd: fix sockets mask size
> >       efd: fix uninitialized structure
> >       crypto/ipsec_mb: fix length and offset settings
> >       crypto/ipsec_mb: fix GMAC parameters setting
> >
> > Pavan Nikhilesh (6):
> >       eventdev/eth_rx: fix missing internal port checks
> >       event/cnxk: fix QoS devargs parsing
> >       common/cnxk: add workaround for vWQE flush
> >       config: align mempool elements to 128 bytes on CN10K
> >       event/cnxk: fix sub-event clearing mask length
> >       event/cnxk: fix Rx adapter config check
> >
> > Peng Yu (1):
> >       vhost: fix linker script syntax
> >
> > Piotr Bronowski (2):
> >       crypto/ipsec_mb: fix premature dereference
> >       crypto/ipsec_mb: fix GCM requested digest length
> >
> > Qi Zhang (2):
> >       net/ice: fix Tx checksum offload capability
> >       doc: update matching versions in ice guide
> >
> > Radu Nicolau (5):
> >       examples/ipsec-secgw: fix offload flag used for TSO IPv6
> >       net/iavf: fix segmentation offload condition
> >       net/iavf: fix segmentation offload buffer size
> >       net/iavf: support NAT-T / UDP encapsulation
> >       net/iavf: fix AES-GMAC IV size
> >
> > Rahul Bhansali (2):
> >       net/cnxk: fix mbuf data length
> >       examples/l3fwd: fix buffer overflow in Tx
> >
> > Rahul Lakkireddy (1):
> >       net/cxgbe: fix dangling pointer by mailbox access rework
> >
> > Raja Zidane (8):
> >       net/mlx5: fix mark enabling for Rx
> >       app/testpmd: fix GENEVE parsing in checksum mode
> >       app/compress-perf: fix cycle count operations allocation
> >       app/compress-perf: optimize operations pool allocation
> >       compress/mlx5: support out-of-space status
> >       app/compress-perf: fix socket ID type during init
> >       app/compress-perf: fix number of queue pairs to setup
> >       compressdev: fix socket ID type
> >
> > Rakesh Kudurumalla (2):
> >       net/cnxk: fix build with GCC 12
> >       net/cnxk: fix RSS RETA table update
> >
> > Rashmi Shetty (1):
> >       doc: fix dlb2 guide
> >
> > Reshma Pattan (1):
> >       app/pdump: abort on multi-core capture limit
> >
> > Rongwei Liu (3):
> >       net/mlx5: fix shared RSS destroy
> >       net/mlx5: fix meter creation default state
> >       net/mlx5: forbid multiple ASO actions in a single rule
> >
> > Ruifeng Wang (1):
> >       config: add arch define for Arm
> >
> > Satheesh Paul (5):
> >       common/cnxk: fix nibble parsing order when dumping MCAM
> >       common/cnxk: fix flow deletion
> >       common/cnxk: fix log level during MCAM allocation
> >       common/cnxk: fix base rule merge
> >       net/cnxk: fix Rx/Tx function update
> >
> > Sean Morrissey (2):
> >       app/testpmd: fix dereference before null check
> >       doc: fix telemetry example in cryptodev guide
> >
> > Shijith Thotton (1):
> >       crypto/cnxk: enable allocated queues only
> >
> > Shun Hao (3):
> >       net/mlx5: fix meter sub-policy creation
> >       net/mlx5: fix E-Switch manager vport ID
> >       net/mlx5: fix meter policy creation assert
> >
> > Simei Su (1):
> >       net/ice: fix mbuf offload flag for Rx timestamp
> >
> > Srikanth Yalavarthi (1):
> >       dma/cnxk: fix installing internal headers
> >
> > Stephen Douthit (1):
> >       net/ixgbe: fix FSP check for X550EM devices
> >
> > Stephen Hemminger (7):
> >       eal/linux: log hugepage create errors with filename
> >       net/memif: remove unnecessary Rx interrupt stub
> >       ipc: end multiprocess thread during cleanup
> >       vfio: cleanup the multiprocess sync handle
> >       pcapng: handle failure of link status query
> >       test/bpf: skip dump if conversion fails
> >       app/dumpcap: check for failure to set promiscuous
> >
> > Steve Yang (4):
> >       app/testpmd: fix stack overflow for EEPROM display
> >       net/i40e: fix unintentional integer overflow
> >       eal/linux: fix illegal memory access in uevent handler
> >       net/iavf: fix function pointer in multi-process
> >
> > Suanming Mou (3):
> >       net/mlx5: set flow error for hash list create
> >       net/mlx5: remove unused function
> >       net/mlx5: fix indexed pool fetch overlap
> >
> > Thinh Tran (1):
> >       net/mlx5: fix CPU socket ID for Rx queue creation
> >
> > Thomas Monjalon (6):
> >       doc: replace deprecated distutils version parsing
> >       dmadev: add missing header include
> >       app/testpmd: fix build without drivers
> >       regexdev: fix section attribute of symbols
> >       build: hide local symbols in shared libraries
> >       devtools: fix symbols check
> >
> > Tianfei Zhang (2):
> >       raw/ifpga/base: fix SPI transaction
> >       raw/ifpga: fix thread closing
> >
> > Tianli Lai (1):
> >       examples/kni: add missing trailing newline in log
> >
> > Timothy McDaniel (3):
> >       event/dlb2: update rolling mask used for dequeue
> >       event/dlb2: poll HW CQ inflights before mapping queue
> >       event/dlb2: add shift value check in sparse dequeue
> >
> > Vanshika Shukla (2):
> >       net/dpaa2: fix unregistering interrupt handler
> >       net/dpaa2: fix timestamping for IEEE1588
> >
> > Viacheslav Ovsiienko (4):
> >       net/mlx5: fix modify field MAC address offset
> >       app/testpmd: fix Tx scheduling interval
> >       net/mlx5: fix metadata endianness in modify field action
> >       doc: fix modify field action description for mlx5
> >
> > Vladimir Medvedkin (1):
> >       app/fib: fix division by zero
> >
> > Wei Huang (5):
> >       raw/ifpga/base: fix port feature ID
> >       raw/ifpga: fix variable initialization in probing
> >       raw/ifpga: fix interrupt handle allocation
> >       raw/ifpga: fix monitor thread
> >       raw/ifpga: fix build with optimization
> >
> > Weiguo Li (14):
> >       common/cnxk: fix error checking
> >       net/enic: fix dereference before null check
> >       net/dpaa2: fix null pointer dereference
> >       regex/mlx5: fix memory allocation check
> >       net/memif: remove pointer deference before null check
> >       net/iavf: fix null pointer dereference
> >       vdpa/sfc: fix null dereference during config
> >       vdpa/sfc: fix null dereference during removal
> >       compress/octeontx: fix null pointer dereference
> >       eventdev/eth_rx: fix parameters parsing memory leak
> >       net/sfc: fix memory allocation size for cache
> >       net/txgbe: fix queue statistics mapping
> >       sched: remove useless malloc in PIE data init
> >       net/bnxt: fix null dereference in session cleanup
> >
> > Wenwu Ma (1):
> >       examples/vhost: fix launch with physical port
> >
> > Wenxuan Wu (1):
> >       eal/linux: fix device monitor stop return
> >
> > Xiaoyu Min (1):
> >       net/mlx5: reject jump to root table
> >
> > Xuan Ding (2):
> >       vhost: fix field naming in guest page struct
> >       vhost: fix physical address mapping
> >
> > Xueming Li (1):
> >       net/virtio: fix Tx queue 0 overriden by queue 128
> >
> > Yajun Wu (1):
> >       common/mlx5: fix queue pair ack timeout configuration
> >
> > Yiding Zhou (1):
> >       net/ice: fix build with 16-byte Rx descriptor
> >
> > Yu Wenjun (1):
> >       net/bonding: fix RSS with early configure
> >
> > Yuan Wang (1):
> >       vhost: fix guest to host physical address mapping
> >
> > Yunjian Wang (12):
> >       net/bonding: fix mode type mismatch
> >       ethdev: fix Rx queue telemetry memory leak on failure
> >       net/ice: fix link up when starting device
> >       net/virtio-user: check FD flags getting failure
> >       net/virtio: fix uninitialized RSS key
> >       ring: fix error code when creating ring
> >       net/ixgbe: check filter init failure
> >       mem: check allocation in dynamic hugepage init
> >       ethdev: remove unnecessary null check
> >       net/ixgbe: reset security context pointer on close
> >       net/txgbe: reset security context pointer on close
> >       net/iavf: reset security context pointer on stop
> >
> > Yuying Zhang (1):
> >       net/ice/base: add profile validation on switch filter
> >
> > Zhihong Wang (1):
> >       ring: fix overflow in memory size calculation
> >
>
>
> --
> Christian Ehrhardt
> Staff Engineer, Ubuntu Server
> Canonical Ltd



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

^ permalink raw reply	[relevance 0%]

* Re: 21.11.1 patches review and test
  2022-04-11  6:58  0% ` Christian Ehrhardt
  2022-04-13  7:26  0%   ` Christian Ehrhardt
@ 2022-04-13 10:06  3%   ` Kevin Traynor
  2022-04-14  5:52  0%     ` Christian Ehrhardt
  1 sibling, 1 reply; 200+ results
From: Kevin Traynor @ 2022-04-13 10:06 UTC (permalink / raw)
  To: Christian Ehrhardt, Thomas Monjalon, Ori Kam
  Cc: stable, dev, Abhishek Marathe, Ali Alnubani, benjamin.walker,
	David Christensen, Hemant Agrawal, Ian Stokes, Jerin Jacob,
	John McNamara, Ju-Hyoung Lee, Luca Boccassi, Pei Zhang,
	qian.q.xu, Raslan Darawsheh, yuan.peng, zhaoyan.chen

Hi Christian/Thomas/Ori,

On 11/04/2022 07:58, Christian Ehrhardt wrote:
> On Fri, Apr 1, 2022 at 12:22 PM Kevin Traynor<ktraynor@redhat.com>  wrote:
>> Hi all,
>>
>> Here is a list of patches targeted for stable release 21.11.1.
> Hi Kevin,
> this breaks on me at build time due to symbol changes.
> It is a wild mix of Base->Internal/Experimental, a few new symbols,
> and even just removed ones (in gpu which is experimental, but still
> would that need a minor soname bump?).
> They might be intentional, but it felt too much to me without at least
> discussing it.
> Could you have a look if you think that they are all intentional, save
> and correct for an LTS release?
> 

Thanks for the report. I've looked through these. Comments below.

> dpkg-gensymbols: warning: some new symbols appeared in the symbols
> file: see diff output below
> dpkg-gensymbols: warning: debian/librte-common-cnxk22/DEBIAN/symbols
> doesn't match completely debian/librte-common-cnxk22.symbols
> --- debian/librte-common-cnxk22.symbols
> (librte-common-cnxk22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> +++ dpkg-gensymbolsUuRb8d 2022-04-11 06:46:22.276766813 +0000
> @@ -197,6 +197,7 @@
>    roc_nix_ptp_clock_read@INTERNAL 21.08
>    roc_nix_ptp_info_cb_register@INTERNAL 21.08
>    roc_nix_ptp_info_cb_unregister@INTERNAL 21.08
> + roc_nix_ptp_is_enable@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>    roc_nix_ptp_rx_ena_dis@INTERNAL 21.08
>    roc_nix_ptp_sync_time_adjust@INTERNAL 21.08
>    roc_nix_ptp_tx_ena_dis@INTERNAL 21.08
> 

This is a new internal from:
commit 28acfe550dcb12b0908df754a4307b8b4d1fe5b0
Author: Harman Kalra <hkalra@marvell.com>
Date:   Thu Mar 3 12:30:42 2022 +0530

     common/cnxk: fix mbuf data offset for VF

     [ upstream commit 8f98e3ecc55e02234f8bec7213b0b6a69c086949 ]

Looks ok to me.

> dpkg-gensymbols: warning: some new symbols appeared in the symbols
> file: see diff output below
> dpkg-gensymbols: warning: debian/librte-ethdev22/DEBIAN/symbols
> doesn't match completely debian/librte-ethdev22.symbols
> --- debian/librte-ethdev22.symbols
> (librte-ethdev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> +++ dpkg-gensymbolskEnokB 2022-04-11 06:46:25.252795157 +0000
> @@ -37,6 +37,7 @@
>    rte_eth_dev_flow_ctrl_get@DPDK_22 21.11
>    rte_eth_dev_flow_ctrl_set@DPDK_22 21.11
>    rte_eth_dev_fw_version_get@DPDK_22 21.11
> + rte_eth_dev_get_by_name@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>    rte_eth_dev_get_dcb_info@DPDK_22 21.11
>    rte_eth_dev_get_eeprom@DPDK_22 21.11
>    rte_eth_dev_get_eeprom_length@DPDK_22 21.11
> 

This is a new internal
Added by:
commit 721d0bbd1668d2a4b617a4a4de0b93dd60283d58
Author: Kumara Parameshwaran <kparameshwar@vmware.com>
Date:   Mon Jan 31 20:02:33 2022 +0530

     ethdev: add internal function to device struct from name

     [ upstream commit 961fb4029b8c52c0e8230d34993c354d70e10e14 ]

Used by:
commit ac180f4d2662503ecd18a2e94689a229104d3d61
Author: Kumara Parameshwaran <kparameshwar@vmware.com>
Date:   Mon Jan 31 20:02:34 2022 +0530

     net/tap: fix to populate FDs in secondary process

     [ upstream commit c36ce7099c2187926cd62cff7ebd479823554929 ]

Looks ok to me.

> dpkg-gensymbols: warning: some new symbols appeared in the symbols
> file: see diff output below
> dpkg-gensymbols: error: some symbols or patterns disappeared in the
> symbols file: see diff output below
> dpkg-gensymbols: warning: debian/librte-regexdev22/DEBIAN/symbols
> doesn't match completely debian/librte-regexdev22.symbols
> --- debian/librte-regexdev22.symbols
> (librte-regexdev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> +++ dpkg-gensymbolsPD0Ygo 2022-04-11 06:46:33.368872490 +0000
> @@ -1,6 +1,8 @@
>   librte_regexdev.so.22 librte-regexdev22 #MINVER#
>    EXPERIMENTAL@EXPERIMENTAL 20.11
> - rte_regex_devices@Base 20.11
> + INTERNAL@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
> + rte_regex_devices@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
>    rte_regexdev_attr_get@EXPERIMENTAL 20.11
>    rte_regexdev_attr_set@EXPERIMENTAL 20.11
>    rte_regexdev_close@EXPERIMENTAL 20.11
> @@ -8,12 +10,16 @@
>    rte_regexdev_count@EXPERIMENTAL 20.11
>    rte_regexdev_dump@EXPERIMENTAL 20.11
>    rte_regexdev_get_dev_id@EXPERIMENTAL 20.11
> - rte_regexdev_get_device_by_name@Base 20.11
> + rte_regexdev_get_device_by_name@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>    rte_regexdev_info_get@EXPERIMENTAL 20.11
> - rte_regexdev_is_valid_dev@Base 20.11
> - rte_regexdev_logtype@Base 20.11
> + rte_regexdev_is_valid_dev@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
> + rte_regexdev_logtype@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
>    rte_regexdev_queue_pair_setup@EXPERIMENTAL 20.11
> - rte_regexdev_register@Base 20.11
> + rte_regexdev_register@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>    rte_regexdev_rule_db_compile_activate@EXPERIMENTAL 20.11
>    rte_regexdev_rule_db_export@EXPERIMENTAL 20.11
>    rte_regexdev_rule_db_import@EXPERIMENTAL 20.11
> @@ -21,7 +27,8 @@
>    rte_regexdev_selftest@EXPERIMENTAL 20.11
>    rte_regexdev_start@EXPERIMENTAL 20.11
>    rte_regexdev_stop@EXPERIMENTAL 20.11
> - rte_regexdev_unregister@Base 20.11
> + rte_regexdev_unregister@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>    rte_regexdev_xstats_by_name_get@EXPERIMENTAL 20.11
>    rte_regexdev_xstats_get@EXPERIMENTAL 20.11
>    rte_regexdev_xstats_names_get@EXPERIMENTAL 20.11
> 

+cc Ori, regex maintainer.

Regex library is an experimental API so everything should have been 
experimental or internal. This is fixing that issue.

It is fixed with
commit 6e7f8939f23c2c8ed80602bc0d62990eebe52013
Author: Thomas Monjalon <thomas@monjalon.net>
Date:   Sun Mar 6 10:20:22 2022 +0100

     regexdev: fix section attribute of symbols

     [ upstream commit 89e290eb8ca99af9f7cfc3292d93860f8e672708 ]

and

   commit 026470bafaa02cba0d46ed7b7e835262399a009a
Author: Thomas Monjalon <thomas@monjalon.net>
Date:   Sun Mar 6 10:20:23 2022 +0100

     build: hide local symbols in shared libraries

     [ upstream commit b403498e14229ee903c8fff9baefcb72894062f3 ]


The fact that they are redesignated to correctly be 
experimental/internal seems ok to me.

> dpkg-gensymbols: error: some symbols or patterns disappeared in the
> symbols file: see diff output below
> dpkg-gensymbols: warning: debian/librte-gpudev22/DEBIAN/symbols
> doesn't match completely debian/librte-gpudev22.symbols
> --- debian/librte-gpudev22.symbols
> (librte-gpudev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> +++ dpkg-gensymbols4qkXdt 2022-04-11 06:46:34.552883776 +0000
> @@ -1,7 +1,7 @@
>   librte_gpudev.so.22 librte-gpudev22 #MINVER#
>    EXPERIMENTAL@EXPERIMENTAL 21.11
>    INTERNAL@INTERNAL 21.11
> - gpu_logtype@Base 21.11
>    rte_gpu_add_child@EXPERIMENTAL 21.11
>    rte_gpu_allocate@INTERNAL 21.11
>    rte_gpu_attach@INTERNAL 21.11
> 

The missing wildcard meant this symbol escaped in 21.11.

It is fixed by:
commit 026470bafaa02cba0d46ed7b7e835262399a009a
Author: Thomas Monjalon <thomas@monjalon.net>
Date:   Sun Mar 6 10:20:23 2022 +0100

     build: hide local symbols in shared libraries

     [ upstream commit b403498e14229ee903c8fff9baefcb72894062f3 ]

In this case the symbol is not redesignated but removed, but it doesn't 
look to have any use to a user, so I think it can be safe to remove.

There are updates to the libabigail.ignore for regex and gpu_dev to 
ignore ABI changes for these fixes.

--

I'm ok with changes above for 21.11.1, what do others think?

Kevin.

> 
> Full log:
> https://launchpadlibrarian.net/596047842/buildlog_ubuntu-jammy-amd64.dpdk_21.11.1~rc1-0ubuntu1~jammyppa2_BUILDING.txt.gz
> 


^ permalink raw reply	[relevance 3%]

* Re: 21.11.1 patches review and test
  2022-04-13 10:06  3%   ` Kevin Traynor
@ 2022-04-14  5:52  0%     ` Christian Ehrhardt
  2022-04-14  9:08  4%       ` Kevin Traynor
  0 siblings, 1 reply; 200+ results
From: Christian Ehrhardt @ 2022-04-14  5:52 UTC (permalink / raw)
  To: Kevin Traynor
  Cc: Thomas Monjalon, Ori Kam, stable, dev, Abhishek Marathe,
	Ali Alnubani, benjamin.walker, David Christensen, Hemant Agrawal,
	Ian Stokes, Jerin Jacob, John McNamara, Ju-Hyoung Lee,
	Luca Boccassi, Pei Zhang, qian.q.xu, Raslan Darawsheh, yuan.peng,
	zhaoyan.chen

On Wed, Apr 13, 2022 at 12:06 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> Hi Christian/Thomas/Ori,
>
> On 11/04/2022 07:58, Christian Ehrhardt wrote:
> > On Fri, Apr 1, 2022 at 12:22 PM Kevin Traynor<ktraynor@redhat.com>  wrote:
> >> Hi all,
> >>
> >> Here is a list of patches targeted for stable release 21.11.1.
> > Hi Kevin,
> > this breaks on me at build time due to symbol changes.
> > It is a wild mix of Base->Internal/Experimental, a few new symbols,
> > and even just removed ones (in gpu which is experimental, but still
> > would that need a minor soname bump?).
> > They might be intentional, but it felt too much to me without at least
> > discussing it.
> > Could you have a look if you think that they are all intentional, save
> > and correct for an LTS release?
> >
>
> Thanks for the report. I've looked through these. Comments below.
>
> > dpkg-gensymbols: warning: some new symbols appeared in the symbols
> > file: see diff output below
> > dpkg-gensymbols: warning: debian/librte-common-cnxk22/DEBIAN/symbols
> > doesn't match completely debian/librte-common-cnxk22.symbols
> > --- debian/librte-common-cnxk22.symbols
> > (librte-common-cnxk22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> > +++ dpkg-gensymbolsUuRb8d 2022-04-11 06:46:22.276766813 +0000
> > @@ -197,6 +197,7 @@
> >    roc_nix_ptp_clock_read@INTERNAL 21.08
> >    roc_nix_ptp_info_cb_register@INTERNAL 21.08
> >    roc_nix_ptp_info_cb_unregister@INTERNAL 21.08
> > + roc_nix_ptp_is_enable@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
> >    roc_nix_ptp_rx_ena_dis@INTERNAL 21.08
> >    roc_nix_ptp_sync_time_adjust@INTERNAL 21.08
> >    roc_nix_ptp_tx_ena_dis@INTERNAL 21.08
> >
>
> This is a new internal from:
> commit 28acfe550dcb12b0908df754a4307b8b4d1fe5b0
> Author: Harman Kalra <hkalra@marvell.com>
> Date:   Thu Mar 3 12:30:42 2022 +0530
>
>      common/cnxk: fix mbuf data offset for VF
>
>      [ upstream commit 8f98e3ecc55e02234f8bec7213b0b6a69c086949 ]
>
> Looks ok to me.
>
> > dpkg-gensymbols: warning: some new symbols appeared in the symbols
> > file: see diff output below
> > dpkg-gensymbols: warning: debian/librte-ethdev22/DEBIAN/symbols
> > doesn't match completely debian/librte-ethdev22.symbols
> > --- debian/librte-ethdev22.symbols
> > (librte-ethdev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> > +++ dpkg-gensymbolskEnokB 2022-04-11 06:46:25.252795157 +0000
> > @@ -37,6 +37,7 @@
> >    rte_eth_dev_flow_ctrl_get@DPDK_22 21.11
> >    rte_eth_dev_flow_ctrl_set@DPDK_22 21.11
> >    rte_eth_dev_fw_version_get@DPDK_22 21.11
> > + rte_eth_dev_get_by_name@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
> >    rte_eth_dev_get_dcb_info@DPDK_22 21.11
> >    rte_eth_dev_get_eeprom@DPDK_22 21.11
> >    rte_eth_dev_get_eeprom_length@DPDK_22 21.11
> >
>
> This is a new internal
> Added by:
> commit 721d0bbd1668d2a4b617a4a4de0b93dd60283d58
> Author: Kumara Parameshwaran <kparameshwar@vmware.com>
> Date:   Mon Jan 31 20:02:33 2022 +0530
>
>      ethdev: add internal function to device struct from name
>
>      [ upstream commit 961fb4029b8c52c0e8230d34993c354d70e10e14 ]
>
> Used by:
> commit ac180f4d2662503ecd18a2e94689a229104d3d61
> Author: Kumara Parameshwaran <kparameshwar@vmware.com>
> Date:   Mon Jan 31 20:02:34 2022 +0530
>
>      net/tap: fix to populate FDs in secondary process
>
>      [ upstream commit c36ce7099c2187926cd62cff7ebd479823554929 ]
>
> Looks ok to me.
>
> > dpkg-gensymbols: warning: some new symbols appeared in the symbols
> > file: see diff output below
> > dpkg-gensymbols: error: some symbols or patterns disappeared in the
> > symbols file: see diff output below
> > dpkg-gensymbols: warning: debian/librte-regexdev22/DEBIAN/symbols
> > doesn't match completely debian/librte-regexdev22.symbols
> > --- debian/librte-regexdev22.symbols
> > (librte-regexdev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> > +++ dpkg-gensymbolsPD0Ygo 2022-04-11 06:46:33.368872490 +0000
> > @@ -1,6 +1,8 @@
> >   librte_regexdev.so.22 librte-regexdev22 #MINVER#
> >    EXPERIMENTAL@EXPERIMENTAL 20.11
> > - rte_regex_devices@Base 20.11
> > + INTERNAL@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
> > + rte_regex_devices@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
> >    rte_regexdev_attr_get@EXPERIMENTAL 20.11
> >    rte_regexdev_attr_set@EXPERIMENTAL 20.11
> >    rte_regexdev_close@EXPERIMENTAL 20.11
> > @@ -8,12 +10,16 @@
> >    rte_regexdev_count@EXPERIMENTAL 20.11
> >    rte_regexdev_dump@EXPERIMENTAL 20.11
> >    rte_regexdev_get_dev_id@EXPERIMENTAL 20.11
> > - rte_regexdev_get_device_by_name@Base 20.11
> > + rte_regexdev_get_device_by_name@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
> >    rte_regexdev_info_get@EXPERIMENTAL 20.11
> > - rte_regexdev_is_valid_dev@Base 20.11
> > - rte_regexdev_logtype@Base 20.11
> > + rte_regexdev_is_valid_dev@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
> > + rte_regexdev_logtype@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
> >    rte_regexdev_queue_pair_setup@EXPERIMENTAL 20.11
> > - rte_regexdev_register@Base 20.11
> > + rte_regexdev_register@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
> >    rte_regexdev_rule_db_compile_activate@EXPERIMENTAL 20.11
> >    rte_regexdev_rule_db_export@EXPERIMENTAL 20.11
> >    rte_regexdev_rule_db_import@EXPERIMENTAL 20.11
> > @@ -21,7 +27,8 @@
> >    rte_regexdev_selftest@EXPERIMENTAL 20.11
> >    rte_regexdev_start@EXPERIMENTAL 20.11
> >    rte_regexdev_stop@EXPERIMENTAL 20.11
> > - rte_regexdev_unregister@Base 20.11
> > + rte_regexdev_unregister@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
> >    rte_regexdev_xstats_by_name_get@EXPERIMENTAL 20.11
> >    rte_regexdev_xstats_get@EXPERIMENTAL 20.11
> >    rte_regexdev_xstats_names_get@EXPERIMENTAL 20.11
> >
>
> +cc Ori, regex maintainer.
>
> Regex library is an experimental API so everything should have been
> experimental or internal. This is fixing that issue.
>
> It is fixed with
> commit 6e7f8939f23c2c8ed80602bc0d62990eebe52013
> Author: Thomas Monjalon <thomas@monjalon.net>
> Date:   Sun Mar 6 10:20:22 2022 +0100
>
>      regexdev: fix section attribute of symbols
>
>      [ upstream commit 89e290eb8ca99af9f7cfc3292d93860f8e672708 ]
>
> and
>
>    commit 026470bafaa02cba0d46ed7b7e835262399a009a
> Author: Thomas Monjalon <thomas@monjalon.net>
> Date:   Sun Mar 6 10:20:23 2022 +0100
>
>      build: hide local symbols in shared libraries
>
>      [ upstream commit b403498e14229ee903c8fff9baefcb72894062f3 ]
>
>
> The fact that they are redesignated to correctly be
> experimental/internal seems ok to me.
>
> > dpkg-gensymbols: error: some symbols or patterns disappeared in the
> > symbols file: see diff output below
> > dpkg-gensymbols: warning: debian/librte-gpudev22/DEBIAN/symbols
> > doesn't match completely debian/librte-gpudev22.symbols
> > --- debian/librte-gpudev22.symbols
> > (librte-gpudev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
> > +++ dpkg-gensymbols4qkXdt 2022-04-11 06:46:34.552883776 +0000
> > @@ -1,7 +1,7 @@
> >   librte_gpudev.so.22 librte-gpudev22 #MINVER#
> >    EXPERIMENTAL@EXPERIMENTAL 21.11
> >    INTERNAL@INTERNAL 21.11
> > - gpu_logtype@Base 21.11
> >    rte_gpu_add_child@EXPERIMENTAL 21.11
> >    rte_gpu_allocate@INTERNAL 21.11
> >    rte_gpu_attach@INTERNAL 21.11
> >
>
> The missing wildcard meant this symbol escaped in 21.11.
>
> It is fixed by:
> commit 026470bafaa02cba0d46ed7b7e835262399a009a
> Author: Thomas Monjalon <thomas@monjalon.net>
> Date:   Sun Mar 6 10:20:23 2022 +0100
>
>      build: hide local symbols in shared libraries
>
>      [ upstream commit b403498e14229ee903c8fff9baefcb72894062f3 ]
>
> In this case the symbol is not redesignated but removed, but it doesn't
> look to have any use to a user, so I think it can be safe to remove.

I'm 100% with all others, thanks for having a look.
On this one I can easily follow the argument of the fix for the newest release.
But for stable we can never really know if there are users.
In theory for anything that shipped in a Distribution someone might
have coded and linked something against it - we would not know.
The meant to be "stable" update will then break them the hard way.

In this case gladly the function wasn't anything that one would
consider useful for use from outside, so I think it is ok.

But still I wanted to make the point that in general a symbol:
1. once released might be used and we can not never be sure if no one uses them
2. even being EXPERIMENTAL, touching them too much in stable updates
means not-stable. Should we at least try to minimize the impact to
stable releases?

For now I'm adapting my checkers and will continue testing ...

> There are updates to the libabigail.ignore for regex and gpu_dev to
> ignore ABI changes for these fixes.
>
> --
>
> I'm ok with changes above for 21.11.1, what do others think?
>
> Kevin.
>
> >
> > Full log:
> > https://launchpadlibrarian.net/596047842/buildlog_ubuntu-jammy-amd64.dpdk_21.11.1~rc1-0ubuntu1~jammyppa2_BUILDING.txt.gz
> >
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

^ permalink raw reply	[relevance 0%]

* Re: 21.11.1 patches review and test
  2022-04-14  5:52  0%     ` Christian Ehrhardt
@ 2022-04-14  9:08  4%       ` Kevin Traynor
  0 siblings, 0 replies; 200+ results
From: Kevin Traynor @ 2022-04-14  9:08 UTC (permalink / raw)
  To: Christian Ehrhardt
  Cc: Thomas Monjalon, Ori Kam, stable, dev, Abhishek Marathe,
	Ali Alnubani, benjamin.walker, David Christensen, Hemant Agrawal,
	Ian Stokes, Jerin Jacob, John McNamara, Ju-Hyoung Lee,
	Luca Boccassi, Pei Zhang, qian.q.xu, Raslan Darawsheh, yuan.peng,
	zhaoyan.chen

On 14/04/2022 06:52, Christian Ehrhardt wrote:
> On Wed, Apr 13, 2022 at 12:06 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>>
>> Hi Christian/Thomas/Ori,
>>
>> On 11/04/2022 07:58, Christian Ehrhardt wrote:
>>> On Fri, Apr 1, 2022 at 12:22 PM Kevin Traynor<ktraynor@redhat.com>  wrote:
>>>> Hi all,
>>>>
>>>> Here is a list of patches targeted for stable release 21.11.1.
>>> Hi Kevin,
>>> this breaks on me at build time due to symbol changes.
>>> It is a wild mix of Base->Internal/Experimental, a few new symbols,
>>> and even just removed ones (in gpu which is experimental, but still
>>> would that need a minor soname bump?).
>>> They might be intentional, but it felt too much to me without at least
>>> discussing it.
>>> Could you have a look if you think that they are all intentional, save
>>> and correct for an LTS release?
>>>
>>
>> Thanks for the report. I've looked through these. Comments below.
>>
>>> dpkg-gensymbols: warning: some new symbols appeared in the symbols
>>> file: see diff output below
>>> dpkg-gensymbols: warning: debian/librte-common-cnxk22/DEBIAN/symbols
>>> doesn't match completely debian/librte-common-cnxk22.symbols
>>> --- debian/librte-common-cnxk22.symbols
>>> (librte-common-cnxk22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
>>> +++ dpkg-gensymbolsUuRb8d 2022-04-11 06:46:22.276766813 +0000
>>> @@ -197,6 +197,7 @@
>>>     roc_nix_ptp_clock_read@INTERNAL 21.08
>>>     roc_nix_ptp_info_cb_register@INTERNAL 21.08
>>>     roc_nix_ptp_info_cb_unregister@INTERNAL 21.08
>>> + roc_nix_ptp_is_enable@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>>>     roc_nix_ptp_rx_ena_dis@INTERNAL 21.08
>>>     roc_nix_ptp_sync_time_adjust@INTERNAL 21.08
>>>     roc_nix_ptp_tx_ena_dis@INTERNAL 21.08
>>>
>>
>> This is a new internal from:
>> commit 28acfe550dcb12b0908df754a4307b8b4d1fe5b0
>> Author: Harman Kalra <hkalra@marvell.com>
>> Date:   Thu Mar 3 12:30:42 2022 +0530
>>
>>       common/cnxk: fix mbuf data offset for VF
>>
>>       [ upstream commit 8f98e3ecc55e02234f8bec7213b0b6a69c086949 ]
>>
>> Looks ok to me.
>>
>>> dpkg-gensymbols: warning: some new symbols appeared in the symbols
>>> file: see diff output below
>>> dpkg-gensymbols: warning: debian/librte-ethdev22/DEBIAN/symbols
>>> doesn't match completely debian/librte-ethdev22.symbols
>>> --- debian/librte-ethdev22.symbols
>>> (librte-ethdev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
>>> +++ dpkg-gensymbolskEnokB 2022-04-11 06:46:25.252795157 +0000
>>> @@ -37,6 +37,7 @@
>>>     rte_eth_dev_flow_ctrl_get@DPDK_22 21.11
>>>     rte_eth_dev_flow_ctrl_set@DPDK_22 21.11
>>>     rte_eth_dev_fw_version_get@DPDK_22 21.11
>>> + rte_eth_dev_get_by_name@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>>>     rte_eth_dev_get_dcb_info@DPDK_22 21.11
>>>     rte_eth_dev_get_eeprom@DPDK_22 21.11
>>>     rte_eth_dev_get_eeprom_length@DPDK_22 21.11
>>>
>>
>> This is a new internal
>> Added by:
>> commit 721d0bbd1668d2a4b617a4a4de0b93dd60283d58
>> Author: Kumara Parameshwaran <kparameshwar@vmware.com>
>> Date:   Mon Jan 31 20:02:33 2022 +0530
>>
>>       ethdev: add internal function to device struct from name
>>
>>       [ upstream commit 961fb4029b8c52c0e8230d34993c354d70e10e14 ]
>>
>> Used by:
>> commit ac180f4d2662503ecd18a2e94689a229104d3d61
>> Author: Kumara Parameshwaran <kparameshwar@vmware.com>
>> Date:   Mon Jan 31 20:02:34 2022 +0530
>>
>>       net/tap: fix to populate FDs in secondary process
>>
>>       [ upstream commit c36ce7099c2187926cd62cff7ebd479823554929 ]
>>
>> Looks ok to me.
>>
>>> dpkg-gensymbols: warning: some new symbols appeared in the symbols
>>> file: see diff output below
>>> dpkg-gensymbols: error: some symbols or patterns disappeared in the
>>> symbols file: see diff output below
>>> dpkg-gensymbols: warning: debian/librte-regexdev22/DEBIAN/symbols
>>> doesn't match completely debian/librte-regexdev22.symbols
>>> --- debian/librte-regexdev22.symbols
>>> (librte-regexdev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
>>> +++ dpkg-gensymbolsPD0Ygo 2022-04-11 06:46:33.368872490 +0000
>>> @@ -1,6 +1,8 @@
>>>    librte_regexdev.so.22 librte-regexdev22 #MINVER#
>>>     EXPERIMENTAL@EXPERIMENTAL 20.11
>>> - rte_regex_devices@Base 20.11
>>> + INTERNAL@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>>> + rte_regex_devices@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
>>>     rte_regexdev_attr_get@EXPERIMENTAL 20.11
>>>     rte_regexdev_attr_set@EXPERIMENTAL 20.11
>>>     rte_regexdev_close@EXPERIMENTAL 20.11
>>> @@ -8,12 +10,16 @@
>>>     rte_regexdev_count@EXPERIMENTAL 20.11
>>>     rte_regexdev_dump@EXPERIMENTAL 20.11
>>>     rte_regexdev_get_dev_id@EXPERIMENTAL 20.11
>>> - rte_regexdev_get_device_by_name@Base 20.11
>>> + rte_regexdev_get_device_by_name@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>>>     rte_regexdev_info_get@EXPERIMENTAL 20.11
>>> - rte_regexdev_is_valid_dev@Base 20.11
>>> - rte_regexdev_logtype@Base 20.11
>>> + rte_regexdev_is_valid_dev@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
>>> + rte_regexdev_logtype@EXPERIMENTAL 21.11.1~rc1-0ubuntu1~jammyppa2
>>>     rte_regexdev_queue_pair_setup@EXPERIMENTAL 20.11
>>> - rte_regexdev_register@Base 20.11
>>> + rte_regexdev_register@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>>>     rte_regexdev_rule_db_compile_activate@EXPERIMENTAL 20.11
>>>     rte_regexdev_rule_db_export@EXPERIMENTAL 20.11
>>>     rte_regexdev_rule_db_import@EXPERIMENTAL 20.11
>>> @@ -21,7 +27,8 @@
>>>     rte_regexdev_selftest@EXPERIMENTAL 20.11
>>>     rte_regexdev_start@EXPERIMENTAL 20.11
>>>     rte_regexdev_stop@EXPERIMENTAL 20.11
>>> - rte_regexdev_unregister@Base 20.11
>>> + rte_regexdev_unregister@INTERNAL 21.11.1~rc1-0ubuntu1~jammyppa2
>>>     rte_regexdev_xstats_by_name_get@EXPERIMENTAL 20.11
>>>     rte_regexdev_xstats_get@EXPERIMENTAL 20.11
>>>     rte_regexdev_xstats_names_get@EXPERIMENTAL 20.11
>>>
>>
>> +cc Ori, regex maintainer.
>>
>> Regex library is an experimental API so everything should have been
>> experimental or internal. This is fixing that issue.
>>
>> It is fixed with
>> commit 6e7f8939f23c2c8ed80602bc0d62990eebe52013
>> Author: Thomas Monjalon <thomas@monjalon.net>
>> Date:   Sun Mar 6 10:20:22 2022 +0100
>>
>>       regexdev: fix section attribute of symbols
>>
>>       [ upstream commit 89e290eb8ca99af9f7cfc3292d93860f8e672708 ]
>>
>> and
>>
>>     commit 026470bafaa02cba0d46ed7b7e835262399a009a
>> Author: Thomas Monjalon <thomas@monjalon.net>
>> Date:   Sun Mar 6 10:20:23 2022 +0100
>>
>>       build: hide local symbols in shared libraries
>>
>>       [ upstream commit b403498e14229ee903c8fff9baefcb72894062f3 ]
>>
>>
>> The fact that they are redesignated to correctly be
>> experimental/internal seems ok to me.
>>
>>> dpkg-gensymbols: error: some symbols or patterns disappeared in the
>>> symbols file: see diff output below
>>> dpkg-gensymbols: warning: debian/librte-gpudev22/DEBIAN/symbols
>>> doesn't match completely debian/librte-gpudev22.symbols
>>> --- debian/librte-gpudev22.symbols
>>> (librte-gpudev22_21.11.1~rc1-0ubuntu1~jammyppa2_amd64)
>>> +++ dpkg-gensymbols4qkXdt 2022-04-11 06:46:34.552883776 +0000
>>> @@ -1,7 +1,7 @@
>>>    librte_gpudev.so.22 librte-gpudev22 #MINVER#
>>>     EXPERIMENTAL@EXPERIMENTAL 21.11
>>>     INTERNAL@INTERNAL 21.11
>>> - gpu_logtype@Base 21.11
>>>     rte_gpu_add_child@EXPERIMENTAL 21.11
>>>     rte_gpu_allocate@INTERNAL 21.11
>>>     rte_gpu_attach@INTERNAL 21.11
>>>
>>
>> The missing wildcard meant this symbol escaped in 21.11.
>>
>> It is fixed by:
>> commit 026470bafaa02cba0d46ed7b7e835262399a009a
>> Author: Thomas Monjalon <thomas@monjalon.net>
>> Date:   Sun Mar 6 10:20:23 2022 +0100
>>
>>       build: hide local symbols in shared libraries
>>
>>       [ upstream commit b403498e14229ee903c8fff9baefcb72894062f3 ]
>>
>> In this case the symbol is not redesignated but removed, but it doesn't
>> look to have any use to a user, so I think it can be safe to remove.
> 
> I'm 100% with all others, thanks for having a look.
> On this one I can easily follow the argument of the fix for the newest release.
> But for stable we can never really know if there are users.
> In theory for anything that shipped in a Distribution someone might
> have coded and linked something against it - we would not know.
> The meant to be "stable" update will then break them the hard way.
> 
> In this case gladly the function wasn't anything that one would
> consider useful for use from outside, so I think it is ok.
> 
> But still I wanted to make the point that in general a symbol:
> 1. once released might be used and we can not never be sure if no one uses them

The same argument can also be made for 22.03/22.07 which is ABI 
compatible with 22.11. I accept there will be exception cases where it 
makes sense to change in main because it is enabling some future work, 
which are not similarly valid for stable. So the bar should be a bit 
higher in stable.

> 2. even being EXPERIMENTAL, touching them too much in stable updates
> means not-stable. Should we at least try to minimize the impact to
> stable releases?
> 

APIs marked experimental are not part of the ABI version, but I agree it 
is a good goal to minimize changes for these in stable where possible.

> For now I'm adapting my checkers and will continue testing ...
> 

Thanks for raising Christian.

(P.S. on PTO, so won't be able to continue discussion for now)

>> There are updates to the libabigail.ignore for regex and gpu_dev to
>> ignore ABI changes for these fixes.
>>
>> --
>>
>> I'm ok with changes above for 21.11.1, what do others think?
>>
>> Kevin.
>>
>>>
>>> Full log:
>>> https://launchpadlibrarian.net/596047842/buildlog_ubuntu-jammy-amd64.dpdk_21.11.1~rc1-0ubuntu1~jammyppa2_BUILDING.txt.gz
>>>
>>
> 
> 


^ permalink raw reply	[relevance 4%]

* Re: [PATCH v3 2/2] eal: factorize lcore main loop
  2022-04-05 16:34  2%   ` [PATCH v3 2/2] eal: factorize lcore main loop David Marchand
@ 2022-04-14 11:48  0%     ` David Marchand
  0 siblings, 0 replies; 200+ results
From: David Marchand @ 2022-04-14 11:48 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Thomas Monjalon, Morten Brørup, Tyler Retzlaff,
	Ray Kinsella, Bruce Richardson, Dmitry Kozlyuk,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam

On Tue, Apr 5, 2022 at 6:37 PM David Marchand <david.marchand@redhat.com> wrote:
>
> All OS implementations provide the same main loop.
> Introduce helpers (shared for Linux and FreeBSD) to handle synchronisation
> between main and threads and factorize the rest as common code.
> Thread id are now logged as string in a common format across OS.
>
> Note: libabigail flags this change as breaking ABI in clang builds:
>
> 1 function with some indirect sub-type change:
>
>   [C] 'function int rte_eal_remote_launch(int (void*)*, void*, unsigned
>       int)' at eal_common_launch.c:35:1 has some indirect sub-type
>       changes:
>     parameter 1 of type 'int (void*)*' changed:
>       in pointed to type 'function type int (void*)' at rte_launch.h:31:1:
>         entity changed from 'function type int (void*)' to 'typedef
>           lcore_function_t' at rte_launch.h:31:1
>         type size hasn't changed
>
> This is being investigated on libabigail side.
> For now, we don't have much choice but to waive reports on this symbol.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

Added a note in the commitlog about Windows EAL threads affinity (from
a parallel discussion with Tyler), and applied.
Thanks.


-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* Re: [DPDK v3] net/ixgbe: promote MDIO API
  @ 2022-04-15 14:36  4%   ` Ray Kinsella
  2022-04-18  6:41  0%     ` Yang, Qiming
  0 siblings, 1 reply; 200+ results
From: Ray Kinsella @ 2022-04-15 14:36 UTC (permalink / raw)
  To: zhichaox.zeng; +Cc: dev, Haiyue Wang, David Marchand


zhichaox.zeng@intel.com writes:

> From: zhichao zeng <zhichaox.zeng@intel.com>
>
> Promote the MDIO APIs to be stable.
>
> Signed-off-by: zhichao zeng <zhichaox.zeng@intel.com>
> ---
>  drivers/net/ixgbe/rte_pmd_ixgbe.h |  5 -----
>  drivers/net/ixgbe/version.map     | 10 +++++-----
>  2 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
> index eef6f6661c..426fe5845b 100644
> --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
> +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
> @@ -586,7 +586,6 @@ int rte_pmd_ixgbe_bypass_wd_reset(uint16_t port);
>   *   - (-ENODEV) if *port* invalid.
>   *   - (IXGBE_ERR_SWFW_SYNC) If sw/fw semaphore acquisition failed
>   */
> -__rte_experimental
>  int
>  rte_pmd_ixgbe_mdio_lock(uint16_t port);
>  
> @@ -600,7 +599,6 @@ rte_pmd_ixgbe_mdio_lock(uint16_t port);
>   *   - (-ENOTSUP) if hardware doesn't support.
>   *   - (-ENODEV) if *port* invalid.
>   */
> -__rte_experimental
>  int
>  rte_pmd_ixgbe_mdio_unlock(uint16_t port);
>  
> @@ -622,7 +620,6 @@ rte_pmd_ixgbe_mdio_unlock(uint16_t port);
>   *   - (-ENODEV) if *port* invalid.
>   *   - (IXGBE_ERR_PHY) If PHY read command failed
>   */
> -__rte_experimental
>  int
>  rte_pmd_ixgbe_mdio_unlocked_read(uint16_t port, uint32_t reg_addr,
>  				 uint32_t dev_type, uint16_t *phy_data);
> @@ -646,7 +643,6 @@ rte_pmd_ixgbe_mdio_unlocked_read(uint16_t port, uint32_t reg_addr,
>   *   - (-ENODEV) if *port* invalid.
>   *   - (IXGBE_ERR_PHY) If PHY read command failed
>   */
> -__rte_experimental
>  int
>  rte_pmd_ixgbe_mdio_unlocked_write(uint16_t port, uint32_t reg_addr,
>  				  uint32_t dev_type, uint16_t phy_data);
> @@ -725,7 +721,6 @@ enum {
>   *   - (-ENODEV) if *port* invalid.
>   *   - (-ENOTSUP) if hardware doesn't support this feature.
>   */
> -__rte_experimental
>  int
>  rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable);
>  
> diff --git a/drivers/net/ixgbe/version.map b/drivers/net/ixgbe/version.map
> index bca5cc5826..f0f29d8749 100644
> --- a/drivers/net/ixgbe/version.map
> +++ b/drivers/net/ixgbe/version.map
> @@ -16,6 +16,10 @@ DPDK_22 {
>  	rte_pmd_ixgbe_macsec_enable;
>  	rte_pmd_ixgbe_macsec_select_rxsa;
>  	rte_pmd_ixgbe_macsec_select_txsa;

Promoted APIs should be part of the DPDK_23 ABI, not DPDK_22.

David - I just did some checking and noted that we have been promoting
directly from experimental to DPDK 22, and that we did the same for DPDK
21. However in the DPDK_20 we (rightly) promoted to DPDK_21, new APIs
are promoted to being stable in the next ABI release. 

Was that I conscious decision? I don't thinking there is impact by the
error / change, beyond house keeping.


> +	rte_pmd_ixgbe_mdio_lock;
> +	rte_pmd_ixgbe_mdio_unlock;
> +	rte_pmd_ixgbe_mdio_unlocked_read;
> +	rte_pmd_ixgbe_mdio_unlocked_write;
>  	rte_pmd_ixgbe_ping_vf;
>  	rte_pmd_ixgbe_set_all_queues_drop_en;
>  	rte_pmd_ixgbe_set_tc_bw_alloc;
> @@ -31,6 +35,7 @@ DPDK_22 {
>  	rte_pmd_ixgbe_set_vf_vlan_filter;
>  	rte_pmd_ixgbe_set_vf_vlan_insert;
>  	rte_pmd_ixgbe_set_vf_vlan_stripq;
> +	rte_pmd_ixgbe_upd_fctrl_sbp;
>  
>  	local: *;
>  };
> @@ -40,9 +45,4 @@ EXPERIMENTAL {
>  
>  	rte_pmd_ixgbe_get_fdir_info;
>  	rte_pmd_ixgbe_get_fdir_stats;
> -	rte_pmd_ixgbe_mdio_lock;
> -	rte_pmd_ixgbe_mdio_unlock;
> -	rte_pmd_ixgbe_mdio_unlocked_read;
> -	rte_pmd_ixgbe_mdio_unlocked_write;
> -	rte_pmd_ixgbe_upd_fctrl_sbp;
>  };


-- 
Regards, Ray K

^ permalink raw reply	[relevance 4%]

* Re: [PATCH v2 2/2] build: hide local symbols in shared libraries
  2022-03-08 14:24  4%   ` [PATCH v2 2/2] build: hide local symbols in shared libraries Thomas Monjalon
  2022-03-09 10:58  0%     ` Kevin Traynor
@ 2022-04-15 14:56  0%     ` Ray Kinsella
  1 sibling, 0 replies; 200+ results
From: Ray Kinsella @ 2022-04-15 14:56 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, david.marchand, stable, Parav Pandit, Xueming Li,
	Elena Agostini, Ori Kam, Andrew Rybchenko


Thomas Monjalon <thomas@monjalon.net> writes:

> The symbols which are not listed in the version script
> are exported by default.
> Adding a local section with a wildcard make non-listed functions
> and variables as hidden, as it should be in all version.map files.
>
> These are the changes done in the shared libraries:
> - DF .text  Base          auxiliary_add_device
> - DF .text  Base          auxiliary_dev_exists
> - DF .text  Base          auxiliary_dev_iterate
> - DF .text  Base          auxiliary_insert_device
> - DF .text  Base          auxiliary_is_ignored_device
> - DF .text  Base          auxiliary_match
> - DF .text  Base          auxiliary_on_scan
> - DF .text  Base          auxiliary_scan
> - DO .bss   Base          auxiliary_bus_logtype
> - DO .data  Base          auxiliary_bus
> - DO .bss   Base          gpu_logtype
>
> There is no impact on regexdev library.
>
> Because these local symbols were exported as non-internal
> in DPDK 21.11, any change in these functions would break the ABI.
> Exception rules are added for these experimental libraries,
> so the ABI check will skip them until the next ABI version.
>
> A check is added to avoid such miss in future.
>
> Fixes: 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")
> Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library")
> Cc: stable@dpdk.org

Good catch, I see you fixed a few of these recently.

>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  devtools/check-symbol-maps.sh     | 7 +++++++
>  devtools/libabigail.abignore      | 8 ++++++++
>  drivers/bus/auxiliary/version.map | 2 ++
>  lib/gpudev/version.map            | 2 ++
>  lib/regexdev/version.map          | 2 ++
>  5 files changed, 21 insertions(+)
>
> diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh
> index 5bd290ac97..8266fdf9ea 100755
> --- a/devtools/check-symbol-maps.sh
> +++ b/devtools/check-symbol-maps.sh
> @@ -53,4 +53,11 @@ if [ -n "$duplicate_symbols" ] ; then
>      ret=1
>  fi
>  
> +local_miss_maps=$(grep -L 'local: \*;' $@)
> +if [ -n "$local_miss_maps" ] ; then
> +    echo "Found maps without local catch-all:"
> +    echo "$local_miss_maps"
> +    ret=1
> +fi
> +
>  exit $ret
> diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> index 18c11c80c6..c618f20032 100644
> --- a/devtools/libabigail.abignore
> +++ b/devtools/libabigail.abignore
> @@ -32,3 +32,11 @@
>  ; Ignore changes in common mlx5 driver, should be all internal
>  [suppress_file]
>          soname_regexp = ^librte_common_mlx5\.
> +
> +; Ignore visibility fix of local functions in experimental auxiliary driver
> +[suppress_file]
> +        soname_regexp = ^librte_bus_auxiliary\.
> +
> +; Ignore visibility fix of local functions in experimental gpudev library
> +[suppress_file]
> +        soname_regexp = ^librte_gpudev\.
> diff --git a/drivers/bus/auxiliary/version.map b/drivers/bus/auxiliary/version.map
> index a52260657c..dc993e84ff 100644
> --- a/drivers/bus/auxiliary/version.map
> +++ b/drivers/bus/auxiliary/version.map
> @@ -4,4 +4,6 @@ EXPERIMENTAL {
>  	# added in 21.08
>  	rte_auxiliary_register;
>  	rte_auxiliary_unregister;
> +
> +	local: *;
>  };
> diff --git a/lib/gpudev/version.map b/lib/gpudev/version.map
> index b23e3fd6eb..a2c8ce5759 100644
> --- a/lib/gpudev/version.map
> +++ b/lib/gpudev/version.map
> @@ -39,4 +39,6 @@ INTERNAL {
>  	rte_gpu_get_by_name;
>  	rte_gpu_notify;
>  	rte_gpu_release;
> +
> +	local: *;
>  };
> diff --git a/lib/regexdev/version.map b/lib/regexdev/version.map
> index 988b909638..3c6e9fffa1 100644
> --- a/lib/regexdev/version.map
> +++ b/lib/regexdev/version.map
> @@ -26,6 +26,8 @@ EXPERIMENTAL {
>  	rte_regexdev_xstats_get;
>  	rte_regexdev_xstats_names_get;
>  	rte_regexdev_xstats_reset;
> +
> +	local: *;
>  };
>  
>  INTERNAL {


-- 
Regards, Ray K

^ permalink raw reply	[relevance 0%]

* [PATCH 3/3] ci: build some job with ASan
  @ 2022-04-15 17:31  3% ` David Marchand
  0 siblings, 0 replies; 200+ results
From: David Marchand @ 2022-04-15 17:31 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara, dmitry.kozliuk, Aaron Conole, Michael Santana

Enable ASan, this can greatly help identify leaks and buffer overflows.
Running all unit tests is not possible at the moment: skip unit tests
who have known issues with ASan.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 .ci/linux-build.sh          |   8 ++
 .github/workflows/build.yml |   3 +-
 app/test/meson.build        | 208 +++++++++++++++++++-----------------
 3 files changed, 118 insertions(+), 101 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 774a1441bf..93706c0131 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -95,6 +95,14 @@ if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
 fi
+
+if [ "$ASAN" = "true" ]; then
+    OPTS="$OPTS -Db_sanitize=address"
+    if [ "${CC%%clang}" != "$CC" ]; then
+        OPTS="$OPTS -Db_lundef=false"
+    fi
+fi
+
 meson build --werror $OPTS
 ninja -C build
 
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 22daaabb91..45871e76ed 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -16,6 +16,7 @@ jobs:
     env:
       AARCH64: ${{ matrix.config.cross == 'aarch64' }}
       ABI_CHECKS: ${{ contains(matrix.config.checks, 'abi') }}
+      ASAN: ${{ contains(matrix.config.checks, 'asan') }}
       BUILD_32BIT: ${{ matrix.config.cross == 'i386' }}
       BUILD_DOCS: ${{ contains(matrix.config.checks, 'doc') }}
       CC: ccache ${{ matrix.config.compiler }}
@@ -47,7 +48,7 @@ jobs:
           - os: ubuntu-18.04
             compiler: clang
             library: shared
-            checks: doc+tests
+            checks: asan+doc+tests
           - os: ubuntu-18.04
             compiler: gcc
             library: static
diff --git a/app/test/meson.build b/app/test/meson.build
index 5fc1dd1b7b..4622b5c010 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -149,96 +149,97 @@ test_deps = enabled_libs
 # as well as libs, the pci and vdev bus drivers are needed for a lot of tests
 test_deps += ['bus_pci', 'bus_vdev']
 
-# Each test is marked with flag true/false
-# to indicate whether it can run in no-huge mode.
+# Each test is marked with flags:
+# - the first flag indicates whether the test can run in no-huge mode,
+# - the second flag indicates whether the test can run with ASan enabled,
 fast_tests = [
-        ['acl_autotest', true],
-        ['atomic_autotest', false],
-        ['bitmap_autotest', true],
-        ['bpf_autotest', true],
-        ['bpf_convert_autotest', true],
-        ['bitops_autotest', true],
-        ['byteorder_autotest', true],
-        ['cksum_autotest', true],
-        ['cmdline_autotest', true],
-        ['common_autotest', true],
-        ['cpuflags_autotest', true],
-        ['debug_autotest', true],
-        ['devargs_autotest', true],
-        ['eal_flags_c_opt_autotest', false],
-        ['eal_flags_main_opt_autotest', false],
-        ['eal_flags_n_opt_autotest', false],
-        ['eal_flags_hpet_autotest', false],
-        ['eal_flags_no_huge_autotest', false],
-        ['eal_flags_a_opt_autotest', false],
-        ['eal_flags_b_opt_autotest', false],
-        ['eal_flags_vdev_opt_autotest', false],
-        ['eal_flags_r_opt_autotest', false],
-        ['eal_flags_mem_autotest', false],
-        ['eal_flags_file_prefix_autotest', false],
-        ['eal_flags_misc_autotest', false],
-        ['eal_fs_autotest', true],
-        ['errno_autotest', true],
-        ['ethdev_link_status', true],
-        ['event_ring_autotest', true],
-        ['fib_autotest', true],
-        ['fib6_autotest', true],
-        ['func_reentrancy_autotest', false],
-        ['hash_autotest', true],
-        ['interrupt_autotest', true],
-        ['ipfrag_autotest', false],
-        ['lcores_autotest', true],
-        ['logs_autotest', true],
-        ['lpm_autotest', true],
-        ['lpm6_autotest', true],
-        ['malloc_autotest', false],
-        ['mbuf_autotest', false],
-        ['mcslock_autotest', false],
-        ['memcpy_autotest', true],
-        ['memory_autotest', false],
-        ['mempool_autotest', false],
-        ['memzone_autotest', false],
-        ['meter_autotest', true],
-        ['multiprocess_autotest', false],
-        ['per_lcore_autotest', true],
-        ['pflock_autotest', true],
-        ['prefetch_autotest', true],
-        ['rcu_qsbr_autotest', true],
-        ['pie_autotest', true],
-        ['rib_autotest', true],
-        ['rib6_autotest', true],
-        ['ring_autotest', true],
-        ['rwlock_test1_autotest', true],
-        ['rwlock_rda_autotest', true],
-        ['rwlock_rds_wrm_autotest', true],
-        ['rwlock_rde_wro_autotest', true],
-        ['sched_autotest', true],
-        ['security_autotest', false],
-        ['spinlock_autotest', true],
-        ['stack_autotest', false],
-        ['stack_lf_autotest', false],
-        ['string_autotest', true],
-        ['tailq_autotest', true],
-        ['ticketlock_autotest', true],
-        ['timer_autotest', false],
-        ['user_delay_us', true],
-        ['version_autotest', true],
-        ['crc_autotest', true],
-        ['distributor_autotest', false],
-        ['eventdev_common_autotest', true],
-        ['fbarray_autotest', true],
-        ['hash_readwrite_func_autotest', false],
-        ['ipsec_autotest', true],
-        ['kni_autotest', false],
-        ['kvargs_autotest', true],
-        ['member_autotest', true],
-        ['power_cpufreq_autotest', false],
-        ['power_autotest', true],
-        ['power_kvm_vm_autotest', false],
-        ['reorder_autotest', true],
-        ['service_autotest', true],
-        ['thash_autotest', true],
-        ['trace_autotest', true],
+        ['acl_autotest', true, true],
+        ['atomic_autotest', false, true],
+        ['bitmap_autotest', true, true],
+        ['bpf_autotest', true, true],
+        ['bpf_convert_autotest', true, true],
+        ['bitops_autotest', true, true],
+        ['byteorder_autotest', true, true],
+        ['cksum_autotest', true, true],
+        ['cmdline_autotest', true, true],
+        ['common_autotest', true, true],
+        ['cpuflags_autotest', true, true],
+        ['debug_autotest', true, true],
+        ['devargs_autotest', true, true],
+        ['eal_flags_c_opt_autotest', false, false],
+        ['eal_flags_main_opt_autotest', false, false],
+        ['eal_flags_n_opt_autotest', false, false],
+        ['eal_flags_hpet_autotest', false, false],
+        ['eal_flags_no_huge_autotest', false, false],
+        ['eal_flags_a_opt_autotest', false, false],
+        ['eal_flags_b_opt_autotest', false, false],
+        ['eal_flags_vdev_opt_autotest', false, false],
+        ['eal_flags_r_opt_autotest', false, false],
+        ['eal_flags_mem_autotest', false, false],
+        ['eal_flags_file_prefix_autotest', false, false],
+        ['eal_flags_misc_autotest', false, false],
+        ['eal_fs_autotest', true, true],
+        ['errno_autotest', true, true],
+        ['ethdev_link_status', true, true],
+        ['event_ring_autotest', true, true],
+        ['fib_autotest', true, true],
+        ['fib6_autotest', true, true],
+        ['func_reentrancy_autotest', false, true],
+        ['hash_autotest', true, true],
+        ['interrupt_autotest', true, true],
+        ['ipfrag_autotest', false, true],
+        ['lcores_autotest', true, true],
+        ['logs_autotest', true, true],
+        ['lpm_autotest', true, true],
+        ['lpm6_autotest', true, true],
+        ['malloc_autotest', false, true],
+        ['mbuf_autotest', false, true],
+        ['mcslock_autotest', false, true],
+        ['memcpy_autotest', true, true],
+        ['memory_autotest', false, true],
+        ['mempool_autotest', false, true],
+        ['memzone_autotest', false, true],
+        ['meter_autotest', true, true],
+        ['multiprocess_autotest', false, false],
+        ['per_lcore_autotest', true, true],
+        ['pflock_autotest', true, true],
+        ['prefetch_autotest', true, true],
+        ['rcu_qsbr_autotest', true, true],
+        ['pie_autotest', true, true],
+        ['rib_autotest', true, true],
+        ['rib6_autotest', true, true],
+        ['ring_autotest', true, true],
+        ['rwlock_test1_autotest', true, true],
+        ['rwlock_rda_autotest', true, true],
+        ['rwlock_rds_wrm_autotest', true, true],
+        ['rwlock_rde_wro_autotest', true, true],
+        ['sched_autotest', true, true],
+        ['security_autotest', false, true],
+        ['spinlock_autotest', true, true],
+        ['stack_autotest', false, true],
+        ['stack_lf_autotest', false, true],
+        ['string_autotest', true, true],
+        ['tailq_autotest', true, true],
+        ['ticketlock_autotest', true, true],
+        ['timer_autotest', false, true],
+        ['user_delay_us', true, true],
+        ['version_autotest', true, true],
+        ['crc_autotest', true, true],
+        ['distributor_autotest', false, true],
+        ['eventdev_common_autotest', true, true],
+        ['fbarray_autotest', true, true],
+        ['hash_readwrite_func_autotest', false, true],
+        ['ipsec_autotest', true, true],
+        ['kni_autotest', false, true],
+        ['kvargs_autotest', true, true],
+        ['member_autotest', true, true],
+        ['power_cpufreq_autotest', false, true],
+        ['power_autotest', true, true],
+        ['power_kvm_vm_autotest', false, true],
+        ['reorder_autotest', true, true],
+        ['service_autotest', true, true],
+        ['thash_autotest', true, true],
+        ['trace_autotest', true, true],
 ]
 
 # Tests known to have issues or which don't belong in other tests lists.
@@ -345,15 +346,16 @@ endif
 
 if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
-    fast_tests += [['flow_classify_autotest', false]]
+    fast_tests += [['flow_classify_autotest', false, true]]
 endif
 if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
-    fast_tests += [['metrics_autotest', true]]
+    fast_tests += [['metrics_autotest', true, true]]
 endif
 if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
-    fast_tests += [['telemetry_json_autotest', true], ['telemetry_data_autotest', true]]
+    fast_tests += [['telemetry_json_autotest', true, true]]
+    fast_tests += [['telemetry_data_autotest', true, true]]
 endif
 if dpdk_conf.has('RTE_LIB_PIPELINE')
 # pipeline lib depends on port and table libs, so those must be present
@@ -366,7 +368,7 @@ if dpdk_conf.has('RTE_LIB_PIPELINE')
             'test_table_ports.c',
             'test_table_tables.c',
     ]
-    fast_tests += [['table_autotest', true]]
+    fast_tests += [['table_autotest', true, false]] # https://bugs.dpdk.org/show_bug.cgi?id=820
 endif
 
 # The following linkages of drivers are required because
@@ -386,26 +388,26 @@ if dpdk_conf.has('RTE_NET_RING')
     test_sources += 'test_pmd_ring.c'
     test_sources += 'test_event_eth_tx_adapter.c'
     test_sources += 'sample_packet_forward.c'
-    fast_tests += [['ring_pmd_autotest', true]]
+    fast_tests += [['ring_pmd_autotest', true, true]]
     perf_test_names += 'ring_pmd_perf_autotest'
-    fast_tests += [['event_eth_tx_adapter_autotest', false]]
+    fast_tests += [['event_eth_tx_adapter_autotest', false, true]]
     if dpdk_conf.has('RTE_LIB_BITRATESTATS')
         test_sources += 'test_bitratestats.c'
-        fast_tests += [['bitratestats_autotest', true]]
+        fast_tests += [['bitratestats_autotest', true, true]]
     endif
     if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
         test_sources += 'test_latencystats.c'
-        fast_tests += [['latencystats_autotest', true]]
+        fast_tests += [['latencystats_autotest', true, true]]
     endif
     if dpdk_conf.has('RTE_LIB_PDUMP')
         test_sources += 'test_pdump.c'
-        fast_tests += [['pdump_autotest', true]]
+        fast_tests += [['pdump_autotest', true, false]]
     endif
 endif
 if dpdk_conf.has('RTE_NET_NULL')
     test_deps += 'net_null'
     test_sources += 'test_vdev.c'
-    fast_tests += [['vdev_autotest', true]]
+    fast_tests += [['vdev_autotest', true, true]]
 endif
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
@@ -431,7 +433,7 @@ if dpdk_conf.has('RTE_LIB_COMPRESSDEV')
     if compress_test_dep.found()
         test_dep_objs += compress_test_dep
         test_sources += 'test_compressdev.c'
-        fast_tests += [['compressdev_autotest', false]]
+        fast_tests += [['compressdev_autotest', false, true]]
     endif
 endif
 
@@ -478,6 +480,12 @@ foreach arg : fast_tests
         endif
     endif
 
+    if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address,undefined'
+        if not arg[2]
+            run_test = false
+        endif
+    endif
+
     if (get_option('default_library') == 'shared' and
         arg[0] == 'event_eth_tx_adapter_autotest')
         foreach drv:dpdk_drivers
-- 
2.23.0


^ permalink raw reply	[relevance 3%]

* RE: [DPDK v3] net/ixgbe: promote MDIO API
  2022-04-15 14:36  4%   ` Ray Kinsella
@ 2022-04-18  6:41  0%     ` Yang, Qiming
  0 siblings, 0 replies; 200+ results
From: Yang, Qiming @ 2022-04-18  6:41 UTC (permalink / raw)
  To: Ray Kinsella, Zeng, ZhichaoX; +Cc: dev, Wang, Haiyue, David Marchand



> -----Original Message-----
> From: Ray Kinsella <mdr@ashroe.eu>
> Sent: 2022年4月15日 22:36
> To: Zeng, ZhichaoX <zhichaox.zeng@intel.com>
> Cc: dev@dpdk.org; Wang, Haiyue <haiyue.wang@intel.com>; David
> Marchand <david.marchand@redhat.com>
> Subject: Re: [DPDK v3] net/ixgbe: promote MDIO API
> 
> 
> zhichaox.zeng@intel.com writes:
> 
> > From: zhichao zeng <zhichaox.zeng@intel.com>
> >
> > Promote the MDIO APIs to be stable.
> >
> > Signed-off-by: zhichao zeng <zhichaox.zeng@intel.com>

Your sign off should be Zhichao Zeng, upper case.

> > ---
> >  drivers/net/ixgbe/rte_pmd_ixgbe.h |  5 -----
> >  drivers/net/ixgbe/version.map     | 10 +++++-----
> >  2 files changed, 5 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h
> > b/drivers/net/ixgbe/rte_pmd_ixgbe.h
> > index eef6f6661c..426fe5845b 100644
> > --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
> > +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
> > @@ -586,7 +586,6 @@ int rte_pmd_ixgbe_bypass_wd_reset(uint16_t
> port);
> >   *   - (-ENODEV) if *port* invalid.
> >   *   - (IXGBE_ERR_SWFW_SYNC) If sw/fw semaphore acquisition failed
> >   */
> > -__rte_experimental
> >  int
> >  rte_pmd_ixgbe_mdio_lock(uint16_t port);
> >
> > @@ -600,7 +599,6 @@ rte_pmd_ixgbe_mdio_lock(uint16_t port);
> >   *   - (-ENOTSUP) if hardware doesn't support.
> >   *   - (-ENODEV) if *port* invalid.
> >   */
> > -__rte_experimental
> >  int
> >  rte_pmd_ixgbe_mdio_unlock(uint16_t port);
> >
> > @@ -622,7 +620,6 @@ rte_pmd_ixgbe_mdio_unlock(uint16_t port);
> >   *   - (-ENODEV) if *port* invalid.
> >   *   - (IXGBE_ERR_PHY) If PHY read command failed
> >   */
> > -__rte_experimental
> >  int
> >  rte_pmd_ixgbe_mdio_unlocked_read(uint16_t port, uint32_t reg_addr,
> >  				 uint32_t dev_type, uint16_t *phy_data);
> @@ -646,7 +643,6 @@
> > rte_pmd_ixgbe_mdio_unlocked_read(uint16_t port, uint32_t reg_addr,
> >   *   - (-ENODEV) if *port* invalid.
> >   *   - (IXGBE_ERR_PHY) If PHY read command failed
> >   */
> > -__rte_experimental
> >  int
> >  rte_pmd_ixgbe_mdio_unlocked_write(uint16_t port, uint32_t reg_addr,
> >  				  uint32_t dev_type, uint16_t phy_data);
> @@ -725,7 +721,6 @@ enum
> > {
> >   *   - (-ENODEV) if *port* invalid.
> >   *   - (-ENOTSUP) if hardware doesn't support this feature.
> >   */
> > -__rte_experimental
> >  int
> >  rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable);
> >
> > diff --git a/drivers/net/ixgbe/version.map
> > b/drivers/net/ixgbe/version.map index bca5cc5826..f0f29d8749 100644
> > --- a/drivers/net/ixgbe/version.map
> > +++ b/drivers/net/ixgbe/version.map
> > @@ -16,6 +16,10 @@ DPDK_22 {
> >  	rte_pmd_ixgbe_macsec_enable;
> >  	rte_pmd_ixgbe_macsec_select_rxsa;
> >  	rte_pmd_ixgbe_macsec_select_txsa;
> 
> Promoted APIs should be part of the DPDK_23 ABI, not DPDK_22.
> 
> David - I just did some checking and noted that we have been promoting
> directly from experimental to DPDK 22, and that we did the same for DPDK
> 21. However in the DPDK_20 we (rightly) promoted to DPDK_21, new APIs
> are promoted to being stable in the next ABI release.
> 
> Was that I conscious decision? I don't thinking there is impact by the error /
> change, beyond house keeping.
> 
> 
> > +	rte_pmd_ixgbe_mdio_lock;
> > +	rte_pmd_ixgbe_mdio_unlock;
> > +	rte_pmd_ixgbe_mdio_unlocked_read;
> > +	rte_pmd_ixgbe_mdio_unlocked_write;
> >  	rte_pmd_ixgbe_ping_vf;
> >  	rte_pmd_ixgbe_set_all_queues_drop_en;
> >  	rte_pmd_ixgbe_set_tc_bw_alloc;
> > @@ -31,6 +35,7 @@ DPDK_22 {
> >  	rte_pmd_ixgbe_set_vf_vlan_filter;
> >  	rte_pmd_ixgbe_set_vf_vlan_insert;
> >  	rte_pmd_ixgbe_set_vf_vlan_stripq;
> > +	rte_pmd_ixgbe_upd_fctrl_sbp;
> >
> >  	local: *;
> >  };
> > @@ -40,9 +45,4 @@ EXPERIMENTAL {
> >
> >  	rte_pmd_ixgbe_get_fdir_info;
> >  	rte_pmd_ixgbe_get_fdir_stats;
> > -	rte_pmd_ixgbe_mdio_lock;
> > -	rte_pmd_ixgbe_mdio_unlock;
> > -	rte_pmd_ixgbe_mdio_unlocked_read;
> > -	rte_pmd_ixgbe_mdio_unlocked_write;
> > -	rte_pmd_ixgbe_upd_fctrl_sbp;
> >  };
> 
> 
> --
> Regards, Ray K

^ permalink raw reply	[relevance 0%]

* [PATCH v2 0/7] Add new cryptodev op for event metadata
    @ 2022-04-18 19:33  4% ` Akhil Goyal
  2022-04-18 19:33  2%   ` [PATCH v2 1/7] cryptodev: add APIs to get/set " Akhil Goyal
  1 sibling, 1 reply; 200+ results
From: Akhil Goyal @ 2022-04-18 19:33 UTC (permalink / raw)
  To: dev
  Cc: anoobj, jerinj, abhinandan.gujjar, jay.jayatheerthan,
	narender.vangati, vfialko, Akhil Goyal

For using event crypto metadata, event metadata need to be set
in session. For this session user data was used for symmetric
crypto sessions and no support was present for asymmetric and
security sessions.
The use of userdata to store event metadata (which is dereferenced
in PMD) is not correct as it is meant for the application to use it.
Hence, a new API is created to set and get event crypto metadata which
is scalable to all sessions supported by the crypto PMD.
The application can use the set API to set event metadata and the
PMD may store that inside the session private data and PMD need not
use the get API as it would be internal to the PMD.
For the software event crypto adapter implementation, the eventdev
library can use the get API to get the event metadata stored inside
the session structure.
For Asymmetric sessions, a new field is added inside the session
struct which is internal to library.
For symmetric and security sessions, new field cannot be added as
it would be ABI break. Hence, session userdata is being used to
store that as it was used earlier. In next ABI break release this
would be fixed similar to asymmetric crypto case.

The patchset also add support for asymmetric crypto adapter
in the test applications and the crypto/cnxk implementation of
the new cryptodev op and corresponding changes in the eventdev lib.


changes in v2:
- v1 patchset only fixed security sessions and also caused ABI breakage.
This is fixed in v2.
- added new API for setting event metadata.
- added new cryptodev op which can handle all sessions

Akhil Goyal (5):
  crypto/octeontx: use new API for event metadata
  test/event: use new API to set event crypto metadata
  eventdev: use new API to get event crypto metadata
  test/event: add asymmetric cases for crypto adapter
  test-eventdev: support asym ops for crypto adapter

Volodymyr Fialko (2):
  cryptodev: add APIs to get/set event metadata
  crypto/cnxk: add event metadata set operation

 app/test-eventdev/evt_common.h              |   2 +
 app/test-eventdev/evt_options.c             |  17 +
 app/test-eventdev/evt_options.h             |   4 +
 app/test-eventdev/test_perf_atq.c           |  12 +-
 app/test-eventdev/test_perf_common.c        | 254 ++++++++--
 app/test-eventdev/test_perf_common.h        |  45 +-
 app/test-eventdev/test_perf_queue.c         |  12 +-
 app/test/test_event_crypto_adapter.c        | 503 +++++++++++++++++++-
 doc/guides/tools/testeventdev.rst           |   5 +
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c   | 144 +++++-
 drivers/crypto/cnxk/cn10k_ipsec.h           |   2 +
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c    | 138 +++++-
 drivers/crypto/cnxk/cn9k_ipsec.h            |   2 +
 drivers/crypto/cnxk/cnxk_ae.h               |   2 +
 drivers/crypto/cnxk/cnxk_cryptodev_ops.h    |  18 -
 drivers/crypto/cnxk/cnxk_se.h               |   2 +
 drivers/crypto/octeontx/otx_cryptodev_ops.c |  20 +-
 lib/cryptodev/cryptodev_pmd.h               |  23 +
 lib/cryptodev/rte_cryptodev.c               |  52 ++
 lib/cryptodev/rte_cryptodev.h               |  34 ++
 lib/cryptodev/version.map                   |   4 +
 lib/eventdev/rte_event_crypto_adapter.c     |  55 +--
 22 files changed, 1162 insertions(+), 188 deletions(-)

-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* [PATCH v2 1/7] cryptodev: add APIs to get/set event metadata
  2022-04-18 19:33  4% ` [PATCH v2 0/7] Add new cryptodev op for " Akhil Goyal
@ 2022-04-18 19:33  2%   ` Akhil Goyal
  0 siblings, 0 replies; 200+ results
From: Akhil Goyal @ 2022-04-18 19:33 UTC (permalink / raw)
  To: dev
  Cc: anoobj, jerinj, abhinandan.gujjar, jay.jayatheerthan,
	narender.vangati, vfialko, Akhil Goyal

From: Volodymyr Fialko <vfialko@marvell.com>

Currently, crypto session userdata is used to set event crypto
metadata from the application and the driver is dereferencing it
in driver which is not correct. User data is meant to be opaque
to the driver.
To support this, new API is added to get and set event crypto
metadata. The new API, rte_cryptodev_set_session_event_mdata,
allows setting event metadata in session private data which is
filled inside PMD using a new cryptodev op. This operation
can be performed on any of the PMD supported sessions
(sym/asym/security).
For SW abstraction of event crypto adapter to be used by
eventdev library, a new field is added in asymmetric crypto
session for now and for symmetric case, current implementation
of using userdata is used. Symmetric cases cannot be fixed now,
as it will be ABI breakage which will be resolved in DPDK 22.11.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
 lib/cryptodev/cryptodev_pmd.h | 23 ++++++++++++++++
 lib/cryptodev/rte_cryptodev.c | 52 +++++++++++++++++++++++++++++++++++
 lib/cryptodev/rte_cryptodev.h | 34 +++++++++++++++++++++++
 lib/cryptodev/version.map     |  4 +++
 4 files changed, 113 insertions(+)

diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index 2b1ce2da2d..f374b6c880 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -398,6 +398,25 @@ typedef int (*cryptodev_sym_configure_raw_dp_ctx_t)(
 	enum rte_crypto_op_sess_type sess_type,
 	union rte_cryptodev_session_ctx session_ctx, uint8_t is_update);
 
+/**
+ * Typedef that the driver provided to set event crypto meta data.
+ *
+ * @param	dev		Crypto device pointer.
+ * @param	sess		Crypto or security session.
+ * @param	op_type		Operation type.
+ * @param	sess_type	Session type.
+ * @param	ev_mdata	Pointer to the event crypto meta data
+ *				(aka *union rte_event_crypto_metadata*)
+ * @return
+ *   - On success return 0.
+ *   - On failure return negative integer.
+ */
+typedef int (*cryptodev_session_event_mdata_set_t)(
+	struct rte_cryptodev *dev, void *sess,
+	enum rte_crypto_op_type op_type,
+	enum rte_crypto_op_sess_type sess_type,
+	void *ev_mdata);
+
 /** Crypto device operations function pointer table */
 struct rte_cryptodev_ops {
 	cryptodev_configure_t dev_configure;	/**< Configure device. */
@@ -442,6 +461,8 @@ struct rte_cryptodev_ops {
 			/**< Initialize raw data path context data. */
 		};
 	};
+	cryptodev_session_event_mdata_set_t session_ev_mdata_set;
+	/**< Set a Crypto or Security session even meta data. */
 };
 
 
@@ -636,6 +657,8 @@ RTE_STD_C11 struct rte_cryptodev_asym_session {
 	/**< Size of private data used when creating mempool */
 	uint16_t user_data_sz;
 	/**< Session user data will be placed after sess_data */
+	void *event_mdata;
+	/**< Event crypto adapter metadata */
 	uint8_t padding[3];
 	uint8_t sess_private_data[0];
 };
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 3500a2d470..9ea64bc4f0 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2259,6 +2259,58 @@ rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id,
 			sess_type, session_ctx, is_update);
 }
 
+int
+rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess,
+	enum rte_crypto_op_type op_type,
+	enum rte_crypto_op_sess_type sess_type,
+	void *ev_mdata)
+{
+	struct rte_cryptodev *dev;
+
+	if (!rte_cryptodev_is_valid_dev(dev_id))
+		goto skip_pmd_op;
+
+	dev = rte_cryptodev_pmd_get_dev(dev_id);
+	if (dev->dev_ops->session_ev_mdata_set == NULL)
+		goto skip_pmd_op;
+
+	return (*dev->dev_ops->session_ev_mdata_set)(dev, sess, op_type,
+			sess_type, ev_mdata);
+
+skip_pmd_op:
+#define EVENT_CRYPTO_MDATA_SZ	16
+/**<
+ * sizeof(union rte_event_crypto_metadata). To be removed when event_mdata is
+ * added in rte_cryptodev_sym_session
+ */
+
+	if (op_type == RTE_CRYPTO_OP_TYPE_SYMMETRIC)
+		return rte_cryptodev_sym_session_set_user_data(sess, ev_mdata,
+				EVENT_CRYPTO_MDATA_SZ);
+	else if (op_type == RTE_CRYPTO_OP_TYPE_ASYMMETRIC) {
+		((struct rte_cryptodev_asym_session *)sess)->event_mdata =
+						ev_mdata;
+		return 0;
+	} else
+		return -ENOTSUP;
+}
+
+void *
+rte_cryptodev_session_event_mdata_get(struct rte_crypto_op *op)
+{
+	if (op->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC &&
+			op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
+		return rte_cryptodev_sym_session_get_user_data(op->sym->session);
+	else if (op->type == RTE_CRYPTO_OP_TYPE_ASYMMETRIC &&
+			op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
+		return op->asym->session->event_mdata;
+	else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
+			op->private_data_offset)
+		return ((uint8_t *)op + op->private_data_offset);
+	else
+		return NULL;
+}
+
 uint32_t
 rte_cryptodev_raw_enqueue_burst(struct rte_crypto_raw_dp_ctx *ctx,
 	struct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs,
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 45d33f4a50..b3ddc41ab1 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -1269,6 +1269,40 @@ __rte_experimental
 int
 rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id);
 
+/**
+ * Set session event meta data
+ *
+ * @param	dev_id		The device identifier.
+ * @param	sess            Crypto or security session.
+ * @param	op_type         Operation type.
+ * @param	sess_type       Session type.
+ * @param	ev_mdata	Pointer to the event crypto meta data
+ *				(aka *union rte_event_crypto_metadata*)
+ *
+ * @return
+ *  - On success, zero.
+ *  - On failure, a negative value.
+ */
+__rte_experimental
+int
+rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess,
+	enum rte_crypto_op_type op_type,
+	enum rte_crypto_op_sess_type sess_type,
+	void *ev_mdata);
+
+/**
+ * Get session event meta data (aka *union rte_event_crypto_metadata*)
+ *
+ * @param	op            pointer to *rte_crypto_op* structure.
+ *
+ * @return
+ *  - On success, pointer to event crypto metadata
+ *  - On failure, a negative value.
+ */
+__rte_experimental
+void *
+rte_cryptodev_session_event_mdata_get(struct rte_crypto_op *op);
+
 /**
  * Union of different crypto session types, including session-less xform
  * pointer.
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index c7c5aefceb..b8a23a1791 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -105,6 +105,10 @@ EXPERIMENTAL {
 	rte_cryptodev_asym_session_pool_create;
 	rte_cryptodev_asym_session_set_user_data;
 	__rte_cryptodev_trace_asym_session_pool_create;
+
+	#added in 22.07
+	rte_cryptodev_session_event_mdata_get;
+	rte_cryptodev_session_event_mdata_set;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 2%]

Results 11201-11400 of ~18000   |  | reverse | sort options + mbox downloads above
-- links below jump to the message on this page --
2020-10-08 15:30     [dpdk-dev] [PATCH v4 1/5] eal: add API for bus close rohit.raj
2022-01-10  5:26     ` [PATCH v5 1/2] " rohit.raj
2022-02-09 11:04  3%   ` David Marchand
2022-02-09 13:20  3%     ` Thomas Monjalon
2020-10-09  3:48     [dpdk-dev] [PATCH v6 0/3] librte_ethdev: error recovery support Kalesh A P
2022-01-28 12:48     ` [dpdk-dev] [PATCH v7 0/4] ethdev: " Kalesh A P
2022-01-28 12:48       ` [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events Kalesh A P
2022-02-01 12:52  3%     ` Ferruh Yigit
2022-02-02 11:44  0%       ` Ray Kinsella
2022-02-10 22:16  3%         ` Thomas Monjalon
2022-02-11 10:09  5%           ` Ray Kinsella
2022-02-14 10:16  4%             ` Ray Kinsella
2022-02-14 11:15  4%               ` Thomas Monjalon
2022-02-14 16:06  5%                 ` Ray Kinsella
2022-02-14 16:25  0%                   ` Thomas Monjalon
2022-02-14 18:27  0%                     ` Ray Kinsella
2022-02-15 13:55  4%                       ` Ray Kinsella
2022-02-15 15:12  0%                         ` Thomas Monjalon
2022-02-15 16:12  0%                           ` Ray Kinsella
2021-10-06  4:48     [dpdk-dev] [RFC 0/3] ethdev: datapath-focused flow rules management Alexander Kozyrev
2022-01-18 15:30     ` [PATCH v2 00/10] " Alexander Kozyrev
2022-01-18 15:30       ` [PATCH v2 01/10] ethdev: introduce flow pre-configuration hints Alexander Kozyrev
2022-01-24 14:36  3%     ` Jerin Jacob
2022-01-24 17:35  0%       ` Thomas Monjalon
2022-01-24 17:46  0%         ` Jerin Jacob
2022-01-24 18:08  3%           ` Bruce Richardson
2022-01-25  1:14  0%             ` Alexander Kozyrev
2022-01-25 15:58  4%             ` Ori Kam
2022-01-25 18:09  3%               ` Bruce Richardson
2022-01-25 18:14  3%                 ` Bruce Richardson
2022-01-26  9:45  0%                   ` Ori Kam
2022-01-26 10:52  4%                     ` Bruce Richardson
2022-01-26 11:21  0%                       ` Thomas Monjalon
2022-01-26 12:19  0%                         ` Ori Kam
2022-01-26 13:41  0%                           ` Bruce Richardson
2022-01-26 15:12  0%                             ` Ori Kam
2022-01-24 17:40  0%       ` Ajit Khaparde
2022-01-25  1:28  0%         ` Alexander Kozyrev
2022-01-25 18:44               ` Jerin Jacob
2022-01-26 22:02                 ` Alexander Kozyrev
2022-01-27  9:34  3%               ` Jerin Jacob
2021-10-15  5:13     [dpdk-dev] [PATCH] app/testpmd: fix l4 sw csum over multi segments Xiaoyun Li
2022-01-24 12:28     ` [PATCH v6 0/2] Add functions to calculate UDP/TCP cksum in mbuf Xiaoyun Li
2022-01-24 12:28  3%   ` [PATCH v6 1/2] net: add " Xiaoyun Li
2021-12-15 18:19     [PATCH 1/7] net/bonding: fix typos and whitespace Robert Sanford
2021-12-21 19:57     ` [PATCH v2 0/8] net/bonding: fixes and LACP short timeout Robert Sanford
2021-12-21 19:57       ` [PATCH v2 4/8] net/bonding: support enabling " Robert Sanford
2022-02-04 14:46  4%     ` Ferruh Yigit
2021-12-21 19:57       ` [PATCH v2 8/8] net/bonding: add LACP short timeout tests Robert Sanford
2022-02-04 14:49  4%     ` Ferruh Yigit
2022-02-04 15:09  3%   ` [PATCH v2 0/8] net/bonding: fixes and LACP short timeout Ferruh Yigit
2021-12-20 10:27     [PATCH 1/8] common/dpaax: caamflib: Remove code related to SEC ERA 1 to 7 Gagandeep Singh
2021-12-28  9:10     ` [PATCH v2 0/8] NXP crypto drivers changes Gagandeep Singh
2021-12-28  9:10       ` [PATCH v2 4/8] crypto/dpaa2_sec: support AES-GMAC Gagandeep Singh
2022-01-21 11:29  3%     ` [EXT] " Akhil Goyal
2022-02-08 14:15  0%       ` Gagandeep Singh
2021-12-22  6:13     [PATCH] eventdev/rx_adapter: add event port get api Naga Harish K S V
2022-01-22 17:07  4% ` [PATCH v2] " Naga Harish K S V
2022-01-22 17:14  4%   ` [PATCH v3] eventdev/eth_rx: " Naga Harish K S V
2022-01-23 15:32  0%     ` Jerin Jacob
2021-12-22  8:25     [PATCH v2] mempool: fix the description of some function return values Zhiheng Chen
2021-12-23 10:07     ` [PATCH v3] " Zhiheng Chen
2022-01-24 17:04  3%   ` Olivier Matz
2021-12-24 22:59     [PATCH 0/1] mempool: implement index-based per core cache Dharmik Thakkar
2022-01-13  5:36     ` [PATCH v2 " Dharmik Thakkar
2022-01-13  5:36       ` [PATCH v2 1/1] " Dharmik Thakkar
2022-01-20  8:21         ` Morten Brørup
2022-01-21  6:01           ` Honnappa Nagarahalli
2022-01-21  7:36             ` Morten Brørup
2022-01-24 13:05  0%           ` Ray Kinsella
2022-01-21  9:12  0%         ` Bruce Richardson
2021-12-26 15:34     [RFC] mempool: rte_mempool_do_generic_get optimizations Morten Brørup
2022-01-19 15:03     ` [PATCH v3] mempool: fix put objects to mempool with cache Morten Brørup
2022-01-24 15:39  3%   ` Olivier Matz
2022-01-28  9:37  0%     ` Morten Brørup
2022-02-02 10:33  3% ` [PATCH v4] mempool: fix mempool cache flushing algorithm Morten Brørup
2021-12-30  3:08     [RFC 0/3] Add support for GRE optional fields matching Sean Zhang
2021-12-30  3:08     ` [RFC 1/3] ethdev: support GRE optional fields Sean Zhang
2022-01-19  9:53       ` Ferruh Yigit
2022-01-19 10:01         ` Thomas Monjalon
2022-01-19 10:56           ` Ori Kam
2022-01-25  9:49  0%         ` Sean Zhang (Networking SW)
2022-01-25 11:37  0%           ` Ferruh Yigit
2022-01-25 13:06  0%             ` Ori Kam
2022-01-25 14:29  0%               ` Ferruh Yigit
2022-01-25 16:03  0%                 ` Ori Kam
2021-12-30  6:08     [PATCH v6 00/26] Net/SPNIC: support SPNIC into DPDK 22.03 Yanling Song
2022-01-19 16:56     ` Ferruh Yigit
2022-01-21  9:27  0%   ` Yanling Song
2022-01-21 10:22  0%     ` Ferruh Yigit
2022-01-24  5:12  0%       ` Hemant Agrawal
2022-02-12 14:01  0%       ` Yanling Song
2022-01-17 20:18     [PATCH v5 00/50] introduce IWYU Sean Morrissey
2022-02-02  9:47     ` [PATCH v6 " Sean Morrissey
2022-02-02  9:47       ` [PATCH v6 20/50] pdump: remove unneeded header includes Sean Morrissey
2022-02-02 15:54         ` Stephen Hemminger
2022-02-02 16:00  3%       ` Bruce Richardson
2022-02-02 16:45  0%         ` Morten Brørup
2022-01-17 23:14     [PATCH] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if Michael Barker
2022-01-17 23:23     ` [PATCH v2] " Michael Barker
2022-01-20 14:16       ` Thomas Monjalon
2022-01-23 21:17  0%     ` Michael Barker
2022-01-23 21:07  8%   ` [PATCH v3] " Michael Barker
2022-01-23 21:20  8%     ` [PATCH v4] " Michael Barker
2022-01-25 10:33  0%       ` Ray Kinsella
2022-01-31  0:05  8%       ` [PATCH v5] " Michael Barker
2022-02-12 14:00  0%         ` Thomas Monjalon
2022-01-20 16:26     [PATCH v2 0/4] ethdev: introduce IP reassembly offload Akhil Goyal
2022-01-30 17:59  4% ` [PATCH v3 " Akhil Goyal
2022-01-30 17:59       ` [PATCH v3 4/4] security: add IPsec option for IP reassembly Akhil Goyal
2022-02-01 14:12         ` Ferruh Yigit
2022-02-02  9:15  3%       ` [EXT] " Akhil Goyal
2022-02-02 14:04  0%         ` Ferruh Yigit
2022-02-01 14:10  0%   ` [PATCH v3 0/4] ethdev: introduce IP reassembly offload Ferruh Yigit
2022-02-04 22:13  4%   ` [PATCH v4 0/3] " Akhil Goyal
2022-02-04 22:13         ` [PATCH v4 3/3] security: add IPsec option for IP reassembly Akhil Goyal
2022-02-08  9:01           ` David Marchand
2022-02-08  9:18  3%         ` [EXT] " Akhil Goyal
2022-02-08  9:27  0%           ` David Marchand
2022-02-08 10:45  0%             ` Akhil Goyal
2022-02-08 13:19  0%               ` Akhil Goyal
2022-02-08 19:55  0%                 ` David Marchand
2022-02-08 20:01  0%                   ` Akhil Goyal
2022-02-08 20:11  4%     ` [PATCH v5 0/3] ethdev: introduce IP reassembly offload Akhil Goyal
2022-02-08 22:20  4%       ` [PATCH v6 " Akhil Goyal
2022-02-10  8:54  0%         ` Ferruh Yigit
2022-01-22 17:02  4% [PATCH v2] eventdev/rx_adapter: add event port get api Naga Harish K S V
2022-02-01  9:18  3% Minutes of tech-board meeting: 2022-01-26 Richardson, Bruce
2022-02-03 16:04     [PATCH v3 0/4] crypto: improve asym session usage Ciara Power
2022-02-03 16:04  1% ` [PATCH v3 1/4] crypto: use single buffer for asymmetric session Ciara Power
2022-02-03 16:04  2% ` [PATCH v3 4/4] crypto: modify return value for asym session create Ciara Power
2022-02-04 17:42     [PATCH 0/7] Verify C++ compatibility of public headers Bruce Richardson
2022-02-10 15:42     ` [PATCH v4 " Bruce Richardson
2022-02-10 15:42 11%   ` [PATCH v4 7/7] buildtools/chkincs: test headers for C++ compatibility Bruce Richardson
2022-02-11 11:36     ` [PATCH v5 0/2] Verify C++ compatibility of public headers Bruce Richardson
2022-02-11 11:36 11%   ` [PATCH v5 2/2] buildtools/chkincs: test headers for C++ compatibility Bruce Richardson
2022-02-07 11:35     [PATCH v2 0/4] Clarify asymmetric random, add 'k' and crypto uint Arek Kusztal
2022-02-07 11:35     ` [PATCH v2 4/4] crypto: reorganize endianness comments, add " Arek Kusztal
2022-02-10 10:17  3%   ` [EXT] " Akhil Goyal
2022-02-10 16:38  0%     ` Zhang, Roy Fan
2022-02-10 21:08  4%       ` Akhil Goyal
2022-02-11 10:54  0%         ` Ray Kinsella
2022-02-07 16:02     [PATCH v18 8/8] eal: implement functions for mutex management Ananyev, Konstantin
2022-02-08  2:21     ` Ananyev, Konstantin
2022-02-09  2:47  3%   ` Narcisa Ana Maria Vasile
2022-02-09 13:57  0%     ` Ananyev, Konstantin
2022-02-20 21:56  4%       ` Dmitry Kozlyuk
2022-02-23 17:08  0%         ` Dmitry Kozlyuk
2022-02-24 17:29  0%           ` Ananyev, Konstantin
2022-02-24 17:44  0%             ` Stephen Hemminger
2022-02-08 13:47  4% [PATCH] ci: remove outdated default reference tag for ABI Thomas Monjalon
2022-02-08 15:08  7% ` Aaron Conole
2022-02-08 22:03  8%   ` Brandon Lo
2022-02-09 13:37  4%   ` Thomas Monjalon
2022-02-09 14:04  4%     ` David Marchand
2022-03-01  9:56  9% ` [PATCH v2] ci: remove outdated default versions for ABI check Thomas Monjalon
2022-03-01 10:07  4%   ` David Marchand
2022-03-06  9:27  4%     ` Thomas Monjalon
2022-02-09 15:38     [PATCH v4 0/5] crypto: improve asym session usage Ciara Power
2022-02-09 15:38  1% ` [PATCH v4 2/5] crypto: use single buffer for asymmetric session Ciara Power
2022-02-09 15:38  2% ` [PATCH v4 5/5] crypto: modify return value for asym session create Ciara Power
2022-02-10 14:01     ` [PATCH v5 0/5] crypto: improve asym session usage Ciara Power
2022-02-10 14:01  1%   ` [PATCH v5 2/5] crypto: use single buffer for asymmetric session Ciara Power
2022-02-10 14:01  2%   ` [PATCH v5 5/5] crypto: modify return value for asym session create Ciara Power
2022-02-10 15:53     ` [PATCH v6 0/5] crypto: improve asym session usage Ciara Power
2022-02-10 15:54  1%   ` [PATCH v6 2/5] crypto: use single buffer for asymmetric session Ciara Power
2022-02-10 15:54  2%   ` [PATCH v6 5/5] crypto: modify return value for asym session create Ciara Power
2022-02-11  9:29     ` [PATCH v7 0/5] crypto: improve asym session usage Ciara Power
2022-02-11  9:29  1%   ` [PATCH v7 2/5] crypto: use single buffer for asymmetric session Ciara Power
2022-02-11  9:29  2%   ` [PATCH v7 5/5] crypto: modify return value for asym session create Ciara Power
2022-02-10 10:25     [PATCH] crypto: fix misspelled key in qt format Arek Kusztal
2022-02-12 11:34  3% ` [EXT] " Akhil Goyal
2022-02-18  6:11  0%   ` Kusztal, ArkadiuszX
2022-02-25 17:56  4%     ` Thomas Monjalon
2022-02-25 19:35  0%       ` Ray Kinsella
2022-02-19  4:11     [PATCH v7 00/10] ethdev: datapath-focused flow rules management Alexander Kozyrev
2022-02-20  3:43     ` [PATCH v8 " Alexander Kozyrev
2022-02-20  3:44       ` [PATCH v8 02/11] ethdev: add flow item/action templates Alexander Kozyrev
2022-02-21 10:57         ` Andrew Rybchenko
2022-02-21 13:12           ` Ori Kam
2022-02-21 15:14  3%         ` Alexander Kozyrev
2022-02-19 23:43     [PATCH 0/3] more unnecessary null checks Stephen Hemminger
2022-02-20 18:21  3% ` [PATCH v3 0/8] yet more unnecessary NULL checks Stephen Hemminger
2022-02-21  6:47     DPDK LTS release Kamaraj P
2022-02-21 10:23     ` Kevin Traynor
2022-02-23 16:16       ` Kamaraj P
2022-02-23 16:57  3%     ` Kevin Traynor
2022-02-22 21:04     [PATCH 0/6] mlx5: external RxQ support Michael Baum
2022-02-23 18:48  3% ` [PATCH v2 " Michael Baum
2022-02-23 18:48  4%   ` [PATCH v2 1/6] common/mlx5: consider local functions as internal Michael Baum
2022-02-24  8:38  0%   ` [PATCH v2 0/6] mlx5: external RxQ support Matan Azrad
2022-02-24 23:25  3%   ` [PATCH v3 " Michael Baum
2022-02-24 23:25  4%     ` [PATCH v3 1/6] common/mlx5: consider local functions as internal Michael Baum
2022-02-25 18:01  0%       ` Ferruh Yigit
2022-02-25 18:38  3%         ` Thomas Monjalon
2022-02-25 19:13  0%           ` Ferruh Yigit
2022-02-23 13:32     [PATCH] raw/cnxk_gpio: fix DPDK version in a map file Tomasz Duszynski
2022-02-23 13:50     ` Ferruh Yigit
2022-02-23 16:28  3%   ` Thomas Monjalon
2022-02-23 16:43     [PATCH 0/3] net/mlx5: fix link state detection Dmitry Kozlyuk
2022-03-01 12:15     ` [PATCH v2 " Dmitry Kozlyuk
2022-03-01 12:15       ` [PATCH v2 1/3] common/mlx5: add Netlink event helpers Dmitry Kozlyuk
2022-03-02 15:49         ` Ferruh Yigit
2022-03-02 15:56           ` Dmitry Kozlyuk
2022-03-08 13:48  3%         ` Kevin Traynor
2022-03-08 15:18  0%           ` Dmitry Kozlyuk
2022-03-01 16:54 15% [PATCH 1/2] devtools: remove event/dlb exception in ABI check David Marchand
2022-03-01 16:54 10% ` [PATCH 2/2] devtools: use libabigail rule for mlx glue drivers David Marchand
2022-03-02 10:16  3%   ` Ray Kinsella
2022-03-08 14:04  0%     ` Thomas Monjalon
2022-03-02 10:13  4% ` [PATCH 1/2] devtools: remove event/dlb exception in ABI check Ray Kinsella
2022-03-03  6:01     [RFC] ethdev: introduce protocol type based header split xuan.ding
2022-03-03 16:15  3% ` Stephen Hemminger
2022-03-04  9:58  3%   ` Zhang, Qi Z
2022-03-04 11:54  0%     ` Morten Brørup
2022-03-04 17:32  3%     ` Stephen Hemminger
2022-03-06  9:20     [PATCH 0/2] add missing local symbols catch-all Thomas Monjalon
2022-03-06  9:20  4% ` [PATCH 1/2] regexdev: fix section attribute of symbols Thomas Monjalon
2022-03-07 10:15  0%   ` Ori Kam
2022-03-06  9:20  4% ` [PATCH 2/2] build: hide local symbols in shared libraries Thomas Monjalon
2022-03-08 14:24     ` [PATCH v2 0/2] add missing local symbols catch-all Thomas Monjalon
2022-03-08 14:24  4%   ` [PATCH v2 1/2] regexdev: fix section attribute of symbols Thomas Monjalon
2022-03-08 14:24  4%   ` [PATCH v2 2/2] build: hide local symbols in shared libraries Thomas Monjalon
2022-03-09 10:58  0%     ` Kevin Traynor
2022-03-09 18:54  0%       ` Thomas Monjalon
2022-04-15 14:56  0%     ` Ray Kinsella
2022-03-07 22:39     [PATCH] examples/distributor: one Tx queue is enough Honnappa Nagarahalli
2022-03-08  3:26  3% ` Honnappa Nagarahalli
2022-03-09  0:22     [PATCH v1 0/2] bbdev: add device info on queue topology Nicolas Chautru
2022-03-09  0:22     ` [PATCH v1 1/2] " Nicolas Chautru
2022-03-09  1:28  3%   ` Stephen Hemminger
2022-03-10 23:49     [PATCH v1] bbdev: add new operation for FFT processing Nicolas Chautru
2022-03-10 23:49     ` Nicolas Chautru
2022-03-11  1:12  3%   ` Stephen Hemminger
2022-03-17 18:42  3%     ` Chautru, Nicolas
2022-03-17  0:11  3% [PATCH v1] doc: announce changes in bbdev related to enum extension Nicolas Chautru
2022-03-17  0:11 10% ` Nicolas Chautru
2022-03-17  9:54  3% DPDK 22.03 released Thomas Monjalon
2022-03-17 18:37  3% [PATCH v2] doc: announce changes in bbdev related to enum extension Nicolas Chautru
2022-03-17 18:37 10% ` Nicolas Chautru
2022-03-18 14:35 10% [PATCH] version: 22.07-rc0 David Marchand
2022-03-18 15:46  0% ` Aaron Conole
2022-03-21 15:41  0%   ` Thomas Monjalon
2022-03-21 13:01  0% ` Thomas Monjalon
2022-03-21 14:09  3%   ` David Marchand
2022-03-22  9:15  0%     ` Ray Kinsella
2022-03-22 10:35  0%       ` Thomas Monjalon
2022-03-23  9:24 13% [PATCH] devtools: document ABI suppression rules David Marchand
2022-03-29  9:37  4% ` Thomas Monjalon
2022-03-23  9:30     [PATCH] eal: factorize lcore main loop David Marchand
2022-04-01  8:44     ` [PATCH v2 1/2] eal: cleanup lcore ID hand-over David Marchand
2022-04-01  8:44       ` [PATCH v2 2/2] eal: factorize lcore main loop David Marchand
2022-04-05  7:05  3%     ` David Marchand
2022-04-05 16:34     ` [PATCH v3 1/2] eal: cleanup lcore ID hand-over David Marchand
2022-04-05 16:34  2%   ` [PATCH v3 2/2] eal: factorize lcore main loop David Marchand
2022-04-14 11:48  0%     ` David Marchand
2022-03-25 11:16     [PATCH 0/2] Session crypto event metadata api Volodymyr Fialko
2022-03-25 11:16     ` [PATCH 1/2] security: introduce per session event metadata Volodymyr Fialko
2022-04-04  8:38       ` Gujjar, Abhinandan S
2022-04-04  9:48  3%     ` Akhil Goyal
2022-04-04 10:42  0%       ` Gujjar, Abhinandan S
2022-04-13  7:13  3%         ` Akhil Goyal
2022-04-18 19:33  4% ` [PATCH v2 0/7] Add new cryptodev op for " Akhil Goyal
2022-04-18 19:33  2%   ` [PATCH v2 1/7] cryptodev: add APIs to get/set " Akhil Goyal
2022-03-29 13:10  3% [PATCH 0/6] Extend and set event queue attributes at runtime Shijith Thotton
2022-03-29 13:11     ` [PATCH 1/6] eventdev: support to set " Shijith Thotton
2022-03-30 10:58       ` Van Haaren, Harry
2022-04-04  9:35  3%     ` Shijith Thotton
2022-04-04  9:45  4%       ` Van Haaren, Harry
2022-03-30 12:14  3%   ` Mattias Rönnblom
2022-04-04 11:45  0%     ` Shijith Thotton
2022-03-29 13:11  3% ` [PATCH 2/6] eventdev: add weight and affinity to queue attributes Shijith Thotton
2022-03-30 12:12  0%   ` Mattias Rönnblom
2022-04-04  9:33  0%     ` Shijith Thotton
2022-03-29 18:49  0% ` [PATCH 0/6] Extend and set event queue attributes at runtime Jerin Jacob
2022-03-30 10:52  4%   ` Van Haaren, Harry
2022-04-04  7:57  0%     ` Shijith Thotton
2022-04-05  5:40  3% ` [PATCH v2 " Shijith Thotton
2022-04-05  5:40  3%   ` [PATCH v2 2/6] eventdev: add weight and affinity to queue attributes Shijith Thotton
2022-04-11 11:07  3%   ` [PATCH v2 0/6] Extend and set event queue attributes at runtime Shijith Thotton
2022-03-31 21:28     [PATCH 0/3] doc: build on Windows Dmitry Kozlyuk
2022-03-31 21:28  6% ` [PATCH 2/3] doc: fix API index Markdown syntax Dmitry Kozlyuk
2022-04-06 17:10     ` [PATCH v2 0/3] doc: build on Windows Dmitry Kozlyuk
2022-04-06 17:10  6%   ` [PATCH v2 2/3] doc: fix API index Markdown syntax Dmitry Kozlyuk
2022-04-01 10:22  2% 21.11.1 patches review and test Kevin Traynor
2022-04-11  3:03  0% ` Pei Zhang
2022-04-13  4:06  0%   ` YangHang Liu
2022-04-11  6:58  0% ` Christian Ehrhardt
2022-04-13  7:26  0%   ` Christian Ehrhardt
2022-04-13 10:06  3%   ` Kevin Traynor
2022-04-14  5:52  0%     ` Christian Ehrhardt
2022-04-14  9:08  4%       ` Kevin Traynor
2022-04-06 15:04     [RFC PATCH v1 00/18] merge DTS component files to DPDK Juraj Linkeš
2022-04-06 15:04  1% ` [RFC PATCH v1 02/18] dts: merge DTS framework/dut.py " Juraj Linkeš
2022-04-07  5:30     [RFC 0/2] queue-based flow aged report Xiaoyu Min
2022-04-07  5:30     ` [RFC 1/2] ethdev: port flags for pre-configuration flow hints Xiaoyu Min
2022-04-07 15:04  3%   ` Stephen Hemminger
2022-04-08  2:35  4%     ` Jack Min
2022-04-12 16:16     [DPDK v2] net/ixgbe: promote MDIO API zhichaox.zeng
2022-04-12 17:56     ` [DPDK v3] " zhichaox.zeng
2022-04-15 14:36  4%   ` Ray Kinsella
2022-04-18  6:41  0%     ` Yang, Qiming
2022-04-15 17:31     [PATCH 0/3] Enable ASan in GHA David Marchand
2022-04-15 17:31  3% ` [PATCH 3/3] ci: build some job with ASan David Marchand

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).