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 2FD49C77B73 for ; Mon, 1 May 2023 10:28:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232300AbjEAK2c (ORCPT ); Mon, 1 May 2023 06:28:32 -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-Google-Smtp-Source: ACHHUZ4UGe6rKgDK9J0Fv3OD1362dMlDO30XbwBLq2L7tXBmbUGS4RqXkA11U0RdxloRzim2DjKI3Q== 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: 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.