From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Lipiec, Herakliusz" Subject: Re: [PATCH v2] example/ipv4_multicast: fix app hanging when using clone Date: Wed, 14 Nov 2018 10:21:09 +0000 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "thomas@monjalon.net" , "Burakov, Anatoly" , "stable@dpdk.org" To: "Wang, Dong1" , "Ananyev, Konstantin" , "dev@dpdk.org" Return-path: In-Reply-To: <3E2E5017C928014B90FD7864A64F0B5514F74E83@SHSMSX103.ccr.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Dong, I think that if a developer is to manipulate ol_flags, then its onto that d= eveloper to take care of copying ol_flags . Regards Herakliusz > -----Original Message----- > From: Wang, Dong1 > Sent: Wednesday, November 14, 2018 10:09 AM > To: Ananyev, Konstantin ; Lipiec, Heraklius= z > ; dev@dpdk.org > Cc: thomas@monjalon.net; Burakov, Anatoly ; > stable@dpdk.org > Subject: RE: [PATCH v2] example/ipv4_multicast: fix app hanging when usin= g > clone >=20 > Hi Konstantin, >=20 > In this example, no flags be set by user, so no need to copy flags from o= riginal > mbuf. > I'm thinking about some DPDK developers may create their own application > based on this example, they add some flags before packet be cloned. >=20 > Regards, > Dong >=20 > -----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 when usin= g > clone >=20 > Hi Dong, >=20 > > 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 >=20 > 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 >=20 > > > > 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 f= irst > 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 performs th= e > 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 100644 > > --- 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