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 0D0BCA0503 for ; Tue, 17 May 2022 18:03:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3E6141109; Tue, 17 May 2022 18:03:53 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id D1A134003C; Tue, 17 May 2022 18:03:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652803432; x=1684339432; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Av8VTRbb0drvU59U7d+d1Dqgf9ZAqBOugKdgfwu51+0=; b=lSALGFZpo3N+4V2pk6KZBipyzheibitVFHw7IpnP5ufi0Es1gPPMwOkL jSEfE8OoPU4GFm1FfnUB94ULqAq8FluYMNMFF15hoEYWZDe01un1v9v9Y 8D8v8HD2DKal7IuRlMemr/+yOuCIGzFeSy0twkXT+aGnqgR9tEyMTgYIp Di0aq10l2ISv6E58xSqreYPZuoIORxPJJ8aCluSgXktWNrxUTXE7LUY/T SXN5NjoxIJFcAe+X5/q6Y7cZE0e/uy1hA8GiC/fOJubwkVkg5ehLZYm8O aAgp6Fh3lAMy4LIxWHi1WCtUo8wsmS7bni6ukMFhKS9Awx7cXVBGOQ2mG w==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="357639767" X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="357639767" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 09:02:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="555836504" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga002.jf.intel.com with ESMTP; 17 May 2022 09:02:15 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 17 May 2022 09:02:15 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 17 May 2022 09:02:14 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 17 May 2022 09:02:14 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.43) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 17 May 2022 09:02:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EpfAjaxKznjg1nGucmBtehe6awaLp5Qp4FTW25z9NQtVO/M1HCe01QU23ywRvSc7ImG1PzxJyQ6w0OjLd9JFMdVjI4lL/+dcGBvd7qrAXMwJu2APO5pHys3flJLEbzIBtdIyAWRfw0j+KdwyM4f6Lj7Kd9VEKEUD3uz/vvisPkkhEok8wHfi7Zt6lpj2ouNKd19IAsNkTDF9N7i8jGoY9CMw+9ja02LFStHZ1rdcoB60DZ+F2K/pb+zeKbI4Qsjad9MVcZk4wd7S39ZQXY9l8yNTLBGYXUqiSuNSfb1/0FbcymcYEe4VZsqSsdTwRCubriCRIpIPyHz28ymc2uLhvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ADt8Rv6RoqXXppX1rRPudMxjqd29ptXWCYNdHEF/wnk=; b=O1gEZrOkWrILFe/BWbUba1RJq/bQL53Mjx17pKXiz9rZqDJBKDtIM8RX1KJ/4Qb5tfa7MO6+fp2o0kBBnpGykMo5iZLGi8uygSn+SSepGJzeayJNNaPD6F9QB7WB4ZvKcLvMcfLG9lNpKobeBIMOKM1GbFhUoHnXIjqnRMG3zx2ieX+VF884ERo2lNHKmrNF10LHeyzO2jV7SZYU1qFSsmFRYdXVFHOBC7ZHs/DrUk7N08RZt7JjOxwOEZWyyfWBMCuOnZ6XkFsU7qBeKrg0PKFuY9x0q5i2aCMlZwjNl/yEHOnNqqotKWIb4TEQOGf7pTxiOZ81tQxl9BrqtMRCWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB3516.namprd11.prod.outlook.com (2603:10b6:5:72::13) by CH2PR11MB4328.namprd11.prod.outlook.com (2603:10b6:610:3b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.18; Tue, 17 May 2022 16:02:10 +0000 Received: from DM6PR11MB3516.namprd11.prod.outlook.com ([fe80::187:4143:ba20:d362]) by DM6PR11MB3516.namprd11.prod.outlook.com ([fe80::187:4143:ba20:d362%7]) with mapi id 15.20.5250.018; Tue, 17 May 2022 16:02:10 +0000 From: "Zhang, Yuying" To: "Ma, WenwuX" , "Li, Xiaoyun" , "Singh, Aman Deep" , "dev@dpdk.org" CC: "Hu, Jiayu" , "Wang, Yinan" , "He, Xingguang" , "stable@dpdk.org" Subject: RE: [PATCH v3] app/testpmd: perform SW IP checksum for GRO/GSO packets Thread-Topic: [PATCH v3] app/testpmd: perform SW IP checksum for GRO/GSO packets Thread-Index: AQHYZZ0pVsoe7PhltkyLfbyTF07NCK0jQmuQ Date: Tue, 17 May 2022 16:02:10 +0000 Message-ID: References: <20220511013705.24602-1-wenwux.ma@intel.com> <20220512010756.29553-1-wenwux.ma@intel.com> In-Reply-To: <20220512010756.29553-1-wenwux.ma@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6f3645bc-1a2e-41d5-500c-08da381e9981 x-ms-traffictypediagnostic: CH2PR11MB4328:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +cAVgTFfo7N7yHHwQpPfLd0nKQqLCwL31Zc04dXNZPM9o8i810f0tV4Obwmyer0nk3K9cL6XWyTadr58yA4cHqnkQyc+1rVvYR8H57sDwMntix9MVppz46OBNk87LJjGO3LRxV5wl3RxBizAp1TEAPKvtT6P9p7kWIHQ/dkKQGi+S5lOD26xDGMfvqE9VLP4I0+Ni7adbjxBbQMPcIAtrvsyiYsJkVXpaWSL79Ex6p0u3tKQaftIG5Ew4Y/TO0BvpthIAeGHcmaS+w1kCJ7+JbLIRG6736dgXqHDDmHIM174/Ngc+QgzmB7PgcUpjnZejW8EAwT3CuMdWxzT2fvoiWIXuazkL6sZwl5t1lTZU87PqEUUZK9b+I3PbaufxymQ7FBS6o8ISPHGvDdXPkoH1jcFXolsKVrq6IAW1v6V6/mggKHadInie3wr6lqSV3p3/bNNcrBrobKB1OkONSSfw8lQP320T9QzlqfjkpTA5Wo8DHavTi+SqsLGPicJx83PzQ3Wwet43Yy9qrJaAaYOfISnk+o7/qixYr8OsZbOkOHsTO7xSa8er+YAIikISG2UIYWrnO7C9nFdtwlJnDTml6qTcPtCinz+I+k3AqXfxikIRDQU5ZePGCuwx0Qr7Vf5H2yhCw3Fpg1Hl4OLZ3dpFvzK/+yCTttBqiTfqj6pQ6KgV9dEpJOOUwUaZ2ySm3ivgZ984NIyicD8VTS/QSbz9A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3516.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(66446008)(82960400001)(450100002)(76116006)(66946007)(66556008)(4326008)(8676002)(38100700002)(122000001)(38070700005)(2906002)(508600001)(9686003)(26005)(6506007)(7696005)(316002)(53546011)(86362001)(52536014)(186003)(71200400001)(55016003)(5660300002)(66476007)(64756008)(110136005)(83380400001)(54906003)(33656002)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Ibj0T/OfuBq+8FqfL7zPBqBh+pJ3Mg7RuEjNDanK9ftzdqjPhFx8GcOgdXNo?= =?us-ascii?Q?an5S8tuHj6Z9DWBc6yG0/SFsASYL0q6gy+H6VNeS6EpL3hs9dKWHsJzIDxyP?= =?us-ascii?Q?qmEm2XYYyarORsEVt0+z7fdvm0nUNuokWYCcRJyAIAJXmEwBZDFIy1bgk7e1?= =?us-ascii?Q?AWCthWkn7bpk6QgBlD7JTnguhm931slVpssv2FcN3q5JSMb2oK6Ft0kvn2d9?= =?us-ascii?Q?JmtH9rII97bRkDAzbGJhpEM4eXJbcjK7UozuUh8v+G8WwAiO2QcZg/p8Yvw7?= =?us-ascii?Q?AoGy41JQptXAGX+2y/Ca/3cHkC8x+2qlyaOW/Cwh2LeGpF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yJPUSwzM7+0GkDZO9LeZM6Eq/g70lSOI6YUyp9YTihZfCqcgTn4jj?= =?us-ascii?Q?w/pLwigMwkmFEJIBUs+REHfvV0QR8Y4PH4mMcmVm3vdRfPX4Iqwm7i5DxMi+?= =?us-ascii?Q?VqEYmmfiKMh/rZGOrg58eYorPQ79OzvLP+2AhkM37cOxVHgWtz/HV0lBEOLZ?= =?us-ascii?Q?5x+eHEot1kwZd9zDuo2mgDHw+h5kx+vyNMpG/itDP4ISaIyNu6M/Q1pkJsVp?= =?us-ascii?Q?imcsi0YqgF31PMiVsTX4i5CEjN3DT+++xUGvaTB8Uvgf5sXrPM4cBrLw0Ctx?= =?us-ascii?Q?nrYcDKSUxRDgaTSrNiVga3/Ipi7i10g0UKD0EKJXEC60yiUQ7YOoQDNJCSGz?= =?us-ascii?Q?uOzXmf9FSC3kl3TFCf0ne7OfEVaXbY2/BrCxFzZMGiSSj5RRNJWOTFsoeWi8?= =?us-ascii?Q?ClFRoOQ1B/kFWdE2mDS/EuYw6d1iN2mtM+L4lXngQE2EOzsXr0iEdZnXcTeA?= =?us-ascii?Q?evVpxtiqwZz2eJlmsFIIgwBMFMLql7J4h38FfMqHgBYWIEi9lqh3qAT4Iv6B?= =?us-ascii?Q?fINLjj3Hbw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3516.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f3645bc-1a2e-41d5-500c-08da381e9981 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2022 16:02:10.1753 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: JE7Te+0pUHn9NLHZ+pqulY/+JXWaBz8Zc7cNZDOVENsvptCQdJ0Lr2N9mgtlDQ9CBCglI5ve16bg683rZ288JA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR11MB4328 X-OriginatorOrg: intel.com 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 Hi Wenwu, LGTM. > -----Original Message----- > From: Ma, WenwuX > Sent: Thursday, May 12, 2022 9:08 AM > To: Li, Xiaoyun ; Singh, Aman Deep > ; Zhang, Yuying ; > dev@dpdk.org > Cc: Hu, Jiayu ; Wang, Yinan ; > He, Xingguang ; Ma, WenwuX > ; stable@dpdk.org > Subject: [PATCH v3] app/testpmd: perform SW IP checksum for GRO/GSO > packets >=20 > The GRO/GSO library doesn't re-calculate checksums for merged/fragmented > packets. If users want the packets to have correct IP checksums, they sho= uld > select HW IP checksum calculation for the port which the packets are > transmitted to. But if the port doesn't support HW IP checksum, users may > perform a SW IP checksum. This patch add the code about it. >=20 > Fixes: b7091f1dcfbc ("app/testpmd: enable the heavyweight mode TCP/IPv4 > GRO") > Fixes: 52f38a2055ed ("app/testpmd: enable TCP/IPv4 VxLAN and GRE GSO") > Cc: stable@dpdk.org >=20 > Signed-off-by: Wenwu Ma Acked-by: Yuying Zhang > --- > app/test-pmd/csumonly.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) >=20 > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index > 8b6665d6f3..2498ee88a2 100644 > --- a/app/test-pmd/csumonly.c > +++ b/app/test-pmd/csumonly.c > @@ -778,6 +778,28 @@ pkt_copy_split(const struct rte_mbuf *pkt) > return md[0]; > } >=20 > +#if defined(RTE_LIB_GRO) || defined(RTE_LIB_GSO) > +/* > + * Re-calculate IP checksum for merged/fragmented packets. > + */ > +static void > +pkts_ip_csum_recalc(struct rte_mbuf **pkts_burst, const uint16_t > +nb_pkts, uint64_t tx_offloads) { > + int i; > + struct rte_ipv4_hdr *ipv4_hdr; > + for (i =3D 0; i < nb_pkts; i++) { > + if ((pkts_burst[i]->ol_flags & RTE_MBUF_F_TX_IPV4) && > + (tx_offloads & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM) > =3D=3D 0) { > + ipv4_hdr =3D rte_pktmbuf_mtod_offset(pkts_burst[i], > + struct rte_ipv4_hdr *, > + pkts_burst[i]->l2_len); > + ipv4_hdr->hdr_checksum =3D 0; > + ipv4_hdr->hdr_checksum =3D > rte_ipv4_cksum(ipv4_hdr); > + } > + } > +} > +#endif > + > /* > * Receive a burst of packets, and for each packet: > * - parse packet, and try to recognize a supported packet type (1) @@ = - > 1098,6 +1120,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) > fs->gro_times =3D 0; > } > } > + > + pkts_ip_csum_recalc(pkts_burst, nb_rx, tx_offloads); > } > #endif >=20 > @@ -1131,6 +1155,8 @@ pkt_burst_checksum_forward(struct fwd_stream > *fs) >=20 > tx_pkts_burst =3D gso_segments; > nb_rx =3D nb_segments; > + > + pkts_ip_csum_recalc(tx_pkts_burst, nb_rx, tx_offloads); > } else > #endif > tx_pkts_burst =3D pkts_burst; > -- > 2.25.1