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 DD8A6C3DA79 for ; Mon, 26 Dec 2022 03:46:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231490AbiLZDqw (ORCPT ); Sun, 25 Dec 2022 22:46:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbiLZDqv (ORCPT ); Sun, 25 Dec 2022 22:46:51 -0500 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 48C7EDFC for ; Sun, 25 Dec 2022 19:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672026364; 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=LPML0T2odU1efvKA6TB4e9nlnB9KljoL+oggFMgoV7U=; b=Bvu8b1TUY1E2MPEAP3BzBoEoDuDQoKPYHocp/o1Rt8ikM2/YBu6DnfFXD2fNYtdsENvGVf zcyJt8SRwssMs5agIdbFIh81blqjCSl0x1EHflJNlJsQP++ghg50WtnIYrmlTWQXc5PEWp 0CSKvsGT0kho4qwN9OrUtzCV/fgfMpA= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-124-gwr7SG6INlyNpkFS2SuroQ-1; Sun, 25 Dec 2022 22:45:55 -0500 X-MC-Unique: gwr7SG6INlyNpkFS2SuroQ-1 Received: by mail-ot1-f69.google.com with SMTP id e8-20020a9d63c8000000b006704cedcfe2so5875250otl.19 for ; Sun, 25 Dec 2022 19:45:55 -0800 (PST) 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=LPML0T2odU1efvKA6TB4e9nlnB9KljoL+oggFMgoV7U=; b=XABv1EsKazpEcy3aBpcjeooz776pwbGPckO67WfRq29sGM7rtGExvRqs1s+Wr135yX EjObQmQP0kRRqs5fAy9izKVKY787TI4eTLfb4QQFgPOJGYkRDzshRu6b69wuQ4ybQoOH uKEX+OxRUmPC9mWuL23iNiTxw+yLP7zIRe3GJ2FYu2h9yv7oTRWwM476H6IXl9f7Cpjx LFXBkHWD795NThf0oB1x99tam8ohFMfICjJ8ymZ8MOqknVEMw8cTAiIWsw2s8rG0b5iy 1g0qPI2ofj/x6X07pxCMRuq2b8rJTiB982la4ArBfYRVBWy+a5dZtqZn0j8gFl9JSw2y wFdQ== X-Gm-Message-State: AFqh2koTUtqgnIo/oZJKs7xubHvXkNy38zFM0mJY6LA9FEu5dKN0Gkaf QP3O3T34xPSCCA/p0t+tSrIRl3NesPnxnNGlVM+4Nz/BsvGNjzwWIeDeikFR0irVEEcYLG7kVnX 3kDPtyrPa7/QAic+lgbzZnLwxG0BgsLgp X-Received: by 2002:a05:6830:4a3:b0:670:8334:ccf2 with SMTP id l3-20020a05683004a300b006708334ccf2mr1092692otd.201.1672026354896; Sun, 25 Dec 2022 19:45:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXv4l8sal78jwmSmfNpp5adoBH8DFpxNZ4rOpa5yo3+kGZLSJd99jDWK2hJIcSUrI33x/vEuSXvdG0zyZB3QQ+8= X-Received: by 2002:a05:6830:4a3:b0:670:8334:ccf2 with SMTP id l3-20020a05683004a300b006708334ccf2mr1092684otd.201.1672026354707; Sun, 25 Dec 2022 19:45:54 -0800 (PST) MIME-Version: 1.0 References: <20221222060427.21626-1-jasowang@redhat.com> <20221222060427.21626-5-jasowang@redhat.com> In-Reply-To: From: Jason Wang Date: Mon, 26 Dec 2022 11:45:43 +0800 Message-ID: Subject: Re: [RFC PATCH 4/4] virtio-net: sleep instead of busy waiting for cvq command To: Alvaro Karsz 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" Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Dec 23, 2022 at 3:39 PM Alvaro Karsz wrote: > > > 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. Right, that is the goal. Thanks > > Thanks >