From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BFBCC433E0 for ; Wed, 20 Jan 2021 06:49:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBE8F2313B for ; Wed, 20 Jan 2021 06:49:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbhATGsr (ORCPT ); Wed, 20 Jan 2021 01:48:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbhATGre (ORCPT ); Wed, 20 Jan 2021 01:47:34 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0BAAC061575 for ; Tue, 19 Jan 2021 22:46:47 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id g1so23779527edu.4 for ; Tue, 19 Jan 2021 22:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=g4lhhRzpUykCcRXCg/W7T7JNzcLSoefS0TeqhIEaN/8=; b=rPRydcGzNYYD4jdcx6cs91TNqFu4h+kQ6v/HhigV9C1h7tO7mVRQ/4RKNOl68YWW8e D61o4I2b1sWwltWA+6h5JB2vxbbrsgxCEYvue5eyWZSt6egTWDii7fFu+uGwP9JV8nTM fcRZ2Evekiu+eVFCPn3tXkOurhrsRuUKQcCAmhFApSsm+kxOxJMcGy4VdKB3cqWGLmv/ fnD654WAKlTvQA6+kmR1Y/YAx9QBZdZEzr08NWdJfLILFIN4Bi0gwQo3k11e1W0OyQAS oPREr7i2f1QuS+Crpshk5/7gaSE6RjKb5886HveDOq1DcYYFFQXJE3/4R3PrQg/aQtdz YwkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=g4lhhRzpUykCcRXCg/W7T7JNzcLSoefS0TeqhIEaN/8=; b=cRGHT08Ga0Rv2nvi1Qd66wFG6bqcbcbqjWAykKP3dHIqDZxRSj98nyOEhJQf+gUZUN kWTOwFcezavvb3UAs2dBC1inIHsPoglm0CNDoS7712va3dpEESjOYO5i5P0c+yfjSFo1 J2YNDMAugwg+lx2eWeinDCFkftQNH8Z7aq1i+SPpl3dQMSdxWoE1FkF2FQmxHOCm3Pe5 jO+yjGXm55+qkUYdxZQW+iO3cU5PE+6hm/EcQlPoN2ZpjFqIojBL6UPWXstVWfoegsE+ UsZlydDkzM+PtS/Y0wysunPn+y/ng5Wv/FFxrOjAyTO/PCVMSyIY9S3o/bf68nAG95Hw Xg3w== X-Gm-Message-State: AOAM530GyIoxRyiBDxFT8LyHuan2nZ2vw3khFLvnJiQ+cm0gnzz853sY QKNLdp1IPc6kyoGN1CCOKxX86FQSCC3SLJ4Kce6u X-Google-Smtp-Source: ABdhPJzS0Fmnn19Dv/j0SuEVertO84A9c+rb/SpMABBdKYWrAbeYpyc0LC9NhIq1vhkOeDgZsTngL/MrfQWeGGE/14o= X-Received: by 2002:a05:6402:228a:: with SMTP id cw10mr6032506edb.195.1611125206521; Tue, 19 Jan 2021 22:46:46 -0800 (PST) MIME-Version: 1.0 References: <20210119045920.447-1-xieyongji@bytedance.com> <20210119045920.447-4-xieyongji@bytedance.com> <310d7793-e4ff-fba3-f358-418cb64c7988@redhat.com> In-Reply-To: <310d7793-e4ff-fba3-f358-418cb64c7988@redhat.com> From: Yongji Xie Date: Wed, 20 Jan 2021 14:46:35 +0800 Message-ID: Subject: Re: Re: [RFC v3 03/11] vdpa: Remove the restriction that only supports virtio-net devices To: Jason Wang Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , sgarzare@redhat.com, Parav Pandit , Bob Liu , Christoph Hellwig , Randy Dunlap , Matthew Wilcox , viro@zeniv.linux.org.uk, axboe@kernel.dk, bcrl@kvack.org, Jonathan Corbet , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, Jan 20, 2021 at 11:47 AM Jason Wang wrote: > > > On 2021/1/19 =E4=B8=8B=E5=8D=8812:59, Xie Yongji wrote: > > With VDUSE, we should be able to support all kinds of virtio devices. > > > > Signed-off-by: Xie Yongji > > --- > > drivers/vhost/vdpa.c | 29 +++-------------------------- > > 1 file changed, 3 insertions(+), 26 deletions(-) > > > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > > index 29ed4173f04e..448be7875b6d 100644 > > --- a/drivers/vhost/vdpa.c > > +++ b/drivers/vhost/vdpa.c > > @@ -22,6 +22,7 @@ > > #include > > #include > > #include > > +#include > > > > #include "vhost.h" > > > > @@ -185,26 +186,6 @@ static long vhost_vdpa_set_status(struct vhost_vdp= a *v, u8 __user *statusp) > > return 0; > > } > > > > -static int vhost_vdpa_config_validate(struct vhost_vdpa *v, > > - struct vhost_vdpa_config *c) > > -{ > > - long size =3D 0; > > - > > - switch (v->virtio_id) { > > - case VIRTIO_ID_NET: > > - size =3D sizeof(struct virtio_net_config); > > - break; > > - } > > - > > - if (c->len =3D=3D 0) > > - return -EINVAL; > > - > > - if (c->len > size - c->off) > > - return -E2BIG; > > - > > - return 0; > > -} > > > I think we should use a separate patch for this. > Will do it. Thanks, Yongji