From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EFD08A04B0; Sun, 27 Sep 2020 03:49:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 51EEC1D6CA; Sun, 27 Sep 2020 03:49:46 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id B42DE1D6C1 for ; Sun, 27 Sep 2020 03:49:44 +0200 (CEST) IronPort-SDR: oW4zlCnnDhSWoRaEo0YCWCrZbiHEuWtDJRSEVq9tCxdtEWfzEwiavm80P60phKEylpL/Ec6HL7 lqheFl4Ht+rw== X-IronPort-AV: E=McAfee;i="6000,8403,9756"; a="246576064" X-IronPort-AV: E=Sophos;i="5.77,308,1596524400"; d="scan'208";a="246576064" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2020 18:49:42 -0700 IronPort-SDR: kqkLBnmXb7H4/vYfXttvDGn36NSiQxOOYL/qCwg9P2t/76rvdIXCwpChNJGigPRU482yq+0ExG Fv7uvOIFQhZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,308,1596524400"; d="scan'208";a="456373778" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga004.jf.intel.com with ESMTP; 26 Sep 2020 18:49:41 -0700 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 26 Sep 2020 18:49:40 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 27 Sep 2020 09:49:37 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Sun, 27 Sep 2020 09:49:37 +0800 From: "Hu, Jiayu" To: "yang_y_yi@163.com" , "dev@dpdk.org" CC: "thomas@monjalon.net" , "yangyi01@inspur.com" Thread-Topic: [PATCH v7 2/3] gro: add VXLAN UDP/IPv4 GRO support Thread-Index: AQHWklDLTl/gzeIEP0mB/JIDEtNw8Kl7ud8A Date: Sun, 27 Sep 2020 01:49:37 +0000 Message-ID: References: <20200924085740.270192-1-yang_y_yi@163.com> <20200924085740.270192-3-yang_y_yi@163.com> In-Reply-To: <20200924085740.270192-3-yang_y_yi@163.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v7 2/3] gro: add VXLAN UDP/IPv4 GRO support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 Yi, Just a small issue, and please see it inline. After change it, you can add my ack in the serial patches. Thanks, Jiayu > -----Original Message----- > From: yang_y_yi@163.com > Sent: Thursday, September 24, 2020 4:58 PM > To: dev@dpdk.org > Cc: Hu, Jiayu ; thomas@monjalon.net; > yangyi01@inspur.com; yang_y_yi@163.com > Subject: [PATCH v7 2/3] gro: add VXLAN UDP/IPv4 GRO support >=20 > From: Yi Yang >=20 > VXLAN UDP/IPv4 GRO can help improve VM-to-VM UDP > performance when UFO or GSO is enabled in VM, GRO > must be supported if UFO or GSO is enabled, > otherwise, performance can't get big improvement > if only GSO is there. >=20 > With this enabled in DPDK, OVS DPDK can leverage it > to improve VM-to-VM UDP performance, it will reassemble > VXLAN UDP/IPv4 fragments immediate after they are > received from a physical NIC. It is very helpful in > OVS DPDK VXLAN use case. >=20 > Signed-off-by: Yi Yang > diff --git a/lib/librte_gro/rte_gro.c b/lib/librte_gro/rte_gro.c > index ac23df1..e56bd20 100644 > --- a/lib/librte_gro/rte_gro.c > +++ b/lib/librte_gro/rte_gro.c > @@ -11,6 +11,7 @@ > #include "gro_tcp4.h" > #include "gro_udp4.h" > #include "gro_vxlan_tcp4.h" > +#include "gro_vxlan_udp4.h" >=20 > typedef void *(*gro_tbl_create_fn)(uint16_t socket_id, > uint16_t max_flow_num, > @@ -20,14 +21,14 @@ >=20 > static gro_tbl_create_fn tbl_create_fn[RTE_GRO_TYPE_MAX_NUM] =3D { > gro_tcp4_tbl_create, gro_vxlan_tcp4_tbl_create, > - gro_udp4_tbl_create, NULL}; > + gro_udp4_tbl_create, gro_vxlan_udp4_tbl_create, NULL}; > static gro_tbl_destroy_fn tbl_destroy_fn[RTE_GRO_TYPE_MAX_NUM] =3D { > gro_tcp4_tbl_destroy, gro_vxlan_tcp4_tbl_destroy, > - gro_udp4_tbl_destroy, > + gro_udp4_tbl_destroy, gro_vxlan_udp4_tbl_destroy, > NULL}; > static gro_tbl_pkt_count_fn tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] =3D > { > gro_tcp4_tbl_pkt_count, > gro_vxlan_tcp4_tbl_pkt_count, > - gro_udp4_tbl_pkt_count, > + gro_udp4_tbl_pkt_count, > gro_vxlan_udp4_tbl_pkt_count, > NULL}; >=20 > #define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \ > @@ -47,6 +48,16 @@ > RTE_PTYPE_INNER_L3_IPV4_EXT | \ > RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN)) !=3D 0)) >=20 > +#define IS_IPV4_VXLAN_UDP4_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 \ > + RTE_PTYPE_TUNNEL_VXLAN) && \ > + ((ptype & RTE_PTYPE_INNER_L4_UDP) =3D=3D \ > + RTE_PTYPE_INNER_L4_UDP) && \ > + (((ptype & RTE_PTYPE_INNER_L3_MASK) & \ > + (RTE_PTYPE_INNER_L3_IPV4 | \ > + RTE_PTYPE_INNER_L3_IPV4_EXT | \ > + RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN)) !=3D 0)) >=20 > /* > * GRO context structure. It keeps the table structures, which are > @@ -137,19 +148,27 @@ struct gro_ctx { > struct gro_udp4_item udp_items[RTE_GRO_MAX_BURST_ITEM_NUM] > =3D {{0} }; >=20 > /* Allocate a reassembly table for VXLAN TCP GRO */ > - struct gro_vxlan_tcp4_tbl vxlan_tbl; > - struct gro_vxlan_tcp4_flow > vxlan_flows[RTE_GRO_MAX_BURST_ITEM_NUM]; > - struct gro_vxlan_tcp4_item > vxlan_items[RTE_GRO_MAX_BURST_ITEM_NUM] > + struct gro_vxlan_tcp4_tbl vxlan_tcp_tbl; > + struct gro_vxlan_tcp4_flow > vxlan_tcp_flows[RTE_GRO_MAX_BURST_ITEM_NUM]; > + struct gro_vxlan_tcp4_item > vxlan_tcp_items[RTE_GRO_MAX_BURST_ITEM_NUM] > =3D {{{0}, 0, 0} }; >=20 > + /* Allocate a reassembly table for VXLAN UDP GRO */ > + struct gro_vxlan_udp4_tbl vxlan_udp_tbl; > + struct gro_vxlan_udp4_flow > vxlan_udp_flows[RTE_GRO_MAX_BURST_ITEM_NUM]; > + struct gro_vxlan_udp4_item > vxlan_udp_items[RTE_GRO_MAX_BURST_ITEM_NUM] > + =3D {{{0}} }; It seems you need add a space after the "}", and this is found by checkpatc= h. > + > struct rte_mbuf *unprocess_pkts[nb_pkts]; > uint32_t item_num; > int32_t ret; > uint16_t i, unprocess_num =3D 0, nb_after_gro =3D nb_pkts; > - uint8_t do_tcp4_gro =3D 0, do_vxlan_gro =3D 0, do_udp4_gro =3D 0; > + uint8_t do_tcp4_gro =3D 0, do_vxlan_tcp_gro =3D 0, do_udp4_gro =3D 0, > + do_vxlan_udp_gro =3D 0; >=20 > if (unlikely((param->gro_types & (RTE_GRO_IPV4_VXLAN_TCP_IPV4 | > RTE_GRO_TCP_IPV4 | > + RTE_GRO_IPV4_VXLAN_UDP_IPV4 | > RTE_GRO_UDP_IPV4)) =3D=3D 0)) > return nb_pkts; >=20 > @@ -160,15 +179,28 @@ struct gro_ctx { >=20 > if (param->gro_types & RTE_GRO_IPV4_VXLAN_TCP_IPV4) { > for (i =3D 0; i < item_num; i++) > - vxlan_flows[i].start_index =3D INVALID_ARRAY_INDEX; > - > - vxlan_tbl.flows =3D vxlan_flows; > - vxlan_tbl.items =3D vxlan_items; > - vxlan_tbl.flow_num =3D 0; > - vxlan_tbl.item_num =3D 0; > - vxlan_tbl.max_flow_num =3D item_num; > - vxlan_tbl.max_item_num =3D item_num; > - do_vxlan_gro =3D 1; > + vxlan_tcp_flows[i].start_index =3D > INVALID_ARRAY_INDEX; > + > + vxlan_tcp_tbl.flows =3D vxlan_tcp_flows; > + vxlan_tcp_tbl.items =3D vxlan_tcp_items; > + vxlan_tcp_tbl.flow_num =3D 0; > + vxlan_tcp_tbl.item_num =3D 0; > + vxlan_tcp_tbl.max_flow_num =3D item_num; > + vxlan_tcp_tbl.max_item_num =3D item_num; > + do_vxlan_tcp_gro =3D 1; > + } > +