Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4076677rwb; Mon, 31 Jul 2023 00:21:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlFRlLYzAkMOW7PKlK5bKK3lydDLvdLiD6XF98iXI7hrVEuBGx+U+zyHghSzUAOMjJDDWFwR X-Received: by 2002:a17:90b:603:b0:263:41d2:4e2 with SMTP id gb3-20020a17090b060300b0026341d204e2mr9107600pjb.32.1690788096465; Mon, 31 Jul 2023 00:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690788096; cv=none; d=google.com; s=arc-20160816; b=vI1qxE7vv15W9fvMSyLy+cobv6VG9r8zOv1uoGQsZ6+L803q89aJ8wfZnZ/X1mk9eF RkZX3QrETZThbJg41TwpXmy3QJW6mGNcleylghTBc3qhAGbxUFEEIAKk4ddmeqUCPI2D grToWFBvlGU3TqhG4pvgDmSmOnUMmZwkgPivgIo6cyj7QjHzHvVV5cLNNlPJSnCVUUkR 4AUbqT0/wAiAyDirA0J7uH3j6eHiu/U8SLTNA8xwm8XyI3shg1ET7JPhwCecUjOHt1ow xD1dtDvS7i2GnOigW0vUCmwARNsPkNDExM2BVVmMX2TU+A1GGje9w4CvGELzR5gEDYt5 i3iw== 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=9F90Lb2s6G0ugGSS8D5PR3Nu2cqZtzEuNKJh0Awsb80=; fh=CGWzxlV4teWcWPC68Z4DNQYNInkb3X4rbhseKDpOnoM=; b=Ozc77U1rf1tV/cn/8E6q9Ul8pOXqbClpItLOtM25zSDXvFOU0I1K0e/bYMOnRdzfI0 c9ChhvgPvZVBa6j8LYXRchpRIRbNSfsBHXU6LHQPEcaHzg7yHXTyn6K9WcFjnhFPUAzo 7780G+3A/yNxNFo/W8syrqdMfz5XSo4Lq4EsStMggzsg5nX2rYTYYqq4UIYZA6F+6DQP FvFYQeWFiepdxgm8BOXgsFtaLXE316tnCdmWVWGUoCxgKyTKMdBqgMEPuzNQL26/Egep e6sTsixjgmu33WjptX2Ms6n5Vcxk+gEQVdfJtfvsWgxk+vjf7wczj/OrTv87DsE+2pRe Z70A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iVT8dpg0; 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 p8-20020a17090a2d8800b00262e28866d4si2043872pjd.163.2023.07.31.00.21.24; Mon, 31 Jul 2023 00:21:36 -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=iVT8dpg0; 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 S229865AbjGaGbN (ORCPT + 99 others); Mon, 31 Jul 2023 02:31:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbjGaGbM (ORCPT ); Mon, 31 Jul 2023 02:31:12 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 877D01BC for ; Sun, 30 Jul 2023 23:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690785020; 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=9F90Lb2s6G0ugGSS8D5PR3Nu2cqZtzEuNKJh0Awsb80=; b=iVT8dpg0TDxtbhOmiE+agqWIezsII3xOVtBNgyTN0e3alPuwLbN+yo8ysuIUKi8nsy9D/Y E3ZnRhxAJWTCDjcsivKylK3s06hdnYpKNwV1IIGFYajhD5mUN/Uzs7zwKs4eqef8khxs9j s7i3EaCA3CeByX92RU8j5Ii6evqJzk0= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-215-AAAIOZJxMtiDKl_zzvTPGg-1; Mon, 31 Jul 2023 02:30:18 -0400 X-MC-Unique: AAAIOZJxMtiDKl_zzvTPGg-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b9c548bc66so33571991fa.1 for ; Sun, 30 Jul 2023 23:30:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690785016; x=1691389816; 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=9F90Lb2s6G0ugGSS8D5PR3Nu2cqZtzEuNKJh0Awsb80=; b=C9wwcLjB8jFXHFedash1CJvGzlE3rcPUsZMtg0llPxYT0xRCNbOTE9WZ8BwEW6xius GFn+Jgwis/B0rPhLHZL37hIItmwEGj3arK0Zgm373Zh0ALVJMXpNbbaTnSa/DjXJLAiK Mddrn+nt7Ba/cDCJU2BMeKH5eT68XtQ5TfQWn2GB+V2Jz3M68da3408UUc0rWrXHihXW OvrFj8PIRhKryC05GRwq05LL0MAXAZfk/CmckKBTvJ708l/iCSlKcS5F4ZH+NrzLL7fg ZTQ2ud8sUUxw0JaBY1HCITcISLcfaZedd2nVoQqQ/sap662bqIpOhXLioLCZy+ANxO5Z 1VFA== X-Gm-Message-State: ABy/qLY9wcPNk7rlYllYKGePrcjfrMIYi5c70si/GWIbOJetlJcrOXKH Z+Scyf+JwFVpfEk8lGTMsdyIiUbvz7fVNVIVnnd/YCrBbEVfFca7C1QUGQ1XiAEphjjc1NEJyKr 12BgrI4aoYnGNUt51wwNMIGDr6Gpj8JaufE51wI2v X-Received: by 2002:a2e:99c5:0:b0:2b9:df53:4c2a with SMTP id l5-20020a2e99c5000000b002b9df534c2amr2649455ljj.20.1690785016712; Sun, 30 Jul 2023 23:30:16 -0700 (PDT) X-Received: by 2002:a2e:99c5:0:b0:2b9:df53:4c2a with SMTP id l5-20020a2e99c5000000b002b9df534c2amr2649436ljj.20.1690785016410; Sun, 30 Jul 2023 23:30:16 -0700 (PDT) MIME-Version: 1.0 References: <20230724025720-mutt-send-email-mst@kernel.org> <20230725033506-mutt-send-email-mst@kernel.org> <20230726073453-mutt-send-email-mst@kernel.org> <20230727020930-mutt-send-email-mst@kernel.org> <20230727054300-mutt-send-email-mst@kernel.org> In-Reply-To: <20230727054300-mutt-send-email-mst@kernel.org> From: Jason Wang Date: Mon, 31 Jul 2023 14:30:04 +0800 Message-ID: Subject: Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop To: "Michael S. Tsirkin" Cc: Maxime Coquelin , Shannon Nelson , xuanzhuo@linux.alibaba.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net 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_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, 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 Thu, Jul 27, 2023 at 5:46=E2=80=AFPM Michael S. Tsirkin = wrote: > > On Thu, Jul 27, 2023 at 04:59:33PM +0800, Jason Wang wrote: > > > They really shouldn't - any NIC that takes forever to > > > program will create issues in the networking stack. > > > > Unfortunately, it's not rare as the device/cvq could be implemented > > via firmware or software. > > Currently that mean one either has sane firmware with a scheduler that > can meet deadlines, or loses ability to report errors back. > > > > But if they do they can always set this flag too. > > > > This may have false negatives and may confuse the management. > > > > Maybe we can extend the networking core to allow some device specific > > configurations to be done with device specific lock without rtnl. For > > example, split the set_channels to > > > > pre_set_channels > > set_channels > > post_set_channels > > > > The device specific part could be done in pre and post without a rtnl l= ock? > > > > Thanks > > > Would the benefit be that errors can be reported to userspace then? > Then maybe. I think you will have to show how this works for at least > one card besides virtio. Even for virtio, this seems not easy, as e.g the virtnet_send_command() and netif_set_real_num_tx_queues() need to appear to be atomic to the networking core. I wonder if we can re-consider the way of a timeout here and choose a sane value as a start. Thanks > > > -- > MST >