Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5293699rwr; Mon, 1 May 2023 03:33:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ63TvZ/KvFU6dJ86djuWrRftUcvslTTuwcwItZdb381+JKt0+iK06ynm7jRUJNdI9w2IwCh X-Received: by 2002:a05:6a20:158c:b0:f2:e399:b114 with SMTP id h12-20020a056a20158c00b000f2e399b114mr16571155pzj.1.1682937237233; Mon, 01 May 2023 03:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682937237; cv=none; d=google.com; s=arc-20160816; b=QPQ7iCOh1Buj9X/c4i27IyNi3G17Xwl6VbghZ2M4R0jJFqzf+dY3lC0qP78QndZFYg kgqGpfEH9kLkxt6jTddDVnLjRSTq/QhxNAc8oU4OYXaKLXI0pvoChr8i4PTFSQ3twC4A /lyze1grRnydc+/ui2OYxJVzURjWrYiPMY4EpILq8XGoTaDyeUMWyJbjJt5lNfXcTClF S6eF+I0P3MNtafWNNORafr/H51rf3abE310PF00eh3xizSN6HYNwu4sOgGLThdAdQnln qmPtLBiJ8bp9wzMPq7K0V/n1At958SGHwpY6BZ9QpmFVV34zPEAWtoF7JKIlFuMsbFi9 xuIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GRtuEtk1Agus0i9a6G5WkwqsQ87YPTcPf/QGDRjhWqA=; b=sp61rNE8OgWwfEZjD4pP3LjG8sJJmPN1PNc0oTRCfmx1jK/eswaosOtvb8wIFgNdXY z9iFk3fNX9wLKlzmEBKWoUd9HMmZ0BbZ4u1aXQFLwT+r23H1ui+9NAwIpE5IntghfdhB HdAsLRZalQYgzbImv2MF91jymx0IF8FpSI4E6wP4PH+UWq5yrAoLrfVLyPrMYOapfpFF 1Uo+LSFwmDXcINjCWevS0JpTaLrRkCZUDKgDE8Sbesu/nI75YhbqBdP3Hj1ISev9mAfS 6GJ7UowCTeQ8rzaa9qJq5Q1j6g4cVr0soZ4pCGA7t6JaN9s+pwQoSmEmDgIsrBsR4DFF 5roQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H5EZSN2k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a630d06000000b0051b5d2315efsi26838568pgl.845.2023.05.01.03.33.42; Mon, 01 May 2023 03:33:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H5EZSN2k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231755AbjEAK2a (ORCPT + 99 others); Mon, 1 May 2023 06:28:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjEAK22 (ORCPT ); Mon, 1 May 2023 06:28:28 -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 BB690135 for ; Mon, 1 May 2023 03:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682936860; 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=GRtuEtk1Agus0i9a6G5WkwqsQ87YPTcPf/QGDRjhWqA=; b=H5EZSN2ko9LRDsD7BdDWQztbHQeXTj4PNMhw5IwRCWZXE403Oj0fHVNOvkz1UmNT8D3zBN szCVwN/+I0l8fcTfWq+N/ffoiRX8VopkKavya4bJKnp3PyxxKW4CjeBehRd6hretTAX+0y hQC+zJQD5DRRkX1zEeNxhtC8ZO6cfa4= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-167-pSJyoYN1N-ODTiGM8jbrXw-1; Mon, 01 May 2023 06:27:39 -0400 X-MC-Unique: pSJyoYN1N-ODTiGM8jbrXw-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3f32b3835e9so6996865e9.1 for ; Mon, 01 May 2023 03:27:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682936858; x=1685528858; 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 :message-id:reply-to; bh=GRtuEtk1Agus0i9a6G5WkwqsQ87YPTcPf/QGDRjhWqA=; b=TsxdrLSzOlGHXDupdfnJdpecG4V0HNTNx/HJAEkVJZSU9C9IDmvH27KJ1ERuJtPr7j EkXRPZfSADHBh/3u5vDYP3h+5nqaPpsHWgoW4B/h2+RepcrRSOvBFPXLrqs7CNehu3tY dhX0Jos1VU7d5CIGZoZHss56bnJqKuaB9zF1sBc4OTCSNAMJWIAFn/H9jn/qHcCCUumD ky/IYwZQrf3beFaWRBlSqr2vVvlJiR0s15HMulMRsi5YO8VvpzeklOF1SMg9GYtc7efr QMiP0KUNqezetv1GUIBLUwiP6nd5q3gE1iq3HEzLWqp6jTWi5skb3CsmaAfMSeE59n4M 5wzQ== X-Gm-Message-State: AC+VfDwZNu7KtxlfYPAJFK61s9Adw4K1s7Q4wMhtEm9PRHh+apcICuqF 1brPSCLjZNbO+yOBHbE/ZNxohUgwQJNA/ozxSG9R+By6ivQzCF45qpGVissJ/Bpdk+i4C7xN4jQ 4cD9vEkBatYZbeEZQq1M32cGH X-Received: by 2002:a05:600c:24cd:b0:3f1:92e8:a6fe with SMTP id 13-20020a05600c24cd00b003f192e8a6femr9959571wmu.31.1682936858082; Mon, 01 May 2023 03:27:38 -0700 (PDT) X-Received: by 2002:a05:600c:24cd:b0:3f1:92e8:a6fe with SMTP id 13-20020a05600c24cd00b003f192e8a6femr9959562wmu.31.1682936857810; Mon, 01 May 2023 03:27:37 -0700 (PDT) Received: from redhat.com ([2a06:c701:742c:c300:3695:a81b:6f0b:8940]) by smtp.gmail.com with ESMTPSA id f15-20020a7bcd0f000000b003f182cc55c4sm32005051wmj.12.2023.05.01.03.27.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 03:27:37 -0700 (PDT) Date: Mon, 1 May 2023 06:27:34 -0400 From: "Michael S. Tsirkin" To: Alvaro Karsz Cc: "jasowang@redhat.com" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "xuanzhuo@linux.alibaba.com" Subject: Re: [RFC PATCH net 0/3] virtio-net: allow usage of small vrings Message-ID: <20230501062107-mutt-send-email-mst@kernel.org> References: <20230430131518.2708471-1-alvaro.karsz@solid-run.com> <20230430100535-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 30, 2023 at 06:15:03PM +0000, Alvaro Karsz wrote: > > > > This patchset follows a discussion in the mailing list [1]. > > > > > > This fixes only part of the bug, rings with less than 4 entries won't > > > work. > > > > Why the difference? > > > > Because the RING_SIZE < 4 case requires much more adjustments. > > * We may need to squeeze the virtio header into the headroom. > * We may need to squeeze the GSO header into the headroom, or block the features. We alread do this though no? I think we'll need to tweak hard_header_len to guarantee it's there as opposed to needed_headroom ... > * At the moment, without NETIF_F_SG, we can receive a skb with 2 segments, we may need to reduce it to 1. You are saying clearing NETIF_F_SG does not guarantee a linear skb? > * We may need to change all the control commands, so class, command and command specific data will fit in a single segment. > * We may need to disable the control command and all the features depending on it. well if we don't commands just fail as we can't add them right? no corruption or stalls ... > * We may need to disable NAPI? hmm why napi? > There may be more changes.. > > I was thinking that it may be easier to start with the easier case RING_SIZE >= 4, make sure everything is working fine, then send a follow up patchset with the required adjustments for RING_SIZE < 4. it's ok but I'm just trying to figure out where does 4 come from.