[dpdk-dev] [PATCH] app/testpmd: fix forward port ids setting

Wu, Jingjing jingjing.wu at intel.com
Thu Sep 7 09:44:17 CEST 2017



> -----Original Message-----
> From: Matan Azrad [mailto:matan at mellanox.com]
> Sent: Sunday, September 3, 2017 9:19 PM
> To: Wu, Jingjing <jingjing.wu at intel.com>; Gaetan Rivet <gaetan.rivet at 6wind.com>;
> Thomas Monjalon <thomas at monjalon.net>
> Cc: dev at dpdk.org; Ori Kam <orika at mellanox.com>; stable at dpdk.org
> Subject: [PATCH] app/testpmd: fix forward port ids setting
> 
> The corrupted code didn't check the port availability when
> it was trying to set the forward port IDs array.
> However, when it was counting the number of ports, the availability
> was checked by RTE_ETH_FOREACH_DEV iterator.
> 
> Hence, even when ETH devices ports were not in ATTACHED state,
> the testpmd tried to forward traffic by them and got segmentation
> fault at queue access time.
> 
> For example:
> When EAL command line parameters include two devices, the first
> is failsafe with two sub devices and the second is any device,
> testpmd gets two devices by the iterator and sets for forwarding
> both, the failsafe device and the failsafe first sub device
> (instead of the second sub device).
> After the first failsafe sub device state was changed to DEFERRED,
> testpmd tries to forward traffic through the deferred device
> because it didn't check the port availability in setting time.
> 
> The fix uses the RTE_ETH_FOREACH_DEV iterator for the forward
> port IDs default setting.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Matan Azrad <matan at mellanox.com>

>From the view of testpmd, the fix is good.

Acked-by: Jingjing Wu <jingjing.wu at intel.com>

Thanks
Jingjing


More information about the dev mailing list