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 221D8A00C4; Fri, 1 Jul 2022 11:54:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B04C4069D; Fri, 1 Jul 2022 11:54:54 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 1718340150 for ; Fri, 1 Jul 2022 11:54: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=1656669292; x=1688205292; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=TqKuCTyB0tN8Ym+uosPnBO66Ht3w9lfLM9YhBjXvvCI=; b=H45LjwtypzFqBFAkvPnrSP/e7ykuPy+CEsSlGEEQD9WK/rLt/+M462VW 09t+4G4IXkKgTCl+k+y+nHXNSyS1WXSqR7RhREjlBqgTYlo5Gj6XAQsIw H9092enDizng0CZoK76f9gqAchgrV4upfGOlUDGyJxupH2zfb7DTTBh/q eO1E2KNeRxH3fa8J3x7+QUteRDrYV2eLiY/bv1/fykK3QgLOdn5Y4YgTF q8e9U0kwFnPbESYWwPATtoCBJGvWFvaODZAArf6zaL+8VARt8VMa0UNKN Nt6ovPBICvty+bk/PGdMDMnuJ1S6SJWe+xHAfwiROyvO4z0cV+mM6b6aB Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="271385630" X-IronPort-AV: E=Sophos;i="5.92,236,1650956400"; d="scan'208";a="271385630" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2022 02:54:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,236,1650956400"; d="scan'208";a="718574623" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga004.jf.intel.com with ESMTP; 01 Jul 2022 02:54:50 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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; Fri, 1 Jul 2022 02:54:50 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 1 Jul 2022 02:54:50 -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; Fri, 1 Jul 2022 02:54:50 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.105) 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; Fri, 1 Jul 2022 02:54:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gi+ywo0ZCbwQHpWQZygnV4NddbWEaSwIi8w3HQHAihTScphm5wfIrO+HpirD/tFvEhwWEiPZFvXoH0OeqEJacUtvMul1rPyz7sDshO8rrvw/0jKev442anPeqFD42bg9byNT27fNbOMjmbR3yxP/OU5xXGTDy0Dj1IaMmav4KElp6JCbuiNcbgCVoBfGgcMNfEqhKnCDF2jiVkJnScLD12vtl7cAv6rjiTjcpzJjvI9WVo8y3+3h0O1txSccVdHxkstYz8mKWdBPIhGb9sLeeYERtIIveBf0RFXNkvBVbnP8Dodc8H7iSFi7Ts+thMQWByF6pWE7qlZGWA02K2wZug== 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=qJQ1e1zYGgixDaWJymJDJjP0QFsF+5WEHJ8N16Ezzck=; b=gjoUcFfCzcrHskI0XiokE5fYvifyEDKhbYuZe6AJNjqWqrG945pry2icMM8Ej2+RCk3e2wx/8G1IkOq0o5iCpDybF5x5xT4a/nbxC5Gu4rYwDk0ENgt7NnezqzmNE91zcKJ0BZkKMx8sSiLqphzIvPakEyi3GmseLrvP/88njL/T06gDtHUAvgKI6BSP7kbqsSQPu6oLEmVHMbIUFuFBct/QT2yomm7anpuIs0pZqkhp6Cnnr7//kLSKWIZ9bMefXMknG/eopUr1jRfwzZ3Im+jPR8vmLYSHTUbkFSHjY0vXzkP6w7hOutMaYnvoeXnZCUSAylcww02ApmTg+HyYcw== 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 BYAPR11MB3221.namprd11.prod.outlook.com (2603:10b6:a03:1c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Fri, 1 Jul 2022 09:54:48 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54a0:2dbc:18b7:2aa9]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54a0:2dbc:18b7:2aa9%7]) with mapi id 15.20.5373.018; Fri, 1 Jul 2022 09:54:47 +0000 From: "Xia, Chenbo" To: "Ding, Xuan" , "maxime.coquelin@redhat.com" CC: "dev@dpdk.org" , "Hu, Jiayu" , "Ling, WeiX" Subject: RE: [PATCH] vhost: fix sync dequeue offload Thread-Topic: [PATCH] vhost: fix sync dequeue offload Thread-Index: AQHYh401QcSocJNnjUWS7gw4uaauBa1pUKeA Date: Fri, 1 Jul 2022 09:54:47 +0000 Message-ID: References: <20220624053824.31432-1-xuan.ding@intel.com> In-Reply-To: <20220624053824.31432-1-xuan.ding@intel.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: b30ee48d-80b8-44d1-e673-08da5b47bb88 x-ms-traffictypediagnostic: BYAPR11MB3221:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zrP8KWhwzNyJBryAzg2DewC39pUmytWiLVZ4BVFe29YQ3mFlGzhQ85z25HJCAIUGG6/AdrpZdVDSGdrVDaI63a7/I4+y56XQhJWWicHLsaPZwacu5zirR/LcTMYgVjmESxopg0juk0mdisC2yKq0YLJiZTk2qxGlmZWact2gHWrUjVnDlmWs9twoklMdE88OwA8g1rg0uq8nybtcdjRNDFEmLl+tt9O3G6RXSrrvHUFTGrKnz33FbXCvpcu5F8BaEyuS7Kim8MV+fpbDlguZr5o3DeOOadwnSHmhrpgnyPcPPH2wsPiRx8QGNDiylXb4Bc6ipSrG52inKwmOdp9vEyPz2TvaAd894XT5xlVBRKhv1choCB6rf1GRuYhDJddirtB6dUnFC/qfwmZlhYWJQAcUX7imhBE9YwK2dvR/ic01j+g4IGxp7jI10pSWtPhtjssO4yszr88vSWYE3/jFH0CWcuKRnbYkd1mWq3xHCd4OY9ZA8UwxGP4YIhcGtpowlb/gwOFK+HEh183tEENN1Li09YUEIwmvbeA7N+9XT/CYkZh8sPAiujo0HFvvyTNgIjqHWqyO+mupzuhGXcGzOWEtzF8P0ya72ampktUhwuRpSyJFwqbOHAKz6ahXxUTesdvUiHhrA2FpFJySZsnyxHcK7ki6hGuBnAAskSY05WzYR1fajAlChQClyH/kn6X8L3YJYILMEMV9WfgAJbdy2ln9mmQp6ECn7G3ZUvmvCK5UE2/NVMRY25bmetzcTI7lB7gT9xQ6d6CaKqwIXJsd3fTJzqU6cNpmApkc43e7ZcVImBt/xkVYcExbLy4HuvGM 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:(13230016)(376002)(39860400002)(366004)(396003)(136003)(346002)(186003)(107886003)(38070700005)(316002)(55016003)(76116006)(64756008)(71200400001)(66556008)(110136005)(66476007)(38100700002)(8676002)(66946007)(83380400001)(4326008)(54906003)(53546011)(2906002)(82960400001)(66446008)(86362001)(478600001)(8936002)(6506007)(26005)(52536014)(9686003)(122000001)(33656002)(41300700001)(5660300002)(7696005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6b5+vZ/zF8m1FpQit0MTWGmtotA10iDHtF/8osVcnyzHOe+ILTVblOC9ZJov?= =?us-ascii?Q?/O0gW34tfxJsLWw+3DpRy6+tNji3gxqmeEwfNnQqE9mEFe5IXpV/2W4jph3V?= =?us-ascii?Q?pHfzEpQ7vZFn8gt7psczhqnNtv5V6nxVCcYfTnMMIXJIwTKYKhyX245MeM99?= =?us-ascii?Q?asPOfoRewKerUJVpfo/415aSZpYQDSIRuKorKynykat9pQ6HlDdE/mYbz+ad?= =?us-ascii?Q?4wcpx/y27JkEAN5YZrrgpp1Mz5wmMo5rjwQUSQfF9pwRSYnDCYC3nE4ZKQcx?= =?us-ascii?Q?K0bhJD8d46KWyOqGC6EoHZVtwWJyWWPk3VDr9HlHX63khxn1B5DWNbl1BEuT?= =?us-ascii?Q?pyN4KivYnIbeUThjoN3prMNUkxnn4KVj72deiKn7keuhXvH/KdTgPF18r06r?= =?us-ascii?Q?WAMfVMB3LN/oLD8PUBxXue4hVu5IeBYXPSqRvKxlffpGPY06Km4Dm/kRxqoI?= =?us-ascii?Q?Klqoi17WliFLXQKhopK2lyd4xwOk+RAGu/xqJ7e4E/SuAGB7yQvwT6SSemUf?= =?us-ascii?Q?H9jxP1F8mQtL12rmzivVnYBhSxwX3P/+HE0ac4UUCDLn4BXScufTxEjODopF?= =?us-ascii?Q?yv4tm+m3VYPzw40jLn9W0PjuzSRcTdSU1FOLum35r1bQTyM1feEneQrYIDAn?= =?us-ascii?Q?Xls0VC4MeveDXdn47iPEpxUagTeskQpM2MYgEZWeGXA4xn4NNypDihjCi+Va?= =?us-ascii?Q?+ot62NrPgr4cDjZUyHjwz5ovUjK+wR0ABd3F9htBU/qoDBeslaL6ul+FZHUX?= =?us-ascii?Q?Ib6dD0odqDaXzVEZBuLS3MR0FP6Kd7sGR5qlfSFOLumSrKyvnaWli0h1fSr5?= =?us-ascii?Q?syRYWGcHNIu8G5l+ElCBMAeopAhXTwzGXkQGX25gX3cu/qiapLc7vWwNJ2aW?= =?us-ascii?Q?RgE37uHWZArDXg2aVAOUrHnhLVOPbw/3ft85zBFwAwRvcVP1DoYqkEhOhCTG?= =?us-ascii?Q?l6zI8ZGZziPtV/CtsT80b5xAhVXapqaKdB7mRUZCt99ujYHfRHQVLup3GOnC?= =?us-ascii?Q?aPuNrugLF0nckOeSoMKUnC6LqT17H3JoBtod8K7ScjQ2IU41E67LWuQnGI/z?= =?us-ascii?Q?H372OQ6W7H6zwjDTixeFfVR+IM5NsJ6yx3Hlsoo9v6WXFfMW6C3cMBYMI7/y?= =?us-ascii?Q?2kBGNrchxxJCy755OdGTcsknGxEUW969imz9YGDR8Ndbmznd19+4VP0kp9Kz?= =?us-ascii?Q?aRfvod0vs6be9saflSNqMff2//3P+kjCvMd22HX5bJ2mxyu7ZOdJy6YD1Pol?= =?us-ascii?Q?RGLCb7AEnhK1nKAzz2rWgoDBX4rAw8ndpekkGfnRsbY67H0fb2JAdPuAnHUa?= =?us-ascii?Q?DVChfEk2z7vCHEvkgFgbT20fPaGsZAsouysz9pOyyCZ0FacOcLUaShtrOmMy?= =?us-ascii?Q?kLNhK0dWUwAVVI2KMs0LTunYX0RvSvuCb2Vzw5mbSUpTl9O7Q7RlCwLjkq0n?= =?us-ascii?Q?5RjdREeebB9HltGrWKzlvONw6RDkNdvFpxIXRWKtx//E0AGTH7XQXBw36RXb?= =?us-ascii?Q?DfWRYt+ig2VPhcJbYs2+TPpvaAnfyyvaPM0vfLhXa9w/lxwYB3wfD4JimI2p?= =?us-ascii?Q?/GVgakjoe4I+MuGktRONJRnnn0lq27SJKHW4rnxc?= 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: b30ee48d-80b8-44d1-e673-08da5b47bb88 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2022 09:54:47.2994 (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: x32GGhh1XWryyP4gbHSpI2SkshmYpTKbD+npVTe81ol3YEYAmoZHKUVWL6bMM80Lnu/8R2igwn6FN3KS2U+B7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3221 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Ding, Xuan > Sent: Friday, June 24, 2022 1:38 PM > To: maxime.coquelin@redhat.com; Xia, Chenbo > Cc: dev@dpdk.org; Hu, Jiayu ; Ling, WeiX > ; Ding, Xuan > Subject: [PATCH] vhost: fix sync dequeue offload >=20 > From: Xuan Ding >=20 > This patch fixes the missing virtio net header copy in sync > dequeue path caused by refactoring, which affects dequeue > offloading. >=20 > Fixes: 6d823bb302c7("vhost: prepare sync for descriptor to mbuf > refactoring") >=20 > Signed-off-by: Xuan Ding > --- > lib/vhost/virtio_net.c | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c > index 68a26eb17d..d5a9f7c691 100644 > --- a/lib/vhost/virtio_net.c > +++ b/lib/vhost/virtio_net.c > @@ -2635,9 +2635,17 @@ desc_to_mbuf(struct virtio_net *dev, struct > vhost_virtqueue *vq, > buf_iova + buf_offset, cpy_len, false) < > 0) > goto error; > } else { > - sync_fill_seg(dev, vq, cur, mbuf_offset, > - buf_addr + buf_offset, > - buf_iova + buf_offset, cpy_len, false); > + if (hdr && cur =3D=3D m) { > + rte_memcpy(rte_pktmbuf_mtod_offset(cur, void *, > mbuf_offset), > + (void *)((uintptr_t)(buf_addr + buf_offset)), > + cpy_len); > + vhost_log_cache_write_iova(dev, vq, buf_iova + > buf_offset, cpy_len); > + PRINT_PACKET(dev, (uintptr_t)(buf_addr + > buf_offset), cpy_len, 0); Although above logic can also be included in func sync_fill_seg, but it wil= l need to add a new dequeue-specific param, so I would think this patch is fine. During review of this patch, I also notice one bug that writes dirty page l= og when doing dequeue. But it's not related to this patch. So: Reviewed-by: Chenbo Xia =20 > + } else { > + sync_fill_seg(dev, vq, cur, mbuf_offset, > + buf_addr + buf_offset, > + buf_iova + buf_offset, cpy_len, false); > + } > } >=20 > mbuf_avail -=3D cpy_len; > -- > 2.17.1