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 67C84A0547; Sun, 26 Sep 2021 19:54:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E06374003D; Sun, 26 Sep 2021 19:54:18 +0200 (CEST) Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) by mails.dpdk.org (Postfix) with ESMTP id 929404003C for ; Sun, 26 Sep 2021 19:54:17 +0200 (CEST) Received: by mail-il1-f169.google.com with SMTP id w1so16627491ilv.1 for ; Sun, 26 Sep 2021 10:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fvO4ufVU6evERU+q21R8JvoCjy1WeLB7LLGwOUR56A0=; b=BDrzNrktDvUsTEyAJmReH06iecc3Hgx158P3BiPRc8ammia6nm+YqCE7YhPhOwtg99 NIdBF6sHuYnLKMpSjUNclkStqdV1qJktWO+RcqbFF7T7K3WY0q52I22ALoys79eS45XZ kNzEVmk3X4+sc8g48DhayfjLp2SkRbWTzvm8w= 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=fvO4ufVU6evERU+q21R8JvoCjy1WeLB7LLGwOUR56A0=; b=aJO6BL0mY/iV6Z3PCcAkO5MMS5BaQbPwQKFFL0vpuFnn1ZevClxMa8Aj9xl0JlVXXS yTjjn4apk9X4bDVefyHunhPo/rR7D/tkGF9K3PbwymbLSENPKFbIYofL9wN3v4olcQUG 6KZlhQs8A5J0gXbWn7X9pubyQUWJVS+ztQDKPVGwzXaPjzxh41IaeoDd20DSShMY3JQx woWr1F3NtkDZmIXiQvQ/TVpySZakMIxqJTj+9Bux5yWOVDiPHRUiOj/lFkQcZX5tMy5F k++LCtbZeMNBA0MXEHpIlC67nVc8EXRh/sgxQdmTGSbg0cDJ9c4XWKfclFeYGJlCG8ot 7dYQ== X-Gm-Message-State: AOAM532xlnnruS4wOjMumioQ97WvYH8rxcqxxIuHXc9NeTN5usu2/kkm f/O8LhnrXvRequVyVIpBICw1c9oUJzEJvRBDeQzOPQ== X-Google-Smtp-Source: ABdhPJwm7oHrt01AatWxPTlXihaVL80iEh8v6DmpErSJ8660EpPHhuq5BhyCnorfrDBfhF6Ao57GAbK/gvQvMANSusc= X-Received: by 2002:a05:6e02:c2f:: with SMTP id q15mr3132481ilg.255.1632678856673; Sun, 26 Sep 2021 10:54:16 -0700 (PDT) MIME-Version: 1.0 References: <20210727034204.20649-1-xuemingl@nvidia.com> <20210917080121.329373-1-xuemingl@nvidia.com> <20210917080121.329373-3-xuemingl@nvidia.com> In-Reply-To: <20210917080121.329373-3-xuemingl@nvidia.com> From: Ajit Khaparde Date: Sun, 26 Sep 2021 10:54:00 -0700 Message-ID: To: Xueming Li Cc: dpdk-dev , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , Ray Kinsella Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000004efa3a05cce9aba1" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH v3 2/8] ethdev: new API to aggregate shared Rx queue group 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 Sender: "dev" --0000000000004efa3a05cce9aba1 Content-Type: text/plain; charset="UTF-8" On Fri, Sep 17, 2021 at 1:02 AM Xueming Li wrote: > > This patch introduces new api to aggreated ports among same shared Rx s/aggregated/aggregate > queue group. Only queues with specified share group is aggregated. s/is/are > Rx burst and device close are expected to be supported by new device. > > Signed-off-by: Xueming Li Minor nits - typos actually! > --- > lib/ethdev/ethdev_driver.h | 23 ++++++++++++++++++++++- > lib/ethdev/rte_ethdev.c | 22 ++++++++++++++++++++++ > lib/ethdev/rte_ethdev.h | 16 ++++++++++++++++ > lib/ethdev/version.map | 3 +++ > 4 files changed, 63 insertions(+), 1 deletion(-) > > diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h > index 524757cf6f..72156a4153 100644 > --- a/lib/ethdev/ethdev_driver.h > +++ b/lib/ethdev/ethdev_driver.h > @@ -786,10 +786,28 @@ typedef int (*eth_get_monitor_addr_t)(void *rxq, > * @return > * Negative errno value on error, number of info entries otherwise. > */ > - > typedef int (*eth_representor_info_get_t)(struct rte_eth_dev *dev, > struct rte_eth_representor_info *info); > > +/** > + * @internal > + * Aggregate shared Rx queue. > + * > + * Create a new port used for shared Rx queue polling. > + * > + * Only queues with specified share group are aggregated. > + * At least Rx burst and device close should be supported. > + * > + * @param dev > + * Ethdev handle of port. > + * @param group > + * Shared Rx queue group to aggregate. > + * @return > + * UINT16_MAX if failed, otherwise aggregated port number. > + */ > +typedef int (*eth_shared_rxq_aggregate_t)(struct rte_eth_dev *dev, > + uint32_t group); > + > /** > * @internal A structure containing the functions exported by an Ethernet driver. > */ > @@ -950,6 +968,9 @@ struct eth_dev_ops { > > eth_representor_info_get_t representor_info_get; > /**< Get representor info. */ > + > + eth_shared_rxq_aggregate_t shared_rxq_aggregate; > + /**< Aggregate shared Rx queue. */ > }; > > /** > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index b3a58d5e65..9f2ef58309 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -6301,6 +6301,28 @@ rte_eth_representor_info_get(uint16_t port_id, > return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); > } > > +uint16_t > +rte_eth_shared_rxq_aggregate(uint16_t port_id, uint32_t group) > +{ > + struct rte_eth_dev *dev; > + uint64_t offloads; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + dev = &rte_eth_devices[port_id]; > + > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->shared_rxq_aggregate, > + UINT16_MAX); > + > + offloads = dev->data->dev_conf.rxmode.offloads; > + if ((offloads & RTE_ETH_RX_OFFLOAD_SHARED_RXQ) == 0) { > + RTE_ETHDEV_LOG(ERR, "port_id=%u doesn't support Rx offload\n", > + port_id); > + return UINT16_MAX; > + } > + > + return (*dev->dev_ops->shared_rxq_aggregate)(dev, group); > +} > + > RTE_LOG_REGISTER_DEFAULT(rte_eth_dev_logtype, INFO); > > RTE_INIT(ethdev_init_telemetry) > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index a578c9db9d..f15d2142b2 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -4895,6 +4895,22 @@ __rte_experimental > int rte_eth_representor_info_get(uint16_t port_id, > struct rte_eth_representor_info *info); > > +/** > + * Aggregate shared Rx queue ports to one port for polling. > + * > + * Only queues with specified share group is aggregated. s/is/are > + * Any operation besides Rx burst and device close is unexpected. > + * > + * @param port_id > + * The port identifier of the device from shared Rx queue group. > + * @param group > + * Shared Rx queue group to aggregate. > + * @return > + * UINT16_MAX if failed, otherwise aggregated port number. > + */ > +__rte_experimental > +uint16_t rte_eth_shared_rxq_aggregate(uint16_t port_id, uint32_t group); > + > #include > > /** > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > index 3eece75b72..97a2233508 100644 > --- a/lib/ethdev/version.map > +++ b/lib/ethdev/version.map > @@ -249,6 +249,9 @@ EXPERIMENTAL { > rte_mtr_meter_policy_delete; > rte_mtr_meter_policy_update; > rte_mtr_meter_policy_validate; > + > + # added in 21.11 > + rte_eth_shared_rxq_aggregate; > }; > > INTERNAL { > -- > 2.33.0 > --0000000000004efa3a05cce9aba1--