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 2DA1AA0543; Tue, 4 Oct 2022 09:05:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C94F240DDC; Tue, 4 Oct 2022 09:05:18 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 5777B40A87 for ; Tue, 4 Oct 2022 09:05:17 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id C414E5D; Tue, 4 Oct 2022 10:05:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru C414E5D DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1664867116; bh=cKaKMADOP0lpqcvIDbZ7Z1WvhpZ8Ad040sT383pKk+A=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=RYO9v1T+rth62AxZZQz/S05MBmsRYL6K/xm509rzozNKFxYK7Cmzo/ngJOtzP/oaJ 5NXkZr1xqYq91bjs0YtIR0qY6n8lISBETjhq1MSRLK81ump0Qq0kx2eKJK4F9BUQDU hw4kA0RNYtm7p5hYxDQ8y9WVs1NaluFcuuftcmcw= Message-ID: <16a8fa5e-16b5-1499-f225-18a55d4e1b5d@oktetlabs.ru> Date: Tue, 4 Oct 2022 10:05:16 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH v4 1/3] ethdev: introduce ethdev desc dump API Content-Language: en-US To: Ferruh Yigit , Dongdong Liu , dev@dpdk.org, thomas@monjalon.net, ferruh.yigit@xilinx.com, stephen@networkplumber.org, mdr@ashroe.eu Cc: "Min Hu (Connor)" References: <20220527023351.40577-1-humin29@huawei.com> <20220923074316.25077-1-liudongdong3@huawei.com> <20220923074316.25077-2-liudongdong3@huawei.com> <32e4a2fe-e75f-e832-278c-651d5081324a@amd.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <32e4a2fe-e75f-e832-278c-651d5081324a@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 10/4/22 01:40, Ferruh Yigit wrote: > On 9/23/2022 8:43 AM, Dongdong Liu wrote: > >> >> From: "Min Hu (Connor)" >> >> Added the ethdev Rx/Tx desc dump API which provides functions for query >> descriptor from device. HW descriptor info differs in different NICs. >> The information demonstrates I/O process which is important for debug. >> As the information is different > > Overall OK to have these new APIs, please find comments below. > > Do you think does it worth to list this as one of the PMD future in > future list, in 'doc/guides/nics/features.rst' ? IMHO it does not deserve entry in features. It is a deep debugging using vendor-specific information. > >  between NICs, the new API is introduced. >> >> Signed-off-by: Min Hu (Connor) >> Signed-off-by: Dongdong Liu >> Acked-by: Ray Kinsella > > <...> > >>   int rte_eth_dev_priv_dump(uint16_t port_id, FILE *file); >> >> +/** >> + * @warning >> + * @b EXPERIMENTAL: this API may change, or be removed, without prior >> notice >> + * >> + * Dump ethdev Rx descriptor info to a file. >> + * >> + * This API is used for debugging, not a dataplane API. >> + * >> + * @param file >> + *   A pointer to a file for output. >> + * @param dev >> + *   Port (ethdev) handle. >> + * @param queue_id >> + *   The selected queue. >> + * @param num >> + *   The number of the descriptors to dump. >> + * @return >> + *   - On success, zero. >> + *   - On failure, a negative value. >> + */ >> +__rte_experimental >> +int rte_eth_rx_hw_desc_dump(FILE *file, uint16_t port_id, uint16_t >> queue_id, >> +                           uint16_t num); > > There are other HW desc related APIs, like > 'rte_eth_rx_descriptor_status()'. > Should this APIs follow same naming convention: > 'rte_eth_rx_descriptor_dump()' > 'rte_eth_tx_descriptor_dump()' +1 on naming, it should not be bound to HW. SW parts could be interesting as well. > >> + >> +/** >> + * @warning >> + * @b EXPERIMENTAL: this API may change, or be removed, without prior >> notice >> + * >> + * Dump ethdev Tx descriptor info to a file. >> + * >> + * This API is used for debugging, not a dataplane API. >> + * >> + * @param file >> + *   A pointer to a file for output. >> + * @param dev >> + *   Port (ethdev) handle. >> + * @param queue_id >> + *   The selected queue. >> + * @param num >> + *   The number of the descriptors to dump. >> + * @return >> + *   - On success, zero. >> + *   - On failure, a negative value. >> + */ >> +__rte_experimental >> +int rte_eth_tx_hw_desc_dump(FILE *file, uint16_t port_id, uint16_t >> queue_id, >> +                           uint16_t num); > > 'num' is provided, does it assume it starts from offset 0, what do you > think to provide 'offset' as parameter? > It may be a use case to start from where tail/head pointer is. > >> + >> + >>   #include >> >>   /** >> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map >> index 03f52fee91..3c7c75b582 100644 >> --- a/lib/ethdev/version.map >> +++ b/lib/ethdev/version.map >> @@ -285,6 +285,8 @@ EXPERIMENTAL { >>          rte_mtr_color_in_protocol_priority_get; >>          rte_mtr_color_in_protocol_set; >>          rte_mtr_meter_vlan_table_update; >> +       rte_eth_rx_hw_desc_dump; >> +       rte_eth_tx_hw_desc_dump; > > These new APIs should go after "# added in 22.11" comment, if you rebase > on top of latest HEAD, comment is already there. >