Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3626950rwe; Mon, 17 Apr 2023 00:37:33 -0700 (PDT) X-Google-Smtp-Source: AKy350ZJfxYyG5W/ergheq/xjcaoAvconMTjIMQw+1s/f/icJ7OMmIFS0oBUOlUjNueTHBOCbwdw X-Received: by 2002:a17:903:4112:b0:1a6:6fef:62f6 with SMTP id r18-20020a170903411200b001a66fef62f6mr10663197pld.30.1681717053401; Mon, 17 Apr 2023 00:37:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681717053; cv=pass; d=google.com; s=arc-20160816; b=k0XhRhfBDES9FzmGmFAb3ESNAWgTdwWsNJE4IlYceaAlO2GMQTe4LFqJ2r+6h6sQJX 60uWnmX4lAF2obLg+9V0wsMTpMtAHnTUJpcowmdAMbG6/lqfWDcBhuSkqfgRAGUOYF/t POD/D60w+hWvdMknk6iV7xnWbI2UmBXyvGcXfhJ92duQNg4HKF8USGG0v+MCp2jVJEYK B0euairiluYAql73559tsk5biln5ECkYv8yCyLPjGZgHV5GCnVhtAPb9w71ao8Xg69M3 ivkS2Ymn6iY5xYGmwcFlTkMy1yLDxPpZDZ3B3imyXyvB2e7cy4clHJvMu9a0t5WbJRqf P43w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=dHH1UOp1kdHERDYPaKU16BISIii18fSin6jeUbEGdY8=; b=HgtufjuXGFlg3e5iiHN2zJHCP46dQSlmm4KnJmNu9+SwkGDKwd2KKiohPrKQH1+V2C v3AFUMxdY/duOpxWvmi4dAHO/RCkTvro0WicnImSBhQfSdB0zh4wZ0QhcrRx4U0GFrPl FzHEuy+UVOpS0m3N+0eze3EFmFCgmRUADh7z9iABSOvKfbp7piBaiiabdVmNUf7rcq3o d+cFTF3A70o/1eGZc7VgxUx1Y6DmwYNqy3KxiglHWxuH8cjL/WwP1Ne2RL2bsqpJ0hYR 9ilnKPVBE2F2jP9WIt4FkL5eQFNqylR6/ldHrQ4CbTvEKPcjrappXqmN8TEjQwxNZHZ9 dQwQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@solidrn.onmicrosoft.com header.s=selector1-solidrn-onmicrosoft-com header.b=qll58cOP; arc=pass (i=1 spf=pass spfdomain=solid-run.com dkim=pass dkdomain=solid-run.com dmarc=pass fromdomain=solid-run.com); 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ja11-20020a170902efcb00b001a6bd4c9090si4619481plb.173.2023.04.17.00.37.22; Mon, 17 Apr 2023 00:37:33 -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=@solidrn.onmicrosoft.com header.s=selector1-solidrn-onmicrosoft-com header.b=qll58cOP; arc=pass (i=1 spf=pass spfdomain=solid-run.com dkim=pass dkdomain=solid-run.com dmarc=pass fromdomain=solid-run.com); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229488AbjDQHgZ (ORCPT + 99 others); Mon, 17 Apr 2023 03:36:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbjDQHgA (ORCPT ); Mon, 17 Apr 2023 03:36:00 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0D1D5BB3; Mon, 17 Apr 2023 00:34:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A0amTUAoDGhJVV2IvgQDB9QdS75ZuvStM4cbi3+aB7WBwQiU4XTrftSwByx8BEnAklWzwPrYJKYGQeQXAAmg0rwCMD8NU28iaZrWiFiIuzaXE2e4o+aVkcZGKsDSyxpM7UXpssJaM7gSs5bks4j3R59F9Yi1svyJAEqQBdbYfH4eUdKXsilwYdxx5BVenEl9WpZAIf4z6u6AlZU4q0mUUJ/q3aUkct6PqMvkYNi5+UmGD32nPiK5GGEO3hL1//HlFfs3oFpOT9hahPjJdwP3i5SULgw4HM5UNTjxzIW0gM+MOoAm3Z57UM7SN5vdssVNVp8bAjGei7ic+G9k8UGkvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dHH1UOp1kdHERDYPaKU16BISIii18fSin6jeUbEGdY8=; b=Cf/VyLqRGmrguFaM0MQbL25YOOFO4AwvONbSaESjtdoEDfqJGeZveXaraTV50RsGyuj+OiE03OUO67rDPyceiX50DwCqo8HrpppJ6zX4yF7XVq7DHBTWc0Gj03BJk/T8aJBSfgVfNII1HMcTw0OEixiyCLl0pgvNBK1nr6BUps6TUIupyoS1dkxLs0B4fxj59OCVDJhlzSIEbDuREbGknIZaPxchAGMRcfy9Ug8f7YnF0CP/1TXJJXulYQhwe2MAcX63+bxdjrWIKlOhvmhxj0FT6irZc0PRCJ1I7KU3QSPRs036ccLdSntSY7nf7wGGWLxI08auyUvF38eEF/QtNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=solid-run.com; dmarc=pass action=none header.from=solid-run.com; dkim=pass header.d=solid-run.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=solidrn.onmicrosoft.com; s=selector1-solidrn-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dHH1UOp1kdHERDYPaKU16BISIii18fSin6jeUbEGdY8=; b=qll58cOPbE2jFNpd123U9XYYGlmIcW4zJ1HSWgw4YmbEWcQn+V524/oKwt+LvMFvjJ5n0wrQKJdmCRlcwkZbuLrelG50wW1y5BCgKy5qmlAw1ZJ5jM9pRka5eAMO81RgbwmDA27ZQu5R/pCilX65IEMIBT4RlY+r0I8cUV18Vew= Received: from AM0PR04MB4723.eurprd04.prod.outlook.com (2603:10a6:208:c0::20) by DU2PR04MB8840.eurprd04.prod.outlook.com (2603:10a6:10:2e3::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Mon, 17 Apr 2023 07:33:58 +0000 Received: from AM0PR04MB4723.eurprd04.prod.outlook.com ([fe80::54c9:6706:9dc6:d977]) by AM0PR04MB4723.eurprd04.prod.outlook.com ([fe80::54c9:6706:9dc6:d977%5]) with mapi id 15.20.6298.030; Mon, 17 Apr 2023 07:33:58 +0000 From: Alvaro Karsz To: "Michael S. Tsirkin" 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 Thread-Topic: [PATCH net] virtio-net: reject small vring sizes Thread-Index: AQHZcDeGnH5xR2OGlkuo4s6jvhNMC68uIjT9gABGFgCAAG90AIAAMSwAgAABjzCAAARBAIAABATIgAAENICAAAM4Mw== Date: Mon, 17 Apr 2023 07:33:58 +0000 Message-ID: References: <20230416074607.292616-1-alvaro.karsz@solid-run.com> <20230416164453-mutt-send-email-mst@kernel.org> <20230417021725-mutt-send-email-mst@kernel.org> <20230417023911-mutt-send-email-mst@kernel.org> <20230417030713-mutt-send-email-mst@kernel.org> In-Reply-To: <20230417030713-mutt-send-email-mst@kernel.org> Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=solid-run.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM0PR04MB4723:EE_|DU2PR04MB8840:EE_ x-ms-office365-filtering-correlation-id: e19b4be2-c3ab-42ca-ab39-08db3f161b48 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VP7jBj0ZGSSF1pkKs03p/bc+06yuLdnRUKzOg/KgbgtARBUGU73UTXnP4L8r82+ax5V0iX5NCKG3aO7yVqrF8p0CjWwSKgT6S+wPrzXcckj8nFiD4bz4VG6WxjcGAb8YxILkdeLOLWv5BAshdEk79BPas7/9tzILM3MTplH9kMQD60OhVkE46O9nqB7p2vcND8sUfVWkAmS90nSjwq971YD95M+dpoCfgOowy5pIyuX4T7vjJsfV0+8nKqHYNJbd9rfD9A0alncfON+U22ICS1vue0jC8+L+PJXJBrpE9r943uRL2ZC9rWEzw4u1nR2tJ6JDWpdMq8N7NKEEjzgYfjKrWIu+Iq+mtEOj3grFNkbIlCN6xpiOjLAr9SUrEIMuJxdhzgseI7M/hYLdbs1ya0SjXR5/XriID/L2HxQFoDgBsAuJagjk2UmcFhUq82ebEgDpLpXSuccBv2o75rRUuG44ISJ4AME6glyx0o2vc8BwVG2Pm87XZHwZoG/aYX0u3osTkxA2cLnAOy6wpmupjmfyc4lY2B/fX/jJtlnICb8teLOMEcEIh87yGxmxOfvbxLzBpAguyIDrwJ7259hBLMLwf/Fwk8F0up34t54qCvMj++8KfL3+Dk1h1HZGhOUD x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB4723.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39840400004)(136003)(366004)(396003)(376002)(451199021)(55016003)(91956017)(66476007)(76116006)(66946007)(66556008)(66446008)(64756008)(6916009)(4326008)(478600001)(316002)(54906003)(5660300002)(52536014)(44832011)(8676002)(41300700001)(122000001)(8936002)(38100700002)(186003)(9686003)(71200400001)(7696005)(26005)(6506007)(33656002)(86362001)(38070700005)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?SZR4FT3691BVrjxka/bYA2FHv8ZTzKXzjSEqoZHp/oIfTjW3vLEEY9E1mB?= =?iso-8859-1?Q?4Si56Ykgi1WRYHHj73x7GiHvGT6GpcPKM3XGG8VbyQ/1q/mlB2TQztssh0?= =?iso-8859-1?Q?bNJHskNFL11XmFT5aKHExBuhUH1TSBfPUTSRJLKbx7Ww2aukpAfXFn0/ZY?= =?iso-8859-1?Q?tRjkahDsqISgv1mOeNNdpSHn/btIrfd1BoKRazAnA4fYHHwIBExFSUC1uF?= =?iso-8859-1?Q?ArjzVFCZfEb4U3Hzaz1tIHErbyErUfl3qCH+y1AQA+MRDc8BWAjjyFm0lJ?= =?iso-8859-1?Q?vhTqFPQXYGPK3cMzXKu9fQnlzTAWBmd2PN2ms/p2/Ubz7VxZv9WF2pAPcF?= =?iso-8859-1?Q?smJGb486xJCj7CTrKGGZaR0LCSHQNdrEuAQ1iDiPbZ+go5leSXK0E1ZSh5?= =?iso-8859-1?Q?IMCf9TlMnIBy7Dk1Iy31KwOh8p6Z2qxXQ4/5QeqoWBuCG7VWicBkXEz28x?= =?iso-8859-1?Q?G35zHIVq+Hl228cnF8aGdQV7TKQpn0A/8FncUtBbgeFZc3ZHT7LuMxpROF?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hiRrSdc5xU/c4c45gBVE5KOM5nUac?= =?iso-8859-1?Q?TECgO5Se2w71kSYZebcwanTFm5DVSHSFetl3C9Jy1cyXvqjGu/8MTorPuP?= =?iso-8859-1?Q?mPhFz8aXsxTsyySEhbEB9hGeAQ9jHhP4gLp2TzuS2qTmijSoFrfddn5VEz?= =?iso-8859-1?Q?7+E3u28v32aMwJ86pRlZPHhi7z8PMQo2ATOaHd0RCQ6PNYy7pvxNLclH9D?= =?iso-8859-1?Q?H5Cfwgwhuiw1C5K4mwAEpDdjhm+bhljJKc?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: solid-run.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4723.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e19b4be2-c3ab-42ca-ab39-08db3f161b48 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Apr 2023 07:33:58.2135 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a4a8aaf3-fd27-4e27-add2-604707ce5b82 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DSsQCOFNf/7Pki4w9Z0PxuhPISOtUw3DwrVOqV8+iMGoCDNp09myASUxGIk1nt3oWfU8qsG2QxAu8mVEIMXaFecjYK/UDb+o71ElhIcgceI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8840 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_PASS,SPF_PASS,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 > > > > > Actually, I think that all you need to do is disable NETIF_F_SG,= =0A= > > > > > and things will work, no?=0A= > > > >=0A= > > > > I think that this is not so simple, if I understand correctly, by d= isabling NETIF_F_SG we will never receive a chained skbs to transmit, but w= e still have more functionality to address, for example:=0A= > > > > * The TX timeouts.=0A= > > >=0A= > > > I don't get it. With a linear skb we can transmit it as long as there= 's=0A= > > > space for 2 entries in the vq: header and data. What's the source of = the=0A= > > > timeouts?=0A= > > >=0A= > >=0A= > > I'm not saying that this is not possible, I meant that we need more cha= nges to virtio-net.=0A= > > The source of the timeouts is from the current implementation of virtne= t_poll_tx.=0A= > >=0A= > > if (sq->vq->num_free >=3D 2 + MAX_SKB_FRAGS)=0A= > > netif_tx_wake_queue(txq);=0A= > =0A= > Oh right. So this should check NETIF_F_SG then.=0A= > BTW both ring size and s/g can be tweaked by ethtool, also=0A= > needs handling.=0A= > =0A= =0A= Good point.=0A= =0A= > >=0A= > > > > * Guest GSO/big MTU (without VIRTIO_NET_F_MRG_RXBUF?), we can't cha= in page size buffers anymore.=0A= > > >=0A= > > > I think we can. mergeable_min_buf_len will just be large.=0A= > > >=0A= > >=0A= > > I meant that we can't just by clearing NETIF_F_SG, we'll need to change= virtio-net a little bit more, for example, the virtnet_set_big_packets fun= ction.=0A= > >=0A= > =0A= > Right - for RX, big_packets_num_skbfrags ignores ring size and that's=0A= > probably a bug if mtu is very large.=0A= > =0A= =0A= So, what do you think, we should fix virtio-net to work with smaller rings?= we should fail probe?=0A= =0A= I think that since this never came up until now, there is no big demand to = such small rings.=0A=