From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0244BA04A2; Sun, 23 Jan 2022 16:32:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 749E742788; Sun, 23 Jan 2022 16:32:41 +0100 (CET) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by mails.dpdk.org (Postfix) with ESMTP id B17BC40040 for ; Sun, 23 Jan 2022 16:32:39 +0100 (CET) Received: by mail-io1-f46.google.com with SMTP id s18so95480ioa.12 for ; Sun, 23 Jan 2022 07:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nITSz37H65z+b7gWI8q8MnJ0dLvpPNcdoWBdIC/YfpM=; b=ny/dz/+kALABBn3zwp2YkWlr5bkXdOKYL/1zgmPwDpa59tvtPfVrEMveky5grhEPn0 da/RUQ3r8lDDEfJlj75ofFSGRbYi8BgncPudhBg4KuVFRO8xaYrEp8XCNrwG0zs7jgSR RmXSCJyoEcJ2QUbrbKzD4LlzHBHYzjrULVM6iSXYNaBPl46mUI9bbjUm7ZuBUPFEVhj2 qOWgsdHakQUX3nHv+D0VtdXLuqfMi2gHrlPWpNssCQdtSiUxh6FvfGi4HvsglDTb2387 OBsz1ZydPkS9Yh3G7q0+s2OLU65cIWFbJOzG4jwTCWTzzgtgGF/3ZnvdhE4K29o/bNFQ 9E5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nITSz37H65z+b7gWI8q8MnJ0dLvpPNcdoWBdIC/YfpM=; b=406kMLUUPZqD5l6iZcu9+6katkknv1XPcVbzkGEghdcJyFOozTD7HP0u2G2u/Z8g4h 4MNXruvXIG53doC+hMotS4Ry9ghvgk1oGJb3iPQ7dzcB0U7Gr73ejS7zGoTTCoFuJjlH axvquzkW64cwVscsfQq2nC5AKkMNIesK/XzuAtaELXs1Nuz2gSEn6Rq32dBGIR3VzQwp JLxdVWObALnQSPfGwut0SzWWVp0L0gFXylJQW49EvsvIv1hX751j/bR/dKhpXhad2zLM d/q33+K1nBTUoGrJMwQt6oQtEnMQX+xFYA3CdWpInMbLHI7JUAS+LwQ2sAY0Wk+5fC8z NUXA== X-Gm-Message-State: AOAM533SDYMxcnBSCgqFFhICk8nU/WxhmO2r8mCxqwuYwJiN1sl/zO1I y729LHO05crBnkNlVD7vUYgW4S6Uatb8nyeeHxOQIEEfN7U= X-Google-Smtp-Source: ABdhPJzVLJ/QziSUTWVn9u6O3fKP9XjaZmUaNnWBVLgDFZ+CznUOv+MPTUDREqdP3R7DE7sOGYGmLlNBwaI3jZKm2y4= X-Received: by 2002:a02:7114:: with SMTP id n20mr2716024jac.158.1642951958906; Sun, 23 Jan 2022 07:32:38 -0800 (PST) MIME-Version: 1.0 References: <20220122170742.877897-1-s.v.naga.harish.k@intel.com> <20220122171420.879392-1-s.v.naga.harish.k@intel.com> In-Reply-To: <20220122171420.879392-1-s.v.naga.harish.k@intel.com> From: Jerin Jacob Date: Sun, 23 Jan 2022 21:02:12 +0530 Message-ID: Subject: Re: [PATCH v3] eventdev/eth_rx: add event port get api To: Naga Harish K S V Cc: "Jayatheerthan, Jay" , dpdk-dev Content-Type: text/plain; charset="UTF-8" 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 On Sat, Jan 22, 2022 at 10:44 PM Naga Harish K S V wrote: > > This patch introduces new api for retrieving event port id > of eth rx adapter. > > Signed-off-by: Naga Harish K S V > Acked-by: Jay Jayatheerthan > > --- > v3: > * update commit message head line Applied to dpdk-next-net-eventdev/for-main with the following changes. Thanks 1) api -> API in git commit message 2) Added following in "New Features" section in doc/guides/rel_notes/release_22_03.rst * **Added an API to retrieve event port id of eth rx adapter.** A new API, ``rte_event_eth_rx_adapter_event_port_get()``, was added. > > v2: > * address review comments > > v1: > * initial implementation > --- > doc/guides/rel_notes/release_22_03.rst | 2 ++ > lib/eventdev/rte_event_eth_rx_adapter.c | 20 ++++++++++++++++++++ > lib/eventdev/rte_event_eth_rx_adapter.h | 20 ++++++++++++++++++++ > lib/eventdev/version.map | 3 +++ > 4 files changed, 45 insertions(+) > > diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst > index 6d99d1eaa9..288d94c0e6 100644 > --- a/doc/guides/rel_notes/release_22_03.rst > +++ b/doc/guides/rel_notes/release_22_03.rst > @@ -83,6 +83,8 @@ API Changes > This section is a comment. Do not overwrite or remove it. > Also, make sure to start the actual text at the margin. > ======================================================= > +* eventdev: Added new API ``rte_event_eth_rx_adapter_event_port_get``, > + to retrieve event port id of eth rx adapter. > > > ABI Changes > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c > index f946137b25..ae1e260c08 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -3123,6 +3123,26 @@ rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id) > return rx_adapter->service_inited ? 0 : -ESRCH; > } > > +int > +rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id) > +{ > + struct event_eth_rx_adapter *rx_adapter; > + > + if (rxa_memzone_lookup()) > + return -ENOMEM; > + > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); > + > + rx_adapter = rxa_id_to_adapter(id); > + if (rx_adapter == NULL || event_port_id == NULL) > + return -EINVAL; > + > + if (rx_adapter->service_inited) > + *event_port_id = rx_adapter->event_port_id; > + > + return rx_adapter->service_inited ? 0 : -ESRCH; > +} > + > int > rte_event_eth_rx_adapter_cb_register(uint8_t id, > uint16_t eth_dev_id, > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h > index 9546d792e9..3608a7b2cf 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > @@ -37,6 +37,7 @@ > * - rte_event_eth_rx_adapter_queue_conf_get() > * - rte_event_eth_rx_adapter_queue_stats_get() > * - rte_event_eth_rx_adapter_queue_stats_reset() > + * - rte_event_eth_rx_adapter_event_port_get() > * > * The application creates an ethernet to event adapter using > * rte_event_eth_rx_adapter_create_ext() or rte_event_eth_rx_adapter_create() > @@ -684,6 +685,25 @@ rte_event_eth_rx_adapter_queue_stats_reset(uint8_t id, > uint16_t eth_dev_id, > uint16_t rx_queue_id); > > +/** > + * Retrieve the event port ID of an adapter. If the adapter doesn't use > + * a rte_service function, this function returns -ESRCH. > + * > + * @param id > + * Adapter identifier. > + * > + * @param [out] event_port_id > + * A pointer to a uint8_t, to be filled in with the port id. > + * > + * @return > + * - 0: Success > + * - <0: Error code on failure, if the adapter doesn't use a rte_service > + * function, this function returns -ESRCH. > + */ > +__rte_experimental > +int > +rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map > index ade1f1182e..cd5dada07f 100644 > --- a/lib/eventdev/version.map > +++ b/lib/eventdev/version.map > @@ -105,6 +105,9 @@ EXPERIMENTAL { > rte_event_eth_rx_adapter_queue_conf_get; > rte_event_eth_rx_adapter_queue_stats_get; > rte_event_eth_rx_adapter_queue_stats_reset; > + > + # added in 22.03 > + rte_event_eth_rx_adapter_event_port_get; > }; > > INTERNAL { > -- > 2.25.1 >