From patchwork Mon Jan 2 05:14: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: 121497 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 3E594A00C4; Mon, 2 Jan 2023 06:14:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD95C42BC9; Mon, 2 Jan 2023 06:14:53 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 3202940693 for ; Mon, 2 Jan 2023 06:14: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=1672636491; x=1704172491; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AMcCTrhAs+qR8gsfUT3OT7ZAwHifEVvxWZ5c7Z/Y2mU=; b=ehaMiHAipSP97yFvDb9oQ88qLR2CWKlXSmwItNtnKa1wquOpA/eYZPlD kK4amNeQI/gQ08oshGpnR8dNK6EeuPXOHBJJOZnIsiyMmQU4lKe2S81/8 /p/VVaoIVZem5SyYT4GffJV8eQqWIsmy4WiKYH/ICvK1QhGVrGW1LNImZ DKku1Uqur3t6/4p7BpyDDqijJIGF2ox8GC+HI3jIZ13msvbFFTdskSoFK R1TG1nvvo9H4giEudH3+gMh5vz0qEbA4FKbS+TV60ljA/pLgk1dFNLDkG BqKYL1iE/mUxXkNCsNJzkqEexrvb/sQCmbpM9uAjY0WmRV5DLRu3indUD g==; X-IronPort-AV: E=McAfee;i="6500,9779,10577"; a="407696635" X-IronPort-AV: E=Sophos;i="5.96,293,1665471600"; d="scan'208";a="407696635" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jan 2023 21:14:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10577"; a="778456560" X-IronPort-AV: E=Sophos;i="5.96,293,1665471600"; d="scan'208";a="778456560" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by orsmga004.jf.intel.com with ESMTP; 01 Jan 2023 21:14: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 v5 2/4] eventdev/eth_tx: change eventdev reconfig logic Date: Sun, 1 Jan 2023 23:14:42 -0600 Message-Id: <20230102051444.1263632-2-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: <20221219062852.2557488-1-s.v.naga.harish.k@intel.com> <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_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 --- --- .../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