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 574DCA0093 for ; Fri, 17 Jun 2022 13:34:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39AD440698; Fri, 17 Jun 2022 13:34:01 +0200 (CEST) Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42]) by mails.dpdk.org (Postfix) with ESMTP id EDA5B40698; Fri, 17 Jun 2022 13:33:59 +0200 (CEST) Received: by mail-vs1-f42.google.com with SMTP id j39so3799625vsv.11; Fri, 17 Jun 2022 04:33:59 -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=Ka48FVoheIZLOq860j4ImetbmLjA0P29G9o7NM2Ucpo=; b=o6anM1n8vO/omcoD37AcYeHCfR3nBHcmqvAplh0QG7uJRedGXbezYeun3iSmCE2k38 L0AIw/hhcPcchydYs7mtcLjTNt0trJFij4xhe7AyJksX29oAABxMi8WtHK1NOUP+85yG QNpm6J7S0SDuw89+4WVEACrPy/8aIL5vH1+YlmwHMhZUJLLT05gVwzwe2Zrs0RhrbxuB P8juonBViNGTVIoCgN1JCeqYGF+4styEIt/sI1D8Ln4nzWi8UvVhcUUOOgb0iJrBHXCV PZhzgaZgzoH/0XZoxbaOR2sBZmjSiZv2JsvNKWRJfOrQx8kDwP4D7rk1Jxh+s6W660xG 4o6Q== 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=Ka48FVoheIZLOq860j4ImetbmLjA0P29G9o7NM2Ucpo=; b=yCbe+7UMxyMoyL9QHeg25lxZTnxM4MHPsKFQgi3TeQgp/FbUBY7KIqLsvrrddDLcQO vpl7Ai9/x4W6WDnYtxWX2dsYiFCLzybjBIvZhpHaJs9AKr5wgRLoj2Y18XqyoKNbdRas 6U+W8vzttk5ENK89g81CI6pYspnZ28YknIqGo42ghHR98f02qsU7YgYHo0a0unitvMYB vl2HnE0VQCjXgIk7ZRFk3w06YhNKwubpQ+nUmXbO8AFlwDUOhAHULGlCrnTb55e8ZApq DRgWokj7UDFtfhZkPZZJFEsGLL88L4NC+r0OVdlMPD2RRngmd8txsnCtnurWn1eyJqoi /frg== X-Gm-Message-State: AJIora/k9RUQTNTyEwW4bGu+e+Jym1mtyvXa0WEQc4rEWVfDppX0j1na xG6/Vd7aKXj6KSg1x/04LOnNTsHpsF3I+qv2Z3M05Yki/ZSqLw== X-Google-Smtp-Source: AGRyM1s7AslIzvz06GdgtTbbN9r47yuebxrxdnL6hTk4dX7poNY+wfy5MrFQXhqrUX9YMg6VLD+C2szPQ0/t7r8EUmo= X-Received: by 2002:a67:b706:0:b0:34c:2d90:249 with SMTP id h6-20020a67b706000000b0034c2d900249mr3823911vsf.79.1655465639234; Fri, 17 Jun 2022 04:33:59 -0700 (PDT) MIME-Version: 1.0 References: <20220320101232.34438-1-kumaraparamesh92@gmail.com> <20220608095704.45375-1-kumaraparmesh92@gmail.com> <15ebcc9606c14f75a92a7498a3f78589@intel.com> In-Reply-To: <15ebcc9606c14f75a92a7498a3f78589@intel.com> From: kumaraparameshwaran rathinavel Date: Fri, 17 Jun 2022 17:03:47 +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="0000000000005d50b605e1a32115" 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 --0000000000005d50b605e1a32115 Content-Type: text/plain; charset="UTF-8" > -----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 ip A simpler way is to add a "((ptype & RTE_PTYPE_L4_FRAG) != > 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) == RTE_PTYPE_L4_TCP) && \ > ((ptype & RTE_PTYPE_L4_FRAG) != RTE_PTYPE_L4_FRAG) && \ > (RTE_ETH_IS_TUNNEL_PKT(ptype) == 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 ip > > A simpler way is to add a "((ptype & RTE_PTYPE_L4_FRAG) != > 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) == RTE_PTYPE_L4_TCP) && \ > ((ptype & RTE_PTYPE_L4_FRAG) != RTE_PTYPE_L4_FRAG) && \ > (RTE_ETH_IS_TUNNEL_PKT(ptype) == 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] = { > > ((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP) && \ > > (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0)) > > > > +#define IS_IPV4_FRAGMENT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \ > > + ((ptype & RTE_PTYPE_L4_FRAG) == RTE_PTYPE_L4_FRAG)) > > + > > #define IS_IPV4_VXLAN_TCP4_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) > > && \ > > ((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP) && \ > > ((ptype & RTE_PTYPE_TUNNEL_VXLAN) == \ @@ -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 = > > rte_pktmbuf_read(pkts[i], pkts[i]->l2_len, > > + > > sizeof(*ip4h), &ip4h_copy); > > + if (ip4h->next_proto_id == IPPROTO_UDP && > > do_udp4_gro) { > > + ret = gro_udp4_reassemble(pkts[i], > > + &udp_tbl, 0); > > + if (ret > 0) > > + nb_after_gro--; > > + else if (ret < 0) > > + unprocess_pkts[unprocess_num++] = > > pkts[i]; > > + } else if (ip4h->next_proto_id == IPPROTO_TCP && > > do_tcp4_gro) { > > + ret = gro_tcp4_reassemble(pkts[i], > > + &tcp_tbl, 0); > > + if (ret > 0) > > + nb_after_gro--; > > + else if (ret < 0) > > + unprocess_pkts[unprocess_num++] = > > pkts[i]; > > + } else { > > + unprocess_pkts[unprocess_num++] = pkts[i]; > > + } > > + } else if (IS_IPV4_VXLAN_TCP4_PKT(pkts[i]->packet_type) && > > do_vxlan_tcp_gro) { > > ret = gro_vxlan_tcp4_reassemble(pkts[i], > > &vxlan_tcp_tbl, 0); > > @@ -349,7 +373,22 @@ rte_gro_reassemble(struct rte_mbuf **pkts, > > current_time = rte_rdtsc(); > > > > for (i = 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 = > > rte_pktmbuf_read(pkts[i], pkts[i]->l2_len, > > + > > sizeof(*ip4h), &ip4h_copy); > > + if (ip4h->next_proto_id == IPPROTO_UDP && > > do_udp4_gro) { > > + if (gro_udp4_reassemble(pkts[i], udp_tbl, > > + current_time) < 0) > > + unprocess_pkts[unprocess_num++] = > > pkts[i]; > > + } else if (ip4h->next_proto_id == IPPROTO_TCP && > > do_tcp4_gro) { > > + if (gro_tcp4_reassemble(pkts[i], tcp_tbl, > > + current_time) < 0) > > + unprocess_pkts[unprocess_num++] = > > pkts[i]; > > + } else { > > + unprocess_pkts[unprocess_num++] = 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 > > --0000000000005d50b605e1a32115 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> -----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 id= entifying 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_P= KT 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))

This would be handlin= g only the UDP fragmentation case. What if there is fragmentation of TCP pa= ckets?=C2=A0 What happens if the packet is RTE_PTYPE_L4_FRAG and in the=C2= =A0 struct rte_ipv4_hdr the proto type is IPPROTO_TCP ? What happens to tha= t case?

On Sun, Jun 12, 2022 at 10:50 AM Hu, Jiayu <jiayu.hu@intel.com> 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_udp4_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 =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=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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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

--0000000000005d50b605e1a32115--