[v3,2/4] eventdev/eth_tx: change eventdev reconfig logic

Message ID 20221219053315.2538180-2-s.v.naga.harish.k@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [v3,1/4] eventdev/eth_rx: change eventdev reconfig logic |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Naga Harish K, S V Dec. 19, 2022, 5:33 a.m. UTC
  When rte_event_eth_tx_adapter_create() is used for creating adapter
instance, eventdev is reconfigured with additional
``rte_event_dev_config::nb_event_ports`` parameter.

This eventdev reconfig logic is enhanced to increment the
``rte_event_dev_config::nb_single_link_event_port_queues``
parameter if the adapter event port config is of type
``RTE_EVENT_PORT_CFG_SINGLE_LINK``.

With this change the application is no longer need to configure the
eventdev with ``rte_event_dev_config::nb_single_link_event_port_queues``
parameter required for eth_tx adapter when the adapter is created
using above mentioned api.

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
---
v2:
* fix build error in doc/prog_guide
v3:
* update doxygen
---
---
 .../prog_guide/event_ethernet_tx_adapter.rst    | 17 +++++++++++++++++
 lib/eventdev/rte_event_eth_tx_adapter.c         |  2 ++
 lib/eventdev/rte_event_eth_tx_adapter.h         | 13 +++++++++++++
 3 files changed, 32 insertions(+)
  

Comments

Gujjar, Abhinandan S Dec. 19, 2022, 5:49 a.m. UTC | #1
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

> -----Original Message-----
> From: Naga Harish K, S V <s.v.naga.harish.k@intel.com>
> Sent: Monday, December 19, 2022 11:03 AM
> To: jerinj@marvell.com; Carrillo, Erik G <erik.g.carrillo@intel.com>; Gujjar,
> Abhinandan S <abhinandan.gujjar@intel.com>
> Cc: dev@dpdk.org; Jayatheerthan, Jay <jay.jayatheerthan@intel.com>
> Subject: [PATCH v3 2/4] eventdev/eth_tx: change eventdev reconfig logic
> 
> When rte_event_eth_tx_adapter_create() is used for creating adapter
> instance, eventdev is reconfigured with additional
> ``rte_event_dev_config::nb_event_ports`` parameter.
> 
> This eventdev reconfig logic is enhanced to increment the
> ``rte_event_dev_config::nb_single_link_event_port_queues``
> parameter if the adapter event port config is of type
> ``RTE_EVENT_PORT_CFG_SINGLE_LINK``.
> 
> With this change the application is no longer need to configure the eventdev
> with ``rte_event_dev_config::nb_single_link_event_port_queues``
> parameter required for eth_tx adapter when the adapter is created using
> above mentioned api.
> 
> Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
> ---
> v2:
> * fix build error in doc/prog_guide
> v3:
> * update doxygen
> ---
> ---
>  .../prog_guide/event_ethernet_tx_adapter.rst    | 17 +++++++++++++++++
>  lib/eventdev/rte_event_eth_tx_adapter.c         |  2 ++
>  lib/eventdev/rte_event_eth_tx_adapter.h         | 13 +++++++++++++
>  3 files changed, 32 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/event_ethernet_tx_adapter.rst
> b/doc/guides/prog_guide/event_ethernet_tx_adapter.rst
> index 905cb445e0..8e6cc87b04 100644
> --- a/doc/guides/prog_guide/event_ethernet_tx_adapter.rst
> +++ b/doc/guides/prog_guide/event_ethernet_tx_adapter.rst
> @@ -56,6 +56,23 @@ and needs to create an event port for it. The callback is
> expected to fill the
> 
>          err = rte_event_eth_tx_adapter_create(id, dev_id, &tx_p_conf);
> 
> +Event device configuration for service based adapter
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +When rte_event_eth_tx_adapter_create() is used for creating adapter
> +instance, eventdev is reconfigured with additional
> +``rte_event_dev_config::nb_event_ports`` parameter.
> +This eventdev reconfig logic also increment the
> +``rte_event_dev_config::nb_single_link_event_port_queues``
> +parameter if the adapter event port config is of type
> +``RTE_EVENT_PORT_CFG_SINGLE_LINK``.
> +
> +So the application is no longer need to configure the event device with
> +``rte_event_dev_config::nb_event_ports`` and
> +``rte_event_dev_config::nb_single_link_event_port_queues``
> +parameters required for eth_tx adapter when the adapter is created
> +using above mentioned api.
> +
>  Adding Tx Queues to the Adapter Instance
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c
> b/lib/eventdev/rte_event_eth_tx_adapter.c
> index 88309d2aaa..c780ee1264 100644
> --- a/lib/eventdev/rte_event_eth_tx_adapter.c
> +++ b/lib/eventdev/rte_event_eth_tx_adapter.c
> @@ -316,6 +316,8 @@ txa_service_conf_cb(uint8_t __rte_unused id, uint8_t
> dev_id,
> 
>  	port_id = dev_conf.nb_event_ports;
>  	dev_conf.nb_event_ports += 1;
> +	if (pc->event_port_cfg & RTE_EVENT_PORT_CFG_SINGLE_LINK)
> +		dev_conf.nb_single_link_event_port_queues += 1;
> 
>  	ret = rte_event_dev_configure(dev_id, &dev_conf);
>  	if (ret) {
> diff --git a/lib/eventdev/rte_event_eth_tx_adapter.h
> b/lib/eventdev/rte_event_eth_tx_adapter.h
> index 645b87b78a..889e09981e 100644
> --- a/lib/eventdev/rte_event_eth_tx_adapter.h
> +++ b/lib/eventdev/rte_event_eth_tx_adapter.h
> @@ -142,6 +142,19 @@ struct rte_event_eth_tx_adapter_stats {
>  /**
>   * Create a new ethernet Tx adapter with the specified identifier.
>   *
> + * When this API is used for creating adapter instance, eventdev is
> + * reconfigured with additional
> + ``rte_event_dev_config::nb_event_ports``
> + * parameter during service initialization. This eventdev reconfig
> + logic also
> + * increment the
> + ``rte_event_dev_config::nb_single_link_event_port_queues``
> + * parameter if the adapter event port config is of type
> + * ``RTE_EVENT_PORT_CFG_SINGLE_LINK``.
> + *
> + * So the application is no longer need to account for
> + * ``rte_event_dev_config::nb_event_ports`` and
> + * ``rte_event_dev_config::nb_single_link_event_port_queues``
> + * parameters required for eth Tx adapter in eventdev configure when
> + * the adapter is created with this api.
> + *
>   * @param id
>   *  The identifier of the ethernet Tx adapter.
>   * @param dev_id
> --
> 2.25.1
  

Patch

diff --git a/doc/guides/prog_guide/event_ethernet_tx_adapter.rst b/doc/guides/prog_guide/event_ethernet_tx_adapter.rst
index 905cb445e0..8e6cc87b04 100644
--- a/doc/guides/prog_guide/event_ethernet_tx_adapter.rst
+++ b/doc/guides/prog_guide/event_ethernet_tx_adapter.rst
@@ -56,6 +56,23 @@  and needs to create an event port for it. The callback is expected to fill the
 
         err = rte_event_eth_tx_adapter_create(id, dev_id, &tx_p_conf);
 
+Event device configuration for service based adapter
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When rte_event_eth_tx_adapter_create() is used for creating
+adapter instance, eventdev is reconfigured with additional
+``rte_event_dev_config::nb_event_ports`` parameter.
+This eventdev reconfig logic also increment the
+``rte_event_dev_config::nb_single_link_event_port_queues``
+parameter if the adapter event port config is of type
+``RTE_EVENT_PORT_CFG_SINGLE_LINK``.
+
+So the application is no longer need to configure the
+event device with ``rte_event_dev_config::nb_event_ports`` and
+``rte_event_dev_config::nb_single_link_event_port_queues``
+parameters required for eth_tx adapter when the adapter is created
+using above mentioned api.
+
 Adding Tx Queues to the Adapter Instance
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c
index 88309d2aaa..c780ee1264 100644
--- a/lib/eventdev/rte_event_eth_tx_adapter.c
+++ b/lib/eventdev/rte_event_eth_tx_adapter.c
@@ -316,6 +316,8 @@  txa_service_conf_cb(uint8_t __rte_unused id, uint8_t dev_id,
 
 	port_id = dev_conf.nb_event_ports;
 	dev_conf.nb_event_ports += 1;
+	if (pc->event_port_cfg & RTE_EVENT_PORT_CFG_SINGLE_LINK)
+		dev_conf.nb_single_link_event_port_queues += 1;
 
 	ret = rte_event_dev_configure(dev_id, &dev_conf);
 	if (ret) {
diff --git a/lib/eventdev/rte_event_eth_tx_adapter.h b/lib/eventdev/rte_event_eth_tx_adapter.h
index 645b87b78a..889e09981e 100644
--- a/lib/eventdev/rte_event_eth_tx_adapter.h
+++ b/lib/eventdev/rte_event_eth_tx_adapter.h
@@ -142,6 +142,19 @@  struct rte_event_eth_tx_adapter_stats {
 /**
  * Create a new ethernet Tx adapter with the specified identifier.
  *
+ * When this API is used for creating adapter instance, eventdev is
+ * reconfigured with additional ``rte_event_dev_config::nb_event_ports``
+ * parameter during service initialization. This eventdev reconfig logic also
+ * increment the ``rte_event_dev_config::nb_single_link_event_port_queues``
+ * parameter if the adapter event port config is of type
+ * ``RTE_EVENT_PORT_CFG_SINGLE_LINK``.
+ *
+ * So the application is no longer need to account for
+ * ``rte_event_dev_config::nb_event_ports`` and
+ * ``rte_event_dev_config::nb_single_link_event_port_queues``
+ * parameters required for eth Tx adapter in eventdev configure when
+ * the adapter is created with this api.
+ *
  * @param id
  *  The identifier of the ethernet Tx adapter.
  * @param dev_id