[dpdk-dev] app/testpmd: update start log to be less verbose

Message ID 20180425141509.160899-1-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail apply patch file failure

Commit Message

Ferruh Yigit April 25, 2018, 2:15 p.m. UTC
  A per port per queue log is too verbose with multiple port/queue log is
longer than full screen, make it less verbose:
- Reduced log to only first queue of the port, as a sample
- Merged a few lines
- Indent queue logs for readability

The log becomes as following after update:

testpmd> start tx_first
io packet forwarding - ports=2 - cores=1 - streams=8 - NUMA support enabled, MP over anonymous pages disabled
Logical Core 1 (socket 0) forwards packets on 8 streams:
  RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
  RX P=0/Q=1 (socket 0) -> TX P=1/Q=1 (socket 0) peer=02:00:00:00:00:01
  RX P=0/Q=2 (socket 0) -> TX P=1/Q=2 (socket 0) peer=02:00:00:00:00:01
  RX P=0/Q=3 (socket 0) -> TX P=1/Q=3 (socket 0) peer=02:00:00:00:00:01
  RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
  RX P=1/Q=1 (socket 0) -> TX P=0/Q=1 (socket 0) peer=02:00:00:00:00:00
  RX P=1/Q=2 (socket 0) -> TX P=0/Q=2 (socket 0) peer=02:00:00:00:00:00
  RX P=1/Q=3 (socket 0) -> TX P=0/Q=3 (socket 0) peer=02:00:00:00:00:00

  io packet forwarding packets/burst=32
  nb forwarding cores=1 - nb forwarding ports=2
  port 0: RX queue number: 4 Tx queue number: 4
  Rx offloads=0x1000 Tx offloads=0x0
  RX queue: 0
    RX desc=0 - RX free threshold=32
    RX threshold registers: pthresh=8 hthresh=8  wthresh=0
    RX Offloads=0x1000
  TX queue: 0
    TX desc=0 - TX free threshold=32
    TX threshold registers: pthresh=32 hthresh=0  wthresh=0
    TX RS bit threshold=32
    TX offloads=0x0
  port 1: RX queue number: 4 Tx queue number: 4
  Rx offloads=0x1000 Tx offloads=0x0
  RX queue: 0
    RX desc=0 - RX free threshold=32
    RX threshold registers: pthresh=8 hthresh=8  wthresh=0
    RX Offloads=0x1000
  TX queue: 0
    TX desc=0 - TX free threshold=32
    TX threshold registers: pthresh=32 hthresh=0  wthresh=0
    TX RS bit threshold=32
    TX offloads=0x0

Fixes: 266f28b91e34 ("app/testpmd: enable per queue configure")
Cc: qi.z.zhang@intel.com

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---

Hi Qi,

If you are agree with the patch I can squash into original patch.

btw, desc numbers are zero, "TX desc=0","RX desc=0", is this correct?
---
 app/test-pmd/config.c | 35 ++++++++++++++++-------------------
 1 file changed, 16 insertions(+), 19 deletions(-)
  

Comments

Qi Zhang April 26, 2018, 12:16 a.m. UTC | #1
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, April 25, 2018 10:15 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: [PATCH] app/testpmd: update start log to be less verbose
> 
> A per port per queue log is too verbose with multiple port/queue log is
> longer than full screen, make it less verbose:
> - Reduced log to only first queue of the port, as a sample
> - Merged a few lines
> - Indent queue logs for readability
> 
> The log becomes as following after update:
> 
> testpmd> start tx_first
> io packet forwarding - ports=2 - cores=1 - streams=8 - NUMA support enabled,
> MP over anonymous pages disabled Logical Core 1 (socket 0) forwards
> packets on 8 streams:
>   RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
>   RX P=0/Q=1 (socket 0) -> TX P=1/Q=1 (socket 0) peer=02:00:00:00:00:01
>   RX P=0/Q=2 (socket 0) -> TX P=1/Q=2 (socket 0) peer=02:00:00:00:00:01
>   RX P=0/Q=3 (socket 0) -> TX P=1/Q=3 (socket 0) peer=02:00:00:00:00:01
>   RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
>   RX P=1/Q=1 (socket 0) -> TX P=0/Q=1 (socket 0) peer=02:00:00:00:00:00
>   RX P=1/Q=2 (socket 0) -> TX P=0/Q=2 (socket 0) peer=02:00:00:00:00:00
>   RX P=1/Q=3 (socket 0) -> TX P=0/Q=3 (socket 0) peer=02:00:00:00:00:00
> 
>   io packet forwarding packets/burst=32
>   nb forwarding cores=1 - nb forwarding ports=2
>   port 0: RX queue number: 4 Tx queue number: 4
>   Rx offloads=0x1000 Tx offloads=0x0
>   RX queue: 0
>     RX desc=0 - RX free threshold=32
>     RX threshold registers: pthresh=8 hthresh=8  wthresh=0
>     RX Offloads=0x1000
>   TX queue: 0
>     TX desc=0 - TX free threshold=32
>     TX threshold registers: pthresh=32 hthresh=0  wthresh=0
>     TX RS bit threshold=32
>     TX offloads=0x0
>   port 1: RX queue number: 4 Tx queue number: 4
>   Rx offloads=0x1000 Tx offloads=0x0
>   RX queue: 0
>     RX desc=0 - RX free threshold=32
>     RX threshold registers: pthresh=8 hthresh=8  wthresh=0
>     RX Offloads=0x1000
>   TX queue: 0
>     TX desc=0 - TX free threshold=32
>     TX threshold registers: pthresh=32 hthresh=0  wthresh=0
>     TX RS bit threshold=32
>     TX offloads=0x0
> 
> Fixes: 266f28b91e34 ("app/testpmd: enable per queue configure")
> Cc: qi.z.zhang@intel.com
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> 
> Hi Qi,
> 
> If you are agree with the patch I can squash into original patch.

OK

> 
> btw, desc numbers are zero, "TX desc=0","RX desc=0", is this correct?

Yes, since the default value of nb_rxd and nb_txd is 0 which mean let device take its default value.
The patch keep rxtx_config_display just print the configure parameters but not real device configure as before.
But maybe "TX desc=default" is better for readable?

Regards
Qi
  
Ferruh Yigit April 26, 2018, 9:45 a.m. UTC | #2
On 4/26/2018 1:16 AM, Zhang, Qi Z wrote:
> 
> 
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Wednesday, April 25, 2018 10:15 PM
>> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
>> <jingjing.wu@intel.com>
>> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>
>> Subject: [PATCH] app/testpmd: update start log to be less verbose
>>
>> A per port per queue log is too verbose with multiple port/queue log is
>> longer than full screen, make it less verbose:
>> - Reduced log to only first queue of the port, as a sample
>> - Merged a few lines
>> - Indent queue logs for readability
>>
>> The log becomes as following after update:
>>
>> testpmd> start tx_first
>> io packet forwarding - ports=2 - cores=1 - streams=8 - NUMA support enabled,
>> MP over anonymous pages disabled Logical Core 1 (socket 0) forwards
>> packets on 8 streams:
>>   RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
>>   RX P=0/Q=1 (socket 0) -> TX P=1/Q=1 (socket 0) peer=02:00:00:00:00:01
>>   RX P=0/Q=2 (socket 0) -> TX P=1/Q=2 (socket 0) peer=02:00:00:00:00:01
>>   RX P=0/Q=3 (socket 0) -> TX P=1/Q=3 (socket 0) peer=02:00:00:00:00:01
>>   RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
>>   RX P=1/Q=1 (socket 0) -> TX P=0/Q=1 (socket 0) peer=02:00:00:00:00:00
>>   RX P=1/Q=2 (socket 0) -> TX P=0/Q=2 (socket 0) peer=02:00:00:00:00:00
>>   RX P=1/Q=3 (socket 0) -> TX P=0/Q=3 (socket 0) peer=02:00:00:00:00:00
>>
>>   io packet forwarding packets/burst=32
>>   nb forwarding cores=1 - nb forwarding ports=2
>>   port 0: RX queue number: 4 Tx queue number: 4
>>   Rx offloads=0x1000 Tx offloads=0x0
>>   RX queue: 0
>>     RX desc=0 - RX free threshold=32
>>     RX threshold registers: pthresh=8 hthresh=8  wthresh=0
>>     RX Offloads=0x1000
>>   TX queue: 0
>>     TX desc=0 - TX free threshold=32
>>     TX threshold registers: pthresh=32 hthresh=0  wthresh=0
>>     TX RS bit threshold=32
>>     TX offloads=0x0
>>   port 1: RX queue number: 4 Tx queue number: 4
>>   Rx offloads=0x1000 Tx offloads=0x0
>>   RX queue: 0
>>     RX desc=0 - RX free threshold=32
>>     RX threshold registers: pthresh=8 hthresh=8  wthresh=0
>>     RX Offloads=0x1000
>>   TX queue: 0
>>     TX desc=0 - TX free threshold=32
>>     TX threshold registers: pthresh=32 hthresh=0  wthresh=0
>>     TX RS bit threshold=32
>>     TX offloads=0x0
>>
>> Fixes: 266f28b91e34 ("app/testpmd: enable per queue configure")
>> Cc: qi.z.zhang@intel.com
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>>
>> Hi Qi,
>>
>> If you are agree with the patch I can squash into original patch.
> 
> OK

Thanks, I will squash this one.

> 
>>
>> btw, desc numbers are zero, "TX desc=0","RX desc=0", is this correct?
> 
> Yes, since the default value of nb_rxd and nb_txd is 0 which mean let device take its default value.
> The patch keep rxtx_config_display just print the configure parameters but not real device configure as before.
> But maybe "TX desc=default" is better for readable?

Instead of "default" what about to display actual value, I assume user will be
interested more with it actual value.

> 
> Regards
> Qi
>
  
Ferruh Yigit April 26, 2018, 10:36 a.m. UTC | #3
On 4/26/2018 10:45 AM, Ferruh Yigit wrote:
> On 4/26/2018 1:16 AM, Zhang, Qi Z wrote:
>>
>>
>>> -----Original Message-----
>>> From: Yigit, Ferruh
>>> Sent: Wednesday, April 25, 2018 10:15 PM
>>> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
>>> <jingjing.wu@intel.com>
>>> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Zhang, Qi Z
>>> <qi.z.zhang@intel.com>
>>> Subject: [PATCH] app/testpmd: update start log to be less verbose
>>>
>>> A per port per queue log is too verbose with multiple port/queue log is
>>> longer than full screen, make it less verbose:
>>> - Reduced log to only first queue of the port, as a sample
>>> - Merged a few lines
>>> - Indent queue logs for readability
>>>
>>> The log becomes as following after update:
>>>
>>> testpmd> start tx_first
>>> io packet forwarding - ports=2 - cores=1 - streams=8 - NUMA support enabled,
>>> MP over anonymous pages disabled Logical Core 1 (socket 0) forwards
>>> packets on 8 streams:
>>>   RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
>>>   RX P=0/Q=1 (socket 0) -> TX P=1/Q=1 (socket 0) peer=02:00:00:00:00:01
>>>   RX P=0/Q=2 (socket 0) -> TX P=1/Q=2 (socket 0) peer=02:00:00:00:00:01
>>>   RX P=0/Q=3 (socket 0) -> TX P=1/Q=3 (socket 0) peer=02:00:00:00:00:01
>>>   RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
>>>   RX P=1/Q=1 (socket 0) -> TX P=0/Q=1 (socket 0) peer=02:00:00:00:00:00
>>>   RX P=1/Q=2 (socket 0) -> TX P=0/Q=2 (socket 0) peer=02:00:00:00:00:00
>>>   RX P=1/Q=3 (socket 0) -> TX P=0/Q=3 (socket 0) peer=02:00:00:00:00:00
>>>
>>>   io packet forwarding packets/burst=32
>>>   nb forwarding cores=1 - nb forwarding ports=2
>>>   port 0: RX queue number: 4 Tx queue number: 4
>>>   Rx offloads=0x1000 Tx offloads=0x0
>>>   RX queue: 0
>>>     RX desc=0 - RX free threshold=32
>>>     RX threshold registers: pthresh=8 hthresh=8  wthresh=0
>>>     RX Offloads=0x1000
>>>   TX queue: 0
>>>     TX desc=0 - TX free threshold=32
>>>     TX threshold registers: pthresh=32 hthresh=0  wthresh=0
>>>     TX RS bit threshold=32
>>>     TX offloads=0x0
>>>   port 1: RX queue number: 4 Tx queue number: 4
>>>   Rx offloads=0x1000 Tx offloads=0x0
>>>   RX queue: 0
>>>     RX desc=0 - RX free threshold=32
>>>     RX threshold registers: pthresh=8 hthresh=8  wthresh=0
>>>     RX Offloads=0x1000
>>>   TX queue: 0
>>>     TX desc=0 - TX free threshold=32
>>>     TX threshold registers: pthresh=32 hthresh=0  wthresh=0
>>>     TX RS bit threshold=32
>>>     TX offloads=0x0
>>>
>>> Fixes: 266f28b91e34 ("app/testpmd: enable per queue configure")
>>> Cc: qi.z.zhang@intel.com
>>>
>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>> ---
>>>
>>> Hi Qi,
>>>
>>> If you are agree with the patch I can squash into original patch.
>>
>> OK
> 
> Thanks, I will squash this one.


Squashed into relevant commit in next-net, thanks.

While applying one more indentation for port level added, also one more line for
Tx queue merged, the output become:

testpmd> start
io packet forwarding - ports=2 - cores=1 - streams=8 - NUMA support enabled, MP
over anonymous pages disabled
Logical Core 1 (socket 0) forwards packets on 8 streams:
  RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
  RX P=0/Q=1 (socket 0) -> TX P=1/Q=1 (socket 0) peer=02:00:00:00:00:01
  RX P=0/Q=2 (socket 0) -> TX P=1/Q=2 (socket 0) peer=02:00:00:00:00:01
  RX P=0/Q=3 (socket 0) -> TX P=1/Q=3 (socket 0) peer=02:00:00:00:00:01
  RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
  RX P=1/Q=1 (socket 0) -> TX P=0/Q=1 (socket 0) peer=02:00:00:00:00:00
  RX P=1/Q=2 (socket 0) -> TX P=0/Q=2 (socket 0) peer=02:00:00:00:00:00
  RX P=1/Q=3 (socket 0) -> TX P=0/Q=3 (socket 0) peer=02:00:00:00:00:00

  io packet forwarding packets/burst=32
  nb forwarding cores=1 - nb forwarding ports=2
  port 0: RX queue number: 4 Tx queue number: 4
    Rx offloads=0x1000 Tx offloads=0x0
    RX queue: 0
      RX desc=0 - RX free threshold=32
      RX threshold registers: pthresh=8 hthresh=8  wthresh=0
      RX Offloads=0x1000
    TX queue: 0
      TX desc=0 - TX free threshold=32
      TX threshold registers: pthresh=32 hthresh=0  wthresh=0
      TX offloads=0x0 - TX RS bit threshold=32
  port 1: RX queue number: 4 Tx queue number: 4
    Rx offloads=0x1000 Tx offloads=0x0
    RX queue: 0
      RX desc=0 - RX free threshold=32
      RX threshold registers: pthresh=8 hthresh=8  wthresh=0
      RX Offloads=0x1000
    TX queue: 0
      TX desc=0 - TX free threshold=32
      TX threshold registers: pthresh=32 hthresh=0  wthresh=0
      TX offloads=0x0 - TX RS bit threshold=32
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 216a7eb4e..a5bfda140 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1776,43 +1776,40 @@  rxtx_config_display(void)
 		uint16_t *nb_tx_desc = &ports[pid].nb_tx_desc[0];
 
 		/* per port config */
-		printf("  port %d:\n", (unsigned int)pid);
-		printf("  Rx offloads=0x%"PRIx64"\n",
-				ports[pid].dev_conf.rxmode.offloads);
+		printf("  port %d: RX queue number: %d Tx queue number: %d\n",
+				(unsigned int)pid, nb_rxq, nb_txq);
 
-		printf("  Tx offloads=0x%"PRIx64"\n",
+		printf("  Rx offloads=0x%"PRIx64" Tx offloads=0x%"PRIx64"\n",
+				ports[pid].dev_conf.rxmode.offloads,
 				ports[pid].dev_conf.txmode.offloads);
 
-		printf("  RX queue number: %d\n", nb_rxq);
-
-		/* per rx queue config */
-		for (qid = 0; qid < nb_rxq; qid++) {
+		/* per rx queue config only for first queue to be less verbose */
+		for (qid = 0; qid < 1; qid++) {
 			printf("  RX queue: %d\n", qid);
-			printf("  RX desc=%d - RX free threshold=%d\n",
+			printf("    RX desc=%d - RX free threshold=%d\n",
 				nb_rx_desc[qid], rx_conf[qid].rx_free_thresh);
-			printf("  RX threshold registers: pthresh=%d hthresh=%d "
+			printf("    RX threshold registers: pthresh=%d hthresh=%d "
 				" wthresh=%d\n",
 				rx_conf[qid].rx_thresh.pthresh,
 				rx_conf[qid].rx_thresh.hthresh,
 				rx_conf[qid].rx_thresh.wthresh);
-			printf("  RX Offloads=0x%"PRIx64"\n",
+			printf("    RX Offloads=0x%"PRIx64"\n",
 				rx_conf[qid].offloads);
 		}
 
-		printf("  Tx queue number: %d\n", nb_txq);
-
-		/* per tx queue config */
-		for (qid = 0; qid < nb_txq; qid++) {
+		/* per tx queue config only for first queue to be less verbose */
+		for (qid = 0; qid < 1; qid++) {
 			printf("  TX queue: %d\n", qid);
-			printf("  TX desc=%d - TX free threshold=%d\n",
+			printf("    TX desc=%d - TX free threshold=%d\n",
 				nb_tx_desc[qid], tx_conf[qid].tx_free_thresh);
-			printf("  TX threshold registers: pthresh=%d hthresh=%d "
+			printf("    TX threshold registers: pthresh=%d hthresh=%d "
 				" wthresh=%d\n",
 				tx_conf[qid].tx_thresh.pthresh,
 				tx_conf[qid].tx_thresh.hthresh,
 				tx_conf[qid].tx_thresh.wthresh);
-			printf("  TX RS bit threshold=%d\n", tx_conf->tx_rs_thresh);
-			printf("  TX offloads=0x%"PRIx64"\n",
+			printf("    TX RS bit threshold=%d\n",
+				tx_conf->tx_rs_thresh);
+			printf("    TX offloads=0x%"PRIx64"\n",
 				tx_conf[qid].offloads);
 		}
 	}