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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 18F25C433B4 for ; Tue, 13 Apr 2021 04:28:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1AEC613AB for ; Tue, 13 Apr 2021 04:28:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbhDME2y (ORCPT ); Tue, 13 Apr 2021 00:28:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbhDME2y (ORCPT ); Tue, 13 Apr 2021 00:28:54 -0400 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 640E8C061756 for ; Mon, 12 Apr 2021 21:28:34 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id x4so17776641edd.2 for ; Mon, 12 Apr 2021 21:28:34 -0700 (PDT) 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=KgX9vitQLsw/fJL+KP8I/opZHLQIHCxWsZWMUb2jijc=; b=eFRlFPRnxba6eXyWbDP4eUAP/8qETyj5QilhvrMDxqow9MKkPtjWWn5nKiuVjqrpkv BoNi0dhY+1eyDZLRsWmnQz7FsRI0GLPTaSvD5S6Nalm0QjKZ8LzS3XB1m/pI8zmgJ1Pz I2YA00fULsrV5BC6TbbvXbwwvZAcZ2gR+WuRjl4tJKWFuzSK2mUlQZBiqTi6CEbOIkFO sLOJkUheEo2WXa/FBLisAtNwE6JGx44fFsT4NAQRGb0u9MSeVR59huKxKvvrLZ6XhkWl 32bc/LrM4GhJ56+2MsnmB1/WkQCVsGpNBxuH6ZFSqodIMwLj28XAKOOyka489ZugEhXC 9hng== 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=KgX9vitQLsw/fJL+KP8I/opZHLQIHCxWsZWMUb2jijc=; b=jx6YAwhRTnn4Zlpcd4jz4oa9mKOTUNoGclXmN+Xg3WPs5dxMe1vg3Un0R0zSW9B48H UGO5pr3KSZ+xbBKCQuFaVhctCWOvppM6FztF9tuo1NeZNGIDxy7nwnNwsvl2zq9wJpk5 jBWuZA166JFFftaEYRF9QTKD0udeBDE99Rj+q98NuI4irYqWZSYIkOcPIZ4ZQRDxLQcS pg9H7He3sYGDtdVrroFxk1pb1rGM6LAb6HZ1AqJp60g0oZ+7bHG1+jQcBLqbAslmFxu6 /g4EaT0oyDIkgtpkswDapG7OaAZlcpinTFVvrqwwTLHGrSECf3aEK1MHKPl7S7I5lKFJ qGBA== X-Gm-Message-State: AOAM533qjPViwYrtlGWTWN8wFgypv1KMlzDbqaOq3rbTtDz0XzQAjXUt FNO0Txs9JT0kwRlX0FCY01kc3WOl0q6D8lNUUWlJ X-Google-Smtp-Source: ABdhPJxFsbFTwB0q0pNAp17qZJqIqm6vYW6whW2nB86LPbKviA3Z1PMbmmSz/1gnXoDoaJMm9C847RmTUrmsQNZTmWo= X-Received: by 2002:a05:6402:6ca:: with SMTP id n10mr32891030edy.312.1618288112971; Mon, 12 Apr 2021 21:28:32 -0700 (PDT) MIME-Version: 1.0 References: <20210331080519.172-1-xieyongji@bytedance.com> <20210331080519.172-10-xieyongji@bytedance.com> <091dde74-449b-385c-0ec9-11e4847c6c4c@redhat.com> <0f386dfe-45c9-5609-55f7-b8ab2a4abf5e@redhat.com> In-Reply-To: From: Yongji Xie Date: Tue, 13 Apr 2021 12:28:21 +0800 Message-ID: Subject: Re: Re: [PATCH v6 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace To: Jason Wang Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , Stefano Garzarella , Parav Pandit , Christoph Hellwig , Christian Brauner , Randy Dunlap , Matthew Wilcox , viro@zeniv.linux.org.uk, Jens Axboe , bcrl@kvack.org, Jonathan Corbet , =?UTF-8?Q?Mika_Penttil=C3=A4?= , Dan Carpenter , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.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: linux-fsdevel@vger.kernel.org On Tue, Apr 13, 2021 at 11:35 AM Jason Wang wrote: > > > =E5=9C=A8 2021/4/12 =E4=B8=8B=E5=8D=885:59, Yongji Xie =E5=86=99=E9=81=93= : > > On Mon, Apr 12, 2021 at 5:37 PM Jason Wang wrote: > >> > >> =E5=9C=A8 2021/4/12 =E4=B8=8B=E5=8D=884:02, Yongji Xie =E5=86=99=E9=81= =93: > >>> On Mon, Apr 12, 2021 at 3:16 PM Jason Wang wrot= e: > >>>> =E5=9C=A8 2021/4/9 =E4=B8=8B=E5=8D=884:02, Yongji Xie =E5=86=99=E9= =81=93: > >>>>>>>>> +}; > >>>>>>>>> + > >>>>>>>>> +struct vduse_dev_config_data { > >>>>>>>>> + __u32 offset; /* offset from the beginning of config spac= e */ > >>>>>>>>> + __u32 len; /* the length to read/write */ > >>>>>>>>> + __u8 data[VDUSE_CONFIG_DATA_LEN]; /* data buffer used to = read/write */ > >>>>>>>> Note that since VDUSE_CONFIG_DATA_LEN is part of uAPI it means w= e can > >>>>>>>> not change it in the future. > >>>>>>>> > >>>>>>>> So this might suffcient for future features or all type of virti= o devices. > >>>>>>>> > >>>>>>> Do you mean 256 is no enough here=EF=BC=9F > >>>>>> Yes. > >>>>>> > >>>>> But this request will be submitted multiple times if config lengh i= s > >>>>> larger than 256. So do you think whether we need to extent the size= to > >>>>> 512 or larger? > >>>> So I think you'd better either: > >>>> > >>>> 1) document the limitation (256) in somewhere, (better both uapi and= doc) > >>>> > >>> But the VDUSE_CONFIG_DATA_LEN doesn't mean the limitation of > >>> configuration space. It only means the maximum size of one data > >>> transfer for configuration space. Do you mean document this? > >> > >> Yes, and another thing is that since you're using > >> data[VDUSE_CONFIG_DATA_LEN] in the uapi, it implies the length is alwa= ys > >> 256 which seems not good and not what the code is wrote. > >> > > How about renaming VDUSE_CONFIG_DATA_LEN to VDUSE_MAX_TRANSFER_LEN? > > > > Thanks, > > Yongji > > > So a question is the reason to have a limitation of this in the uAPI? > Note that in vhost-vdpa we don't have such: > > struct vhost_vdpa_config { > __u32 off; > __u32 len; > __u8 buf[0]; > }; > If so, we need to call read()/write() multiple times each time receiving/sending one request or response in userspace and kernel. For example, 1. read and check request/response type 2. read and check config length if type is VDUSE_SET_CONFIG or VDUSE_GET_CO= NFIG 3. read the payload Not sure if it's worth it. Thanks, Yongji