Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3603699rwe; Mon, 17 Apr 2023 00:09:19 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2+65RxdjWg844VWT94h1LMuHpfBVD3q9oxUCHCOtuZUAlSK916yb30ptgTDK2dKsBMcLT X-Received: by 2002:a05:6a21:6da2:b0:ef:dd63:1831 with SMTP id wl34-20020a056a216da200b000efdd631831mr2241049pzb.11.1681715359117; Mon, 17 Apr 2023 00:09:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681715359; cv=pass; d=google.com; s=arc-20160816; b=dfCEy3LfG0Av9fJDh+ksw3TuncJ1Y8q0o3JNM/HLs5K8lq9UbeRxaf0Kxrym9qmn+j q61Av5168GlV1aQsddYFUG7uXvb6lJipzxItevCTMqD7szjxYJo+VaXlPofXFAGW1q1y pI1fD82XsCA4TbloB6CMA9qMo4QaLKGDOGZBvP6YdLeemRecep2Lc/2MOHq+2Q7Gn7Lr ff3p92PAsyucjkoVWE4tSM38nPG9cSEyOjLc9qRw5keviZ2z1S116jdxa6UuuVRtolei R/WA0eP7maYaeCLy/K4/8xGO1lrQYbTZWyX85JS4+mtrl5ABppFWOpPM17oIAFQF9IVc N7Tg== 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=zKQyGSsCvFfJKbDIXvkZxWkXgn+4F9DDxOwQId9WFp4=; b=f/KPTqXkII4d2+0fxiIEC81UpgNnXHxXr+EayMQJxW06yV47XhdSA8/L4EpaOqfq9o uXZar66FjbsQq9g2NVCEr4OmeBzzy6WsRrg3ArDYrH7XEIOXS9hAyp+WqKU2aVu0Yyhn sEkZhoOJGaJ+CaFKjpD0+xyhLjFBM/pP3g4CfsrEI7XCvn4qSuk2Yz08SzFoHNjO5Y7a 3qVrWF0Kb1gWn0SpD7vz3bVTe5qtueECN9gyfycVCUONCCmsrJSZSX56H+gKmZ+681BC eakp667Wr35cu5SSdQzudk1zEYLc0pYfI3KilV37fRme7WkKKwCCzdBfEuB8yVWZ2tYQ 9gzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@solidrn.onmicrosoft.com header.s=selector1-solidrn-onmicrosoft-com header.b=N24Hk6hu; 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 i14-20020a63584e000000b00502f9ffb8bbsi11116496pgm.297.2023.04.17.00.09.06; Mon, 17 Apr 2023 00:09:19 -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=N24Hk6hu; 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 S230048AbjDQHEC (ORCPT + 99 others); Mon, 17 Apr 2023 03:04:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbjDQHEA (ORCPT ); Mon, 17 Apr 2023 03:04:00 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2057.outbound.protection.outlook.com [40.107.21.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7490B7; Mon, 17 Apr 2023 00:03:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b8Rg6fM/ZKOqQb2RNP86qx4ywv7po8MLL9cfWOb0QbJ/wI9eQaWGk2R3KzCasLlvosxJhdXbmBK1jrKe4FegWI2xdkA9/aPjjBKnX0L42lKZs1DcVrj9TyHiHWPJFGm6DyuvjRQJCfhkcD3H5OCpVmV8BFSHP9QffM7DUwFtEonRv2v+BN4vbBXv6l/D2MKUCVr6kW1PIk8jFZkUROPpH4XmagOBB/9zgTBGi7+rmdOY04xh0pY3TtxzyT8KN6TMq7UBG5cqgxw42Q4LS623M/8KU320H2NYulIBuxFm5R9P5ba+4YuR8V6+A6fibatYwbgOY9paM/wf8Vnkj1cX7g== 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=zKQyGSsCvFfJKbDIXvkZxWkXgn+4F9DDxOwQId9WFp4=; b=QhNkfwVdEhP3RpjGM1yEZhWJeqAPgfv+MVktkxihXBgLyo5QAl9gDQs+WBe+k9Fn5R3NqYhos7Y5tPp3f1buPXu+wbw8opQpFb0AOLyko92kRQ/iLtky3gPdBg7WwKSu5TOa8S+avK+ry9gwrc2rfPnhvTfec3SPRSt2VW9Mw/oUx0vHX7beQ154n1SsN98TJqxmD+WovQJ79CL3B0bPupAjJLzoANrl7qOUF3/Oc1e6qT+4ew4hf73NlG1AKtXYB1Z/mJLeE2AU4g9lDJ7hx/LtEsns/c+LWx2tlSaHtg48VFrzhbPQiSAvdJKOoOCaZQJpH1M5GygjRROYrTWyMA== 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=zKQyGSsCvFfJKbDIXvkZxWkXgn+4F9DDxOwQId9WFp4=; b=N24Hk6hu3uq6RSGyr6OrsA+5dQ1Ecy/IzsCXdGYWVuUGqC94dwUYBcQhvJ9TFr5zQ+W9TYHoqSqNO9UUqcHQUAQ7wpaXxqVmLT47ja4eBfUiyFj/4ysmPXTLHQluuJ2+KFCwHPxGsqkJaHswbhCaBGnMNCr9LAlu4ff1ubAj6CU= Received: from AM0PR04MB4723.eurprd04.prod.outlook.com (2603:10a6:208:c0::20) by PA4PR04MB8016.eurprd04.prod.outlook.com (2603:10a6:102:cb::10) 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:03:52 +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:03:52 +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: AQHZcDeGnH5xR2OGlkuo4s6jvhNMC68uIjT9gABGFgCAAG90AIAAMSwAgAABjzCAAARBAIAABATI Date: Mon, 17 Apr 2023 07:03:52 +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> In-Reply-To: <20230417023911-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_|PA4PR04MB8016:EE_ x-ms-office365-filtering-correlation-id: 21cae1d3-66c7-486c-ab0d-08db3f11e6df x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MMumY+qFWipP7xfDkSj04zeV/OXfa2yYMfVdvjSFV+HJhA72OMBp+fPbnNJk9QxgkQ9bnRRtYr6Q9ikfty0KiBROo1S0FZc6gjbOjHVMj1vDAfoFAkm7TArL1TwM5sVhbVx2KyFxU8Bdl0WUL7y50/TZCiCYB2Z999gi2KOySKjqWQgulEbZHVH5AJM6TDvGNmy8Iy2PkVulv9yAnCjzsOSA4uCODXuiqh50HnukJVw7HcKWi9NzJudBav39OGFWGko6j/WGmRBgprV53BUiLaNNXN29jnETZMvYAmiokayCNR3/8GFFbTd8Gv2Z4ZH7WEzgFQvPo53rDWhFP/ZzFE9u4tM5y/bWMvrFIcU5/CZ4pju9IWKZN3CY1WgqeiFNrbzKgxIk/vyZMY5WMrU2BEDGWKEUrDyElMgBojsHj5zgGBHiFy8uu8JhD1b8wn01A8Nyi8pZP98ssovJY3Q+2AtnCi7Lyn6JWfRh4vpmWXJ9FqmFcGLvlStzhNFTBRrW+UN/WAOS4zeAFp9oAA0++qhsQZGDw/nu/YTy6/fxiv6MdAnCQbMh/DYx8RJUG5KHubITRpZikPsqdVPht2OFbZnnvkQWp4Edd7MywbLXtoM4MA8AwH+L6ZoZBlyl4F9f 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)(376002)(366004)(396003)(136003)(39840400004)(346002)(451199021)(54906003)(55016003)(7696005)(71200400001)(478600001)(41300700001)(316002)(91956017)(6916009)(4326008)(64756008)(66556008)(186003)(66446008)(26005)(6506007)(9686003)(66946007)(66476007)(76116006)(52536014)(5660300002)(44832011)(2906002)(8936002)(8676002)(38100700002)(38070700005)(122000001)(33656002)(86362001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?A8MPFyM1CClUc9wII7XxQ78BkVA3EE+biqOL49hyyB/Q8Knuu6qGiJNzgQ?= =?iso-8859-1?Q?QlBD+qmElf8ZwZuhjcGCuQIWSWQo0ewyVsr8XqWCeCv9zOBF1rcaVtziTt?= =?iso-8859-1?Q?OQSiN4+0CkShiK0u57S1I+2oQ4vZ4IaGdVW95RoQ35OaAMnjiwnBMTZ2fc?= =?iso-8859-1?Q?1l7ZYvwNaj0CakMhmXYDzED3EHT2ygyIAAXG9gAOiGiN5qzLlVBJS9ruf6?= =?iso-8859-1?Q?znfM+wGn6auUV9jdNGfO4ZcsbVEjrh8NagjvTKD06CKW7UvTQd5WtDKY77?= =?iso-8859-1?Q?HD2FPJBtsgJZ639rLqPZhMeJO4KlimnFzfH8sKe+CTY5vw3C6hcxdAjOJR?= =?iso-8859-1?Q?8SkLZLumgVX14roKUVTygAmFYxYhIu0y3Kxun81Qb6V2va+Z1OmcelKz7C?= =?iso-8859-1?Q?nCh1Nl/zhvV4E7/isiDZxiPszadKiTCQU2UCQgykw9K6x9naHs5RdShaR3?= =?iso-8859-1?Q?rnkhxYWODsKezuxCaYygkTMo+mMpeifz6MCFTx+F3/5D0rnGP8QQUZtHdM?= =?iso-8859-1?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NbL0357wKAK7JCMyKlK4Z?= =?iso-8859-1?Q?+pnGB1rGTlLzkPZJPHSKPJN6B+qGLD698QUHTOfnwKNqeLDO1qTDfPypOY?= =?iso-8859-1?Q?t58WKWryR9Nw5Q7oiTD2HjixgHlSeCT3xYZfx5xdM/QZoAy/9s/jpac9fg?= =?iso-8859-1?Q?2KBdDIJtoAUNYbLTjNzeON5Z4jCcLW8S101Hwu0IXcUaaoxD/f9usYIEnk?= =?iso-8859-1?Q?+HRH6D1cdAJ6gllFbowDhl2mw4E2SBCn0F?= 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: 21cae1d3-66c7-486c-ab0d-08db3f11e6df X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Apr 2023 07:03:52.3451 (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: GjvfI6Jmkpby4n9x2Taggsg7zqKUWzkwg/n2/NIwC6PZAsHN/rwAbIqorfBzja018XUdPcTq0BSgQ82PTID/QhAAYP9Q1j8WTVcG2HMGiiU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB8016 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 disab= ling NETIF_F_SG we will never receive a chained skbs to transmit, but we st= ill 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 changes= to virtio-net.=0A= The source of the timeouts is from the current implementation of virtnet_po= ll_tx.=0A= =0A= if (sq->vq->num_free >=3D 2 + MAX_SKB_FRAGS)=0A= netif_tx_wake_queue(txq);=0A= =0A= =0A= > > * Guest GSO/big MTU (without VIRTIO_NET_F_MRG_RXBUF?), we can't chain p= age 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 vir= tio-net a little bit more, for example, the virtnet_set_big_packets functio= n.=0A=