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 1E804A034E; Fri, 21 Jan 2022 11:26:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A33EC42745; Fri, 21 Jan 2022 11:26:22 +0100 (CET) Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by mails.dpdk.org (Postfix) with ESMTP id 75C3542744 for ; Fri, 21 Jan 2022 11:26:21 +0100 (CET) Received: by mail-il1-f173.google.com with SMTP id v17so7284387ilg.4 for ; Fri, 21 Jan 2022 02:26:21 -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=ivD7xVn9yYtvqPBC7+hR4q7j1SLGGbXTwe7ZkerPkp4=; b=bvzp3g6IzXArZj12XDcYZvGAMt8FuJd4lBHmJo3UY0Ky08+UlW1duzdJdWwkNOvK6l p6mHGUX2Qz90pwkt5RN5/XLjcqkpg19gr4EoFLr2kJUFIdfuQBcbC+8CTtikdtrnGLFB hiFOt+G6crS7B/CtXM5gS3oOoxpVXa6NsOzBB+2ItpYtGUDIYtjjUkL+6vEAXvCHNEjA mw/30qxoavlWyeW44AF0dqTFB9r3qZda7P2ntRz0hwr207Nt00c3CC7L5/mza2xvPl4V LncXztdvsy8er5zxadq9BYkEtgd/kdC9AV7MnahAfFgy/vtQOkBNv7Dm9EDJS8R8PHTe rMqQ== 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=ivD7xVn9yYtvqPBC7+hR4q7j1SLGGbXTwe7ZkerPkp4=; b=Zhe5jFW/MubhYgdljMPtIf+39nCNXonF+iqYd8ebQYcmmyhQSAQud/RJybBEb/eQmE 54NfNH51rVwxW2qOTVSvqQSkmLMAz5uehIV4HdVxFOAeUCci/TKj/mdI78rS25asxVjY 88KsaBzy/yoG0wxuIaC2xDyRfyZzgjDm4HcFMX6ompMyf/xj3ECo0UVwrCLir81OH5oQ bR3xNAXYUHIxHj54tUoX0ENapY0urRFhMzNRf6eBWD+1lnZEi9vCGV5cwitXZvmV7NbB jQxMFET1LujOhoNuX8BdCY3dNOIMEBmRcixPrmrrzimRHEJuoiiL3gWnErBQZWoJDKLH ZiTw== X-Gm-Message-State: AOAM531Cx3XXrRKa/3iPNB6he0Ea8dUWTCpKgaLegFNSTQ3UFKRb4jpc El3nOlH3aEkJ6ho+rFWo2GNF4gk4FzOjxXiR9SU= X-Google-Smtp-Source: ABdhPJwCXFbpTfBCFRuzW9MbVCxhDnFxBL6C13VTuFqOG2OXauQDHZ1RSg4vKN8sou9lVaHwoWqQSm/zpgcNh0THUoM= X-Received: by 2002:a92:6802:: with SMTP id d2mr1782796ilc.75.1642760780804; Fri, 21 Jan 2022 02:26:20 -0800 (PST) MIME-Version: 1.0 References: <20211222061338.1167674-1-s.v.naga.harish.k@intel.com> In-Reply-To: <20211222061338.1167674-1-s.v.naga.harish.k@intel.com> From: Jerin Jacob Date: Fri, 21 Jan 2022 15:55:54 +0530 Message-ID: Subject: Re: [PATCH] eventdev/rx_adapter: 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 Wed, Dec 22, 2021 at 11:43 AM 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 > --- > lib/eventdev/rte_event_eth_rx_adapter.c | 20 ++++++++++++++++++++ > lib/eventdev/rte_event_eth_rx_adapter.h | 20 ++++++++++++++++++++ > lib/eventdev/version.map | 1 + > 3 files changed, 41 insertions(+) > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c > index 809416d9b7..fca2e38690 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -3119,6 +3119,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..1364eafe38 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 uint32_t, to be filled in with the port id. Pointer to uint8t_t. Right? > + * > + * @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..91d2b5723b 100644 > --- a/lib/eventdev/version.map > +++ b/lib/eventdev/version.map > @@ -102,6 +102,7 @@ EXPERIMENTAL { > > # added in 21.11 See below > rte_event_eth_rx_adapter_create_with_params; Added in 22.03. Also please update the release note for the new API addition. > + rte_event_eth_rx_adapter_event_port_get; > rte_event_eth_rx_adapter_queue_conf_get; > rte_event_eth_rx_adapter_queue_stats_get; > rte_event_eth_rx_adapter_queue_stats_reset; > -- > 2.25.1 >