From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (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 DB54E1991BF for ; Mon, 27 Jan 2025 22:32:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738017126; cv=none; b=JcMFUYtotDBvHV1M0hqaVeWSuZ0eD4RDtnEXlOwp9nGvMB5zrBm2rjK3/k0T2pF4C+hZzqs89UuYQ/dn7olR6IGvaLlo6M07JmumsAz0jisMsdb4Mx1EM7QoQbbkinqhxS7oxQECAjGgXclgW0CXUSRh4MArDONhdtUOWouDtj8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738017126; c=relaxed/simple; bh=18DsTnkG4dmQIgO4BZ+ZSqpV9RzfKM8cduBtIxYkLcs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PG/T5pSmlyEKOCopfuDpd1c9YKSgavi22ffwk7pXj/NNQHAtvulxlt6HT27b8O+3Pfkr4D+CO1OW1oN/cOeCHM6ULVWwpvTPgpejcbJd3h/oH7seRvnD0Dah8nZkjIogCR+c3k20/opC3dqbntnQirb1IDJOa6Rg8V9mrxK+fCE= 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=Tm39xXDu; arc=none smtp.client-ip=209.85.222.176 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="Tm39xXDu" Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-7b8618be68bso485702085a.3 for ; Mon, 27 Jan 2025 14:32:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1738017124; x=1738621924; 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=ZjsGD1HTZWvnB4scix9ien1anGPvw1aSZgElOGgUWqg=; b=Tm39xXDuOanxgEovBiyQYjF7X9i7S5zxTWO5uJADVTiaHZRWA3SlF4+yNjvpF4EyKy ODK8IoHSPnrOQWZnRFiG6kFO0Z/tKDnD1oZxqBwfEDs3stMXU6OkTeKEYY5gzpmuOC45 NBXo/y1yKQUwqn+LyPY1qgAPh89GsZzNrWaLA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738017124; x=1738621924; 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=ZjsGD1HTZWvnB4scix9ien1anGPvw1aSZgElOGgUWqg=; b=sylkwbCjhzMuUapnohlAAwM624PNjxPaXzFffsD/aThQ/ElZHzWWJT0I4cn+yTZZEX kP4cZHePKHRkSL5Z3ErrST13sGCdoMiyZ1y70LjzGSezdehqH3oPNpUm1nhjRNWqjQ5A xBq85T/lGKLIcSDMm58LRV1eznncmhYdyG+96ghh7K2qsqGnsAmuqZXTodFv1RyvNTjO D1kcTpzeu/pCX862Uqrkb/3NL3HU68xjePDoVjvnfQZKPkql/N9Lc3Byp3V3nMpc8XfA UPmKkhH5D1DzNWZyyxkXp1oHKL8EB3rOPnjZXeh+Uzm5gdAmxVifd1SMY/HhaH+zs4aI DXEg== X-Forwarded-Encrypted: i=1; AJvYcCUjdEW3a/2SPyJ7IsEfWsMrDcuwz/4XR9YghloUltYeSlkBfyiKo1NTRdzLDyM+8Vxsv2pFMZLhcCjnRkY=@vger.kernel.org X-Gm-Message-State: AOJu0Ywn5ZGgggP2yZnKZKCFlcbp2hr+a/l0L4eRHH7Y9BXk9NTXdSru Ag340oLwzK2NHlcc7qHx5KngXQcvweMfMd9Cphh7JS35k9bLVzgFnf168diVeTg= X-Gm-Gg: ASbGncsuXDZGcPi94LPhLTNLgwVGu7lCQU+nZnZjrcp8rOtK6d4vyAMwBDtrn3HVqLC bcw+yFLBsgF1ofCeQeAr9JFFjDkOi14t27xtE9+SwEnafI5zFuvv0PsDFbD3sWZ0XDcZsi5dBVd hyv7FOi7ddnr0VSSpvJPWGP+O28OvVM4lcn2Y7HiRHPvUmtwLLG6ceySriLIwckEzqAAI9PJYhB wx1pnirucZ9fdb3XKu2ZegLS0jJ3QSmFgbywOWRaz19sXBq3cp3b3sOFVu+WKv6hOwUe+sbuOj4 LCxPyYpP4KVQRRLV1sGwypCsB4/EDdPnoc0Z0MEnZ1c= X-Google-Smtp-Source: AGHT+IHdGKX0HVzNGGfdBDdxemuHmtZKvg7K5PVnECIhdt+MxpRUfGTD31xYKTRhW3YYIyuHcN82LQ== X-Received: by 2002:a05:620a:44ce:b0:7b7:2de:6fcb with SMTP id af79cd13be357-7be6320f420mr6624365285a.5.1738017123791; Mon, 27 Jan 2025 14:32:03 -0800 (PST) Received: from LQ3V64L9R2 (ool-44c5a22e.dyn.optonline.net. [68.197.162.46]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7be9ae7ece0sm439931185a.8.2025.01.27.14.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 14:32:02 -0800 (PST) Date: Mon, 27 Jan 2025 17:32:00 -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> <20250127142400.24eca319@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: <20250127142400.24eca319@kernel.org> On Mon, Jan 27, 2025 at 02:24:00PM -0800, Jakub Kicinski wrote: > On Mon, 27 Jan 2025 17:07:54 -0500 Joe Damato wrote: > > > 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. > > Right up to this point. > > > Then, one day in the future, if TX-only NAPIs get an ID they will > > magically start to show up. > > > > Is that right? > > Sort of. I was trying to point out corner cases which would also > benefit from netdev_nl_queue_fill_one() being more careful about > the NAPI IDs it reports. But the conclusion is the same. > > > 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. > > netdev_nl_queue_fill_one(), not netdev_nl_napi_fill_one() Right, sorry for the typo/added confusion. > Otherwise SG. > > After net-next reopens I think the patch to netdev_nl_queue_fill_one() > could be posted separately. There may be drivers out there which already > link Tx NAPIs, we shouldn't delay making the reporting more careful. OK, I'll start with that when net-next reopens while waiting on the locking changes to come later and do the actual linking.