From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4474A0545 for ; Mon, 20 Jun 2022 07:23:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98F21427EB; Mon, 20 Jun 2022 07:23:46 +0200 (CEST) Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) by mails.dpdk.org (Postfix) with ESMTP id 95AE640150; Mon, 20 Jun 2022 07:23:43 +0200 (CEST) Received: by mail-vs1-f41.google.com with SMTP id r12so9602411vsg.8; Sun, 19 Jun 2022 22:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HVCSyAPLnxxpXX3wF1Y6zUWhicBL+y16bbvuFvnDCMA=; b=QrxZREGcq4axU4l1i9je6PoYRzHzG60TP/X5zWQFRW3VVu327gP548gHfv+bFSMy9b h8MR5k3iZfqer+CNh/93m64qKwcTKcn+Nz9jx7klV25CC+cOsJaxDWr7/Ckhbof4prdd m40DHpLoEEEQR0CEsV6hzJ2Yrjac+CHpTwkCORWnn8EIqKEAZICE7fw8yP3z/pBH/fUN b94FTKGOTVOB3pIhw9GTpZSEcrQ8cJ/1v54DN/wFL16GApsLy8rNvmbVoQD4idXt886U ROOKI5OyyrnixD7S6fuXu8in1EQ1m+0AkIFe38MF055yKsbaeeMN86fgNur7ZoEPLeZv 4EnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HVCSyAPLnxxpXX3wF1Y6zUWhicBL+y16bbvuFvnDCMA=; b=UDrBINRJ/Ls+FCb/mwzETvQdntlxcaOfJNti9CqnDWFOWlyS0JycCvKHM9zaWdQvVt uI+a5qPfGdeVyhrfnvsRlxs+8yT1ay/mDaEknAyUm0tlfGDEpDsgOrfx0pG4+gTeLc8b P0Fe1p+ibpA59u9UnLIOfqmBakasfcYxfw5Mi0WuFQ62JIZDGBJ9bJWeBrhKO8FhVtZG KAzIDi2yYlnAcb1ZdQsMZtI31vYSajy557ujO81KQSsD5ceudV2AF/2YDqV/mS2hUNu/ VHIIoLlrQSMyTrc2Pnj9b6RwfIiLcNQFX4O4TGXh2jbRtu4MKHA4V4E8gbiOBFaSmXbJ RvIA== X-Gm-Message-State: AJIora8GXggJK6kbzKnXyjZz72ojN0CIbvVXtJixEyGa6HcA5m/3gKZW niZ/n1sdIc0WFqggNnjM8xpzaghqACFSP5J2uPd+mXso5hk= X-Google-Smtp-Source: AGRyM1vDRxeOdLGKxDZRr9XU0Ay9Z20cvrpqRMg0RDXBIlWuv78qauG1l0E5uSITsABq3B4CkwQrXb5MqW+10Lsu1uo= X-Received: by 2002:a67:ff03:0:b0:34a:fa73:cd29 with SMTP id v3-20020a67ff03000000b0034afa73cd29mr8819549vsp.41.1655702622821; Sun, 19 Jun 2022 22:23:42 -0700 (PDT) MIME-Version: 1.0 References: <20220320101232.34438-1-kumaraparamesh92@gmail.com> <20220608095704.45375-1-kumaraparmesh92@gmail.com> <15ebcc9606c14f75a92a7498a3f78589@intel.com> <34203657d6c643ae9d9bc835285768d8@intel.com> In-Reply-To: <34203657d6c643ae9d9bc835285768d8@intel.com> From: kumaraparameshwaran rathinavel Date: Mon, 20 Jun 2022 10:53:31 +0530 Message-ID: Subject: Re: [PATCH v4] gro: bug fix in identifying fragmented packets To: "Hu, Jiayu" Cc: "dev@dpdk.org" , "stable@dpdk.org" Content-Type: multipart/alternative; boundary="000000000000afe01e05e1da4eba" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org --000000000000afe01e05e1da4eba Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Jiyau for the detailed explanation. I will make the changes as per your comments. Thanks, Kumara On Mon, Jun 20, 2022 at 8:27 AM Hu, Jiayu wrote: > Hi Kumara, > > > > IMO, TCP GSO will not use the flag. UDP GSO is the same as IP > fragmentation, > > and UDP fragments are treated as IP fragments. Except the first fragment, > the > > following fragments don=E2=80=99t have L4 header. RTE_PTYPE_L4_FRAG is se= t to > > recognize them as IP fragments fast. > > > > TCP GSO is different with IP fragmentation. All TCP segments have complet= e > > l2/l3/l4 headers. TCP GSO doesn=E2=80=99t use MF flag and offset field in= IP > header but use > > sequence number to reassemble. > > > > The case you mentioned below is IP fragmentation, not UDP GSO or TCP GSO. > > > > Thanks, > > Jiayu > > *From:* kumaraparameshwaran rathinavel > *Sent:* Friday, June 17, 2022 7:34 PM > *To:* Hu, Jiayu > *Cc:* dev@dpdk.org; stable@dpdk.org > *Subject:* Re: [PATCH v4] gro: bug fix in identifying fragmented packets > > > > > -----Original Message----- > > From: Kumara Parameshwaran > > Sent: Wednesday, June 8, 2022 5:57 PM > > To: Hu, Jiayu > > Cc: dev@dpdk.org; Kumara Parameshwaran > > ; stable@dpdk.org > > Subject: [PATCH v4] gro: bug fix in identifying fragmented packets > > > > From: Kumara Parameshwaran > > > > A packet with RTE_PTYPE_L4_FRAG(0x300) contains both RTE_PTYPE_L4_TCP > > (0x100) & RTE_PTYPE_L4_UDP (0x200). A fragmented packet as defined in > > rte_mbuf_ptype.h cannot be recognized as other L4 types and hence the > > GRO layer should not use IS_IPV4_TCP_PKT or IS_IPV4_UDP_PKT for > > RTE_PTYPE_L4_FRAG. Hence, if the packet type is RTE_PTYPE_L4_FRAG the i= p > > A simpler way is to add a "((ptype & RTE_PTYPE_L4_FRAG) !=3D > RTE_PTYPE_L4_FRAG))" > in IS_IPV4_VXLAN_TCP4_PKT and IS_IPV4_TCP_PKT to avoid processing IP > fragments > in TCP based GRO functions. For example: > #define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \ > ((ptype & RTE_PTYPE_L4_TCP) =3D=3D RTE_PTYPE_L4_TCP) && \ > ((ptype & RTE_PTYPE_L4_FRAG) !=3D RTE_PTYPE_L4_FRAG) && \ > (RTE_ETH_IS_TUNNEL_PKT(ptype) =3D=3D 0)) > > > > This would be handling only the UDP fragmentation case. What if there is > fragmentation of TCP packets? What happens if the packet is > RTE_PTYPE_L4_FRAG and in the struct rte_ipv4_hdr the proto type is > IPPROTO_TCP ? What happens to that case? > > > > > > On Sun, Jun 12, 2022 at 10:50 AM Hu, Jiayu wrote: > > Hi Kumara, > > > -----Original Message----- > > From: Kumara Parameshwaran > > Sent: Wednesday, June 8, 2022 5:57 PM > > To: Hu, Jiayu > > Cc: dev@dpdk.org; Kumara Parameshwaran > > ; stable@dpdk.org > > Subject: [PATCH v4] gro: bug fix in identifying fragmented packets > > > > From: Kumara Parameshwaran > > > > A packet with RTE_PTYPE_L4_FRAG(0x300) contains both RTE_PTYPE_L4_TCP > > (0x100) & RTE_PTYPE_L4_UDP (0x200). A fragmented packet as defined in > > rte_mbuf_ptype.h cannot be recognized as other L4 types and hence the > > GRO layer should not use IS_IPV4_TCP_PKT or IS_IPV4_UDP_PKT for > > RTE_PTYPE_L4_FRAG. Hence, if the packet type is RTE_PTYPE_L4_FRAG the i= p > > A simpler way is to add a "((ptype & RTE_PTYPE_L4_FRAG) !=3D > RTE_PTYPE_L4_FRAG))" > in IS_IPV4_VXLAN_TCP4_PKT and IS_IPV4_TCP_PKT to avoid processing IP > fragments > in TCP based GRO functions. For example: > #define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \ > ((ptype & RTE_PTYPE_L4_TCP) =3D=3D RTE_PTYPE_L4_TCP) && \ > ((ptype & RTE_PTYPE_L4_FRAG) !=3D RTE_PTYPE_L4_FRAG) && \ > (RTE_ETH_IS_TUNNEL_PKT(ptype) =3D=3D 0)) > > Thanks, > Jiayu > > > header should be parsed to recognize the appropriate IP type and invoke > the > > respective gro handler. > > > > Fixes: 1ca5e6740852 ("gro: support UDP/IPv4") > > Cc: stable@dpdk.org > > > > Signed-off-by: Kumara Parameshwaran > > --- > > v1: > > * Introduce IS_IPV4_FRAGMENT macro to check if fragmented packet and > > if true extract the IP header to identify the protocol type and > > invoke the appropriate gro handler. This is done for both > > rte_gro_reassemble and rte_gro_reassemble_burst APIs. > > v2,v3,v4: > > * Fix extra whitespace and column limit warnings > > > > lib/gro/rte_gro.c | 43 +++++++++++++++++++++++++++++++++++++++++-- > > 1 file changed, 41 insertions(+), 2 deletions(-) lib/gro/rte_gro.c | = 43 > > +++++++++++++++++++++++++++++++++++++++++-- > > 1 file changed, 41 insertions(+), 2 deletions(-) > > > > diff --git a/lib/gro/rte_gro.c b/lib/gro/rte_gro.c index > > 6f7dd4d709..83d6e21dbb 100644 > > --- a/lib/gro/rte_gro.c > > +++ b/lib/gro/rte_gro.c > > @@ -38,6 +38,9 @@ static gro_tbl_pkt_count_fn > > tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] =3D { > > ((ptype & RTE_PTYPE_L4_UDP) =3D=3D RTE_PTYPE_L4_UDP) && \ > > (RTE_ETH_IS_TUNNEL_PKT(ptype) =3D=3D 0)) > > > > +#define IS_IPV4_FRAGMENT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \ > > + ((ptype & RTE_PTYPE_L4_FRAG) =3D=3D RTE_PTYPE_L4_FRAG)) > > + > > #define IS_IPV4_VXLAN_TCP4_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) > > && \ > > ((ptype & RTE_PTYPE_L4_UDP) =3D=3D RTE_PTYPE_L4_UDP) && \ > > ((ptype & RTE_PTYPE_TUNNEL_VXLAN) =3D=3D \ @@ -240,7 > > +243,28 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts, > > * The timestamp is ignored, since all packets > > * will be flushed from the tables. > > */ > > - if (IS_IPV4_VXLAN_TCP4_PKT(pkts[i]->packet_type) && > > + if (IS_IPV4_FRAGMENT(pkts[i]->packet_type)) { > > + struct rte_ipv4_hdr ip4h_copy; > > + const struct rte_ipv4_hdr *ip4h =3D > > rte_pktmbuf_read(pkts[i], pkts[i]->l2_len, > > + > > sizeof(*ip4h), &ip4h_copy); > > + if (ip4h->next_proto_id =3D=3D IPPROTO_UDP && > > do_udp4_gro) { > > + ret =3D gro_udp4_reassemble(pkts[i], > > + &udp_tbl, 0); > > + if (ret > 0) > > + nb_after_gro--; > > + else if (ret < 0) > > + unprocess_pkts[unprocess_num++] = =3D > > pkts[i]; > > + } else if (ip4h->next_proto_id =3D=3D IPPROTO_TCP= && > > do_tcp4_gro) { > > + ret =3D gro_tcp4_reassemble(pkts[i], > > + &tcp_tbl, 0); > > + if (ret > 0) > > + nb_after_gro--; > > + else if (ret < 0) > > + unprocess_pkts[unprocess_num++] = =3D > > pkts[i]; > > + } else { > > + unprocess_pkts[unprocess_num++] =3D pkts[= i]; > > + } > > + } else if (IS_IPV4_VXLAN_TCP4_PKT(pkts[i]->packet_type) &= & > > do_vxlan_tcp_gro) { > > ret =3D gro_vxlan_tcp4_reassemble(pkts[i], > > &vxlan_tcp_tbl, 0= ); > > @@ -349,7 +373,22 @@ rte_gro_reassemble(struct rte_mbuf **pkts, > > current_time =3D rte_rdtsc(); > > > > for (i =3D 0; i < nb_pkts; i++) { > > - if (IS_IPV4_VXLAN_TCP4_PKT(pkts[i]->packet_type) && > > + if (IS_IPV4_FRAGMENT(pkts[i]->packet_type)) { > > + struct rte_ipv4_hdr ip4h_copy; > > + const struct rte_ipv4_hdr *ip4h =3D > > rte_pktmbuf_read(pkts[i], pkts[i]->l2_len, > > + > > sizeof(*ip4h), &ip4h_copy); > > + if (ip4h->next_proto_id =3D=3D IPPROTO_UDP && > > do_udp4_gro) { > > + if (gro_udp4_reassemble(pkts[i], udp_tbl, > > + current_time) < 0) > > + unprocess_pkts[unprocess_num++] = =3D > > pkts[i]; > > + } else if (ip4h->next_proto_id =3D=3D IPPROTO_TCP= && > > do_tcp4_gro) { > > + if (gro_tcp4_reassemble(pkts[i], tcp_tbl, > > + current_time) < 0) > > + unprocess_pkts[unprocess_num++] = =3D > > pkts[i]; > > + } else { > > + unprocess_pkts[unprocess_num++] =3D pkts[= i]; > > + } > > + } else if (IS_IPV4_VXLAN_TCP4_PKT(pkts[i]->packet_type) &= & > > do_vxlan_tcp_gro) { > > if (gro_vxlan_tcp4_reassemble(pkts[i], > vxlan_tcp_tbl, > > current_time) < 0) > > -- > > 2.25.1 > > --000000000000afe01e05e1da4eba Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Jiyau for the detailed explanation. I will mak= e the changes as per your comments.

Thanks,
Kumara

On Mon, Jun 20, 2022 at 8:27 AM Hu, Jiayu <jiayu.hu@intel.com> wrote:

Hi Kumara,

=C2=A0

IMO, TCP GSO will not use the flag. UDP GSO is the s= ame as IP fragmentation,

and UDP fragments are treated as IP fragments. Excep= t the first fragment, the

following fragments don=E2=80=99t have L4 header. RT= E_PTYPE_L4_FRAG is set to

recognize them as IP fragments fast.

=C2=A0

TCP GSO is different with IP fragmentation. All TCP = segments have complete

l2/l3/l4 headers. TCP GSO doesn=E2=80=99t use MF fla= g and offset field in IP header but use

sequence number to reassemble.

=C2=A0

The case you mentioned below is IP fragmentation, no= t UDP GSO or TCP GSO.

=C2=A0

Thanks,

Jiayu

=C2=A0

> -----Original Message-----
> From: Kumara Param= eshwaran <
kumaraparamesh92@gmail.com>
> Sent: Wednesday, J= une 8, 2022 5:57 PM
> To: Hu, Jiayu <= jiayu.hu@intel.com<= /a>>
> Cc:
dev@dpdk.org; Kumara Parameshwaran<= /span>
> <kumaraparamesh92@gmail.co= m>; stable@dpdk.org
> Subject: [PATCH v4= ] gro: bug fix in identifying fr= agmented packets

>
> From: Kumara Param= eshwaran <kumaraparamesh92@gmail.com>
>
> A packet with RTE_= PTYPE_L4_FRAG(0x300) contains both RTE_PTYPE_L4_TCP
> (0x100) & RTE_= PTYPE_L4_UDP (0x200). A fragmented packet as defined in
> rte_mbuf_ptype.h c= annot be recognized as other L4 types and hence the
> GRO layer should not use IS_IPV4_TCP_PKT or IS_IPV= 4_UDP_PKT for
> RTE_PTYPE_L4_FRAG.= Hence, if the packet type is RTE_PTYPE_L4_FRAG the ip=

A simpler way is to add a "((ptype & RTE_PT= YPE_L4_FRAG) !=3D RTE_PTYPE_L4_FRAG))"
in IS_IPV4_VXLAN_TCP4_PKT and IS_IPV4_TCP_PKT to avoid processing IP fragme= nts
in TCP based GRO= functions. For example:
#define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((ptype & RTE_P= TYPE_L4_TCP) =3D=3D RTE_PTYPE_L4_TCP) && \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((ptype & RTE_PTYPE_L4_FRAG) !=3D RTE_PTYPE= _L4_FRAG) && \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (RTE_ETH_IS_TUNNEL_= PKT(ptype) =3D=3D 0))

=C2=A0

This would be handling only the UDP fragmentation ca= se. What if there is fragmentation of TCP packets?=C2=A0 What happens if th= e packet is RTE_PTYPE_L4_FRAG and in the=C2=A0 struct rte_ipv4_hdr the prot= o type is IPPROTO_TCP ? What happens to that case?

=C2=A0

=C2=A0

On Sun, Jun 12, 2022 at 10:50 AM Hu, Jiayu <jiayu.hu@intel.com&g= t; wrote:

Hi Kumara,

> -----Original Message-----
> From: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
> Sent: Wednesday, June 8, 2022 5:57 PM
> To: Hu, Jiayu <jiayu.hu@intel.com>
> Cc: dev@dpdk.org= ; Kumara Parameshwaran
> <ku= maraparamesh92@gmail.com>; stable@dpdk.org > Subject: [PATCH v4] gro: bug fix in identifying fragmented packets
>
> From: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
>
> A packet with RTE_PTYPE_L4_FRAG(0x300) contains both RTE_PTYPE_L4_TCP<= br> > (0x100) & RTE_PTYPE_L4_UDP (0x200). A fragmented packet as defined= in
> rte_mbuf_ptype.h cannot be recognized as other L4 types and hence the<= br> > GRO layer should not use IS_IPV4_TCP_PKT or IS_IPV4_UDP_PKT for
> RTE_PTYPE_L4_FRAG. Hence, if the packet type is RTE_PTYPE_L4_FRAG the = ip

A simpler way is to add a "((ptype & RTE_PTYPE_L4_FRAG) !=3D RTE_P= TYPE_L4_FRAG))"
in IS_IPV4_VXLAN_TCP4_PKT and IS_IPV4_TCP_PKT to avoid processing IP fragme= nts
in TCP based GRO functions. For example:
#define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((ptype & RTE_P= TYPE_L4_TCP) =3D=3D RTE_PTYPE_L4_TCP) && \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((ptype & RTE_PTYPE_L4_FRAG) !=3D RTE_PTYPE= _L4_FRAG) && \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (RTE_ETH_IS_TUNNEL_= PKT(ptype) =3D=3D 0))

Thanks,
Jiayu

> header should be parsed to recognize the appropriate IP type and invok= e the
> respective gro handler.
>
> Fixes: 1ca5e6740852 ("gro: support UDP/IPv4")
> Cc: stable@dpdk.o= rg
>
> Signed-off-by: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
> ---
> v1:
> * Introduce IS_IPV4_FRAGMENT macro to check if fragmented packet and >=C2=A0 =C2=A0if true extract the IP header to identify the protocol typ= e and
>=C2=A0 =C2=A0invoke the appropriate gro handler. This is done for both<= br> >=C2=A0 =C2=A0rte_gro_reassemble and rte_gro_reassemble_burst APIs.
> v2,v3,v4:
> * Fix extra whitespace and column limit warnings
>
>=C2=A0 lib/gro/rte_gro.c | 43 +++++++++++++++++++++++++++++++++++++++++= --
>=C2=A0 1 file changed, 41 insertions(+), 2 deletions(-)=C2=A0 lib/gro/r= te_gro.c | 43
> +++++++++++++++++++++++++++++++++++++++++--
>=C2=A0 1 file changed, 41 insertions(+), 2 deletions(-)
>
> diff --git a/lib/gro/rte_gro.c b/lib/gro/rte_gro.c index
> 6f7dd4d709..83d6e21dbb 100644
> --- a/lib/gro/rte_gro.c
> +++ b/lib/gro/rte_gro.c
> @@ -38,6 +38,9 @@ static gro_tbl_pkt_count_fn
> tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] =3D {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((ptype & RT= E_PTYPE_L4_UDP) =3D=3D RTE_PTYPE_L4_UDP) && \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(RTE_ETH_IS_TUNN= EL_PKT(ptype) =3D=3D 0))
>
> +#define IS_IPV4_FRAGMENT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) &&= ; \
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((ptype & RTE_PTY= PE_L4_FRAG) =3D=3D RTE_PTYPE_L4_FRAG))
> +
>=C2=A0 #define IS_IPV4_VXLAN_TCP4_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype= )
> && \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((ptype & RT= E_PTYPE_L4_UDP) =3D=3D RTE_PTYPE_L4_UDP) && \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((ptype & RT= E_PTYPE_TUNNEL_VXLAN) =3D=3D \ @@ -240,7
> +243,28 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * The timestamp= is ignored, since all packets
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * will be flush= ed from the tables.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (IS_IPV4_VXLAN_TCP= 4_PKT(pkts[i]->packet_type) &&
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (IS_IPV4_FRAGMENT(= pkts[i]->packet_type)) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0struct rte_ipv4_hdr ip4h_copy;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0const struct rte_ipv4_hdr *ip4h =3D
> rte_pktmbuf_read(pkts[i], pkts[i]->l2_len,
> +
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof= (*ip4h), &ip4h_copy);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0if (ip4h->next_proto_id =3D=3D IPPROTO_UDP &&
> do_udp4_gro) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D gro_udp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0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (IS_IPV4_VX= LAN_TCP4_PKT(pkts[i]->packet_type) &&
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0do_vxlan_tcp_gro) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0ret =3D gro_vxlan_tcp4_reassemble(pkts[i],
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&vxlan_tcp_tbl, 0);=
> @@ -349,7 +373,22 @@ rte_gro_reassemble(struct rte_mbuf **pkts,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0current_time =3D rte_rdtsc();
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < nb_pkts; i++) {
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (IS_IPV4_VXLAN_TCP= 4_PKT(pkts[i]->packet_type) &&
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (IS_IPV4_FRAGMENT(= pkts[i]->packet_type)) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0struct rte_ipv4_hdr ip4h_copy;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0const struct rte_ipv4_hdr *ip4h =3D
> rte_pktmbuf_read(pkts[i], pkts[i]->l2_len,
> +
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof= (*ip4h), &ip4h_copy);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0if (ip4h->next_proto_id =3D=3D IPPROTO_UDP &&
> do_udp4_gro) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (gro_udp4_reassemble(pkts[i], udp_tbl= ,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0current_time) < 0)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unprocess_pk= ts[unprocess_num++] =3D
> pkts[i];
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0} else if (ip4h->next_proto_id =3D=3D IPPROTO_TCP &&
> do_tcp4_gro) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (gro_tcp4_reassemble(pkts[i], tcp_tbl= ,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0current_time) < 0)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unprocess_pk= ts[unprocess_num++] =3D
> pkts[i];
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0} else {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unprocess_pkts[unprocess_num++] =3D pkts= [i];
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0}
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (IS_IPV4_VX= LAN_TCP4_PKT(pkts[i]->packet_type) &&
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0do_vxlan_tcp_gro) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0if (gro_vxlan_tcp4_reassemble(pkts[i], vxlan_tcp_tbl,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0current_time) < 0)
> --
> 2.25.1

--000000000000afe01e05e1da4eba--