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 5F964A034F; Mon, 11 Oct 2021 15:10:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49A7F40142; Mon, 11 Oct 2021 15:10:50 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id A96D24003C for ; Mon, 11 Oct 2021 15:10:48 +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 (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 3FE817F578; Mon, 11 Oct 2021 16:10:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 3FE817F578 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1633957848; bh=78Bi/8PnIsjSvMZXjh5t1cFlFEFlXLtjWiqoQkBhgCw=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=RCJ7j6tW/fAAJc2EA3ARpXdia8/2nUtNTn2gY5z84YIFsNS07SL1Lmp8yG1ZOWTC+ 7MdLFOJCoJBa87YKGWBuTHaNuax9A1IgcgLlh7/tPhTBwvZ/cXtOvtcR8LyHx/r3Hn o+nbLnU230FC9rnM21OzE/hG/QWD/ctNuHQMBDx8= To: "Li, Xiaoyun" Cc: "dev@dpdk.org" , Xueming Li , Viacheslav Galaktionov , Andy Moreton References: <20210827063935.1834143-1-andrew.rybchenko@oktetlabs.ru> <20210915134745.3915643-1-andrew.rybchenko@oktetlabs.ru> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <1e2e62b9-b62e-3966-e056-234f393f5a16@oktetlabs.ru> Date: Mon, 11 Oct 2021 16:10:48 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3] app/testpmd: add command to print representor info 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" Hi Xiaoyun, On 10/11/21 11:32 AM, Li, Xiaoyun wrote: > Hi > >> -----Original Message----- >> From: Andrew Rybchenko >> Sent: Wednesday, September 15, 2021 21:48 >> To: Li, Xiaoyun >> Cc: dev@dpdk.org; Xueming Li ; Viacheslav Galaktionov >> ; Andy Moreton >> Subject: [PATCH v3] app/testpmd: add command to print representor info >> >> From: Viacheslav Galaktionov >> >> Make it simpler to debug configurations and code related to the representor >> info API. >> >> Signed-off-by: Viacheslav Galaktionov >> Signed-off-by: Andrew Rybchenko >> Reviewed-by: Andy Moreton >> Reviewed-by: Xueming(Steven) Li >> --- >> v3: >> - change command to "show port info (port_id) representor" >> >> v2: >> - change output format to log just one line per range >> >> app/test-pmd/cmdline.c | 137 >> +++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 137 insertions(+) >> >> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index >> 7dd3965d6f..2f24d33337 100644 >> --- a/app/test-pmd/cmdline.c >> +++ b/app/test-pmd/cmdline.c >> @@ -162,6 +162,10 @@ static void cmd_help_long_parsed(void *parsed_result, >> "show port (info|stats|summary|xstats|fdir|dcb_tc) >> (port_id|all)\n" >> " Display information for port_id, or all.\n\n" >> >> + "show port info (port_id) representor\n" >> + " Show supported representors" >> + " for a specific port\n\n" > > Why not just put " Show supported representors for a specific port\n\n" in one sentence? > Thanks, done in v4. >> + >> "show port port_id (module_eeprom|eeprom)\n" >> " Display the module EEPROM or EEPROM >> information for port_id.\n\n" >> >> @@ -7904,6 +7908,138 @@ cmdline_parse_inst_t cmd_showport = { >> }, >> }; >> > >> + printf("Controller %d, PF %d", range->controller, range->pf); >> + >> + switch (range->type) { >> + case RTE_ETH_REPRESENTOR_NONE: >> + printf(", NONE\n"); >> + break; >> + case RTE_ETH_REPRESENTOR_VF: >> + if (range_diff > 0) { >> + printf(", VF %d..%d\n", range->vf, >> + range->vf + range_diff); >> + } else { >> + printf(", VF %d\n", range->vf); >> + } > > There's no need of braces for this "if else" like others. Fixed in v4. > > BRs > Xiaoyun > >> + break; >> + case RTE_ETH_REPRESENTOR_SF: >> + printf(", SF %d\n", range->sf); >> + break; >> + case RTE_ETH_REPRESENTOR_PF: >> + if (range_diff > 0) >> + printf("..%d\n", range->pf + range_diff); >> + else >> + printf("\n"); >> + break; >> + default: >> + printf(", UNKNOWN TYPE %d\n", range->type); >> + break; >> + } >> + } >> + >> + free(info); >> +} >> + > >> -- >> 2.30.2 Many thanks for review notes, Andrew.