[dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port

Ferruh Yigit ferruh.yigit at intel.com
Fri Oct 16 00:14:04 CEST 2020


On 10/14/2020 11:16 AM, Suanming Mou wrote:
> Hi,
> 
>> -----Original Message-----
>> From: dev <dev-bounces at dpdk.org> On Behalf Of Junyu Jiang
>> Sent: Wednesday, October 14, 2020 4:30 PM
>> To: dev at dpdk.org
>> Cc: Beilei Xing <beilei.xing at intel.com>; Wenzhuo Lu <wenzhuo.lu at intel.com>;
>> Junyu Jiang <junyux.jiang at intel.com>; stable at dpdk.org
>> Subject: [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port
>>
>> There is no error info displayed when running flow flush command with invalid
>> port. This patch fixed the issue.
>>
>> Fixes: 2a449871a12d ("app/testpmd: align behaviour of multi-port detach")
>> Cc: stable at dpdk.org
>>
>> Signed-off-by: Junyu Jiang <junyux.jiang at intel.com>
>> ---
>>   app/test-pmd/config.c | 9 +++++----
>>   1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
>> fe31a9d52..cc4527386 100644
>> --- a/app/test-pmd/config.c
>> +++ b/app/test-pmd/config.c
>> @@ -1775,16 +1775,17 @@ port_flow_flush(portid_t port_id)
>>   	struct rte_port *port = &ports[port_id];
>>   	int ret = 0;
>>
>> +	if (port_id_is_invalid(port_id, ENABLED_WARN) ||
>> +		port_id == (portid_t)RTE_PORT_ALL)
>> +		return -EINVAL;
>> +
> 
> Also better to move the port initialize after this check to make the code clean?
 >

+1


More information about the dev mailing list