Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4812202rwr; Sun, 23 Apr 2023 14:02:13 -0700 (PDT) X-Google-Smtp-Source: AKy350aIApckp2tWGmWNQnnyj8WAtH6iUMV0TjirB1Uvr8MtUpslSqxbZUB2wtFWRtHrIHDrTOe0 X-Received: by 2002:a05:6a00:b8a:b0:63d:23a7:ca62 with SMTP id g10-20020a056a000b8a00b0063d23a7ca62mr15379683pfj.19.1682283732840; Sun, 23 Apr 2023 14:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682283732; cv=none; d=google.com; s=arc-20160816; b=Dut18grHk4OHfdW6Tn8oCigM6ThfDCTOQO3lIBPxOX+c9qHn3UZYR/WWQXI/QYX0Lu KWTORzpTIszlal22ZZajUZsXktakOnc3SRhYVWvwAUYNOZfJr77w0paYMZGAhDd9nOzp kFUxQrGXJW3clx9ealmuuDz2yz64Ehcc/MKHaRd2tpfnJdXVsD8sllkwIPK5J4o+8GDd VXR0b0DOsoekosN/HdlKhfqTzSATVAyYQ2hUhmEKfFL38u8E/A0k9695t+K3h9VmfsWI HazVd5A2JqLbS784RJVRBr+fXYDYhKB7NeY+zRNuW/Vc30vHn/F/i9VVFcQUppRqgkXB g4VQ== 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=b5ejvIIx/RJ7eYanc2DeN6LKkOul5lY8GnPOGLq5m+0=; b=fYxKDFqYvTs0yRZRNwRJrPiVPzEOUjkZXiS/grQt3efdCOcfjcvHMLZ2ayaJ0KXSNO 6YZ9WWPs3kQ/KfxSt7pZKj70JsF8NXWpxReiWLvC3xgCj62ibWp8UXxdlzNX+4IPr/vt 3RO/3YIxMXkp53ouAf8n4sorbvyil7FcQfQw7UvdyAvA1zvU914SBZrf+0ovhHqZgCZZ JVhNG8KINmNvMuMchJqm6F3+b9XcBUJSDBnUvg4Vrn2O7MWXS2NuaX5aEorzSXSQlBTF tlDZXyX9xugiCiA9EM0+zindFGiMNgkM2xgNtyyfPObL0fCF0USQXGlcItPo++4ZMFIs qL/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dkJQsWm5; 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 189-20020a6305c6000000b005139191c0a7si10526100pgf.787.2023.04.23.14.01.53; Sun, 23 Apr 2023 14:02:12 -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=dkJQsWm5; 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 S229841AbjDWUSc (ORCPT + 99 others); Sun, 23 Apr 2023 16:18:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjDWUSb (ORCPT ); Sun, 23 Apr 2023 16:18:31 -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 B8911E6F for ; Sun, 23 Apr 2023 13:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682281062; 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=b5ejvIIx/RJ7eYanc2DeN6LKkOul5lY8GnPOGLq5m+0=; b=dkJQsWm5kU8xdjiueJcB1na8+LovmB6bKDobXr5eDBLspDyYXmYzgKgpZNC8Ivfgf5LC7J KNw+JpcGqrtcsSEvTwmaOkMbve9YpkZwTKQr77CsGUFZL0Dah5RZSMh+xC43lZbepF1iYj rQr2wDb85DCOU+z+087iBJ9b53eOnwc= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-462-PFKcRqCIOLaYCAZdhyEJGw-1; Sun, 23 Apr 2023 16:17:41 -0400 X-MC-Unique: PFKcRqCIOLaYCAZdhyEJGw-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f08900cad7so13088265e9.3 for ; Sun, 23 Apr 2023 13:17:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682281060; x=1684873060; 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=b5ejvIIx/RJ7eYanc2DeN6LKkOul5lY8GnPOGLq5m+0=; b=h3wu0IBI9Bg4P76xqzu3n+ICUG5SECjD9Zy/09xR2fgaPesdpSiXHZdn/1egGLPBqu +KAeJMpDYYPFdR5z2rKv6Ypfz7qhFVOzFqP5fAIq/wqOawmoa9z+XTjRWGxY/zxlGkDn 0Kg8Se53g4xuUThwur7UDRcE+UmHNkij9Xx1G0yvZrnWv/p+wZNo1xy5WAWyFfgdJAaW +HVZAT0SP3RGUk0RhdGMd4BqMTOYGsRrxKHcEXHvcasyShahD30bkZsxbzm7EAaFSigU kzv8wXyoEWifMtsOqBzbDB2owmXlG2ZWhHGnH8Qwlowv+2OImwWnmcclnKdvvpWp61Ki JogA== X-Gm-Message-State: AAQBX9cEFE3psyNbpOmQrDWF16sODhpWGDJ005BcyQ/UIfCjI2XXHZwr h9nvG3tx2A16WfMiyoqETyst1mErB7Jz0JM5qHJCTvfQzJWAOUGGFSw2Us0GbAPyfw9pSE8UgnI NMNMnR398XQTriihVcdhMOZ5NNmzquGKL X-Received: by 2002:a7b:c008:0:b0:3f1:7440:f21d with SMTP id c8-20020a7bc008000000b003f17440f21dmr5959102wmb.33.1682281059807; Sun, 23 Apr 2023 13:17:39 -0700 (PDT) X-Received: by 2002:a7b:c008:0:b0:3f1:7440:f21d with SMTP id c8-20020a7bc008000000b003f17440f21dmr5959093wmb.33.1682281059474; Sun, 23 Apr 2023 13:17:39 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id p1-20020a5d48c1000000b002f27dd92643sm2357771wrs.99.2023.04.23.13.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Apr 2023 13:17:38 -0700 (PDT) Date: Sun, 23 Apr 2023 16:17:35 -0400 From: "Michael S. Tsirkin" To: Alvaro Karsz Cc: Jason Wang , "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" Subject: Re: [PATCH net] virtio-net: reject small vring sizes Message-ID: <20230423161644-mutt-send-email-mst@kernel.org> References: <20230417051816-mutt-send-email-mst@kernel.org> <20230417073830-mutt-send-email-mst@kernel.org> <20230417075645-mutt-send-email-mst@kernel.org> <20230423031308-mutt-send-email-mst@kernel.org> <20230423065132-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=ham 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 23, 2023 at 12:28:49PM +0000, Alvaro Karsz wrote: > > > > > The rest of stuff can probably just be moved to after find_vqs without > > > > much pain. > > > > > > > Actually, I think that with a little bit of pain :) > > > If we use small vrings and a GRO feature bit is set, Linux will need to allocate 64KB of continuous memory for every receive descriptor.. > > > > Oh right. Hmm. Well this is same as big packets though, isn't it? > > > > Well, when VIRTIO_NET_F_MRG_RXBUF is not negotiated and one of the GRO features is, the receive buffers are page size buffers chained together to form a 64K buffer. > In this case, do all the chained descriptors actually point to a single block of continuous memory, or is it possible for the descriptors to point to pages spread all over? > > > > > > Instead of failing probe if GRO/CVQ are set, can we just reset the device if we discover small vrings and start over? > > > Can we remember that this device uses small vrings, and then just avoid negotiating the features that we cannot support? > > > > > > We technically can of course. I am just not sure supporting CVQ with just 1 s/g entry will > > ever be viable. > > Even if we won't support 1 s/g entry, do we want to fail probe in such cases? > We could just disable the CVQ feature (with reset, as suggested before). > I'm not saying that we should, just raising the option. > OK I'm convinced, reset and re-negotiate seems cleaner. -- MST