Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1553990rwd; Sun, 14 May 2023 22:45:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6BDUjZUkE2yUehubCfQjCQjxG1xGorNOlEUwl4p6CkFS7NBCqQB9x86NIV2F3hKVxfQb00 X-Received: by 2002:a17:902:82c5:b0:1ac:b4db:6a80 with SMTP id u5-20020a17090282c500b001acb4db6a80mr17784402plz.5.1684129523743; Sun, 14 May 2023 22:45:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684129523; cv=none; d=google.com; s=arc-20160816; b=db+d9kgYi6EDSty2h+d62genZ9ulo6GVWJDOyDAP75Hw2+ZCVpflVBKzVYGUpT8IW6 dFQeI3kiQTPe6ksZbhZSanazQ/0QnNpN5WfTfzrdiogFXYT378aw+bxCuKSx4rwfsOS6 TRCilP2Ld8bwGXTSrXUR8m0kApHoBgA/LbjRzlo93+5W9bYiS96UD9C5Eu4nB3JatN1m kBR0hJQlJULOfuxmMdMJox2uCSeelMU3ONHaBNVTpmLnQhCYnL60Nuqe65H/QfRQod/V v6nrTLZn6zXeeTHkZw6en8WJ/nwApXsfHQ2+9IpfArs6lGVFAqAcRqyZANXUbpwn4zve HC5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=PWL+vmE+VOJe076wrGPBFtIigtHfPH7nZD62FaxHuXw=; b=lmnR99pgb92LxdO8+0G3VtBcdV4uhQbdBfhyoGImGn4JxbevEYJ8OUql8fA3zgUt1v CagoovKBhqmZt6/bp9p8od02Hk6woZuROfMJygALkJHcuVsH4WBtSijTT+GHQ+ze7xgT YTY7sKX460qljzGaGcyy87D7qiYf6n/5ZRhjTzrSBIN5zVtfXjza+SeOaKrjOMYy6oqY ROTJvx1ejj/qGzTUwm+msW4A0K3BMWVEHw389KLlow/XBdb4LjfFFwa2komzYgtNQPHE mDQef/+31KHENFa1K0UJ98QRni152o9DC37eEMcHXX9LasXC0W6WIjqoN8afbnCPNNjY 3ccg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Th3SGSwZ; 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 n10-20020a170902d2ca00b001ab23ced2d2si16963432plc.613.2023.05.14.22.45.08; Sun, 14 May 2023 22:45:23 -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=Th3SGSwZ; 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 S229966AbjEOFOi (ORCPT + 99 others); Mon, 15 May 2023 01:14:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjEOFOh (ORCPT ); Mon, 15 May 2023 01:14:37 -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 5285410D7 for ; Sun, 14 May 2023 22:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684127629; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PWL+vmE+VOJe076wrGPBFtIigtHfPH7nZD62FaxHuXw=; b=Th3SGSwZ8O1kI21W6XdqksIctb1/6GZbQkpOd1uFThvl1AWi/oxvujHFf/tTuSFvPms9Lo Vyi9X+V1Gc3qWFhV89N8WRGebHXDLpLpdJgl9u/UjreJ5EzZOjTvg+B6mBlBFmkugNRNHZ aYnFX6pQNbfD3AuU3k6upTznbEA2mQk= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-AhlHplGfMJuoO0yKHl4BRw-1; Mon, 15 May 2023 01:13:47 -0400 X-MC-Unique: AhlHplGfMJuoO0yKHl4BRw-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-4f381431472so663155e87.3 for ; Sun, 14 May 2023 22:13:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684127625; x=1686719625; h=content-transfer-encoding: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=PWL+vmE+VOJe076wrGPBFtIigtHfPH7nZD62FaxHuXw=; b=JULR3mE5mPLfdCGqoLMuOi2UlGnG294Lz2vYemGoHauOC899unDa3Ub11VHw1LSBGu yGEexlNmopeojSRbSYWBRNFvjVyZyJKhnAeOeiok6RroSTKOHeGt92LEzmZ5+abPCIi5 kIqmBPDMJQwDRu8kDrkv9BBG3Ej0ycoAAoJZtadVyLOb9aQacY3aePlo9uSQiU0N8FPH ORDfiPRmtpvz47nA+7Q5TU7yuiblvHUW/9RiCDdUBX0TiM8Bh+OWx1PPBr2Kd3afBwMC ZwBScBiVEdpsKL6lhc/5gULrmjkK1LsFdEftJn4wGbyDIVZMkThKCYdPrhCnXp1symqa jmng== X-Gm-Message-State: AC+VfDwoMwq4OnLiOxZxQ8F++VbIl/mFG6Zix960ILhNDVge5yAoWs1/ IscXAouZ1oG3wN3Zwjq6Z7f62fFYwENFQTgYKG4o413eTNCl2O1ht3hy6AGeBcoJkdJCKkxEBO5 +TJevIDWmlxAzAn+S+mYH6mLosOL60RZybyQ1n2pp X-Received: by 2002:ac2:4c32:0:b0:4f2:e145:7170 with SMTP id u18-20020ac24c32000000b004f2e1457170mr1682376lfq.11.1684127625478; Sun, 14 May 2023 22:13:45 -0700 (PDT) X-Received: by 2002:ac2:4c32:0:b0:4f2:e145:7170 with SMTP id u18-20020ac24c32000000b004f2e1457170mr1682370lfq.11.1684127625214; Sun, 14 May 2023 22:13:45 -0700 (PDT) MIME-Version: 1.0 References: <20230413064027.13267-1-jasowang@redhat.com> <20230413064027.13267-2-jasowang@redhat.com> <20230413121525-mutt-send-email-mst@kernel.org> <20230414031947-mutt-send-email-mst@kernel.org> <20230510012951-mutt-send-email-mst@kernel.org> <20230515004422-mutt-send-email-mst@kernel.org> In-Reply-To: <20230515004422-mutt-send-email-mst@kernel.org> From: Jason Wang Date: Mon, 15 May 2023 13:13:33 +0800 Message-ID: Subject: Re: [PATCH net-next V2 1/2] virtio-net: convert rx mode setting to use workqueue To: "Michael S. Tsirkin" Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, maxime.coquelin@redhat.com, alvaro.karsz@solid-run.com, eperezma@redhat.com, xuanzhuo@linux.alibaba.com, david.marchand@redhat.com, netdev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 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=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 On Mon, May 15, 2023 at 12:45=E2=80=AFPM Michael S. Tsirkin wrote: > > On Mon, May 15, 2023 at 09:05:54AM +0800, Jason Wang wrote: > > On Wed, May 10, 2023 at 1:33=E2=80=AFPM Michael S. Tsirkin wrote: > > > > > > On Mon, Apr 17, 2023 at 11:40:58AM +0800, Jason Wang wrote: > > > > On Fri, Apr 14, 2023 at 3:21=E2=80=AFPM Michael S. Tsirkin wrote: > > > > > > > > > > On Fri, Apr 14, 2023 at 01:04:15PM +0800, Jason Wang wrote: > > > > > > Forget to cc netdev, adding. > > > > > > > > > > > > On Fri, Apr 14, 2023 at 12:25=E2=80=AFAM Michael S. Tsirkin wrote: > > > > > > > > > > > > > > On Thu, Apr 13, 2023 at 02:40:26PM +0800, Jason Wang wrote: > > > > > > > > This patch convert rx mode setting to be done in a workqueu= e, this is > > > > > > > > a must for allow to sleep when waiting for the cvq command = to > > > > > > > > response since current code is executed under addr spin loc= k. > > > > > > > > > > > > > > > > Signed-off-by: Jason Wang > > > > > > > > > > > > > > I don't like this frankly. This means that setting RX mode wh= ich would > > > > > > > previously be reliable, now becomes unreliable. > > > > > > > > > > > > It is "unreliable" by design: > > > > > > > > > > > > void (*ndo_set_rx_mode)(struct net_dev= ice *dev); > > > > > > > > > > > > > - first of all configuration is no longer immediate > > > > > > > > > > > > Is immediate a hard requirement? I can see a workqueue is used = at least: > > > > > > > > > > > > mlx5e, ipoib, efx, ... > > > > > > > > > > > > > and there is no way for driver to find out when > > > > > > > it actually took effect > > > > > > > > > > > > But we know rx mode is best effort e.g it doesn't support vhost= and we > > > > > > survive from this for years. > > > > > > > > > > > > > - second, if device fails command, this is also not > > > > > > > propagated to driver, again no way for driver to find out > > > > > > > > > > > > > > VDUSE needs to be fixed to do tricks to fix this > > > > > > > without breaking normal drivers. > > > > > > > > > > > > It's not specific to VDUSE. For example, when using virtio-net = in the > > > > > > UP environment with any software cvq (like mlx5 via vDPA or cma > > > > > > transport). > > > > > > > > > > > > Thanks > > > > > > > > > > Hmm. Can we differentiate between these use-cases? > > > > > > > > It doesn't look easy since we are drivers for virtio bus. Underlaye= r > > > > details were hidden from virtio-net. > > > > > > > > Or do you have any ideas on this? > > > > > > > > Thanks > > > > > > I don't know, pass some kind of flag in struct virtqueue? > > > "bool slow; /* This vq can be very slow sometimes. Don't wait= for it! */" > > > > > > ? > > > > > > > So if it's slow, sleep, otherwise poll? > > > > I feel setting this flag might be tricky, since the driver doesn't > > know whether or not it's really slow. E.g smartNIC vendor may allow > > virtio-net emulation over PCI. > > > > Thanks > > driver will have the choice, depending on whether > vq is deterministic or not. Ok, but the problem is, such booleans are only useful for virtio ring codes. But in this case, virtio-net knows what to do for cvq. So I'm not sure who the user is. Thanks > > > > > -- > > > MST > > > >