Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1994740rdb; Wed, 31 Jan 2024 16:14:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEShhwHhJjvi8zJY0ZC/bIaldjY9r1eGB4EXPQHRN4auiPLerskiNPkdST+ce8NNZjJYg9 X-Received: by 2002:a05:6402:60a:b0:55f:4602:bf7d with SMTP id n10-20020a056402060a00b0055f4602bf7dmr2175026edv.26.1706746463745; Wed, 31 Jan 2024 16:14:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706746463; cv=pass; d=google.com; s=arc-20160816; b=vLUuORfOeKqKi1zgaEPsvRGHS80H5YnyIB3+iBZxEsChfv+lrMaw7pUrD2ssN42Oxh 2ViA5yLeXebOsDWiCjgtDVYvkT3e43o7wKnh2Y8cWYfat18PwZYSJqQUcJ0Gss50hCFv KgiPIeZXHNIQfnvbcbF4sQTl6/u1w0qrDqvFeOOcLikW9Eb6TbVfe0mpghkuusvMxwpb eWmVJ/RYZzZktCU6q6YBa/+DIdjDbG4mT0f0iUxh5pCsRCUtaAN9k7Md7jpTMEL1oK0K jIKj4nTbgtKXIAxVmRc+gEiBQkg6EIKbhbwIJZq/jFq4+XGkgsAScUPfdbWLqPNDSG84 clJg== 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=BSgtboSShFLNeui1A9h1jOt/Yng0SQEv3lZa3ntE4Qc=; fh=dSI80fpHy7MFps0puD8BEyNYLA+pn9ob+PbXaU2Mw/s=; b=plCpVtYzirKL1DDN5qBr51yJZmvBIGKSeCjW0A3o+UZMTUXL+NJKDD9U6kYbKAVLXw WfDK/nGskou9twYXoXE+fyZbO33cJ8vceAClYxHpIeLXxWHw8NOSgCCC38TLENitBrf9 lOaM+ot4ZTikz0qWOpgie/ykchTFfw8Zh/mO3jjz4d9Y180RO5XqyYRTJkAX0avcVqMQ y8oujtWzn6ocv3VI2W1uvUAdXHrje72qZGEdXlxCYbuOdzhSwmBa9fhlW7//xm7nqp00 +wnRa/wEEKpcL+qYrtxY+Dtp95wYFvnA5NOkrQPlp1L5uMRGP5OdubX1ckRYTdQnpCQy 7Sdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tbrgd0qG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47411-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47411-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; AJvYcCU8hjG4UR6MPKu7YxrXZnjz/rhn+tzAD9kltyk4iMFQ8t2kMKNqhiqL1uuEeBHkLgkR/0Ddmtz3I2FTH9E4dfq4V4a38N/ydhTz1l5Jug== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f20-20020a056402069400b0055fb386e79bsi95254edy.569.2024.01.31.16.14.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 16:14:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47411-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tbrgd0qG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47411-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47411-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 809FC1F26C26 for ; Thu, 1 Feb 2024 00:14:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2AC4A35; Thu, 1 Feb 2024 00:14:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Tbrgd0qG" 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 1E35A37C; Thu, 1 Feb 2024 00:14:13 +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=1706746454; cv=none; b=kzdJMc3A/yZnIzPyqi+O2QQIm+5zhXGLUuR1LVlm9Ma+LTSXOumHlMLOJonJrcQIygBvEVG2lsP/BzRKVVcvEFMKzp9DTPTZ7+e7ct0gN9toShPERcNOu9qV3fnqceFMQFoEyjAfmKoZlMS2O0N9NN4XB1C0h0S28QDkRYM3+I8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706746454; c=relaxed/simple; bh=UYG+bMN6gA1Ij16eOnxlASAzV3Xla9f4HQGKMwAR6is=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eZ7PZY6/CT6ghbtpJaosZNSurINjBLW6jMW2sh7zNqY14pIUrKf6SvZWplcAbuZlbWCODgpP0zfHlf2apF78RxcR7OEyT+9aBYrVwAffaPrteHwjbiFYrIWgh7wScGXGgFPM11YIpA3phkyMqfpPfWvpbVn/GOam/CSHFwwCBOI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Tbrgd0qG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2406AC433F1; Thu, 1 Feb 2024 00:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706746453; bh=UYG+bMN6gA1Ij16eOnxlASAzV3Xla9f4HQGKMwAR6is=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Tbrgd0qGQ82NEm2jHe0rpSSX9NBFwIaCQfe/P3IwOZW8ZYq4NJHN/ZRFwRQIvr7+I sGdzVJdFfG7QiCH21lugyVCDqzf7SonMXoQsi3jq61YyWbd9RWweUHG1ssg0QnUAvC peoIS3A1Y56J8pmHdCZnlmy9AvGQmG/Myq1oGnlNplYV7M4YnzGkXN1KpfDip8BZBZ BK2ixEdJEgCvMylk8Ef9xHjnU0bKfsc1Vu5n/Ak7vavEDqfJkFZiKnnKJIZ2YwPs1m amTu1JuwIl+M1pWqGBNGqKEOD++2B5x/KdCu3eS8xwtSxL4olZnLlYgWgIVR0Cc+fz k/UPLUzb6ez+g== Date: Wed, 31 Jan 2024 16:14:06 -0800 From: Jakub Kicinski To: Shinas Rasheed Cc: , , , , , , , , , , , , "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: [PATCH net-next v5 1/8] octeon_ep_vf: Add driver framework and device initialization Message-ID: <20240131161406.22a9e330@kernel.org> In-Reply-To: <20240129050254.3047778-2-srasheed@marvell.com> References: <20240129050254.3047778-1-srasheed@marvell.com> <20240129050254.3047778-2-srasheed@marvell.com> 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 Sun, 28 Jan 2024 21:02:47 -0800 Shinas Rasheed wrote: > +static int octep_vf_stop(struct net_device *netdev) > +{ > + struct octep_vf_device *oct = netdev_priv(netdev); > + > + netdev_info(netdev, "Stopping the device ...\n"); > + > + /* Stop Tx from stack */ > + netif_tx_stop_all_queues(netdev); netif_tx_disable() stops queues, IIRC. You seem to stop them twice. > + netif_carrier_off(netdev); > + netif_tx_disable(netdev); You haven't masked any IRQ or disabled NAPI. What prevents the queues from getting restarted right after this call? > +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. > +err_register_dev: > +err_mbox_version: > + octep_vf_delete_mbox(octep_vf_dev); > +err_setup_mbox: > + octep_vf_device_cleanup(octep_vf_dev); > +err_octep_vf_config: > + free_netdev(netdev); > +err_alloc_netdev: > + pci_release_mem_regions(pdev); > +err_pci_regions: > +err_dma_mask: > + pci_disable_device(pdev); > + dev_err(&pdev->dev, "Device probe failed\n"); > + return err; > +} Name the labels after what you're jumping to, please. It's so much easier to make sure the code is correct that way. > +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. > + if (!octep_vf_wq) { > + pr_err("%s: Failed to create common workqueue\n", > + OCTEP_VF_DRV_NAME); > + return -ENOMEM; > + } > + > + ret = pci_register_driver(&octep_vf_driver); > + if (ret < 0) { > + pr_err("%s: Failed to register PCI driver; err=%d\n", > + OCTEP_VF_DRV_NAME, ret); > + return ret; > + } > + > + pr_info("%s: Loaded successfully !\n", OCTEP_VF_DRV_NAME); One message when driver is loaded is probably fine, but two is really pushing it. Please don't spam the logs. > + return ret; > +} -- pw-bot: cr