From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (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 CE5AD1DAC88 for ; Mon, 27 Jan 2025 22:21:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738016519; cv=none; b=SN1q33T7azt98Jx0OUGGgcka1JHVKoS2SjdNvJ72LCLj4yCWj4/YTjeZl5GFj1PiYDRCrHovcOkDBYMaBu9qvQhUEIfbTOM1PvhulgmL4OpZEPpy6DYTRhLNM5mcRz0rGe22vdgQxWqrWbW63xufJNv5RqXfQqUzLTN4/Tx7Zj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738016519; c=relaxed/simple; bh=HfDv8yuZwZYBu03PLHPJuhXwvsGp27tdcr/KfDiKWwg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DTYalfk1wIoyMvOOD8lrLgQ7QsX3pjG/3UTBGr2CzBp90tw1bH+oi/16B5B0mJEf6XlRO5FXIV086seTfHs38aOAAiISsWbYAgo7YX+U6pU1FErZ35sJJ2Ze+ApoUHbLz6zgOEw/4HNbwGfEuEpm8KwgshI4IlamzENTSUr9C58= 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=jE1TvHST; arc=none smtp.client-ip=209.85.222.175 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="jE1TvHST" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-7b6ea711805so714970385a.1 for ; Mon, 27 Jan 2025 14:21:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1738016517; x=1738621317; 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=Zgtg9sEYYepf1PWWMu6DdFDPfrhrnEUXJiVlMwbDK8o=; b=jE1TvHSTRugP3N5J/Lg4NSlMHOhp1R5ZGLHh4lsSMDHSBlF0o7fAA1zjSpzy9ZOST1 dZxzveYQ28yn8nI4FUGNn9AqeIdBrIDbqYf0aY19PJVr0CMy9DEHplgSc+syV3jlT7mj F7vI6wMWGKSFj5a5f4pIToEq7iyh2VWXF5Vg8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738016517; x=1738621317; 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=Zgtg9sEYYepf1PWWMu6DdFDPfrhrnEUXJiVlMwbDK8o=; b=NNBNoevN5wXEmJXpqW8lOuR6zJiG8fNdHDoAbl7571ZV5pHxQKzLkK/wQnYbRdPSOG j4oRrnF5lTatEFdA57JgN75IpEjeuKHGh/LybQ4dovmTPQ1NfOcteVdYxuhTdYtdGaWo GCV59sBKJpsySUQCgEhKmhgjgeNZNIWYmSn3d0Fb3FuRnAXdrJtKTyB5ZpBCi8kcFCaT swS12hF16o3jiNk/SsVNkb77AsmOOgGLv8pM9kdDKBKdCjSkV1BQc91NlyURxt4dKX2O DLULpnGtRCf+xMJcD3pqAge3G+0Foq4icBAjujMxdnPN9uJ/eezivbxOXtUxFc3quQkr wZyw== X-Forwarded-Encrypted: i=1; AJvYcCU38Bs4HHhfULD9PVIacUm/fBtLB2yKr0yUDcNltP/ZWaJSQBraUUsOqPiSS6XF66xZyDcxdmuuW3fPD0E=@vger.kernel.org X-Gm-Message-State: AOJu0YzuhuNoG2SJySFReJ0rWa1sq4j/EoCHD0qeiDfsWS++vMzrXpXq Py7O8e72tq7dgqZaNfZOFuW9C+DrLP+4nbr2+dbvT53YXM4sW60U6OpYeysV8I4= X-Gm-Gg: ASbGncvdh7sC2lJEXcrYsR+smgeL3CCiQR4vetBDC59Y/nqWn42t99+ug2kXHX6/qwE FnjzmzNNF34/ZOtcNLezg1FV8ThSjQwuc1FiltcOE3Akm2ZUIEKENdD2G5Igl8IX9hjeU1nKEC+ 1kuNqdCiSA9U2PinA3u7IU817MBy/X1Z0MyLuEJnWhqH6JYbUtAZ+tTJcMQmuRcfDCwBxeUgEyG k4DKz62iDhpOqX71AJ8pYLwRTKMZ6AKaon89IXr2E0taInaGtNoIpMfpZN6/61bXWpP3dBhVG3P nVKYCn1Y7RbCwp1X6Kn61tLSzPXfvarGUUoc/Somd2I= X-Google-Smtp-Source: AGHT+IFwEVN1fNwLMWq8+hBoMC0fAeQqthTVKxqiNjFFaEHa55r9SdnkWzcSkqaYij0jYQMDA3y18w== X-Received: by 2002:a05:620a:17a3:b0:7b1:19f4:c6e0 with SMTP id af79cd13be357-7be63253f1amr6652328185a.51.1738016516733; Mon, 27 Jan 2025 14:21:56 -0800 (PST) Received: from LQ3V64L9R2 (ool-44c5a22e.dyn.optonline.net. [68.197.162.46]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46e6689c838sm43527321cf.37.2025.01.27.14.21.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 14:21:56 -0800 (PST) Date: Mon, 27 Jan 2025 17:21:54 -0500 From: Joe Damato To: Jakub Kicinski Cc: netdev@vger.kernel.org, gerhard@engleder-embedded.com, jasowang@redhat.com, leiyang@redhat.com, xuanzhuo@linux.alibaba.com, mkarsten@uwaterloo.ca, Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Kuniyuki Iwashima , Sebastian Andrzej Siewior , Lorenzo Bianconi , Alexander Lobakin , open list Subject: Re: [RFC net-next v3 1/4] net: protect queue -> napi linking with netdev_lock() Message-ID: Mail-Followup-To: Joe Damato , Jakub Kicinski , netdev@vger.kernel.org, gerhard@engleder-embedded.com, jasowang@redhat.com, leiyang@redhat.com, xuanzhuo@linux.alibaba.com, mkarsten@uwaterloo.ca, Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Kuniyuki Iwashima , Sebastian Andrzej Siewior , Lorenzo Bianconi , Alexander Lobakin , open list References: <20250121191047.269844-1-jdamato@fastly.com> <20250121191047.269844-2-jdamato@fastly.com> <20250127133756.413efb24@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: <20250127133756.413efb24@kernel.org> On Mon, Jan 27, 2025 at 01:37:56PM -0800, Jakub Kicinski wrote: > On Tue, 21 Jan 2025 19:10:41 +0000 Joe Damato wrote: > > From: Jakub Kicinski > > > > netdev netlink is the only reader of netdev_{,rx_}queue->napi, > > and it already holds netdev->lock. Switch protection of the > > writes to netdev->lock as well. > > > > Add netif_queue_set_napi_locked() for API completeness, > > but the expectation is that most current drivers won't have > > to worry about locking any more. Today they jump thru hoops > > to take rtnl_lock. > > I started having second thoughts about this patch, sorry to say. > NAPI objects were easy to protect with the lock because there's > a clear registration and unregistration API. Queues OTOH are made > visible by the netif_set_real_num_queues() call, which is tricky > to protect with the instance lock. Queues are made visible, then > we configure them. > > My thinking changed a bit, I think we should aim to protect all > ndos and ethtool ops with the instance lock. Stanislav and Saeed > seem to be working on that: > https://lore.kernel.org/all/Z5LhKdNMO5CvAvZf@mini-arch/ > so hopefully that doesn't cause too much of a delay. > But you may need to rework this series further :( OK, I'll wait for something to emerge from that work before re-spinning this.