Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3731331rwb; Mon, 7 Aug 2023 19:59:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYr+qf5Dj9mcxPcMbtbTi95NcM5sx8fvMnl9etgWMm6Ewz4lJWWVfuL2OBvYBafzIqid+x X-Received: by 2002:a17:906:10cf:b0:988:f93:32e8 with SMTP id v15-20020a17090610cf00b009880f9332e8mr9660646ejv.26.1691463561530; Mon, 07 Aug 2023 19:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691463561; cv=none; d=google.com; s=arc-20160816; b=AoLziBzQoqavMgCLSAmLYx4BEWJyBI1P+1bppvm/SnYbZDwvIs4Z7fNyAmS9Rchhra GOoZiPg43svP0vWSnKj2zd1oxJ7q4N9YJft0Trvq4ghU70FiUqn/ieRDKOllJ7oO4533 SQsqRN+VFKtJlfoHRMfycCbljQKBkvlO/hzKvhquUo1kAQkNHmMgRxDJER+072q8ykSj 1nZUM/wK1ClscXHMYvRMSIbVMbgsYLY/ljiU5EWi75S88IkIzKhY0j89edQefPAMvmYh +oKhoR27xigkf/bExjGsQ9gy0j3bBZ7iObIv13JyYtIBxM7ec6pyC1FT+TOz6aDe+ZBG wFEw== 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=LeABWAIqA3NR/jSM0/v+3WWsrOAd6qgiAGCX11jVSJU=; fh=CGWzxlV4teWcWPC68Z4DNQYNInkb3X4rbhseKDpOnoM=; b=jRosGR+HaNftOnRlG2uW+9PLWHptwHHv/zJQtgp5O9UU12ySc7DWtDwo+tLATqzFBb LfJRunOVTTDghb4SIV/E/BFZMl5p/nO0x0bUhOXQSgVnFHk57kiqPeTnG97k0AlLagvE 1rMHDU09ACo1HoxJnUnOmylgOeYGM+mZqpYXFayTaHYswrzMemOLmQ9Xj3q53q7uNUgk nz6FHvyTMx3wvSYc9OGEDO+Fl+gywp++B7wH6QDMOXATV76P4ML6Gpr0sVwmG/5jmIUW ZiJOgkmeSSVeFnA9XL+JD5JKfankFr9v4axFbCuz3M9prEewTTiFAOx1MkWhOK8mcv+S 6jww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H7KwxRMb; 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 i20-20020a17090639d400b0099bd8e4b30esi6782591eje.996.2023.08.07.19.58.55; Mon, 07 Aug 2023 19:59:21 -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=H7KwxRMb; 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 S231209AbjHHCck (ORCPT + 99 others); Mon, 7 Aug 2023 22:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230371AbjHHCb6 (ORCPT ); Mon, 7 Aug 2023 22:31:58 -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 08E33185 for ; Mon, 7 Aug 2023 19:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691461871; 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=LeABWAIqA3NR/jSM0/v+3WWsrOAd6qgiAGCX11jVSJU=; b=H7KwxRMbTsv7yjfgkx0gHA2zIrBdxWIKXVPVJ9q2lT4xxU5PmaEPEDQtoSYjafYC4NV8c/ 4IYm7qwMcmjuDPkAWlW3+bcI328yJ/h3ULwWRDneIiVDj4zca0EEvEp8q+sh0BLkBsnlUA 8mUaVB4EMAMZwFGkwvX0lK2EkBC/rcc= 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-175-T279-xFSNfup0XZPtBPaIw-1; Mon, 07 Aug 2023 22:31:09 -0400 X-MC-Unique: T279-xFSNfup0XZPtBPaIw-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b9fa64dba8so49311051fa.0 for ; Mon, 07 Aug 2023 19:31:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691461868; x=1692066668; 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=LeABWAIqA3NR/jSM0/v+3WWsrOAd6qgiAGCX11jVSJU=; b=KcGCoEIo/bTw2J8oQJtimrAqCSHdoM+ugvlqaTBf6sI0TAL+XLKmzEP725uxoB0P/o sNAGtGB+uRrI2+7tLP6Hh+1nvos8bohg4MZEXTs5BABk98WGLPaE0OBEfbsXQpl8JGuZ 0jtjxJbQFYIw21fZHoUlSr+7Zfe19k49L+z7b6Aqyk02nI/Joi2Zc9rGdS0mRr8/FB8z YV0DwJ+URwm07gVJ/2o3HYXDkWWhdAMCZkD3HVr73Nb+yPTpGeov4IoQ0EypVP/fzF2O eUwnsZn7FvVEZlGH7JL2Yia2YHTj6EDx/mewiNDw+M5+4iMsvMzYYV45iC2uk93IimFv Sn6g== X-Gm-Message-State: AOJu0YycAlclMwXSwg1uhi8UlRu+upRA/7tjMNauAiNMRDBL+fx/fi7f yHwlNvCsByPCkzQx+7mNVk9148vvHZjtW1C7t593MrJuziM1Qz4pqFlTRxAbB1k2AKOquJeAHoM 2celxk2ZeOb7CNjlfGvE5G2j6YyKY3NcMK1GPf9JD X-Received: by 2002:a2e:97c9:0:b0:2b9:b1b2:f97a with SMTP id m9-20020a2e97c9000000b002b9b1b2f97amr7713161ljj.0.1691461868041; Mon, 07 Aug 2023 19:31:08 -0700 (PDT) X-Received: by 2002:a2e:97c9:0:b0:2b9:b1b2:f97a with SMTP id m9-20020a2e97c9000000b002b9b1b2f97amr7713147ljj.0.1691461867765; Mon, 07 Aug 2023 19:31:07 -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: From: Jason Wang Date: Tue, 8 Aug 2023 10:30:56 +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 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, Jul 31, 2023 at 2:30=E2=80=AFPM Jason Wang wr= ote: > > 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= lock? > > > > > > 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. Michael, any more input on this? Thanks > > Thanks > > > > > > > -- > > MST > >