Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp234774rwj; Fri, 23 Dec 2022 00:09:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXsjrelNoDt2FFUujEh6dedij6Y11kv0w0MCjLoTFWeEATWo5bn1XAuE8OAvR0cgayBq7Y/h X-Received: by 2002:a05:6a20:4b03:b0:ad:79bb:7869 with SMTP id fp3-20020a056a204b0300b000ad79bb7869mr10246401pzb.56.1671782989011; Fri, 23 Dec 2022 00:09:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671782988; cv=none; d=google.com; s=arc-20160816; b=UQrnRr/sGbdOFBPOiD4gMLEPEI8AbMLNnjscUrPS1cQuS37EeRja/YUXaSjvaAkGFv mFIWmH0NS4oz72A9GBysUoZanCNa1EICblN2nXIyeFojzH2MYz1bMk14nRNKnGWpdGBU pk6JYf8RBXwEAQMGA37q8MFzNChRC/0AbDqaR+nxeqDItfvo1iVTubD7/4pqeKij+imu qXlVJi0gB/IqZ9g5eJAHduG0aWNjZFbZ+1AzG1V7CKywPuEUwH2dkvtLyqyOP15d0mkP IGvG2tFIFk9plfeJRZZLNpmfKbkbzshyaeaywgUeQwZ2bbMF1VQepMF7XAcFYYDFGuIr mktg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FA3Upgc6ssVe6xdA6JsVzh+Jt01y4Sqla6SzmXxN8g4=; b=aDlSE2Rf8lhLFeBqLmNc0NO3CRePt3938GNstvcyuIXbbgUpSX2mIZTjKJMr/f0oEO GO6CwmXbMY/TESAKzjXKVkv6jGftfFLbS1MHc57SNYkTPdYFr7kAQ/PIdYAOMih8y20O aAuAwpyXdfxRU+3OiJlLDdOt2dz+Hd6pDhCtcHoFCaxcZ+zefMhFIY5/62oCuBE3pAhL 5OShrw8/5CDBFEznGCggir7XUUFKC/i94TlusH9EcLiAwSVyR7oYFd/lpIkABN9NhKrq SkPTBX9POkTQXIP52me3YLC+XhSH11DzyJ15aeacIBZdH58p8SZMnCSuR2UTWJGDOCMJ 21sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@solid-run-com.20210112.gappssmtp.com header.s=20210112 header.b=vEB8Uzl9; 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 v13-20020a63464d000000b00477d8b03517si3076656pgk.524.2022.12.23.00.09.39; Fri, 23 Dec 2022 00:09:48 -0800 (PST) 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=@solid-run-com.20210112.gappssmtp.com header.s=20210112 header.b=vEB8Uzl9; 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 S230150AbiLWHjS (ORCPT + 67 others); Fri, 23 Dec 2022 02:39:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbiLWHjP (ORCPT ); Fri, 23 Dec 2022 02:39:15 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 235B0183AC for ; Thu, 22 Dec 2022 23:39:15 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id n65-20020a17090a2cc700b0021bc5ef7a14so4297730pjd.0 for ; Thu, 22 Dec 2022 23:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=solid-run-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FA3Upgc6ssVe6xdA6JsVzh+Jt01y4Sqla6SzmXxN8g4=; b=vEB8Uzl9vY9nFk2qr5qnMKufBVt0p9QAaVvDrH4DemwYgfNK7N0YX/xnomNhC/xTTL roXzvIplSwSMpCGxoARG08eZpDE1T+19szBMbk0zc4KcmmR2b4OMZMKPcq4csrBwjO/a fp+xxrOFSU6sg99h++InHBt9mE1TuCRX8FazaiHK4BKU1KqhL4UYUruHLrs654GnB0TE rrq1pC3kMoIj+fvCqOofRqJUAEPQlJsIQ5nv6VN3MKzV8LqjaH/fdY8B+TwjQCPOmd7y 9rc+M7H642JfsI2vne32JJk2ylFSaC9hk5KyHKbBTY3YYOhisb6k2qB62QnWUtkrnRjA 7dHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FA3Upgc6ssVe6xdA6JsVzh+Jt01y4Sqla6SzmXxN8g4=; b=gl1+7c28KiKjYg5FWdNL73Ihz8Iwee1jlXJfnv2c1cQvvm6Mmlz03rxm+cHA/SAW4C DrQGZ+7xIWTx2fpOZDeIsN8q1kWOH2z5J/x7s1cYFuunnnF9Til+5TQ6gs/4Qf0dvbpN CjARQk/irlupqf5uW64hQ+LGy/pzvgC1P+8Ve7V+vg6BOsZrFpHF33PqjWVFOdoYWrAR Hv8zpoJD21oQOmFwLf7+//eEEPpMbyw5MBXzn+H/VzrcoUpjmI0/nznPVEV5yKfVkld+ HIc1nVAgC+YJaaqmsoA1do386KxNzlqggHbS5ww51PNfb0+4FWX88ZB0D1lmjV3QjunF tM3A== X-Gm-Message-State: AFqh2kq5R+1tpT/f2Y7MA+1msWRTLUOupftWxOdL2et63cT62rJjCdpo 50dVERsGD3f1iNzq7yk9fCL9dN2VtIRBj1hkyAz5sg== X-Received: by 2002:a17:90b:8b:b0:219:19c1:1ae7 with SMTP id bb11-20020a17090b008b00b0021919c11ae7mr675588pjb.13.1671781154551; Thu, 22 Dec 2022 23:39:14 -0800 (PST) MIME-Version: 1.0 References: <20221222060427.21626-1-jasowang@redhat.com> <20221222060427.21626-5-jasowang@redhat.com> In-Reply-To: From: Alvaro Karsz Date: Fri, 23 Dec 2022 09:38:37 +0200 Message-ID: Subject: Re: [RFC PATCH 4/4] virtio-net: sleep instead of busy waiting for cvq command To: Jason Wang Cc: mst@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, maxime.coquelin@redhat.com, eperezma@redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 > This needs to be proposed to the virtio spec first. And actually we > need more than this: > > 1) we still need a way to deal with the device without this feature > 2) driver can't depend solely on what is advertised by the device (e.g > device can choose to advertise a very long timeout) I think that I wasn't clear, sorry. I'm not talking about a new virtio feature, I'm talking about a situation when: * virtio_net issues a control command. * the device gets the command, but somehow, completes the command after timeout. * virtio_net assumes that the command failed (timeout), and issues a different control command. * virtio_net will then call virtqueue_wait_for_used, and will immediately get the previous response (If I'm not wrong). So, this is not a new feature that I'm proposing, just a situation that may occur due to cvq timeouts. Anyhow, your solution calling BAD_RING if we reach a timeout should prevent this situation. Thanks