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 834D3A050A for ; Sat, 7 May 2022 05:20:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 76CBF4113C; Sat, 7 May 2022 05:20:45 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 095E24014F; Sat, 7 May 2022 05:20:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651893642; x=1683429642; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=9lOYOrlCa/i64Iri805IWBvvgIM3iv3ai81gZ1akCKU=; b=isaNdWM6Kwwh5vrz1SAcmjeb7+BWP54HeYKfJVDIf3a8eDnn+f/U+dFf 4TK61uSeVdjp+mspsGxT5Ppsr7CannDZLCwhcipevxQsZWWKQROkmM0YG IdPhZ0fcgBFL36ehquYTFSdEs/SP/9lCGlwxZb+ejxbJ/wqGA0lFyRGLA th3xk3SSJK8XLjAvt827mydIoFy7uvcWyPhiG6hxr6amO39QEmdEqUKbq wUPASFru0m4UPh5pl9TbQsZT7Nk8dpIUezKoox/VZeKoP3J4ngiExOTvA tiLGrF1ffb6+tWoIm1IhInwlLNA7fYdl5EywON8FQd+AXzUaCxPXJpqTj g==; X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="266232585" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="266232585" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 20:20:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="654979113" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by FMSMGA003.fm.intel.com with ESMTP; 06 May 2022 20:20:40 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 6 May 2022 20:20:39 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 6 May 2022 20:20:39 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Fri, 6 May 2022 20:20:39 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Fri, 6 May 2022 20:20:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gwzd5WcuKIG2SRht6KSG58FN4trYVZDkszSPjynnlkRCefmA8YqVya5/AnkFx4Yzu2bGfLUr1bg2yO0zfID9uPS1Xpd46p+CYkFa/+DDQoQvL1bwnBmQFU1LLrM5xeELArMwoqqqELZnhng7kqcnOITdcXmwhkhZKXWzWeMH9t8dH51ql7cS1k+TLL+2v3i9Zgx/S2xAldxyeQFaZxy8hL33BVWbW1vXvVm0y8Updy8t2mHTs5XtcgGRCmHWQ9E6VtUZObEqRbvdMFCyWHU7oH5f0qGl7kFdncTAI8Tbrv+vPdDlT3x6eRtm6jaLuutcacSwFcT3+7zwrHGbhWeLeA== 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=11duOJ5aFkb3pkZyT7lvDqHbE21OUqlgPsVIo5cW9Ok=; b=hVVcdrnK6pvaOzNyu78+R2Wgf2GQtZvhcmOQffSchoS/sjW/6sp+1arfhV7ggnL1gp2CI7ScLsTYAaep3isdPIdpUfMW6TfP4TeIWUSx5XQbCIuf0PIT7Wfvse58BIAHld6t8goOhnKi2WzPr+Mppd9vN+epcX3DUBrWab/AWWvw9PE5+dGXPlKuoVdkzvDU29ybtewpf1tNL+4h/uRCaR3UNmF3CwXA3ZP/VVaCPQH9McZR6WQ7jphA6dSNiPIEkUeHeZlCvx38joR6XHzI3ykvNSIChD7GUV1rC+IPrtm7+fX63VXdQX1wrxFlwqHPNOe4LddS4IwrzpJ9N6WQdA== 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 SA0PR11MB4526.namprd11.prod.outlook.com (2603:10b6:806:96::15) by PH7PR11MB6500.namprd11.prod.outlook.com (2603:10b6:510:213::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.18; Sat, 7 May 2022 03:20:36 +0000 Received: from SA0PR11MB4526.namprd11.prod.outlook.com ([fe80::e93c:bcf9:fdc7:f75f]) by SA0PR11MB4526.namprd11.prod.outlook.com ([fe80::e93c:bcf9:fdc7:f75f%3]) with mapi id 15.20.5206.028; Sat, 7 May 2022 03:20:36 +0000 From: "Ma, WenwuX" To: Maxime Coquelin , "dev@dpdk.org" , "jasowang@redhat.com" , "Xia, Chenbo" , "david.marchand@redhat.com" , "olivier.matz@6wind.com" CC: "stable@dpdk.org" Subject: RE: [PATCH 6/6] net/vhost: perform SW checksum in Tx path Thread-Topic: [PATCH 6/6] net/vhost: perform SW checksum in Tx path Thread-Index: AQHYYGsMxyJc55pjvE2TlRJ51wIuCq0Sny3Q Date: Sat, 7 May 2022 03:20:35 +0000 Message-ID: References: <20220505102729.821075-1-maxime.coquelin@redhat.com> <20220505102729.821075-7-maxime.coquelin@redhat.com> In-Reply-To: <20220505102729.821075-7-maxime.coquelin@redhat.com> Accept-Language: zh-CN, 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: 80206903-fb77-40be-8dcf-08da2fd88d7c x-ms-traffictypediagnostic: PH7PR11MB6500:EE_ 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: PCMo+96Ou0RP0L7K0j9j0lmb3ZLFnW+ZnKTVQVQOGkrlU1kM0j63lGYwnvgzanTKv31f19M/hKkwNgaxQjcgBEPsLS0a5quU8VDHoHikTuKXbLghLY+2HTMjXUhhQdiKcWtvDfg+C7Ozubd31aE2CvIIcjhjCKa2mtR7jSis5QkTblFxbxQOEjlU9uAjLRwNy9ZIn/irqhri1u+1LXFg5+9+iNyYlN5s2rHJb6fupsCdykP4grF06rWxrdEBNvtc6e9CBFWErsNvuTO544OmLRe+7+lnhrJ434t3Z8zfKWDsQWPTBgo28p9ENnjMFDe+X4MVc//JMJcl4Y26ic7Y7sA9aCGVRzeqVLCvQ92Q0dMeK3tRdcITdDpCjsEYdDoTh7L8QFPYPRt/DxX2OoZfTDC37FvVCFCb9XrEAgviXbY/IL96wPlWzVL7dZiShMEtgwgL3zhLPcWE3ldGPgthXhuhZQwzYRs+wvxttngmcU8447uI0aPZchBro0KoLjtta8UrHhJrYriZobehrFOv6TYowZdy6Kd34ZAGZ81DW8JF3AmWoSbjVmXEXCzbBleEcb5GX2rVAYZQ0IcV3newySk+4Z7CewUlGVD7iINTR2LQgOSWt64Tb4EO2qzQkBmtUOARwASXsozOvnmQymbZvP/T0XH9xjfp/4SODQvrJoXUK2y3TCpFsc37N+htBQFFN2kvVqothUAQsW+dIem7qQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA0PR11MB4526.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(2906002)(83380400001)(66476007)(86362001)(71200400001)(5660300002)(122000001)(82960400001)(38100700002)(38070700005)(316002)(8676002)(76116006)(66946007)(66446008)(64756008)(66556008)(4326008)(26005)(9686003)(7696005)(55016003)(33656002)(8936002)(53546011)(186003)(52536014)(6506007)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?K1JrOHNSU1ZuOHl2dy82a3VyVGtSdWN1eExsVkV4aC8wQVJaNWcydk9U?= =?iso-2022-jp?B?SHEzK2JSdmVPTjNqcTZaOUxOSElHSkVyYVMyRFpPNzBIL0l1U0ZTb2lC?= =?iso-2022-jp?B?STRlWURPb0pocTFaZHBhWldBYXZ6L01zTmFMWm1MWTdTR3FIMDJ5VHl0?= =?iso-2022-jp?B?bnFnK3NidHkvL3h0ZDRZQzR2emZTRm5xZ1J2SlpXdGNkcUlvM3hoVFo5?= =?iso-2022-jp?B?NXltZmhabWh1N1Y5WG5OOE51YkRoVXdqT2xiUnV3UlRseE1IZ3JVTGh1?= =?iso-2022-jp?B?SUhhT3ZPakxvV3JOWk4zazRodERwU2VnTHlYaFVnMFNrYmEyalREYU9v?= =?iso-2022-jp?B?MG5qU2FCc0o0N29uOWl3VmVnalhCcFN2c2ovTE5mWVdYZ1YwQzFoRThv?= =?iso-2022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kYrSXFrdjBZK1FkU3VBaVRBZ3p0Y0E4NGJUME5RRlU3VU5vbWRNWEVm?= =?iso-2022-jp?B?V0dzTWhTdU9ITHF5MkE1OGVZbStHUG1CTUxVV2NCa0d2dHZrWmlLTWk2?= =?iso-2022-jp?B?N1Mxa3dSZGdiVGM4MmNCUFJYaUxaOHhRNUlGYXVWU1ZSaElxUUlNeVNQ?= =?iso-2022-jp?B?ejNWVnY2S2sybnp1aWhYUVZIaWswTCtqRzhjTnQ0dFZ6cSs3S0JDaTBx?= =?iso-2022-jp?B?aFJBQWltU1MyNFZJMDVkdjhrMllXMFUyU0JJb09TcHlIdDdlWFlEM2hM?= =?iso-2022-jp?B?Nlo0MDlY?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA0PR11MB4526.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80206903-fb77-40be-8dcf-08da2fd88d7c X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2022 03:20:35.8913 (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: B7Mf9Orb99Ch9uMbOElCllDkNJwh12vZqyh2feuPk9PcUxUKLwhOJW0NOUy62tRRv7wi0AZ6GVW2C04xfOo8bg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6500 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 > -----Original Message----- > From: Maxime Coquelin > Sent: 2022=1B$BG/=1B(B5=1B$B7n=1B(B5=1B$BF|=1B(B 18:27 > To: dev@dpdk.org; jasowang@redhat.com; Xia, Chenbo > ; david.marchand@redhat.com; > olivier.matz@6wind.com > Cc: stable@dpdk.org; Maxime Coquelin > Subject: [PATCH 6/6] net/vhost: perform SW checksum in Tx path >=20 > Virtio specification supports guest checksum offloading for L4, which is > enabled with VIRTIO_NET_F_GUEST_CSUM feature negotiation. However, > the Vhost PMD does not advertise Tx checksum offload capabilities. >=20 > Advertising these offload capabilities at the ethdev level is not enough, > because we could still end-up with the application enabling these offload= s > while the guest not negotiating it. >=20 > This patch advertizes the Tx checksum offload capabilities, and introduce= s a > compatibility layer to cover the case VIRTIO_NET_F_GUEST_CSUM has not > been negotiated but the application does configure the Tx checksum > offloads. This function performs the L4 Tx checksum in SW for UDP and TCP= . > Compared to Rx SW checksum, the Tx SW checksum function needs to > compute the pseudo-header checksum, as we cannot knwo whether it was > done before. >=20 > This patch does not advertize SCTP checksum offloading capability for now= , > but it could be handled later if the need arises. In virtio_enqueue_offload(), if RTE_MBUF_F_TX_IP_CKSUM is set, we will performs the L3 Tx checksum, why do not we advertise IPV4 checksum offloadi= ng capability? Will we advertise it later? >=20 > Reported-by: Jason Wang > Signed-off-by: Maxime Coquelin > --- > drivers/net/vhost/rte_eth_vhost.c | 62 > +++++++++++++++++++++++++++++++ > 1 file changed, 62 insertions(+) >=20 > diff --git a/drivers/net/vhost/rte_eth_vhost.c > b/drivers/net/vhost/rte_eth_vhost.c > index d5303f7368..52a802de05 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -114,6 +114,7 @@ struct pmd_internal { > rte_atomic32_t started; > bool vlan_strip; > bool rx_sw_csum; > + bool tx_sw_csum; > }; >=20 > struct internal_list { > @@ -370,8 +371,10 @@ vhost_dev_csum_configure(struct rte_eth_dev > *eth_dev) { > struct pmd_internal *internal =3D eth_dev->data->dev_private; > const struct rte_eth_rxmode *rxmode =3D ð_dev->data- > >dev_conf.rxmode; > + const struct rte_eth_txmode *txmode =3D ð_dev->data- > >dev_conf.txmode; >=20 > internal->rx_sw_csum =3D false; > + internal->tx_sw_csum =3D false; >=20 > /* SW checksum is not compatible with legacy mode */ > if (!(internal->flags & > RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS)) > @@ -384,6 +387,56 @@ vhost_dev_csum_configure(struct rte_eth_dev > *eth_dev) > internal->rx_sw_csum =3D true; > } > } > + > + if (!(internal->features & (1ULL << VIRTIO_NET_F_GUEST_CSUM))) { > + if (txmode->offloads & > + (RTE_ETH_TX_OFFLOAD_UDP_CKSUM | > RTE_ETH_TX_OFFLOAD_TCP_CKSUM)) { > + VHOST_LOG(NOTICE, "Tx csum will be done in SW, > may impact performance."); > + internal->tx_sw_csum =3D true; > + } > + } > +} > + > +static void > +vhost_dev_tx_sw_csum(struct rte_mbuf *mbuf) { > + uint32_t hdr_len; > + uint16_t csum =3D 0, csum_offset; > + > + switch (mbuf->ol_flags & RTE_MBUF_F_TX_L4_MASK) { > + case RTE_MBUF_F_TX_L4_NO_CKSUM: > + return; > + case RTE_MBUF_F_TX_TCP_CKSUM: > + csum_offset =3D offsetof(struct rte_tcp_hdr, cksum); > + break; > + case RTE_MBUF_F_TX_UDP_CKSUM: > + csum_offset =3D offsetof(struct rte_udp_hdr, dgram_cksum); > + break; > + default: > + /* Unsupported packet type. */ > + return; > + } > + > + hdr_len =3D mbuf->l2_len + mbuf->l3_len; > + csum_offset +=3D hdr_len; > + > + /* Prepare the pseudo-header checksum */ > + if (rte_net_intel_cksum_prepare(mbuf) < 0) > + return; > + > + if (rte_raw_cksum_mbuf(mbuf, hdr_len, > rte_pktmbuf_pkt_len(mbuf) - hdr_len, &csum) < 0) > + return; > + > + csum =3D ~csum; > + /* See RFC768 */ > + if (unlikely((mbuf->packet_type & RTE_PTYPE_L4_UDP) && csum =3D=3D > 0)) > + csum =3D 0xffff; > + > + if (rte_pktmbuf_data_len(mbuf) >=3D csum_offset + 1) > + *rte_pktmbuf_mtod_offset(mbuf, uint16_t *, csum_offset) > =3D csum; > + > + mbuf->ol_flags &=3D ~RTE_MBUF_F_TX_L4_MASK; > + mbuf->ol_flags |=3D RTE_MBUF_F_TX_L4_NO_CKSUM; > } >=20 > static void > @@ -513,6 +566,10 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, > uint16_t nb_bufs) > } > } >=20 > + if (r->internal->tx_sw_csum) > + vhost_dev_tx_sw_csum(m); > + > + > bufs[nb_send] =3D m; > ++nb_send; > } > @@ -1359,6 +1416,11 @@ eth_dev_info(struct rte_eth_dev *dev, >=20 > dev_info->tx_offload_capa =3D RTE_ETH_TX_OFFLOAD_MULTI_SEGS | > RTE_ETH_TX_OFFLOAD_VLAN_INSERT; > + if (internal->flags & RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS) > { > + dev_info->tx_offload_capa |=3D > RTE_ETH_TX_OFFLOAD_UDP_CKSUM | > + RTE_ETH_TX_OFFLOAD_TCP_CKSUM; > + } > + > dev_info->rx_offload_capa =3D RTE_ETH_RX_OFFLOAD_VLAN_STRIP; > if (internal->flags & RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS) > { > dev_info->rx_offload_capa |=3D > RTE_ETH_RX_OFFLOAD_UDP_CKSUM | > -- > 2.35.1