From patchwork Thu Jan 12 16:30:33 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: 121942 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 369DD423B8; Thu, 12 Jan 2023 17:30:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD67E42D91; Thu, 12 Jan 2023 17:30:44 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 7A5E742D81 for ; Thu, 12 Jan 2023 17:30:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673541042; x=1705077042; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6YWu9MvaPoeXZulDs2X1wNm2iM5Uih+YEVaau8Ej+rE=; b=TLW2Wd5kZqyM6iHAarLCHzprz+7vCD0PQP/hLklPznozIMtAdL5zi0G8 PGz8qYDCBZxfbFL6S0IG2GL8YKTQ6fOYZBJ8vZFk2OltwbETjhg5TisXA A3Al0Pth+zT2JL9tBNUNk2YN7LVK+K30N+/mVRHcNpR4lQQ/RbNNavitD xbmRk3aclOAKUxtlveyOkcRGFfqyJYlwKXyHGCgu5YrAobatsEHkx0vHN ebUtpJz7wkTYexInw30H++aKIM0PpbBOeDg+vHMwlE59CkCAUa//lh5d/ DiJbL+Re68sAHYVKk8smHsvaH+wkti6OTOXtrVCKgUhg1QKjCQSnYKbhw g==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="307298262" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="307298262" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 08:30:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="721151289" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="721151289" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga008.fm.intel.com with ESMTP; 12 Jan 2023 08:30:41 -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 v7 2/4] eventdev/eth_tx: change eventdev reconfig logic Date: Thu, 12 Jan 2023 10:30:33 -0600 Message-Id: <20230112163035.1970151-2-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20230112163035.1970151-1-s.v.naga.harish.k@intel.com> References: <20230104064145.2600261-1-s.v.naga.harish.k@intel.com> <20230112163035.1970151-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