From patchwork Wed Dec 14 07:04:40 2022 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: 120870 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 918E3A0543; Wed, 14 Dec 2022 08:05:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13E0D42D14; Wed, 14 Dec 2022 08:04:56 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 76CB942B71 for ; Wed, 14 Dec 2022 08:04: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=1671001494; x=1702537494; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D1RejgChnWht6oGJe23B6CKnWz/XDjedpTkTYbnRcmI=; b=V7cOH+R6v7NSO7W4yTBuW+6W3ftkce81t1sMbhhIjriXTvYiw/sBRcit UpI4XDheDCjTyMOp0oFpK6xT3zxbvxGvjuVkD4HvXDxCZMMmoxmdYESs5 xborwTCI7Tq7i0+BYMDRl8XJmyjJD+OnK3Bqgc6u2ggy64C2Gvl7XC+FA 5ogtU1P1D64ivJQ3Td9obU/4h44sFyVbalaIv9Z1BjXjLWa/YInwQgxcV y1mE0l7+FbzKAYjSGvjFkih2+fT69Hl9yGbCV+pJa79OgnmsQakwXUdlY hLQgFoz6Kcs49g6OPyjLZF8Ju7nqsKu1XS/dLL5dBP9QZYpdKD08Y9Y8C A==; X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="301751941" X-IronPort-AV: E=Sophos;i="5.96,243,1665471600"; d="scan'208";a="301751941" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 23:04:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="823157606" X-IronPort-AV: E=Sophos;i="5.96,243,1665471600"; d="scan'208";a="823157606" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by orsmga005.jf.intel.com with ESMTP; 13 Dec 2022 23:04: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 v2 4/4] eventdev/timer: change eventdev reconfig logic Date: Wed, 14 Dec 2022 01:04:40 -0600 Message-Id: <20221214070440.921488-4-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20221214070440.921488-1-s.v.naga.harish.k@intel.com> References: <20221214055551.913821-4-s.v.naga.harish.k@intel.com> <20221214070440.921488-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 --- v2: * fix build error in documentation --- --- doc/guides/prog_guide/event_timer_adapter.rst | 17 ++++++++++++++ lib/eventdev/rte_event_timer_adapter.c | 23 +++++++++++-------- 2 files changed, 30 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..3dc7144798 100644 --- a/doc/guides/prog_guide/event_timer_adapter.rst +++ b/doc/guides/prog_guide/event_timer_adapter.rst @@ -139,6 +139,23 @@ 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_eth_rx_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 timer adapter when the adapter is created +using 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..5ed233db00 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, + 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",