From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id 414E7986534 for ; Wed, 7 Sep 2022 14:40:23 +0000 (UTC) Date: Wed, 7 Sep 2022 10:40:13 -0400 From: "Michael S. Tsirkin" Message-ID: <20220907103420-mutt-send-email-mst@kernel.org> References: <20220901021038.84751-1-gavinl@nvidia.com> <20220901021038.84751-3-gavinl@nvidia.com> <20220907012608-mutt-send-email-mst@kernel.org> <0355d1e4-a3cf-5b16-8c7f-b39b1ec14ade@nvidia.com> <20220907052317-mutt-send-email-mst@kernel.org> <20220907101335-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 In-Reply-To: Subject: [virtio-dev] Re: [PATCH v5 2/2] virtio-net: use mtu size as buffer length for big packets Content-Type: text/plain; charset=us-ascii Content-Disposition: inline To: Parav Pandit Cc: Gavin Li , "stephen@networkplumber.org" , "davem@davemloft.net" , "jesse.brandeburg@intel.com" , "kuba@kernel.org" , "sridhar.samudrala@intel.com" , "jasowang@redhat.com" , "loseweigh@gmail.com" , "netdev@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "virtio-dev@lists.oasis-open.org" , Gavi Teitz , Xuan Zhuo , Si-Wei Liu List-ID: On Wed, Sep 07, 2022 at 02:33:02PM +0000, Parav Pandit wrote: > > > From: Michael S. Tsirkin > > Sent: Wednesday, September 7, 2022 10:30 AM > > [..] > > > > actually how does this waste space? Is this because your device does > > > > not have INDIRECT? > > > VQ is 256 entries deep. > > > Driver posted total of 256 descriptors. > > > Each descriptor points to a page of 4K. > > > These descriptors are chained as 4K * 16. > > > > So without indirect then? with indirect each descriptor can point to 16 > > entries. > > > With indirect, can it post 256 * 16 size buffers even though vq depth is 256 entries? > I recall that total number of descriptors with direct/indirect descriptors is limited to vq depth. > Was there some recent clarification occurred in the spec to clarify this? This would make INDIRECT completely pointless. So I don't think we ever had such a limitation. The only thing that comes to mind is this: A driver MUST NOT create a descriptor chain longer than the Queue Size of the device. but this limits individual chain length not the total length of all chains. We have an open bug that we forgot to include this requirement in the packed ring documentation. -- MST --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org 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 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D83ABC54EE9 for ; Wed, 7 Sep 2022 14:40:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 630034156A; Wed, 7 Sep 2022 14:40:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 630034156A Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gutEx6zY X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qB4ryK_06gzi; Wed, 7 Sep 2022 14:40:32 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id A39B1410E0; Wed, 7 Sep 2022 14:40:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A39B1410E0 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6EA7DC0033; Wed, 7 Sep 2022 14:40:31 +0000 (UTC) Received: from smtp1.osuosl.org (unknown [IPv6:2605:bc80:3010:0:a800:ff:fe97:d076]) by lists.linuxfoundation.org (Postfix) with ESMTP id CBF49C002D for ; Wed, 7 Sep 2022 14:40:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A55FC81415 for ; Wed, 7 Sep 2022 14:40:29 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A55FC81415 Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gutEx6zY X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RwHzuadWDbS2 for ; Wed, 7 Sep 2022 14:40:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 78EBD81414 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 78EBD81414 for ; Wed, 7 Sep 2022 14:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662561626; 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: in-reply-to:in-reply-to:references:references; bh=1I+mmxEc4W8pgNyOHb25c63UJY3eA7dquqzLpsq3wXo=; b=gutEx6zYs12HFQfLAO/MViO1GakbJwHoovOnK71WttsPKPMy2TgnjJYkdgQk/sD9HJw76p gXhdm32z0DssdaZTvygTgZ+YRXT5iCvQRPw/3ZTcY7r/TV5f6NehvwEsG8Cu0I1RbJY/+2 fJWEb1Lwz9pfrxiePn+U/8UU5xz1H+g= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-314-5-az-9fBPKKWmgZynldqbg-1; Wed, 07 Sep 2022 10:40:20 -0400 X-MC-Unique: 5-az-9fBPKKWmgZynldqbg-1 Received: by mail-wr1-f70.google.com with SMTP id j12-20020adfff8c000000b002265dcdfad7so3635213wrr.2 for ; Wed, 07 Sep 2022 07:40:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=1I+mmxEc4W8pgNyOHb25c63UJY3eA7dquqzLpsq3wXo=; b=JKKJb0I7YCgowfUV2PMP+vYvKXd4I3XQZQw9nJ9wTUGVlvEGYWUG3YTLZt+FBVVZlH n3M7f+WlaBuntZSgjLtzeiI+YQW8cXCZruqopFlokSbHzYQxmnkIlg9+Zqvg26GTVqhe NQJzY/Gl55w6f4gAg6F9JTxVGU22JkgDw7sidPtNPjQO39l7pIO6vQP9GvbQ+34GUBfg 8eMcnUqThl1BJR9wLcBZI9gRkDp9oWjLK5sFnzEYxilzedBeppZ6IE956fqV0XCOvLTj wrkVmL3/8bAOMenqRcAJlG0/udMW96jEVqlg5MSQWZMVc+XRyHPWVDL6J/VgEudH4Ndh CxUA== X-Gm-Message-State: ACgBeo0ISouR6ZNREKRf29vFNz8dvTb9KZaLGctN1CRBEFzjIQ8OL6Jn Ed4DL7KIH4jWlxAcs09nP6a+jfXbsTaxe9vIJ+7oMo8DhRY4OKydA0ekTPx0ym0tZAxdvWQPqxz ag6RGsu1s4Qq9h4vJcBdg9avAWatnS2XduDWYMtO4Ig== X-Received: by 2002:a5d:47aa:0:b0:226:dbf6:680c with SMTP id 10-20020a5d47aa000000b00226dbf6680cmr2325761wrb.581.1662561618396; Wed, 07 Sep 2022 07:40:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Ar7DT/A/B1M/OnVG85xAlKMimAFPyKe5R4Ua4FXozjUSRQVqhm4XYKvyRiC8+NGb64xiXtQ== X-Received: by 2002:a5d:47aa:0:b0:226:dbf6:680c with SMTP id 10-20020a5d47aa000000b00226dbf6680cmr2325743wrb.581.1662561618193; Wed, 07 Sep 2022 07:40:18 -0700 (PDT) Received: from redhat.com ([2.52.135.118]) by smtp.gmail.com with ESMTPSA id i4-20020a05600c354400b003a2f6367049sm21410320wmq.48.2022.09.07.07.40.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 07:40:17 -0700 (PDT) Date: Wed, 7 Sep 2022 10:40:13 -0400 From: "Michael S. Tsirkin" To: Parav Pandit Subject: Re: [PATCH v5 2/2] virtio-net: use mtu size as buffer length for big packets Message-ID: <20220907103420-mutt-send-email-mst@kernel.org> References: <20220901021038.84751-1-gavinl@nvidia.com> <20220901021038.84751-3-gavinl@nvidia.com> <20220907012608-mutt-send-email-mst@kernel.org> <0355d1e4-a3cf-5b16-8c7f-b39b1ec14ade@nvidia.com> <20220907052317-mutt-send-email-mst@kernel.org> <20220907101335-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: "virtio-dev@lists.oasis-open.org" , "sridhar.samudrala@intel.com" , "jesse.brandeburg@intel.com" , Gavi Teitz , "virtualization@lists.linux-foundation.org" , "stephen@networkplumber.org" , "loseweigh@gmail.com" , "netdev@vger.kernel.org" , "kuba@kernel.org" , "davem@davemloft.net" , Gavin Li X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Wed, Sep 07, 2022 at 02:33:02PM +0000, Parav Pandit wrote: > > > From: Michael S. Tsirkin > > Sent: Wednesday, September 7, 2022 10:30 AM > > [..] > > > > actually how does this waste space? Is this because your device does > > > > not have INDIRECT? > > > VQ is 256 entries deep. > > > Driver posted total of 256 descriptors. > > > Each descriptor points to a page of 4K. > > > These descriptors are chained as 4K * 16. > > > > So without indirect then? with indirect each descriptor can point to 16 > > entries. > > > With indirect, can it post 256 * 16 size buffers even though vq depth is 256 entries? > I recall that total number of descriptors with direct/indirect descriptors is limited to vq depth. > Was there some recent clarification occurred in the spec to clarify this? This would make INDIRECT completely pointless. So I don't think we ever had such a limitation. The only thing that comes to mind is this: A driver MUST NOT create a descriptor chain longer than the Queue Size of the device. but this limits individual chain length not the total length of all chains. We have an open bug that we forgot to include this requirement in the packed ring documentation. -- MST _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BEF4C38145 for ; Wed, 7 Sep 2022 14:41:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229603AbiIGOka (ORCPT ); Wed, 7 Sep 2022 10:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbiIGOkZ (ORCPT ); Wed, 7 Sep 2022 10:40:25 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED7645F78 for ; Wed, 7 Sep 2022 07:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662561621; 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: in-reply-to:in-reply-to:references:references; bh=1I+mmxEc4W8pgNyOHb25c63UJY3eA7dquqzLpsq3wXo=; b=SMvxR2B5+IMhxaDCx2pFLVL/y2lbT1WGWe3yLfSWN5eroRPBaksaZL8VLw8EEfdKg2iSlg FqLrdWngiUUQvU7cGvC+XkxmO/bLdTIzpxvECpQRXk+mOi9aDa4yDLbTwQX18mkIxBXvEG KLc/IVO5onCawDgoMgeQuaOm2SA07/E= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-314-aSIIjWqPMIiXlL4m9KGUGg-1; Wed, 07 Sep 2022 10:40:20 -0400 X-MC-Unique: aSIIjWqPMIiXlL4m9KGUGg-1 Received: by mail-wr1-f70.google.com with SMTP id e2-20020adfc842000000b0022861d95e63so3159774wrh.14 for ; Wed, 07 Sep 2022 07:40:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=1I+mmxEc4W8pgNyOHb25c63UJY3eA7dquqzLpsq3wXo=; b=cVba883kaYACod9gUiPKVQtudn4BKDPB1F1/ByEfNJR4diMQFaPy5BGlB6w0HJJsdd SM5wXcuTB2d3h8ek/U0QxuLoHBTzi+bCPDbP1oWTz+aDkji4bXztQ9MVt4zzb/DODl2I RvhVA4xfiK+dZD3k30b42LV3kzg4ar93P01gNZ1zUz7rFRNFukSeUEKpNYtueAKKt+Qn cxYxAvBxULyiHijsZylS6nfvB/H1jt5FSeTz1abqEHLVQaFBIqPU0b/E/fFdtBrqtQe6 aGJjkhHQ2pRQ1ULfoRz2HNfwi4bPkl4hB2Pdu7brMkjdTXOf49ZyZemRvvE8+OvffHpl 4utA== X-Gm-Message-State: ACgBeo1Ug5mPrafm2WMrOn3Ok/0gK7K3uY7cMHvt41DsFY7OOI8ZU2f8 xMfl6+aIQBtKV3Q0t8Tntd7XMr29m3AlmCmSngD491lBUReys5kPyaD7D0oxgbVM+VjyCQWpefm rv+fkTEuY69JNGXjz X-Received: by 2002:a5d:47aa:0:b0:226:dbf6:680c with SMTP id 10-20020a5d47aa000000b00226dbf6680cmr2325762wrb.581.1662561618398; Wed, 07 Sep 2022 07:40:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Ar7DT/A/B1M/OnVG85xAlKMimAFPyKe5R4Ua4FXozjUSRQVqhm4XYKvyRiC8+NGb64xiXtQ== X-Received: by 2002:a5d:47aa:0:b0:226:dbf6:680c with SMTP id 10-20020a5d47aa000000b00226dbf6680cmr2325743wrb.581.1662561618193; Wed, 07 Sep 2022 07:40:18 -0700 (PDT) Received: from redhat.com ([2.52.135.118]) by smtp.gmail.com with ESMTPSA id i4-20020a05600c354400b003a2f6367049sm21410320wmq.48.2022.09.07.07.40.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 07:40:17 -0700 (PDT) Date: Wed, 7 Sep 2022 10:40:13 -0400 From: "Michael S. Tsirkin" To: Parav Pandit Cc: Gavin Li , "stephen@networkplumber.org" , "davem@davemloft.net" , "jesse.brandeburg@intel.com" , "kuba@kernel.org" , "sridhar.samudrala@intel.com" , "jasowang@redhat.com" , "loseweigh@gmail.com" , "netdev@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "virtio-dev@lists.oasis-open.org" , Gavi Teitz , Xuan Zhuo , Si-Wei Liu Subject: Re: [PATCH v5 2/2] virtio-net: use mtu size as buffer length for big packets Message-ID: <20220907103420-mutt-send-email-mst@kernel.org> References: <20220901021038.84751-1-gavinl@nvidia.com> <20220901021038.84751-3-gavinl@nvidia.com> <20220907012608-mutt-send-email-mst@kernel.org> <0355d1e4-a3cf-5b16-8c7f-b39b1ec14ade@nvidia.com> <20220907052317-mutt-send-email-mst@kernel.org> <20220907101335-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Sep 07, 2022 at 02:33:02PM +0000, Parav Pandit wrote: > > > From: Michael S. Tsirkin > > Sent: Wednesday, September 7, 2022 10:30 AM > > [..] > > > > actually how does this waste space? Is this because your device does > > > > not have INDIRECT? > > > VQ is 256 entries deep. > > > Driver posted total of 256 descriptors. > > > Each descriptor points to a page of 4K. > > > These descriptors are chained as 4K * 16. > > > > So without indirect then? with indirect each descriptor can point to 16 > > entries. > > > With indirect, can it post 256 * 16 size buffers even though vq depth is 256 entries? > I recall that total number of descriptors with direct/indirect descriptors is limited to vq depth. > Was there some recent clarification occurred in the spec to clarify this? This would make INDIRECT completely pointless. So I don't think we ever had such a limitation. The only thing that comes to mind is this: A driver MUST NOT create a descriptor chain longer than the Queue Size of the device. but this limits individual chain length not the total length of all chains. We have an open bug that we forgot to include this requirement in the packed ring documentation. -- MST