From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 6863E1B1AC; Sat, 23 Sep 2017 04:26:41 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2017 19:26:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,428,1500966000"; d="scan'208";a="1198166322" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 22 Sep 2017 19:26:40 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 22 Sep 2017 19:26:40 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 22 Sep 2017 19:26:40 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Sat, 23 Sep 2017 10:26:38 +0800 From: "Wu, Jingjing" To: "Ananyev, Konstantin" , "Dai, Wei" , "Xing, Beilei" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v5] net/i40e: fix mirror rule reset when port is stopped Thread-Index: AQHTMfIZhCmXfdtUoUizwmIY/DcQ8qK9Ts2AgACLvICAA+TDQA== Date: Sat, 23 Sep 2017 02:26:37 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810E7B199@SHSMSX103.ccr.corp.intel.com> References: <1505873529-64121-1-git-send-email-wei.dai@intel.com> <1505881001-12200-1-git-send-email-wei.dai@intel.com> <2601191342CEEE43887BDE71AB9772584F24D244@irsmsx105.ger.corp.intel.com> <49759EB36A64CF4892C1AFEC9231E8D650B9A377@PGSMSX106.gar.corp.intel.com> <2601191342CEEE43887BDE71AB9772584F24D80D@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB9772584F24D80D@irsmsx105.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTQ2OGYxYzYtNWMzNC00MTE5LTlkODctMTA3NmE4M2M2ZTYyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImtCcWtDK25TaGM0UU94bzFNSTlzazQzRENDRzMrWGFCQ3pCdGxDTU9FZzg9In0= 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 v5] net/i40e: fix mirror rule reset when port is stopped 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: Sat, 23 Sep 2017 02:26:43 -0000 > -----Original Message----- > From: Ananyev, Konstantin > Sent: Thursday, September 21, 2017 6:46 AM > To: Dai, Wei ; Wu, Jingjing ; X= ing, Beilei > > Cc: dev@dpdk.org; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v5] net/i40e: fix mirror rule reset when p= ort is stopped >=20 > Hi Wei, >=20 > > > > Hi, Konstantin > > > > Without this patch, when a port is stopped, all mirror SW resource are = cleared but HW > settings are still there. > > And once the port is started again, creating mirror rule may fail due t= o remain HW > settings. > > > > There is a testpmd use case which can show why this patch is needed. > > 1. bind PF to igb_uio > > #/root/dpdk-devbind.py -b igb_uio 0000:08:00.0 > > 2. create 2 VFs > > #echo 2 > /sys/bus/pci/devices/0000\:08\:00.0/max_vfs > > 3. launch testpmd with PF, and set port mirror configuration > > #./x86_64-native-linuxapp-gcc/app/testpmd -c 3 -n 4 -- -i > > Testpmd > set port 0 mirror-rule 0 pool-mirror-up 0x1 dst-pool 1 on > > Testpmd > quit > > 4. relaunch testpmd with PF, and set port mirror as the same configurat= ion > > #./x86_64-native-linuxapp-gcc/app/testpmd -c 3 -n 4 -- -i > > Testpmd > set port 0 mirror-rule 0 pool-mirror-up 0x1 dst-pool 1 on > > I40e_mirror_rule_set( ): failed to add mirror rule: ret =3D -53, aq_er= r =3D 13. > > Mirror rule add error: (Function not implemented) > > > > When testpmd is quitted, rte_eth_dev_stop( ) and then rte_eth_dev_close= ( ) are called. > > In these function, i40e_dev_stop( ) and i40e_dev_close( ) is called. > > And i40e_dev_stop is also called by i40e_dev_close( ). > > > > Without this patch, the error in second running of testpmd always happe= n. > > This patch can address this error. >=20 > Thanks for explanation. > Though it seems that the patch while fixing the issue might introduce som= e > inconsistences: > 1. right now for i40e: dev_stop(port); dev_start(port) would keep existin= g HW mirror rule > working. > With your patch is not any more. > 2. What about ixgbe? Do we also need to change its behavior? > As I can see right now ixgbe doesn't reset any mirror rules at dev_st= op(). > Would it be reset automatically, or do we need to update ixgbe PMD too= ? >=20 > About #1 - if we'll decide that this is a desired behavior that dev_stop(= ) voids > all mirror rules, then at least we probably need to update the documentat= ion. > As alternative - at dev_stop() we can reset only actual HW rule, but keep= SW > configuration intact, > and restore them at dev_start(). > I personally think second option is a bit better - as it preserves existi= ng behavior, > and probably more convenient for the user. Yes, you reminded me the mirror is to VF. The mirror rule should be kept or= at least be restored when device start again.. Because the dev_stop should only stop the pf interface, but not affect VF. = It looks like we don't delete the VEB we dev_stop. The reset behavior may need to be done in dev_close, but not in dev_stop. >=20 > About the patch itself, why just not: > while ((p_mirror =3D TAILQ_FIRST(&pf->mirror_list))) > i40e_mirror_rule_reset(dev, p_mirror->index); >=20 Wei's v1 patch is doing like that. But I commented it to change it. Because i40e_mirror_rule_reset is doing a search in the list which is not necessary= . Thanks Jingjing