Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2714315rdb; Mon, 5 Feb 2024 15:45:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHq8Zpm/tEPmepzCdU8qRxR2W7xe3jJMM26i602DXsw7wDhiNN6UtXkLQiOP/zC6E0cLeUE X-Received: by 2002:a50:9b58:0:b0:55f:e564:23a7 with SMTP id a24-20020a509b58000000b0055fe56423a7mr7883049edj.13.1707176701953; Mon, 05 Feb 2024 15:45:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707176701; cv=pass; d=google.com; s=arc-20160816; b=0ZTnpRsccZQ+cSQiPNOrRAF5wb37WLIOmiSdQx+Q9ETi3P86mWI/3nVL0lCyFXkBpI zJV2lOhOaJYnOMgMdAvPkxeI8zRIx6mp1wNrMs+5vdHr4q3MPe4G4iJY60WzATzPfqjJ QSQVqDOqyb48yO1vEQbd7b/pT2JYy9gGg+S4g/9PLMBlCPf6CSPEty0Jo9ukeq6iRRq9 NJKCWuzrX+z9h+PnPto291mfhJuoDaLW9s/Y5uija7GlVcpDr2Xblcl3yZvf9I8IzzZ0 5BbJejP7MsRkQ6NCeINYElLGryq48TJgAEuI/vRf0OE21g2Iq4FjGvDKwal34CSrZ9AB pu/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=KKTAXUCYlFa6RvYSj2vb4Y1iSREHFA0ROeCy34iYBAw=; fh=FuVOhQeznViDcLUjI08KSccwb22vWbEp8eFyLJ6avaM=; b=KbCMqIVmtg4mzLnih1JdXJo609HYUBvWo4Wnumcse54IJOSbaNqc10EppgV/x12Myj BN0sOiKGCiZBelZ8Rt7gSYAWN8dGyi2Yj3QxjVj+5BYBVkMedFXdLV4dR9K3xnkfSBLO bTI4S+hcIXbxhNLNA9eHe0CNfxnAYF1I6AswjVfBUsGLtXLGwYPHNwbO8VXWwWbMFVVN X3OKGKKr0hibqzlli3eOM1jdjnArWZzFaCP/9jaouY5I+77ualMFICLu/0GR/b2m0VrE gC1msEoSRT1JHHc6+mxWa/5Y3KQreTx+H1WZ+q/MS3qG5L2N9Xl4fNLoD9BblV+7Pksb 9tXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="j5CaDjy/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-54103-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54103-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWvwlhTZ8mBrNNr1xrgjNLAYDCfQLlLlCH8/7MS/dNQqEKt4i+6YrqXzYD4ILvGhsXwNXyEg4mbwXRrEemoq+Pw55g1bU14VvS+uuk1yg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cm12-20020a0564020c8c00b00558bd08c756si414874edb.104.2024.02.05.15.45.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 15:45:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54103-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="j5CaDjy/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-54103-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54103-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AFC271F2BB8A for ; Mon, 5 Feb 2024 23:45:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CEEC34BAB5; Mon, 5 Feb 2024 23:44:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="j5CaDjy/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 004FF1EB49; Mon, 5 Feb 2024 23:44:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707176691; cv=none; b=l8yXM1Oxbn3uiu89cQ/b3f2AYmtc4nUH659sCCXT5JXyy6wZZIU6jlkrH0Yaro7KyvPUVMs4wKSd64znZOZ6b4eQ0HV53cv++osy6/rClfWDFDoYlt9XHxCvSmBD15YWSHaWwId8Pi9uhDMQ1htQDLkpPiDz7b/5BfibLkRVpYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707176691; c=relaxed/simple; bh=SxLaOpN/aBErJ9kXh6d9dU6KlKpKu99pWHS/STEMU8M=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IbDxozMIvorEf5/rKabDZZeP72C8ZhJacJ1qCs+3o0sLSEUqAAF9L/2KJo5ByZ6LmzIkZ8qblmggt63xAWvDh0W+OKfXzRc9EC3VElWGQCkA9Lth4FeJP6TVXTFHN9HFtaGhmDCXSclPHH9U177vqmT6UdhdS4BJ3s27MJGnvOU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=j5CaDjy/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1413C433F1; Mon, 5 Feb 2024 23:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707176690; bh=SxLaOpN/aBErJ9kXh6d9dU6KlKpKu99pWHS/STEMU8M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=j5CaDjy/VjxbeQbdgNT8rBul3sjRJv85BNfhU7NBA3ouFRrZ9V9uxMt7N8/1Fxd18 meUCBNTQblbFgDEQJe+UT9h1L8dqhim7LslBtyeknQzuzRhdhMQ9JaFjmoAO8zepYs nJZb2IxMHfZXpZ579O++i4hrpSVSRqECbx0e1IRiCKjkWv3IsDOgkgWkp5HhFoPZYl DiZjuRNBA2X/EI09LTQgegSqHCwSWb4bY2xNNdpL9KG/A8CefmjnXwYw7TCbixR+8j OdXgjcfz6VUfd6A0VCwlCLIJpAct5EjHtn0jkuf8N6d1XaR2rdhtcy7fbsEEsuLRkt M0tiRWjOa/Yqg== Date: Mon, 5 Feb 2024 15:44:48 -0800 From: Jakub Kicinski To: Shinas Rasheed Cc: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Haseeb Gani , Vimlesh Kumar , Sathesh B Edara , "egallen@redhat.com" , "mschmidt@redhat.com" , "pabeni@redhat.com" , "horms@kernel.org" , "wizhao@redhat.com" , "kheib@redhat.com" , "konguyen@redhat.com" , "David S. Miller" , Eric Dumazet , Jonathan Corbet , Veerasenareddy Burru , Satananda Burla , Shannon Nelson , Tony Nguyen , Joshua Hay , Rahul Rameshbabu , Brett Creeley , Andrew Lunn , Jacob Keller Subject: Re: [EXT] Re: [PATCH net-next v5 1/8] octeon_ep_vf: Add driver framework and device initialization Message-ID: <20240205154448.1c5a5ad8@kernel.org> In-Reply-To: References: <20240129050254.3047778-1-srasheed@marvell.com> <20240129050254.3047778-2-srasheed@marvell.com> <20240131161406.22a9e330@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-Transfer-Encoding: 7bit On Sat, 3 Feb 2024 05:35:21 +0000 Shinas Rasheed wrote: > > You haven't masked any IRQ or disabled NAPI. What prevents the queues > > from getting restarted right after this call? > > The napi functionality (along with disabling it when stopping), is introduced (and used) in the patch after this one [2/8]. Also we disable interrupts in the > disable_interrupt hook which is also called in the next patch [2/8]. You gotta make the patches reviewable :( > > > +static void octep_vf_tx_timeout(struct net_device *netdev, unsigned int > > txqueue) > > > +{ > > > + struct octep_vf_device *oct = netdev_priv(netdev); > > > + > > > + queue_work(octep_vf_wq, &oct->tx_timeout_task); > > > +} > > > > I don't see you canceling this work. What if someone unregistered > > the device before it runs? You gotta netdev_hold() a reference. > > We do cancel_work_sync in octep_vf_remove function. But the device is still registered, so the timeout can happen after you cancel but before you unregister. > > > +static int __init octep_vf_init_module(void) > > > +{ > > > + int ret; > > > + > > > + pr_info("%s: Loading %s ...\n", OCTEP_VF_DRV_NAME OCTEP_VF_DRV_STRING); > > > + > > > + /* work queue for all deferred tasks */ > > > + octep_vf_wq = > > create_singlethread_workqueue(OCTEP_VF_DRV_NAME); > > > > Is there a reason this wq has to be single threaded and different than > > system queue? All you schedule on it in this series is the reset task. > > We also schedule the control mailbox task on this workqueue. The > workqueue was created with the intention that there could be other > driver specific tasks to add in the future. It has been single > threaded for now, but we might optimize implementation in the future, > although for now as far as to service our control plane this has been > enough. I haven't spotted the mailbox task in this series, if it's not here, let's switch to system wq, and only add your own when needed.