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 30F7B29CB; Tue, 20 Nov 2018 10:52:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Nov 2018 01:52:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,256,1539673200"; d="scan'208";a="97672157" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by FMSMGA003.fm.intel.com with ESMTP; 20 Nov 2018 01:52:08 -0800 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.8]) by IRSMSX107.ger.corp.intel.com ([169.254.10.79]) with mapi id 14.03.0415.000; Tue, 20 Nov 2018 09:52:04 +0000 From: "Ananyev, Konstantin" To: "Zhao1, Wei" , "Wang, Dong1" , "Lipiec, Herakliusz" , "dev@dpdk.org" CC: "thomas@monjalon.net" , "Burakov, Anatoly" , "stable@dpdk.org" Thread-Topic: [PATCH v2] example/ipv4_multicast: fix app hanging when using clone Thread-Index: AQHUe0b5b7dOcP+BRkqsSp0y8ozILKVOjMiAgABty6CAABMIAIAAAEiAgAAPnYCAAAH1cIAJEQQAgABExKA= Date: Tue, 20 Nov 2018 09:52:04 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258010CEBA153@IRSMSX106.ger.corp.intel.com> References: <20181112204650.7175-1-herakliusz.lipiec@intel.com> <20181113114929.9269-1-herakliusz.lipiec@intel.com> <3E2E5017C928014B90FD7864A64F0B5514F74985@SHSMSX103.ccr.corp.intel.com> <2601191342CEEE43887BDE71AB977258010CEB7388@IRSMSX106.ger.corp.intel.com> <3E2E5017C928014B90FD7864A64F0B5514F74E83@SHSMSX103.ccr.corp.intel.com> <2601191342CEEE43887BDE71AB977258010CEB74B4@IRSMSX106.ger.corp.intel.com> <3E2E5017C928014B90FD7864A64F0B5514F74F8F@SHSMSX103.ccr.corp.intel.com> <2601191342CEEE43887BDE71AB977258010CEB795B@IRSMSX106.ger.corp.intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmJkYWU1NTQtZjM3ZS00YTQyLWJkYTktOWM0NTE0MGZmOTNkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVlNqbW10dVlWXC9BVnRhTVdZWkhkS01nQ0d5WUR0QWNUdXhaVHlvYVlzOCtGVmthU2FNMlNmZmp0OXNYV1pjQkYifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH v2] example/ipv4_multicast: fix app hanging when using clone X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 09:52:11 -0000 Hi Wei, > -----Original Message----- > From: Zhao1, Wei > Sent: Tuesday, November 20, 2018 5:40 AM > To: Ananyev, Konstantin ; Wang, Dong1 ; Lipiec, Herakliusz > ; dev@dpdk.org > Cc: thomas@monjalon.net; Burakov, Anatoly ; st= able@dpdk.org > Subject: RE: [PATCH v2] example/ipv4_multicast: fix app hanging when usin= g clone >=20 > Hi, Konstantin >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ananyev, > > Konstantin > > Sent: Wednesday, November 14, 2018 7:19 PM > > To: Wang, Dong1 ; Lipiec, Herakliusz > > ; dev@dpdk.org > > Cc: thomas@monjalon.net; Burakov, Anatoly ; > > stable@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH v2] example/ipv4_multicast: fix app hang= ing > > when using clone > > > > > > > > > -----Original Message----- > > > From: Wang, Dong1 > > > Sent: Wednesday, November 14, 2018 11:06 AM > > > To: Ananyev, Konstantin ; Lipiec, > > > Herakliusz ; dev@dpdk.org > > > Cc: thomas@monjalon.net; Burakov, Anatoly > > ; > > > stable@dpdk.org > > > Subject: RE: [PATCH v2] example/ipv4_multicast: fix app hanging when > > > using clone > > > > > > Hi Konstantin & Herakliusz, > > > > > > In mcast_out_pkt(), new header added and to be the first segment. Dri= ver > > will check first segment's ol_flags when sending mbuf. > > > > It will check for *TX* flags. > > TX flags are not set in cloned mbuf (only RX ones). > > > > > So why new first segment didn't inherit old one's ol_flags? > > > > Because they are RX flags and they don't' really belong to new packet w= e are > > going to send. > > Also, as that bug shows it is error prone. > > > > > This function already copied other mbuf fields from old one. > > > > And from my perspective it is not needed and better be removed. > > Though it is a subject of different patch probably. >=20 > In the code , function mcast_out_pkt() has the following code, >=20 > /* copy metadata from source packet*/ > hdr->port =3D pkt->port; > hdr->vlan_tci =3D pkt->vlan_tci; > hdr->vlan_tci_outer =3D pkt->vlan_tci_outer; > hdr->tx_offload =3D pkt->tx_offload; > hdr->hash =3D pkt->hash; >=20 > all these are useless , is that right? Yes, I think so. > I will commit a patch to delete them later. Sounds good to me. Konstantin >=20 >=20 >=20 > > > > > > > > Since this is an example and reference code, hope developer can reuse > > > it smoothly. If they didn't notice ol_flags not be copied because ol_= flags is > > not changed in this example, they may take some time to debug their > > application. > > > > For that scenario it is not needed. > > Surely when user linking two packets manually (as we are doing here) it= is his > > responsibility to update the mbuf fileds properly. > > I think this is obvious thing and probably already mentioned in the doc= s. > > Konstantin > > > > > > > > This is a tiny change to the patch, I hope it cloud be done. > > > > > > Thanks, > > > Dong > > > > > > -----Original Message----- > > > From: Ananyev, Konstantin > > > Sent: Wednesday, November 14, 2018 18:18 > > > To: Wang, Dong1 ; Lipiec, Herakliusz > > > ; dev@dpdk.org > > > Cc: thomas@monjalon.net; Burakov, Anatoly > > ; > > > stable@dpdk.org > > > Subject: RE: [PATCH v2] example/ipv4_multicast: fix app hanging when > > > using clone > > > > > > > > > > > > > > Hi Konstantin, > > > > > > > > In this example, no flags be set by user, so no need to copy flags = from > > original mbuf. > > > > > > Then why to bother? > > > > > > > I'm thinking about some DPDK developers may create their own > > > > application based on this example, they add some flags before pack= et be > > cloned. > > > > > > Hmm you receive a packet change l2 header and transmit it. > > > What flags you might need to copy from original header considering th= at > > only RX flags would be set at present moment? > > > If you let say want to insert vlan tag (or so), then you'll have to s= et new TX > > flags. > > > Again, for timestamp you'll need to copy the timestamp value too, whi= ch > > we don't support in that example. > > > Konstantin > > > > > > > > > > > Regards, > > > > Dong > > > > > > > > -----Original Message----- > > > > From: Ananyev, Konstantin > > > > Sent: Wednesday, November 14, 2018 17:03 > > > > To: Wang, Dong1 ; Lipiec, Herakliusz > > > > ; dev@dpdk.org > > > > Cc: thomas@monjalon.net; Burakov, Anatoly > > > > ; stable@dpdk.org > > > > Subject: RE: [PATCH v2] example/ipv4_multicast: fix app hanging whe= n > > > > using clone > > > > > > > > Hi Dong, > > > > > > > > > Hi Herakliusz, > > > > > > > > > > Since pkt->ol_flags might set some other bits except > > > > > IND_ATTACHED_MBUF, how about set its value to original > > > > > pkt->ol_flag > > > > > > > > It could be done, but not sure what is the point? > > > > Which flags you think we need to copy from cloned mbuf (segment #2)= to > > new header? > > > > Konstantin > > > > > > > > > > > > > > Regards, > > > > > Dong > > > > > > > > > > -----Original Message----- > > > > > From: Lipiec, Herakliusz > > > > > Sent: Tuesday, November 13, 2018 19:49 > > > > > To: dev@dpdk.org > > > > > Cc: Ananyev, Konstantin ; Wang, > > > > > Dong1 ; thomas@monjalon.net; Burakov, > > > > > Anatoly ; Lipiec, Herakliusz > > > > > ; stable@dpdk.org > > > > > Subject: [PATCH v2] example/ipv4_multicast: fix app hanging when > > > > > using clone > > > > > > > > > > The ipv4_multicast sample application was dropping packets when > > > > > using mbuf clone. When creating an L2 header and copying metadata > > > > > from the source packet, the ol_flags were also copied along with > > > > > all the other metadata. Because the cloned packet had > > > > > IND_ATTACHED_MBUF > > > > flag set in its ol_flags, this caused the packets to never be freed= when > > using rte_pktmbuf_free. > > > > > Since copying ol_flags from the cloned packet is not necessary in= the > > first place, just don't do it. > > > > > > > > > > Fixes: af75078fece3 ("first public release") > > > > > CC: stable@dpdk.org > > > > > > > > > > Reported-by: Wang Dong > > > > > Signed-off-by: Herakliusz Lipiec > > > > > --- > > > > > doc/guides/sample_app_ug/ipv4_multicast.rst | 1 - > > > > > examples/ipv4_multicast/main.c | 2 -- > > > > > 2 files changed, 3 deletions(-) > > > > > > > > > > diff --git a/doc/guides/sample_app_ug/ipv4_multicast.rst > > > > > b/doc/guides/sample_app_ug/ipv4_multicast.rst > > > > > index ce1474ec7..f6efa7f6f 100644 > > > > > --- a/doc/guides/sample_app_ug/ipv4_multicast.rst > > > > > +++ b/doc/guides/sample_app_ug/ipv4_multicast.rst > > > > > @@ -319,7 +319,6 @@ It is the mcast_out_pkt() function that perfo= rms > > the packet duplication (either > > > > > hdr->pkt.in_port =3D pkt->pkt.in_port; > > > > > hdr->pkt.vlan_macip =3D pkt->pkt.vlan_macip; > > > > > hdr->pkt.hash =3D pkt->pkt.hash; > > > > > - hdr->ol_flags =3D pkt->ol_flags; > > > > > rte_mbuf_sanity_check(hdr, RTE_MBUF_PKT, 1); > > > > > > > > > > return hdr; > > > > > diff --git a/examples/ipv4_multicast/main.c > > > > > b/examples/ipv4_multicast/main.c index 4073a4907..428ca4694 10064= 4 > > > > > --- a/examples/ipv4_multicast/main.c > > > > > +++ b/examples/ipv4_multicast/main.c > > > > > @@ -266,8 +266,6 @@ mcast_out_pkt(struct rte_mbuf *pkt, int > > use_clone) > > > > > hdr->tx_offload =3D pkt->tx_offload; > > > > > hdr->hash =3D pkt->hash; > > > > > > > > > > - hdr->ol_flags =3D pkt->ol_flags; > > > > > - > > > > > __rte_mbuf_sanity_check(hdr, 1); > > > > > return hdr; > > > > > } > > > > > -- > > > > > 2.17.1