Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1251180rdb; Sat, 7 Oct 2023 21:38:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3paN2OTERMRPtjA88knkCCUdJpOSU82TGbIQMunXfs9XejAYoOBn1Tm8zKAV8ecYi0VIR X-Received: by 2002:a05:6a00:a1b:b0:68f:cbd3:5b01 with SMTP id p27-20020a056a000a1b00b0068fcbd35b01mr14118237pfh.13.1696739906931; Sat, 07 Oct 2023 21:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696739906; cv=none; d=google.com; s=arc-20160816; b=0YEjSHLn7S/UN7x3gb5KaTl+s2vzVcRDTjTS9FEtAu5bEGPFW5Cx353IvXz4P8LiJ/ MAsRUKO3s3DgHWqrMKZItTzHOS21I+fCDM7bvIcqlrASrmR5JzI4Qre9Ja0421+f427e LTAfn11YwwkMtpESv0LBp1Pn251V9TlWFzw74PmzrxkkNxPaV9GEAvmLEXZuzvtw0bYt UXog0W29256j9j9fWAw0pVi8KGEBdpZ5P6NoQGZUz5r/WeV5m/WB3hJ+AQNKS/76RVUe iX2irnqhDbsvr7JhNzJzD/nL5hC5B4SgPRJ82/gvEPku7JgVr6aaxWWB77ckwgGdJqmN yqnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=dvtyRRz+nwNRt7FvkUoa8BCNkTJILEam9tMkM/HCha0=; fh=bmy9I0WDZ0XucybgleE15r0K6dE3n6Z6Z9VmrGWpW5k=; b=HnNBJLOc5Q42PsECpCktl0UTzNq9EtfkXZiVgU+mfE0mESTiVBLi7izU7tQxpQly5H A0nwF/zvaRjIr+uc0stCW/a4HV1pqf806X6SCmwTMuv7Y4YOUFa88F48HR/GtldLBbP5 B4E2AexiUpgWozCKrI63rixpJgfBagENkJObsaD08gTsfV9EDxJGMKvIBBuYfdEu68N+ SYbG/r/BeRoyzfXIzyG60yPsjoknImgpXXay86tABo79LMvaLxIP4L193pJa87hv/ftD gDelMQhGknL6i2tMZxns8x3sywHMa3VzAfXbi2CkZsghFSL00vCSqRbfsVyhV3hBgW7I 4hdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GqenPu+d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id k14-20020a056a00168e00b0069343bdd500si4865069pfc.319.2023.10.07.21.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 21:38:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GqenPu+d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id B56CB80BB1CD; Sat, 7 Oct 2023 21:38:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344369AbjJHEh6 (ORCPT + 99 others); Sun, 8 Oct 2023 00:37:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344355AbjJHEh5 (ORCPT ); Sun, 8 Oct 2023 00:37:57 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AAA1BA for ; Sat, 7 Oct 2023 21:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696739835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dvtyRRz+nwNRt7FvkUoa8BCNkTJILEam9tMkM/HCha0=; b=GqenPu+dl1ud/IxCDURRYbNVjTgPCujCHHXdSDZd37ePVwRBPQH+e+lQIvHXclmWTfiFRn j08r00G7lFrM64wh7Vp5Zp7NMUoSATufx4oxnDMG6Jii5JskukYP2hlM2f8x/CveqT1Px7 7rvJPsNEga3Wed0/lC3rLF8pqvzW+iI= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-647-nb-vXxSiOeitvWi_zFiy-Q-1; Sun, 08 Oct 2023 00:37:13 -0400 X-MC-Unique: nb-vXxSiOeitvWi_zFiy-Q-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-503177646d2so3021497e87.2 for ; Sat, 07 Oct 2023 21:37:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696739832; x=1697344632; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dvtyRRz+nwNRt7FvkUoa8BCNkTJILEam9tMkM/HCha0=; b=RA4pBWw2G4RVjOau6rm24tnK4Xm5bQn4jTgKqKkAjWSs/VbKOQq0xWxY90AETDfFt8 dm9ZjEU/n3HU6Xkbl6106B3qid1tQoyDnzuCCT3VmkRG/y52SwYpo59Cp7JTTH+80lbr +RHAdaKcv0pGmK0zII7n8JRgsWcPcnmngJ8BWHoSkT2MC83vKZ6la53ExAlapTNneJXS hgn2zTJGK3lRED5BxWcsi7ft/WT4jx7pkxlmBQ9grDQGX9px5d+BWd0ZdHoL3AK29XjP wBSFR/ec/5bdaoXXa+mp7kZoJLJMFZ4qpJ0EPlB1zLiCIANv+/JBJM8wQhgby+w9BS7f +u6A== X-Gm-Message-State: AOJu0YxO4cFuVKy/YGA3XDTa+0GEyJ8Um/ch7wz7HqygACdFJYVODxng EQ4Gkm8D9nCYJ79Re64S9ItABklRPo+oT6s1hPV2wdo/7D/iZfE4vNHVeQeLFJ3xkH2wmgB7GyH LKlzs4sYc8A6Fu5K9D3kvbitGZC3D09OhVAGKjPbE X-Received: by 2002:ac2:4c9b:0:b0:500:9a15:9054 with SMTP id d27-20020ac24c9b000000b005009a159054mr8820041lfl.20.1696739831933; Sat, 07 Oct 2023 21:37:11 -0700 (PDT) X-Received: by 2002:ac2:4c9b:0:b0:500:9a15:9054 with SMTP id d27-20020ac24c9b000000b005009a159054mr8820036lfl.20.1696739831548; Sat, 07 Oct 2023 21:37:11 -0700 (PDT) MIME-Version: 1.0 References: <20230926050021.717-1-liming.wu@jaguarmicro.com> In-Reply-To: <20230926050021.717-1-liming.wu@jaguarmicro.com> From: Jason Wang Date: Sun, 8 Oct 2023 12:37:00 +0800 Message-ID: Subject: Re: [PATCH 1/2] tools/virtio: Add dma sync api for virtio test To: liming.wu@jaguarmicro.com Cc: "Michael S . Tsirkin" , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 398776277@qq.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 07 Oct 2023 21:38:24 -0700 (PDT) X-Spam-Level: ** On Tue, Sep 26, 2023 at 1:00=E2=80=AFPM wrote: > > From: Liming Wu > > Fixes: 8bd2f71054bd ("virtio_ring: introduce dma sync api for virtqueue") > also add dma sync api for virtio test. > > Signed-off-by: Liming Wu Acked-by: Jason Wang Thanks > --- > tools/virtio/linux/dma-mapping.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-ma= pping.h > index 834a90bd3270..822ecaa8e4df 100644 > --- a/tools/virtio/linux/dma-mapping.h > +++ b/tools/virtio/linux/dma-mapping.h > @@ -24,11 +24,23 @@ enum dma_data_direction { > #define dma_map_page(d, p, o, s, dir) (page_to_phys(p) + (o)) > > #define dma_map_single(d, p, s, dir) (virt_to_phys(p)) > +#define dma_map_single_attrs(d, p, s, dir, a) (virt_to_phys(p)) > #define dma_mapping_error(...) (0) > > #define dma_unmap_single(d, a, s, r) do { (void)(d); (void)(a); (void)(s= ); (void)(r); } while (0) > #define dma_unmap_page(d, a, s, r) do { (void)(d); (void)(a); (void)(s);= (void)(r); } while (0) > > +#define sg_dma_address(sg) (0) > +#define dma_need_sync(v, a) (0) > +#define dma_unmap_single_attrs(d, a, s, r, t) do { \ > + (void)(d); (void)(a); (void)(s); (void)(r); (void)(t); \ > +} while (0) > +#define dma_sync_single_range_for_cpu(d, a, o, s, r) do { \ > + (void)(d); (void)(a); (void)(o); (void)(s); (void)(r); \ > +} while (0) > +#define dma_sync_single_range_for_device(d, a, o, s, r) do { \ > + (void)(d); (void)(a); (void)(o); (void)(s); (void)(r); \ > +} while (0) > #define dma_max_mapping_size(...) SIZE_MAX > > #endif > -- > 2.34.1 >