[dpdk-stable] [PATCH v2] example/ipv4_multicast: fix app hanging when using clone

Ananyev, Konstantin konstantin.ananyev at intel.com
Wed Nov 14 11:17:47 CET 2018


> 
> 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 packet be
> cloned.

Hmm you receive a packet change l2 header and transmit it.
What flags you might need to copy from original header 
considering that 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 set new TX flags. 
Again, for timestamp you'll need to copy the timestamp value too,
which 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 <dong1.wang at intel.com>; Lipiec, Herakliusz <herakliusz.lipiec at intel.com>; dev at dpdk.org
> Cc: thomas at monjalon.net; Burakov, Anatoly <anatoly.burakov at intel.com>; stable at dpdk.org
> Subject: RE: [PATCH v2] example/ipv4_multicast: fix app hanging when 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 at dpdk.org
> > Cc: Ananyev, Konstantin <konstantin.ananyev at intel.com>; Wang, Dong1
> > <dong1.wang at intel.com>; thomas at monjalon.net; Burakov, Anatoly
> > <anatoly.burakov at intel.com>; Lipiec, Herakliusz
> > <herakliusz.lipiec at intel.com>; stable at 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 at dpdk.org
> >
> > Reported-by: Wang Dong <dong1.wang at intel.com>
> > Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec at intel.com>
> > ---
> >  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 the packet duplication (either
> >          hdr->pkt.in_port = pkt->pkt.in_port;
> >          hdr->pkt.vlan_macip = pkt->pkt.vlan_macip;
> >          hdr->pkt.hash = pkt->pkt.hash;
> > -        hdr->ol_flags = 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 = pkt->tx_offload;
> >  	hdr->hash = pkt->hash;
> >
> > -	hdr->ol_flags = pkt->ol_flags;
> > -
> >  	__rte_mbuf_sanity_check(hdr, 1);
> >  	return hdr;
> >  }
> > --
> > 2.17.1



More information about the stable mailing list