> -----Original Message----- > From: Matan Azrad [mailto:ma...@mellanox.com] > Sent: Sunday, September 3, 2017 9:19 PM > To: Wu, Jingjing <jingjing...@intel.com>; Gaetan Rivet > <gaetan.ri...@6wind.com>; > Thomas Monjalon <tho...@monjalon.net> > Cc: dev@dpdk.org; Ori Kam <or...@mellanox.com>; sta...@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: sta...@dpdk.org > > Signed-off-by: Matan Azrad <ma...@mellanox.com>
>From the view of testpmd, the fix is good. Acked-by: Jingjing Wu <jingjing...@intel.com> Thanks Jingjing