From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id A0D2B23C; Mon, 23 Apr 2018 06:13:55 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Apr 2018 21:13:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,316,1520924400"; d="scan'208";a="35368094" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga007.jf.intel.com with ESMTP; 22 Apr 2018 21:13:51 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 22 Apr 2018 21:13:51 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 22 Apr 2018 21:13:51 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.79]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.6]) with mapi id 14.03.0319.002; Mon, 23 Apr 2018 12:13:49 +0800 From: "Hu, Jiayu" To: Ophir Munk , "dev@dpdk.org" , "Ananyev, Konstantin" CC: Thomas Monjalon , Olga Shern , Pascal Mazon , "stable@dpdk.org" Thread-Topic: [PATCH v1] gso: fix marking TCP checksum flag in TCP segments Thread-Index: AQHT2kUwrRaOfU8u0kiaQvDey+ryN6QNovUw Date: Mon, 23 Apr 2018 04:13:48 +0000 Message-ID: References: <1524406859-29585-1-git-send-email-ophirmu@mellanox.com> In-Reply-To: <1524406859-29585-1-git-send-email-ophirmu@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmM2MjQzOWEtYWY3Ny00OTBhLTg4YmYtYmRkNTYwYzQ1MTUyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjhDVmF3NjJNNlpBMjhVa3RDaXdteEVGanJkUm9HNkNtTTJ2ZDBHbGtnY3c9In0= x-ctpclassification: CTP_NT x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH v1] gso: fix marking TCP checksum flag in TCP segments X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 04:13:57 -0000 Hi Ophir, In the GSO design, the GSO library doesn't care about checksums, which means it doesn't check if input packets have correct checksums, and it doesn't do any checksum related work for the output GSO segments. It depends on the callers to use HW or SW checksum calculation for output packets. This is why the GSO library doesn't set PKT_TX_TCP_CKSUM. So I don't think it's a bug. In my opinion, it's not a good idea to enable HW TCP checksum calculation silently, and without the aware of the caller. In fact, the caller always k= now it does SW TSO (i.e. GSO), instead of real HW TSO. If the caller wants HW chec= ksum calculation, it can add PKT_TX_TCP_CKSUM to ol_flags before or after callin= g the GSO library. Add Konstantin for more suggestions. Thanks, Jiayu > -----Original Message----- > From: Ophir Munk [mailto:ophirmu@mellanox.com] > Sent: Sunday, April 22, 2018 10:21 PM > To: dev@dpdk.org; Hu, Jiayu > Cc: Thomas Monjalon ; Olga Shern > ; Pascal Mazon ; Ophir > Munk ; stable@dpdk.org > Subject: [PATCH v1] gso: fix marking TCP checksum flag in TCP segments >=20 > Large TCP packets which are marked with PKT_TX_TCP_SEG flag are > segmented and the flag is cleared in the resulting segments, however, > the segments checksum is not updated. It is therefore required to set > the PKT_TX_TCP_CKSUM flag in each TCP segment in order to mark for the > sending driver the need to update the TCP checksum before transmitting > the segment. >=20 > Fixes: 119583797b6a ("gso: support TCP/IPv4 GSO") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ophir Munk > --- > lib/librte_gso/rte_gso.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/lib/librte_gso/rte_gso.c b/lib/librte_gso/rte_gso.c > index a44e3d4..e9ce9ce 100644 > --- a/lib/librte_gso/rte_gso.c > +++ b/lib/librte_gso/rte_gso.c > @@ -50,12 +50,14 @@ rte_gso_segment(struct rte_mbuf *pkt, > ((IS_IPV4_GRE_TCP4(pkt->ol_flags) && > (gso_ctx->gso_types & > DEV_TX_OFFLOAD_GRE_TNL_TSO)))) { > pkt->ol_flags &=3D (~PKT_TX_TCP_SEG); > + pkt->ol_flags |=3D PKT_TX_TCP_CKSUM; > ret =3D gso_tunnel_tcp4_segment(pkt, gso_size, ipid_delta, > direct_pool, indirect_pool, > pkts_out, nb_pkts_out); > } else if (IS_IPV4_TCP(pkt->ol_flags) && > (gso_ctx->gso_types & > DEV_TX_OFFLOAD_TCP_TSO)) { > pkt->ol_flags &=3D (~PKT_TX_TCP_SEG); > + pkt->ol_flags |=3D PKT_TX_TCP_CKSUM; > ret =3D gso_tcp4_segment(pkt, gso_size, ipid_delta, > direct_pool, indirect_pool, > pkts_out, nb_pkts_out); > -- > 2.7.4