From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D1E91D9694 for ; Mon, 27 Jan 2025 22:07:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738015680; cv=none; b=jpFHFQmKSGMsjWWMBXecW11GqxABlLIvZXPGoDJKwo82ZbmODFH70Qv+OZtzB9/kSEIAQUNCK+6htjGxIh6fPLauZ03qmtWSIL7+tWEpWwlS6JyDSgGIm20Tq2O3eJJO3SVIRbqD7kvnA177gv7dEXB1vnzXuo7s8ahXB+C9BRA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738015680; c=relaxed/simple; bh=OjW398BTWizDSrwZF2nXzwsTgBr9BNV0I55QSA9En5k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bn7WrUm7NX9WGx3feFvJYExOFpTBQXb5dODF4KtxakNTqmpYenXb687/mc0d2HP57foLI/dm0NoI/V37sBfrZLp0hropvKBsg4wKiVoiFr9jNZ5Y62+O4AX7C73MW3YkVdseGxr7VGDd54myJ+1QLd6nHtjABOoN6frK7w0wugQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com; spf=pass smtp.mailfrom=fastly.com; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b=LCL9AhAF; arc=none smtp.client-ip=209.85.222.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastly.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="LCL9AhAF" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-7b6e8814842so568635285a.0 for ; Mon, 27 Jan 2025 14:07:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1738015677; x=1738620477; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=aP5GnQgJZ2/sm68pEmuVw5VQauWjnaDO1BrGzC8Sagk=; b=LCL9AhAFsloa+qNg9rnR6FJZDTXg+hXWPbsnjmvHGLDfyjG1c0uRVeDm4bWAJOgDGg XjUqGexonrMHyHbuvxsVOiA7pzprCea3oMcivERxROFGNC5Y1TG/yVNvz5UiPIZxHQud oH6wB20ZZQsPMmriJmazahR6r6bV10ptVfN7E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738015677; x=1738620477; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aP5GnQgJZ2/sm68pEmuVw5VQauWjnaDO1BrGzC8Sagk=; b=JmSdVyjl+8+1eGmBIXl///CJ60rdjqfwfjjqb6r3GxaEO4je/fpaxXrJvRjMXfg4Nx b0kQzebhYSeEV3MoftcHYmjE3KgxozcGeuu499BhGrXJiL80DzVQwZ8Eymi8pL73JGoz H3hTwF+eE2Tor0JWFI9/QMRZlKbCovC0hRiwQ5/MNwrVpAji4xnT/IyjgMvjkFlMxAvR It73wdjO2JDMLZhDq3w+6DjlFluOSCbUqWeFUoWlQocKA4OxYV9AhMKN8UELMTgWY0s8 7ve4EUjP3NCBKrFPmb9A9Lm+6p9Fge9wmCJiRODqD65gVLempc5AZK1RMnNL+AC6l6bh 5Tzw== X-Forwarded-Encrypted: i=1; AJvYcCWvvt51I0j6KftQNrD0NAbmwce71e9Jhwx/H7NyOLFsexBkWGbVk6fFL1ByZZUy6MtiJnIMUtur+HKK/NI=@vger.kernel.org X-Gm-Message-State: AOJu0YxJQALxuQodmJ2ERcghjDjrJmvNI5+DEoBKFSpL3T99yndl1e1T GUgU+h7KJ8UGchS/NEy1mfo7GBEfICCoHlS1MQhXmTntsRMQSW4XF+TVxWtb4GM= X-Gm-Gg: ASbGncvCjvb7K+XdkrDth7qQjvw3Dx3LNIBzcAK1wYAvvbWZgT1BS3wNqveBcnh4nBt M3MgN0mGHuRnDX0xFk4B6855zuf+pGlv1hsW0QZw+NrJf/AH+/I0bj7oCnUOigbora8oQjwJWZ8 bcvzBRprMoxOp3Qy6iYtepZv239trzylmVUJmOpRjGlBtfGvjsCJ1mjLJs3Edvkm2SgdIRiMkZM uHdpCZd4W2luELFn9w+i0ZV42NN0pJERzTkjzaHsk3KcLlrChsAP90OOvw+rBv6TUBkASfbs/4+ 1K2HUhSmsJCp6G62njKZzNkiDKyOGIvB15Dn0vjBBoE= X-Google-Smtp-Source: AGHT+IGTdVygXNueO3vCZK4btjxRGHvCS781WeHwgFOuP3bnDqU55mAl0oUxDT4tkYkUoR9+a4Hv8A== X-Received: by 2002:a05:620a:2490:b0:7b6:e9be:97dc with SMTP id af79cd13be357-7be6320be81mr7301033485a.8.1738015677499; Mon, 27 Jan 2025 14:07:57 -0800 (PST) Received: from LQ3V64L9R2 (ool-44c5a22e.dyn.optonline.net. [68.197.162.46]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7be9ae8aaf1sm434734685a.40.2025.01.27.14.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 14:07:56 -0800 (PST) Date: Mon, 27 Jan 2025 17:07:54 -0500 From: Joe Damato To: Jakub Kicinski Cc: Jason Wang , netdev@vger.kernel.org, gerhard@engleder-embedded.com, leiyang@redhat.com, xuanzhuo@linux.alibaba.com, mkarsten@uwaterloo.ca, "Michael S. Tsirkin" , Eugenio =?iso-8859-1?Q?P=E9rez?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni , "open list:VIRTIO CORE AND NET DRIVERS" , open list Subject: Re: [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping Message-ID: Mail-Followup-To: Joe Damato , Jakub Kicinski , Jason Wang , netdev@vger.kernel.org, gerhard@engleder-embedded.com, leiyang@redhat.com, xuanzhuo@linux.alibaba.com, mkarsten@uwaterloo.ca, "Michael S. Tsirkin" , Eugenio =?iso-8859-1?Q?P=E9rez?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni , "open list:VIRTIO CORE AND NET DRIVERS" , open list References: <20250127133304.7898e4c2@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250127133304.7898e4c2@kernel.org> On Mon, Jan 27, 2025 at 01:33:04PM -0800, Jakub Kicinski wrote: > On Mon, 27 Jan 2025 14:31:21 -0500 Joe Damato wrote: > > Actually, I missed a patch Jakub submit to net [1], which prevents > > dumping TX-only NAPIs. > > That patch only addresses NAPI ops, here I think we're talking about > attributes of the queue object. Yea, that's true. > > So, I think this RFC as-is (only calling netif_queue_set_napi > > for RX NAPIs) should be fine without changes. > > Weak preference towards making netdev_nl_queue_fill_one() "do the right > thing" when NAPI does not have ID assigned. And right thing IMO would > be to skip reporting the NAPI_ID attribute. Ah, right. Your patch was for netdev_nl_napi_fill_one, so presumably a similar patch would need to be written for netdev_nl_queue_fill_one. > Tx NAPIs are one aspect, whether they have ID or not we may want direct > access to the struct somewhere in the core, via txq, at some point, and > then people may forget the linking has an unintended effect of also > changing the netlink attrs. The other aspect is that driver may link > queue to a Rx NAPI instance before napi_enable(), so before ID is > assigned. Again, we don't want to report ID of 0 in that case. I'm sorry I'm not sure I'm following what you are saying here; I think there might be separate threads concurrently and I'm probably just confused :) I think you are saying that netdev_nl_napi_fill_one should not report 0, which I think is fine but probably a separate patch? I think, but am not sure, that Jason was asking for guidance on TX-only NAPIs and linking them with calls to netif_queue_set_napi. It seems that Jason may be suggesting that the driver shouldn't have to know that TX-only NAPIs have a NAPI ID of 0 and thus should call netif_queue_set_napi for all NAPIs and not have to deal think about TX-only NAPIs at all. >From you've written, Jakub, I think you are suggesting you agree with that, but with the caveat that netdev_nl_napi_fill_one should not report 0. Then, one day in the future, if TX-only NAPIs get an ID they will magically start to show up. Is that right? If so, I'll re-spin the RFC to call netif_queue_set_napi for all NAPIs in virtio_net, including TX-only NAPIs and see about including a patch to tweak netdev_nl_napi_fill_one, if necessary.