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 A82B3A00BE for ; Mon, 16 May 2022 15:24:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9060F42685; Mon, 16 May 2022 15:24:53 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 29B2C40A7A; Mon, 16 May 2022 15:24:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652707490; x=1684243490; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=LY2p6YNRXv6EQBlAm7NEGahwBzYEykkszsk075ZBmmY=; b=nO3rUECd8w7DBM0OjtGJjRifAXnA/BAVVUVszl23Ge0SLXaj5whjXH6j +hXTsNGW5gTfR/XPFrrWOvOfkVBqC1Ljrzu2MYlgWwVpFxv3n70/SCuxZ 6mH+YQ8+hgyCJ1X/ZRAIU6PMI/2h1okDbdvNXKYBusTwbNPylREsU7Xf2 rULQGGWJNid1RdTM/j9EckzXVjl68mWFWjSkKIS5ThEZx+6+r02jFW8Oj 41xEPz5+uVam0JM4caCqTEEHx9ICHioqKxoSBJlbPy64LJC/tGDV7tT/H GTg1uqayQoBGj9IOnSE9dXCQYtVBdOF2RsBTdiYOvk5nK27ZahYXyRvFK w==; X-IronPort-AV: E=McAfee;i="6400,9594,10348"; a="268407957" X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="268407957" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2022 06:24:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="604853670" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga001.jf.intel.com with ESMTP; 16 May 2022 06:24:46 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 16 May 2022 06:24:46 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 16 May 2022 06:24:46 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.102) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 16 May 2022 06:24:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BUJOl9X1CnBtFMppmA0tIu3D/17d293RvvbmhoY92btcL6M1PB2Yowu4/xP3RfFwWT58Kryjyyfk1OxjwOCnQu1Mj1J+a5nGcHfVL3enR4HBJOIO3Ib5+tTpvI6xDKpN6eVMUHtF2/Xr1RS7pmwr8gR8VUFtH0KyppGRQLPS7hGiTaqn90RCGDc8PYpz4KREwE9U6Di1nPQbyqi+IsICsgNos2MEZFwwDI5Uo3409YPRZMYNMzOV+dXpmUaSmw4XyDxvkOtWRTQK5X2Tl8Qni+eoFd6vgFuBJUouvY7B1OXmDJ51lFwadHhNNbCwmofXS4+fhJL/ufmC1uYeUimXlQ== 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=Lo9zQT6GSbhM4DzrVhtvO1nbCsH4XY3q0tfrQqel/NM=; b=I8HLrvqi9g7YSCNBfIFmC35BsdqNE8cc4520Mkuu9SlSjUPMdmcsCHnk/U795aygpxcnfkS4UaTxfzSHyDnqKJxEhbW+QWwhKkVbGDH4M0uwmZ4I7pprQd0WLuUDVGztiRqMlKqLXBUSE/WBleMpoHCSGNt83py+HxcuYEn+nc+7PZtOaAVv7OyyEXFcleGdmviT9n0RLoNdEc9HS68gujuTaOGaBLEIFQyTuB3KXjKCaWsr7awMxHwX16NWHyVyPdPobZXy8DYrignm22jV+FrzyujwrhdTLJednDiFzrkSSBivLOb6VE/cUo0smemJdtykShzW8YPWlZ3zpZxSNw== 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 SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by DM5PR11MB1515.namprd11.prod.outlook.com (2603:10b6:4:11::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.18; Mon, 16 May 2022 13:24:44 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54e1:e802:17c8:93f]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54e1:e802:17c8:93f%7]) with mapi id 15.20.5250.018; Mon, 16 May 2022 13:24:44 +0000 From: "Xia, Chenbo" To: Maxime Coquelin , "dev@dpdk.org" , "jasowang@redhat.com" , "david.marchand@redhat.com" , "olivier.matz@6wind.com" CC: "stable@dpdk.org" Subject: RE: [PATCH 2/6] vhost: fix missing enqueue pseudo-header calculation Thread-Topic: [PATCH 2/6] vhost: fix missing enqueue pseudo-header calculation Thread-Index: AQHYYGrdHtaevkqvtkuhL/lWELJo/a0hj7DA Date: Mon, 16 May 2022 13:24:44 +0000 Message-ID: References: <20220505102729.821075-1-maxime.coquelin@redhat.com> <20220505102729.821075-3-maxime.coquelin@redhat.com> In-Reply-To: <20220505102729.821075-3-maxime.coquelin@redhat.com> Accept-Language: en-US, zh-CN 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: 9ad81b7e-7fe5-4658-dee5-08da373f710a x-ms-traffictypediagnostic: DM5PR11MB1515: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: nO/DglMcsCIRLWAgIePRuIk1nrUBGGbVKhNnOPMjuUnFatj/sAwiuoN9i8OFDZ0DhuAnYyK7BAP0wVZEY7Yad4OwJxtknD99c1pzc+lcQ1YRu5e8rabj4pbs4ZpPTcFQzzOG44642OFAv7PrKQ+JCOuBlpXwuSY6Az945/QjP+6vtS+niVfY5zzMtmIJBkTzhwxEucP7twOuD/mI5Pe6J0bhhm5mWOettgepiEfxiSbiKUgnBzcvmio4XIHkPzIzdeBp0ejNUtYVUolffMoCyZeWDC5OOzg6DqxeOe4jB+WsQscisGx0XBze9nxVQ3NZuFgKpYbEfF9VdkecJZDfXg7NK6x5IqePQJou23psmn+dRQ3+XpLWg/iwOSa3/jY4jMaTpjfpBCo+4QDbucps/s5GgaUB80rhqYMK0vYeIWB3qCKG9bY48xnBhEM/ckCebdqrDNx6zCDDEBgYxFoqWx4Ryugn7iGmEsXiurt+9/raSPXYUDRLjdJ+M83tRYRHG5zYKNPiqw/rF59lq4UwDvToArh/YJinP7kWC+6p9B6zeoLtyYAEZPU1gKfUE3ZuwStTLtTa1tx/b8vzvq9uYrIQi05emAHIaG/CSAFIFssiZaoSYqpPaka4IlNOOC7C9xoF0GN3EuFrdnOqMhGcFG64j7+6l+GsQXUxmnP2OX4aOmRK+41i7PTKf1t8HGh1OuHXPiaEGVuR9ymilIUzgQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(110136005)(33656002)(66556008)(66476007)(66946007)(52536014)(508600001)(86362001)(83380400001)(4326008)(316002)(64756008)(55016003)(8676002)(82960400001)(38100700002)(38070700005)(6506007)(66446008)(76116006)(53546011)(122000001)(2906002)(186003)(71200400001)(5660300002)(26005)(8936002)(7696005)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?eaSVazbB9Jz2GsLozQpFR7Yi5+Ke2Hz/8tbvPJchw+7HNbH3HupD3M2FdPj7?= =?us-ascii?Q?V5NzKkIZEBe0940PrkgmlI3sLW47LuTBWb2dzeuORKmVPIeO5EC8/keA76jc?= =?us-ascii?Q?dN6d0obY1QAcmimkw/Ngyx6sm6Gg5SGd8bsIm2ODnFjhlU5d0LayyVhXl7zV?= =?us-ascii?Q?N6G449xbZTie/LcUdqFpEXwdC4rmjsrEqFxbPpSVxqLGLGfPSj9MDkLR2TWX?= =?us-ascii?Q?jXGY7rxUtGnBczbmrWCDHA8DR26TeGieNRZLgJrqzmqGzKjoV9GtcTe3IfQb?= =?us-ascii?Q?YjCDt5Rr45qZDi0VkdQbvpU+B1ANgtQ1G7Bple/qMD23OuLrCJ72PSLPk0A6?= =?us-ascii?Q?Rz+Jjps2zyrppqtbyos4Ub/GpdQ8HYL3RLbyo7gRxzgO77FuK5HONQ9eQh/6?= =?us-ascii?Q?YLcZM9ykT5Qs0Umdgfhx1HeJvJ/gVTkXJ9LblLeaPTH26twzOOi/3ZSm4tzD?= =?us-ascii?Q?AF/2lxYtf9ogWpTLoHXbrI83cSwYcDGo30XIBoAPEZqg9c8iVaBlHVh5Ravs?= =?us-ascii?Q?ITC53zCIu64wb6vyOJtnZvzp0dSMzy9mXzSZluW1QELnoSsbVVn89MzudgPo?= =?us-ascii?Q?y6buttEpjUZMIxIRn/RHHu0CV6qQose8qPfm7nh+tjQtjgGS7kM6zSghJ5+x?= =?us-ascii?Q?S/dCE+KNJ9vMfl81BrjJGKejUU8k0ftA1INSBOnLKCsFmg5ksfR0i8KQKzsa?= =?us-ascii?Q?4m1xO3xk1I72uf4vqeFGZJ+ScoA6aJKX9QSr/ZwzX2NOsTbzZgZ7j0U6Zv7D?= =?us-ascii?Q?cF25xjWZwe2HqKIt9DHEnLBZXUGS+LFFe9V56blkSbzTM6agmInN02+lciVs?= =?us-ascii?Q?WuxnnmuFYv7pmL+KnzEgxUss0q0sLAsNlNI1CrG8addVf001krup9ZvNPRgk?= =?us-ascii?Q?8GRTF6NENVBSWIujIKKXKleHUjXcjg9mdF26kD3oaGYej6uD7xvmCoVkuUOJ?= =?us-ascii?Q?cJ+q5j4GAXsy5eVW3GDEt5gbME+nMaYZzokZlWe/oTvVpmSOH025Yva5N2Ja?= =?us-ascii?Q?rOa4QQ0XiWdgd8X0DdZipiOJrnRvD4PnuOkf13VLlotI1aSp4EGxBFfKyKg9?= =?us-ascii?Q?PVLOUiSd6JQwIk/tgapVFay8oe/Fqfdwu4zZbHX2wj8xR7ffit657R6hlvIB?= =?us-ascii?Q?u3HjnpCSUWR1Iddjv8Esz0qHSH9MxRUBlJIfF7w6dZSBOBVG08pKNx8CRlSd?= =?us-ascii?Q?5kNl+mDzR/5adbl9AwzDHyPknRo/oI2mUAa0S6qiNk+MFa3mOjERJpXKJWKX?= =?us-ascii?Q?+YMNt+L62dIuNSZeT7MhdiDoF1NhefNclrL9kn5HTKbhh/Hhw74v7s/rx7iH?= =?us-ascii?Q?ld23poh011+JheaInjipX3uTOeFY99phws4tfDYlZdSo99JurDfx5iX94cwq?= =?us-ascii?Q?037m/acOd+NoCJgsl1Hnm2CrZyBym0she39sFMNUOOKmdVBoZ2sBnsVJsL/1?= =?us-ascii?Q?jQ1XbQSOxwOH0wsG0CQBQERihQy6gDfHRzWhAe9s8jq5vxGX8chRTV715pwG?= =?us-ascii?Q?f6q0mAK+DwonI7O2ofhpMLerRkRKEchq7ZtmUi9corRb8ts36iqD8QJSDynO?= =?us-ascii?Q?78oZWIf39o5dTZ3GDym2N8L9upMUlSvxIzxhPZUvH1eLU/xsOvbBGKFr17Am?= =?us-ascii?Q?5GFv91i2JYOIWaECVbGv/1HhLwUGA19ZbNgpcKoAUGLP0P4QUCDpssaOp8bE?= =?us-ascii?Q?NX8ebsERa02iU4uKPiLtb8ejR2jS6PU0nYdFPrdiLjuxGCz4vNsMFkUkpPLn?= =?us-ascii?Q?LJmBWWrxXA=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: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ad81b7e-7fe5-4658-dee5-08da373f710a X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2022 13:24:44.4726 (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: wLo9Oblb4lFGJtjGoLFzjv9mG6Arz1q1488CJWp4eOzipGHVvnU52vAm77fNo28bFi4b88FlqTYImEWDE408VA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1515 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: Thursday, May 5, 2022 6:27 PM > 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 2/6] vhost: fix missing enqueue pseudo-header calculation >=20 > The Virtio specification requires that in case of checksum > offloading, the pseudo-header checksum must be set in the > L4 header. >=20 > When received from another Vhost-user port, the packet > checksum might already contain the pseudo-header checksum > but we have no way to know it. So we have no other choice > than doing the pseudo-header checksum systematically. >=20 > This patch handles this using the rte_net_intel_cksum_prepare() > helper. >=20 > Fixes: 859b480d5afd ("vhost: add guest offload setting") > Cc: stable@dpdk.org >=20 > Signed-off-by: Maxime Coquelin > --- > lib/vhost/virtio_net.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c > index 5f432b0d77..c0ff3357a8 100644 > --- a/lib/vhost/virtio_net.c > +++ b/lib/vhost/virtio_net.c > @@ -548,6 +548,16 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struc= t > virtio_net_hdr *net_hdr) > csum_l4 |=3D RTE_MBUF_F_TX_TCP_CKSUM; >=20 > if (csum_l4) { > + /* > + * Pseudo-header checksum must be set as per Virtio spec. > + * > + * Note: We don't propagate rte_net_intel_cksum_prepare() > + * errors, as it would have an impact on performance, and an > + * error would mean the packet is dropped by the guest instead > + * of being dropped here. > + */ > + rte_net_intel_cksum_prepare(m_buf); > + > net_hdr->flags =3D VIRTIO_NET_HDR_F_NEEDS_CSUM; > net_hdr->csum_start =3D m_buf->l2_len + m_buf->l3_len; >=20 > -- > 2.35.1 Reviewed-by: Chenbo Xia