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 07662A034C; Tue, 18 Jan 2022 16:33:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E068542727; Tue, 18 Jan 2022 16:33:34 +0100 (CET) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by mails.dpdk.org (Postfix) with ESMTP id BAFB74068E for ; Tue, 18 Jan 2022 16:33:33 +0100 (CET) Received: by mail-io1-f50.google.com with SMTP id f24so20072698ioc.0 for ; Tue, 18 Jan 2022 07:33:33 -0800 (PST) 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:content-transfer-encoding; bh=45s7+RHVHIS4r7uXaqpJZcwNcjMNOkmAhG3aFbvqcmY=; b=ci89PYn+2k1VCo9oiSpK/I7MaF5iRrNvR2XtPtC93mhFO/yxxlxXHf5hJ999hOHl/x 5Y4ruIXfWxjOS9oXGOIioL2QWjO9MYO4eRjWRqwHmmG05fdJRh5x9gyPhjbVZrOJJz3u /Pvx4zIQgpLWcevuSvD1yRyHcTN19GHyDF3CQ= 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:content-transfer-encoding; bh=45s7+RHVHIS4r7uXaqpJZcwNcjMNOkmAhG3aFbvqcmY=; b=ynMur7uAjeSXHftsGt9kZSvc6rMSzgB7RRMnvoWGnyGsAbA96KLCmpVNqYSm6IWHAh leSXYwistIpaxctvW8hh40pD0Bk60CZFeIAyCY0YS/lgxjMm4sGqIJkTmbJ/oV+g6hES OtDDw19KIeRz4fI2Y0lFjzW9q+a+D+YAgdyY7eRS11v71/oTEOxqARyPBTqUjZLpOUJ8 KbmbaLvRIEcJCE+EY9iJ9jJRnRnbJbN1fZ+cvwQZNrT0LO6inl47O8IPhSgFsxjJ4yr4 mFMxBZtxb7DEObs03FZXbTjzx/Gj5Ks5P/XmPh5aPyn/7QV1MNtXZANuqbTTsWWd77Tb gt+g== X-Gm-Message-State: AOAM531lCXTEVhVgjdUJ2RcpA3IMG10HJQK+TK/QW4/sEknkqkbldL9u OItb5ttdFNsmtvABXHBUrKb4C77w0M11PsQjEmqMNg== X-Google-Smtp-Source: ABdhPJxH79n2p8nbgqcX3pD6o5gTHi739u6Lyrhw9OUeCbyZK8K5w2uNNNgRMpJ/AhkNPrOn/i4oEyFrmGczFxyXPAo= X-Received: by 2002:a05:6638:11ce:: with SMTP id g14mr808365jas.188.1642520013028; Tue, 18 Jan 2022 07:33:33 -0800 (PST) MIME-Version: 1.0 References: <20220111115437.32855-1-humin29@huawei.com> <20220112024008.25211-1-humin29@huawei.com> <98CBD80474FA8B44BF855DF32C47DC35D86DF9@smartserver.smartshare.dk> <63d4f76f-56ca-6b19-1d60-38145be44369@huawei.com> In-Reply-To: <63d4f76f-56ca-6b19-1d60-38145be44369@huawei.com> From: Ajit Khaparde Date: Tue, 18 Jan 2022 07:33:16 -0800 Message-ID: Subject: Re: [RFC v2] ethdev: introduce ethdev dump API To: "Min Hu (Connor)" Cc: =?UTF-8?Q?Morten_Br=C3=B8rup?= , dpdk-dev , Ferruh Yigit , Thomas Monjalon Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Fri, Jan 14, 2022 at 4:25 PM Min Hu (Connor) wrote: > > Hi, Ajit, > > =E5=9C=A8 2022/1/15 1:56, Ajit Khaparde =E5=86=99=E9=81=93: > > On Wed, Jan 12, 2022 at 3:15 AM Min Hu (Connor) wr= ote: > >> > >> Thanks Morten, fixed in v3. > >> > >> =E5=9C=A8 2022/1/12 15:20, Morten Br=C3=B8rup =E5=86=99=E9=81=93: > >>>> From: Min Hu (Connor) [mailto:humin29@huawei.com] > >>>> Sent: Wednesday, 12 January 2022 03.40 > >>>> > >>>> Added the ethdev dump API which provides functions for query private > >>>> info > >>>> from device. There exists many private properties in different PMD > >>>> drivers, > >>>> such as adapter state, Rx/Tx func algorithm in hns3 PMD. The > >>>> information of > >>>> these properties is important for debug. As the information is priva= te, > >>>> the new API is introduced. > > Do you have any changes to testpmd to use this API? > > > No changes to testpmd. > BTW, I will add some options for proc-info to use this API, > and this is my next-step plan. Ok. proc-info is a good place for this. > > >>>> > >>>> Signed-off-by: Min Hu (Connor) > >>>> --- > >>>> v2: > >>>> * fix dump API name > >>>> * adjust description in doc. > >>>> --- > >>>> doc/guides/rel_notes/release_22_03.rst | 7 +++++++ > >>>> lib/ethdev/ethdev_driver.h | 17 +++++++++++++++++ > >>>> lib/ethdev/rte_ethdev.c | 15 +++++++++++++++ > >>>> lib/ethdev/rte_ethdev.h | 16 ++++++++++++++++ > >>>> 4 files changed, 55 insertions(+) > >>>> > >>>> diff --git a/doc/guides/rel_notes/release_22_03.rst > >>>> b/doc/guides/rel_notes/release_22_03.rst > >>>> index 6d99d1eaa9..4f97df942d 100644 > >>>> --- a/doc/guides/rel_notes/release_22_03.rst > >>>> +++ b/doc/guides/rel_notes/release_22_03.rst > >>>> @@ -55,6 +55,13 @@ New Features > >>>> Also, make sure to start the actual text at the margin. > >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>>> > >>>> +* **Added the private ethdev dump API, for query private info of > >>>> ethdev.** > >>>> + > >>>> + Added the private ethdev dump API which provides functions for qu= ery > >>>> + private info from device. There exists many private properties in > >>>> + different PMD drivers. The information of these properties is > >>>> important > >>>> + for debug. As the information is private, the new API is introduc= ed. > >>>> + > >>>> > >>>> Removed Items > >>>> ------------- > >>>> diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h > >>>> index d95605a355..e75ff3f15b 100644 > >>>> --- a/lib/ethdev/ethdev_driver.h > >>>> +++ b/lib/ethdev/ethdev_driver.h > >>>> @@ -990,6 +990,20 @@ typedef int (*eth_representor_info_get_t)(struc= t > >>>> rte_eth_dev *dev, > >>>> typedef int (*eth_rx_metadata_negotiate_t)(struct rte_eth_dev *de= v, > >>>> uint64_t *features); > >>>> > >>>> +/** > >>>> + * @internal > >>>> + * Get ethdev private info. > >>> > >>> Suggestion: Dump ethdev private info to a file. > >>> > >>>> + * > >>>> + * @param file > >>>> + * A pointer to a file for output. > >>>> + * @param dev > >>>> + * Port (ethdev) handle. > >>>> + * > >>>> + * @return > >>>> + * Negative errno value on error, positive value on success. > >>>> + */ > >>>> +typedef int (*eth_dev_priv_dump_t)(FILE *file, struct rte_eth_dev > >>>> *dev); > >>>> + > >>>> /** > >>>> * @internal A structure containing the functions exported by an > >>>> Ethernet driver. > >>>> */ > >>>> @@ -1186,6 +1200,9 @@ struct eth_dev_ops { > >>>> * kinds of metadata to the PMD > >>>> */ > >>>> eth_rx_metadata_negotiate_t rx_metadata_negotiate; > >>>> + > >>>> + /** Dump ethdev private info */ > >>>> + eth_dev_priv_dump_t eth_dev_priv_dump; > >>>> }; > >>>> > >>>> /** > >>>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > >>>> index a1d475a292..9fc6d91d76 100644 > >>>> --- a/lib/ethdev/rte_ethdev.c > >>>> +++ b/lib/ethdev/rte_ethdev.c > >>>> @@ -6472,6 +6472,21 @@ rte_eth_rx_metadata_negotiate(uint16_t port_i= d, > >>>> uint64_t *features) > >>>> (*dev->dev_ops->rx_metadata_negotiate)(dev, > >>>> features)); > >>>> } > >>>> > >>>> +int > >>>> +rte_eth_dev_priv_dump(FILE *file, uint16_t port_id) > >>>> +{ > >>>> + struct rte_eth_dev *dev; > >>>> + int ret; > >>>> + > >>>> + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >>>> + dev =3D &rte_eth_devices[port_id]; > >>>> + > >>>> + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->eth_dev_priv_dump, - > >>>> ENOTSUP); > >>>> + ret =3D (*dev->dev_ops->eth_dev_priv_dump)(file, dev); > >>>> + > >>>> + return ret; > >>>> +} > >>>> + > >>>> 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 fa299c8ad7..8e33e6927f 100644 > >>>> --- a/lib/ethdev/rte_ethdev.h > >>>> +++ b/lib/ethdev/rte_ethdev.h > >>>> @@ -5888,6 +5888,22 @@ rte_eth_tx_buffer(uint16_t port_id, uint16_t > >>>> queue_id, > >>>> return rte_eth_tx_buffer_flush(port_id, queue_id, buffer); > >>>> } > >>>> > >>>> +/** > >>>> + * @warning > >>>> + * @b EXPERIMENTAL: this API may change, or be removed, without pri= or > >>>> notice > >>>> + * > >>>> + * Get ethdev private info. > >>> > >>> Suggestion: Dump ethdev private info to a file. > >>> > >>>> + * > >>>> + * @param file > >>>> + * A pointer to a file for output. > >>>> + * @param port_id > >>>> + * The port identifier of the Ethernet device. > >>>> + * @return > >>>> + * Negative errno value on error, positive value on success. > >>>> + */ > >>>> +__rte_experimental > >>>> +int rte_eth_dev_priv_dump(FILE *file, uint16_t port_id); > >>>> + > >>>> #ifdef __cplusplus > >>>> } > >>>> #endif > >>>> -- > >>>> 2.33.0 > >>>> > >>> > >>> You should probably also add rte_eth_dev_priv_dump to the EXPERIMENTA= L section of the version.map file. > >>> > >>> Acked-by: Morten Br=C3=B8rup > >>> > >>> . > >>> > > . > >