app/testpmd: fix display types failure when query RSS rule

Message ID 20220707105044.10567-1-lihuisong@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: fix display types failure when query RSS rule |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/iol-intel-Performance fail Performance Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

lihuisong (C) July 7, 2022, 10:50 a.m. UTC
  Now testpmd fails to display types when query RSS rule. The failure is
because the '\n' character is missing at the end of the function
'rss_config_display()'.

Fixes: 534988c490f1 ("app/testpmd: unify RSS types display")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 app/test-pmd/config.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Ferruh Yigit July 7, 2022, 12:22 p.m. UTC | #1
On 7/7/2022 11:50 AM, Huisong Li wrote:
> Now testpmd fails to display types when query RSS rule. The failure is
> because the '\n' character is missing at the end of the function
> 'rss_config_display()'.
> 

Bugzilla ID: 1048

> Fixes: 534988c490f1 ("app/testpmd: unify RSS types display")
> 
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> ---
>   app/test-pmd/config.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 608bec9796..bcb6d42da3 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -1693,6 +1693,7 @@ rss_config_display(struct rte_flow_action_rss *rss_conf)
>   		return;
>   	}
>   	rss_types_display(rss_conf->types, TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);
> +	printf("\n");


Thanks Huisong for the fix.

What do you think to have '\n' in the 'rss_types_display()' function and 
update 'port_rss_hash_conf_show()' usage?

And can do same change for 'rss_offload_types_display()', having last 
'\n' in the function.

>   }
>   
>   static struct port_indirect_action *
  
lihuisong (C) July 7, 2022, 12:42 p.m. UTC | #2
在 2022/7/7 20:22, Ferruh Yigit 写道:
> On 7/7/2022 11:50 AM, Huisong Li wrote:
>> Now testpmd fails to display types when query RSS rule. The failure is
>> because the '\n' character is missing at the end of the function
>> 'rss_config_display()'.
>>
>
> Bugzilla ID: 1048
>
>> Fixes: 534988c490f1 ("app/testpmd: unify RSS types display")
>>
>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>> ---
>>   app/test-pmd/config.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
>> index 608bec9796..bcb6d42da3 100644
>> --- a/app/test-pmd/config.c
>> +++ b/app/test-pmd/config.c
>> @@ -1693,6 +1693,7 @@ rss_config_display(struct rte_flow_action_rss 
>> *rss_conf)
>>           return;
>>       }
>>       rss_types_display(rss_conf->types, 
>> TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);
>> +    printf("\n");
>
>
> Thanks Huisong for the fix.
>
> What do you think to have '\n' in the 'rss_types_display()' function 
> and update 'port_rss_hash_conf_show()' usage?
>
> And can do same change for 'rss_offload_types_display()', having last 
> '\n' in the function.
For the quering RSS rule command, the 'rss_types_display()' is the last 
function
of 'port_flow_query(). But it is not the case in other RSS commands, and 
all have
''printf("\n")'' after 'xxx_types_display()'.
>
>>   }
>>     static struct port_indirect_action *
>
> .
  
Ferruh Yigit July 7, 2022, 1:12 p.m. UTC | #3
On 7/7/2022 1:42 PM, lihuisong (C) wrote:
> CAUTION: This message has originated from an External Source. Please use 
> proper judgment and caution when opening attachments, clicking links, or 
> responding to this email.
> 
> 
> 在 2022/7/7 20:22, Ferruh Yigit 写道:
>> On 7/7/2022 11:50 AM, Huisong Li wrote:
>>> Now testpmd fails to display types when query RSS rule. The failure is
>>> because the '\n' character is missing at the end of the function
>>> 'rss_config_display()'.
>>>
>>
>> Bugzilla ID: 1048
>>
>>> Fixes: 534988c490f1 ("app/testpmd: unify RSS types display")
>>>
>>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>>> ---
>>>   app/test-pmd/config.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
>>> index 608bec9796..bcb6d42da3 100644
>>> --- a/app/test-pmd/config.c
>>> +++ b/app/test-pmd/config.c
>>> @@ -1693,6 +1693,7 @@ rss_config_display(struct rte_flow_action_rss
>>> *rss_conf)
>>>           return;
>>>       }
>>>       rss_types_display(rss_conf->types,
>>> TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);
>>> +    printf("\n");
>>
>>
>> Thanks Huisong for the fix.
>>
>> What do you think to have '\n' in the 'rss_types_display()' function
>> and update 'port_rss_hash_conf_show()' usage?
>>
>> And can do same change for 'rss_offload_types_display()', having last
>> '\n' in the function.
> For the quering RSS rule command, the 'rss_types_display()' is the last
> function
> of 'port_flow_query(). But it is not the case in other RSS commands, and
> all have
> ''printf("\n")'' after 'xxx_types_display()'.

It shouldn't matter if it is last function or not. I think we can make 
'xxx_types_display()' functions self sufficient, without needing 
additional '\n' after them.

Current output of functions:
"
A B C
D E"

Suggested output"
"
A B C
D E
"


>>
>>>   }
>>>     static struct port_indirect_action *
>>
>> .
  
lihuisong (C) July 8, 2022, 1:21 a.m. UTC | #4
在 2022/7/7 21:12, Ferruh Yigit 写道:
> On 7/7/2022 1:42 PM, lihuisong (C) wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> 在 2022/7/7 20:22, Ferruh Yigit 写道:
>>> On 7/7/2022 11:50 AM, Huisong Li wrote:
>>>> Now testpmd fails to display types when query RSS rule. The failure is
>>>> because the '\n' character is missing at the end of the function
>>>> 'rss_config_display()'.
>>>>
>>>
>>> Bugzilla ID: 1048
>>>
>>>> Fixes: 534988c490f1 ("app/testpmd: unify RSS types display")
>>>>
>>>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>>>> ---
>>>>   app/test-pmd/config.c | 1 +
>>>>   1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
>>>> index 608bec9796..bcb6d42da3 100644
>>>> --- a/app/test-pmd/config.c
>>>> +++ b/app/test-pmd/config.c
>>>> @@ -1693,6 +1693,7 @@ rss_config_display(struct rte_flow_action_rss
>>>> *rss_conf)
>>>>           return;
>>>>       }
>>>>       rss_types_display(rss_conf->types,
>>>> TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);
>>>> +    printf("\n");
>>>
>>>
>>> Thanks Huisong for the fix.
>>>
>>> What do you think to have '\n' in the 'rss_types_display()' function
>>> and update 'port_rss_hash_conf_show()' usage?
>>>
>>> And can do same change for 'rss_offload_types_display()', having last
>>> '\n' in the function.
>> For the quering RSS rule command, the 'rss_types_display()' is the last
>> function
>> of 'port_flow_query(). But it is not the case in other RSS commands, and
>> all have
>> ''printf("\n")'' after 'xxx_types_display()'.
>
> It shouldn't matter if it is last function or not. I think we can make 
> 'xxx_types_display()' functions self sufficient, without needing 
> additional '\n' after them.
>
> Current output of functions:
> "
> A B C
> D E"
>
> Suggested output"
> "
> A B C
> D E
> "
Yes, every place calling "xxx_types_display()" needs '\n'. I will move 
it to the inside of "xxx_types_display()"
>
>
>>>
>>>>   }
>>>>     static struct port_indirect_action *
>>>
>>> .
>
> .
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 608bec9796..bcb6d42da3 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1693,6 +1693,7 @@  rss_config_display(struct rte_flow_action_rss *rss_conf)
 		return;
 	}
 	rss_types_display(rss_conf->types, TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);
+	printf("\n");
 }
 
 static struct port_indirect_action *