From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 7A2712BAA; Sun, 12 Feb 2017 05:35:00 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP; 11 Feb 2017 20:34:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,150,1484035200"; d="scan'208";a="63658806" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga005.jf.intel.com with ESMTP; 11 Feb 2017 20:34:58 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 11 Feb 2017 20:34:58 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 11 Feb 2017 20:34:58 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Sun, 12 Feb 2017 12:34:56 +0800 From: "Wu, Jingjing" To: "Iremonger, Bernard" , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH v6 2/2] app/testpmd: fix port stop Thread-Index: AQHSeIsnXuXTOIb0xESM5JLMFxPghqFW+yaQ//+gtACADkRRsA== Date: Sun, 12 Feb 2017 04:34:55 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810CD9A71@SHSMSX103.ccr.corp.intel.com> References: <1485354963-17326-1-git-send-email-bernard.iremonger@intel.com> <1485514200-25230-3-git-send-email-bernard.iremonger@intel.com> <9BB6961774997848B5B42BEC655768F810CD3C32@SHSMSX103.ccr.corp.intel.com> <8CEF83825BEC744B83065625E567D7C224D25BBD@IRSMSX108.ger.corp.intel.com> In-Reply-To: <8CEF83825BEC744B83065625E567D7C224D25BBD@IRSMSX108.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 v6 2/2] app/testpmd: fix port stop 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: Sun, 12 Feb 2017 04:35:01 -0000 > -----Original Message----- > From: Iremonger, Bernard > Sent: Friday, February 3, 2017 6:38 PM > To: Wu, Jingjing ; dev@dpdk.org > Cc: stable@dpdk.org > Subject: RE: [PATCH v6 2/2] app/testpmd: fix port stop >=20 > Hi Jingjing >=20 > > -----Original Message----- > > From: Wu, Jingjing > > Sent: Friday, February 3, 2017 8:22 AM > > To: Iremonger, Bernard ; dev@dpdk.org > > Cc: stable@dpdk.org > > Subject: RE: [PATCH v6 2/2] app/testpmd: fix port stop > > > > > > > > > -----Original Message----- > > > From: Iremonger, Bernard > > > Sent: Friday, January 27, 2017 6:50 PM > > > To: dev@dpdk.org; Wu, Jingjing > > > Cc: Iremonger, Bernard ; > > stable@dpdk.org > > > Subject: [PATCH v6 2/2] app/testpmd: fix port stop > > > > > > The rte_eth_dev_stop function is not called if the port_status is > > > not RTE_PORT_STARTED. This can happen if the rte_eth_dev_start > > > function is called directly, ie not through the start_port function. > > > > > > Make sure rte_eth_dev_stop is always called in stop_port function. > > > > > > Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings") > > > > > > CC: stable@dpdk.org > > > Signed-off-by: Bernard Iremonger > > > --- > > > app/test-pmd/testpmd.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > > > 3d25436..0d7a4d4 100644 > > > --- a/app/test-pmd/testpmd.c > > > +++ b/app/test-pmd/testpmd.c > > > @@ -1490,13 +1490,13 @@ stop_port(portid_t pid) > > > continue; > > > } > > > > > > + rte_eth_dev_stop(pi); > > > + > > > port =3D &ports[pi]; > > > if (rte_atomic16_cmpset(&(port->port_status), > > > RTE_PORT_STARTED, > > > RTE_PORT_HANDLING) =3D=3D 0) > > > continue; > > > > > > - rte_eth_dev_stop(pi); > > > - > > > > I don't think this fix is correct to move rte_eth_dev_stop above. > > > > We need to make sure rte_eth_dev_start is called in start_port. For > > vmdq configuration, You just need to change the configuration when > > port is stopped. >=20 > I think the stop_port() function should always stop the port even if the > port_status is not correct for any reason. > At present stop_port() returns without stopping the port if the port_stat= us is not > RTE_PORT_STARTED. > This is testpmd's design. If you think it is an issue, maybe you need to pr= epare patch to optimize it. But for VMDQ configuration, I'd like to make it= independent but not mixed. =20 > The VMDq configuration is done whet the port is stopped, however to the > complete the VMDq configuration the port must be started. >=20 To change minor, we can stop port, then configure VMDQ and then start port. You make port started in VMDQ config, the Symmetry of stop/start command is= broken and it is not easy to maintain. > Regards, >=20 > Bernard.