From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 0B2DF7D4E; Thu, 7 Sep 2017 09:44:20 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2017 00:44:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,357,1500966000"; d="scan'208";a="1215816826" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 07 Sep 2017 00:44:19 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 7 Sep 2017 00:44:19 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 7 Sep 2017 00:44:19 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.219]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.98]) with mapi id 14.03.0319.002; Thu, 7 Sep 2017 15:44:17 +0800 From: "Wu, Jingjing" To: Matan Azrad , Gaetan Rivet , Thomas Monjalon CC: "dev@dpdk.org" , Ori Kam , "stable@dpdk.org" Thread-Topic: [PATCH] app/testpmd: fix forward port ids setting Thread-Index: AQHTJLdWZqOJwIiHV0qz8alKTY1G9aKpEGrg Date: Thu, 7 Sep 2017 07:44:17 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810E42494@SHSMSX103.ccr.corp.intel.com> References: <1504444747-56298-1-git-send-email-matan@mellanox.com> In-Reply-To: <1504444747-56298-1-git-send-email-matan@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTNiMDY0ZDQtYjkwMC00Y2M4LTgxYmItMjI0NjYzMmYxMTFiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ikt0TzBwYTdTT1wvT3NmT1JtMFBMcXo2TmJKUjExaldROVVQb1lSeUFTc25ZPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix forward port ids setting X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 07:44:21 -0000 > -----Original Message----- > From: Matan Azrad [mailto:matan@mellanox.com] > Sent: Sunday, September 3, 2017 9:19 PM > To: Wu, Jingjing ; Gaetan Rivet ; > Thomas Monjalon > Cc: dev@dpdk.org; Ori Kam ; stable@dpdk.org > Subject: [PATCH] app/testpmd: fix forward port ids setting >=20 > 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. >=20 > 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. >=20 > 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. >=20 > The fix uses the RTE_ETH_FOREACH_DEV iterator for the forward > port IDs default setting. >=20 > Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org >=20 > Signed-off-by: Matan Azrad >>From the view of testpmd, the fix is good. Acked-by: Jingjing Wu Thanks Jingjing