From patchwork Wed Jan 4 06:41:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Naga Harish K, S V" X-Patchwork-Id: 121553 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 11A1EA00C2; Wed, 4 Jan 2023 07:41:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DEA1740A82; Wed, 4 Jan 2023 07:41:50 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 7D58D40697 for ; Wed, 4 Jan 2023 07:41:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672814509; x=1704350509; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QAwTUmNMaBJpC8GCp1X6ALVAXomh75fa6MbXmCv5E0k=; b=QrQZA1yfo8uYd4cMZaugEXWnnc6PBLCGbFh2GhfSe9Pu1KtHNLIrmvUr i2yXVql1qW/my3+LX4qbP9XgNheYGAmYImi96pwW9odvR+/NJGQrgLPRt iOrQh241Gv14dy4u3C7g5h2TmgG7aUjXCZBH446nXvMxLANwBZonniHHg tep8gLM4G9RreCWveTu8Zb1RhLdu2Ok3GIa1ujeFHMVwk1Qc+0uA2msZE /3rMKcz9rnpuvepntKRSjtUsAC7mByeM5qMHK+x14V5b4XkYeyufdYn8P DpJozK7sCSKitbclZBMIGrsZ5qWEukiEAILtMtrTS1fk2kEiDtdha4zHL A==; X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="302227774" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="302227774" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2023 22:41:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="900451504" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="900451504" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga006.fm.intel.com with ESMTP; 03 Jan 2023 22:41:48 -0800 From: Naga Harish K S V To: jerinj@marvell.com, erik.g.carrillo@intel.com, abhinandan.gujjar@intel.com Cc: dev@dpdk.org, jay.jayatheerthan@intel.com Subject: [PATCH v6 1/4] eventdev/eth_rx: change eventdev reconfig logic Date: Wed, 4 Jan 2023 00:41:42 -0600 Message-Id: <20230104064145.2600261-1-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20230102051444.1263632-1-s.v.naga.harish.k@intel.com> References: <20230102051444.1263632-1-s.v.naga.harish.k@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When rte_event_eth_rx_adapter_create() or rte_event_eth_rx_adapter_create_with_params() 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 no longer need to configure the eventdev with ``rte_event_dev_config::nb_single_link_event_port_queues`` parameter required for eth_rx adapter when the adapter is created using above mentioned apis. Signed-off-by: Naga Harish K S V Acked-by: Abhinandan Gujjar --- v2: * Fix build error v3: * update doxygen v5: * update doxygen as per review comments v6: * no update in rxa --- --- .../prog_guide/event_ethernet_rx_adapter.rst | 19 +++++++++++++++++++ lib/eventdev/rte_event_eth_rx_adapter.c | 3 +++ lib/eventdev/rte_event_eth_rx_adapter.h | 14 ++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst b/doc/guides/prog_guide/event_ethernet_rx_adapter.rst index 116c0a27c6..bbe278f7db 100644 --- a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst +++ b/doc/guides/prog_guide/event_ethernet_rx_adapter.rst @@ -71,6 +71,25 @@ set to true. The function is passed the event device to be associated with the adapter and port configuration for the adapter to setup an event port if the adapter needs to use a service function. +Event device configuration for service based adapter +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When rte_event_eth_rx_adapter_create() or +rte_event_eth_rx_adapter_create_with_params() is used for creating +adapter instance, ``rte_event_dev_config::nb_event_ports`` is +automatically incremented and the event device is reconfigured with +the additional event port during service initialization. This event +device reconfigure logic also increments 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``. + +Application no longer needs to account for the +``rte_event_dev_config::nb_event_ports`` and +``rte_event_dev_config::nb_single_link_event_port_queues`` +parameters required for eth Rx adapter in the event device configuration, +when the adapter is created using the above-mentioned APIs. + Adding Rx Queues to the Adapter Instance ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index cf7bbd4d69..34aa87379e 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -1532,6 +1532,9 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, rte_event_dev_stop(dev_id); port_id = dev_conf.nb_event_ports; dev_conf.nb_event_ports += 1; + if (port_conf->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) { RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h index d0e7d0092c..f4652f40e8 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.h +++ b/lib/eventdev/rte_event_eth_rx_adapter.h @@ -382,6 +382,20 @@ int rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id, * control in configuration of the service, it should use the * rte_event_eth_rx_adapter_create_ext() version. * + * When this API is used for creating adapter instance, + * ``rte_event_dev_config::nb_event_ports`` is automatically incremented, + * and event device is reconfigured with additional event port during service + * initialization. This event device reconfigure logic also increments 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``. + * + * Application no longer needs 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 Rx adapter in the event device configuration + * when the adapter is created with this API. + * * @param id * The identifier of the ethernet Rx event adapter. * From patchwork Wed Jan 4 06:41:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Naga Harish K, S V" X-Patchwork-Id: 121554 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4F0FBA00C2; Wed, 4 Jan 2023 07:41:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B753942B8E; Wed, 4 Jan 2023 07:41:52 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 748DA410EA for ; Wed, 4 Jan 2023 07:41:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672814511; x=1704350511; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6YWu9MvaPoeXZulDs2X1wNm2iM5Uih+YEVaau8Ej+rE=; b=LfExGPB9oXfjGAkL2UOrkLAYCtRZR2QmWehQXJ2klqzcWah9ELrYikbb 5HPnAi8yklMQHQyfTZK/MwdB1AIMFabyjaPywxKsk46AgBoKB5JzD99Ko R2qPiVeBTyvp25uP1oq5rVNQHv2UozwAK99Lh3QNHSd0eRWN0DYIG1jVc gs2oB9dqi1mJXp0j7kA0kX65hpfDmDSGaofiiASXvOAol6Hf6pBGsO0l3 GM92SOjEd8z3Oo869U3VrBjM2QL6eXEEaTMUUKBBkYG4v75TkBTm+ey6A us6qxYpS/RKMCHvd9HiCk/YTjqOWYqGz4WgpuLBYPLLoAbQxx3XKfWzKr w==; X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="302227786" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="302227786" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2023 22:41:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="900451509" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="900451509" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga006.fm.intel.com with ESMTP; 03 Jan 2023 22:41:50 -0800 From: Naga Harish K S V To: jerinj@marvell.com, erik.g.carrillo@intel.com, abhinandan.gujjar@intel.com Cc: dev@dpdk.org, jay.jayatheerthan@intel.com Subject: [PATCH v6 2/4] eventdev/eth_tx: change eventdev reconfig logic Date: Wed, 4 Jan 2023 00:41:43 -0600 Message-Id: <20230104064145.2600261-2-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20230104064145.2600261-1-s.v.naga.harish.k@intel.com> References: <20230102051444.1263632-1-s.v.naga.harish.k@intel.com> <20230104064145.2600261-1-s.v.naga.harish.k@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Abhinandan Gujjar --- v2: * fix build error in doc/prog_guide v3: * update doxygen v5: * update doxygen as per review comments v6: * no update in txa --- --- .../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 | 14 ++++++++++++++ 3 files changed, 33 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..711ecb7441 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, ``rte_event_dev_config::nb_event_ports`` is +automatically incremented, and the event device is reconfigured with additional +event port during service initialization. This event device reconfigure logic +also increments 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``. + +Application no longer needs 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 the 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..cd539af7ef 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.h +++ b/lib/eventdev/rte_event_eth_tx_adapter.h @@ -142,6 +142,20 @@ 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, + * ``rte_event_dev_config::nb_event_ports`` is automatically incremented, + * and event device is reconfigured with additional event port during service + * initialization. This event device reconfigure logic also increments 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``. + * + * Application no longer needs to account for the + * ``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 event device configure when + * the adapter is created with this API. + * * @param id * The identifier of the ethernet Tx adapter. * @param dev_id From patchwork Wed Jan 4 06:41:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Naga Harish K, S V" X-Patchwork-Id: 121555 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0989BA00C2; Wed, 4 Jan 2023 07:42:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8702F42D21; Wed, 4 Jan 2023 07:41:54 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 0CB5242D16 for ; Wed, 4 Jan 2023 07:41:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672814513; x=1704350513; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FjyX2JWrGnFaDCZGLZ8rfcYFCDMTW/F3D3/e7l3SPjo=; b=eAqbZ+uYSZ9WFw1kZrhI+uGvvQ9R/d5E9rT3HqI+qg+Wy25dKs3i4Xzq g/xV0bmTGPe7jhuJrim7pZ0xcsvqX32MWZZIbNpC7r8Svy4/sKaSHc4l8 F+FOVHqzBPSvphtrHhur+bM4HmtN4reqovbQIsVdvm6YDvviV+d/r2l4A feWPajtOQ+GNal0GgmFy19gOqJiHIvfcyAOvj7CZVw11ECyrEPDGy25IM NzELuX9sD2APo7yIP9iYywR6cp8eHsoLrISReis7B0hngw4xsrRzZ2jea DUTOe1+dqvbCg0aH9ZhLoWKt68XPNGyHlL+eVJSFBI+xwf9LmpzeVoB+Q Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="302227792" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="302227792" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2023 22:41:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="900451518" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="900451518" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga006.fm.intel.com with ESMTP; 03 Jan 2023 22:41:52 -0800 From: Naga Harish K S V To: jerinj@marvell.com, erik.g.carrillo@intel.com, abhinandan.gujjar@intel.com Cc: dev@dpdk.org, jay.jayatheerthan@intel.com Subject: [PATCH v6 3/4] eventdev/crypto: change eventdev reconfig logic Date: Wed, 4 Jan 2023 00:41:44 -0600 Message-Id: <20230104064145.2600261-3-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20230104064145.2600261-1-s.v.naga.harish.k@intel.com> References: <20230102051444.1263632-1-s.v.naga.harish.k@intel.com> <20230104064145.2600261-1-s.v.naga.harish.k@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When rte_event_crypto_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 crypto adapter when the adapter is created using above mentioned api. Signed-off-by: Naga Harish K S V Acked-by: Abhinandan Gujjar --- v2: * fix build error in documentation v3: * update doxygen v5: * update doxygen as per review comments v6: * no update in crypto adapter --- --- doc/guides/prog_guide/event_crypto_adapter.rst | 17 +++++++++++++++++ lib/eventdev/rte_event_crypto_adapter.c | 3 +++ lib/eventdev/rte_event_crypto_adapter.h | 14 ++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/doc/guides/prog_guide/event_crypto_adapter.rst b/doc/guides/prog_guide/event_crypto_adapter.rst index 554df7e358..7c409176d1 100644 --- a/doc/guides/prog_guide/event_crypto_adapter.rst +++ b/doc/guides/prog_guide/event_crypto_adapter.rst @@ -159,6 +159,23 @@ which it enqueues events towards the crypto adapter using nb_events); } +Event device configuration for service based adapter +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When rte_event_crypto_adapter_create() is used for creating +adapter instance, ``rte_event_dev_config::nb_event_ports`` is +automatically incremented, and event device is reconfigured with additional +event port during service initialization. This event device reconfigure +logic also increments 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``. + +Application no longer needs 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 crypto adapter when the adapter is created +using the above-mentioned API. Querying adapter capabilities ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 3c585d7b0d..5620a36dd3 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -287,6 +287,9 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, rte_event_dev_stop(dev_id); port_id = dev_conf.nb_event_ports; dev_conf.nb_event_ports += 1; + if (port_conf->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) { RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", dev_id); diff --git a/lib/eventdev/rte_event_crypto_adapter.h b/lib/eventdev/rte_event_crypto_adapter.h index 83d154a6ce..0c610b8e04 100644 --- a/lib/eventdev/rte_event_crypto_adapter.h +++ b/lib/eventdev/rte_event_crypto_adapter.h @@ -414,6 +414,20 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, * control in configuration of the service, it should use the * rte_event_crypto_adapter_create_ext() version. * + * When this API is used for creating adapter instance, + * ``rte_event_dev_config::nb_event_ports`` is automatically incremented, + * and the event device is reconfigured with additional event port during + * service initialization. This event device reconfigure logic also increments + * 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``. + * + * Application no longer needs to account for + * ``rte_event_dev_config::nb_event_ports`` and + * ``rte_event_dev_config::nb_single_link_event_port_queues`` + * parameters required for crypto adapter in event device configuration + * when the adapter is created with this API. + * * @param id * Adapter identifier. * From patchwork Wed Jan 4 06:41:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Naga Harish K, S V" X-Patchwork-Id: 121556 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 629A2A00C2; Wed, 4 Jan 2023 07:42:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6EB2242D26; Wed, 4 Jan 2023 07:41:56 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 8A0C342D22 for ; Wed, 4 Jan 2023 07:41:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672814514; x=1704350514; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f4lzGGVJ+qo6h5jUqhzL/kuA3h1+IXTwNSPEd+Aq+iY=; b=I5xod3wibBEMsjcmtteQj80UwXo8znXbvfcZE/Wl+50EeMBZ+6vPf5X3 bdJmmovUcEjVxZRpCIsuucmw5BrqV9AzQshz0/A4hRMKL2JPAvrxGDsU2 Spzjwx8LqJ5+hoz7DcMEGm2+RWb0FQkQXVr77bqce3XJE09R8fSUlOjG0 +AeXiholrkXFfSvqzWQK95YA/HbGn0M0nf7G/eoMcIQWHH4jwsA7goVr6 A52OuKQT+1XTopZ0DiYByM97ApUzLrYfS5C+Gno3y+JQVz1NBAth9xIr5 4DucPdcXS3OJbwtviIqR/pIoVw1e60mlA6HA16ADqPQLReCaQTkSoXXHO A==; X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="302227795" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="302227795" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2023 22:41:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="900451522" X-IronPort-AV: E=Sophos;i="5.96,299,1665471600"; d="scan'208";a="900451522" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga006.fm.intel.com with ESMTP; 03 Jan 2023 22:41:53 -0800 From: Naga Harish K S V To: jerinj@marvell.com, erik.g.carrillo@intel.com, abhinandan.gujjar@intel.com Cc: dev@dpdk.org, jay.jayatheerthan@intel.com Subject: [PATCH v6 4/4] eventdev/timer: change eventdev reconfig logic Date: Wed, 4 Jan 2023 00:41:45 -0600 Message-Id: <20230104064145.2600261-4-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20230104064145.2600261-1-s.v.naga.harish.k@intel.com> References: <20230102051444.1263632-1-s.v.naga.harish.k@intel.com> <20230104064145.2600261-1-s.v.naga.harish.k@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When rte_event_timer_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 timer adapter when the adapter is created using above mentioned api. Signed-off-by: Naga Harish K S V Acked-by: Abhinandan Gujjar --- v2: * fix build error in documentation v3: * update doxygen v4: * fix programmer guide v5: * update doxygen as per review comments v6: * fix adapter cretae logic with correct event port id --- --- doc/guides/prog_guide/event_timer_adapter.rst | 18 +++++++++++++++ lib/eventdev/rte_event_timer_adapter.c | 23 +++++++++++-------- lib/eventdev/rte_event_timer_adapter.h | 14 +++++++++++ 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/doc/guides/prog_guide/event_timer_adapter.rst b/doc/guides/prog_guide/event_timer_adapter.rst index d7307a29bb..b5cd95fef1 100644 --- a/doc/guides/prog_guide/event_timer_adapter.rst +++ b/doc/guides/prog_guide/event_timer_adapter.rst @@ -139,6 +139,24 @@ This function is passed a callback function that will be invoked if the adapter needs to create an event port, giving the application the opportunity to control how it is done. +Event device configuration for service based adapter +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When rte_event_timer_adapter_create() is used for creating +adapter instance, ``rte_event_dev_config::nb_event_ports`` is +automatically incremented, and the event device is reconfigured with +additional event port during service initialization. +This event device reconfigure logic also increments 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``. + +Application no longer needs to account for the +``rte_event_dev_config::nb_event_ports`` and +``rte_event_dev_config::nb_single_link_event_port_queues`` +parameters required for timer adapter in event device configuration, +when the adapter is created using the above-mentioned API. + Adapter modes ^^^^^^^^^^^^^ An event timer adapter can be configured in either periodic or non-periodic mode diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index a0f14bf861..66554f13fc 100644 --- a/lib/eventdev/rte_event_timer_adapter.c +++ b/lib/eventdev/rte_event_timer_adapter.c @@ -88,7 +88,20 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, rte_event_dev_stop(dev_id); port_id = dev_conf.nb_event_ports; + if (conf_arg != NULL) + port_conf = conf_arg; + else { + port_conf = &def_port_conf; + ret = rte_event_port_default_conf_get(dev_id, (port_id - 1), + port_conf); + if (ret < 0) + return ret; + } + dev_conf.nb_event_ports += 1; + if (port_conf->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 < 0) { EVTIM_LOG_ERR("failed to configure event dev %u\n", dev_id); @@ -99,16 +112,6 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, return ret; } - if (conf_arg != NULL) - port_conf = conf_arg; - else { - port_conf = &def_port_conf; - ret = rte_event_port_default_conf_get(dev_id, port_id, - port_conf); - if (ret < 0) - return ret; - } - ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret < 0) { EVTIM_LOG_ERR("failed to setup event port %u on event dev %u\n", diff --git a/lib/eventdev/rte_event_timer_adapter.h b/lib/eventdev/rte_event_timer_adapter.h index cd10db19e4..e21588bede 100644 --- a/lib/eventdev/rte_event_timer_adapter.h +++ b/lib/eventdev/rte_event_timer_adapter.h @@ -212,6 +212,20 @@ typedef int (*rte_event_timer_adapter_port_conf_cb_t)(uint16_t id, * * This function must be invoked first before any other function in the API. * + * When this API is used for creating adapter instance, + * ``rte_event_dev_config::nb_event_ports`` is automatically incremented, + * and the event device is reconfigured with additional event port during + * service initialization. This event device reconfigure logic also increments + * 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``. + * + * Application no longer needs to account for + * ``rte_event_dev_config::nb_event_ports`` and + * ``rte_event_dev_config::nb_single_link_event_port_queues`` + * parameters required for Timer adapter in event device configuration + * when the adapter is created with this API. + * * @param conf * The event timer adapter configuration structure. *