From patchwork Tue Oct 8 23:34:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13827217 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 8DAAD219494 for ; Tue, 8 Oct 2024 23:34:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728430497; cv=none; b=VXTiFsiTkDaDt1ZdvgEAyxTW2yg94b3wBUc6ELr8aHhHDk7/Tb+Rbb7aaf7//6D7hVh4Su+DXsk9eGEKV4yZngdoCmpvnx89CVkw+FNN+iZi7m3OdCh/akorY03yvOYNJreenxqkY4df0PU4O2srZ9H+X0e0Q/8RvjkUCmz0JLU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728430497; c=relaxed/simple; bh=MG80zLeDivzbzlhRayw18/+xZjnuyZEvNlfeT2mt1WA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pv84wE0EncUtVipx9lY5UorB3qAg62i3A+GsRwE0QhUEOnC9JGgBFNt6ZPDXn8C+8zNQrksw5l0MBEKn/Loa08arK467Fg5KuFF2tsOI+1jWJnOpeNV+PzBLjstu+xRDe4GlbhnksuTRNy0SeIr6EZijl6qB2fVZsAysNP1ys9g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Q7TUjj4U; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Q7TUjj4U" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728430496; x=1759966496; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MG80zLeDivzbzlhRayw18/+xZjnuyZEvNlfeT2mt1WA=; b=Q7TUjj4UjhVVa0KPMvZDgcyHBO0bC8bCCyAagJQlf3V9UrozMq7lpi9U h6jehkXTIUxKXgRdIn2cbHCN+ReXgXjieNoXk2GP8AnNp/xWBC3trvbB3 bKeVhiSZ/Gdkk2+ezSUcwirWj1CnxSBRgrB2zb11rLmoR0p504wviYwng gJfSs5f1Ig5jdgOk3juU8qpbhRRJeZizLAbjocg348/xnrzhyxEwfikKF 2vnexv1wTCbSCG9FHSO+GCOY4HNCugNhxt4yjat+a0I9xW5ZjMsrjxOgV Egb61oDw96uFcWwxuNqF8/nYR4ixmqN5WHbLfGU61y/5UsWiAXMfTV+/O Q==; X-CSE-ConnectionGUID: rBVrd9q0ReSqMntCnbBslw== X-CSE-MsgGUID: ikMt1sJsQOamb5SH5uoMWg== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="27779935" X-IronPort-AV: E=Sophos;i="6.11,188,1725346800"; d="scan'208";a="27779935" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 16:34:51 -0700 X-CSE-ConnectionGUID: tyhi8iUzQSeE+kFqAbw+qQ== X-CSE-MsgGUID: WegMTxcHSXu+NapD1oJKJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,188,1725346800"; d="scan'208";a="106794214" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa001.fm.intel.com with ESMTP; 08 Oct 2024 16:34:51 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Joe Damato , anthony.l.nguyen@intel.com, Simon Horman Subject: [PATCH net-next 12/12] e1000: Link NAPI instances to queues and IRQs Date: Tue, 8 Oct 2024 16:34:38 -0700 Message-ID: <20241008233441.928802-13-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.46.0.522.gc50d79eeffbf In-Reply-To: <20241008233441.928802-1-anthony.l.nguyen@intel.com> References: <20241008233441.928802-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Joe Damato Add support for netdev-genl, allowing users to query IRQ, NAPI, and queue information. After this patch is applied, note the IRQ assigned to my NIC: $ cat /proc/interrupts | grep enp0s8 | cut -f1 --delimiter=':' 18 Note the output from the cli: $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \ --dump napi-get --json='{"ifindex": 2}' [{'id': 513, 'ifindex': 2, 'irq': 18}] This device supports only 1 rx and 1 tx queue, so querying that: $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \ --dump queue-get --json='{"ifindex": 2}' [{'id': 0, 'ifindex': 2, 'napi-id': 513, 'type': 'rx'}, {'id': 0, 'ifindex': 2, 'napi-id': 513, 'type': 'tx'}] Signed-off-by: Joe Damato Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/e1000/e1000_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index ab7ae418d294..4de9b156b2be 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c @@ -513,6 +513,8 @@ void e1000_down(struct e1000_adapter *adapter) */ netif_carrier_off(netdev); + netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, NULL); + netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, NULL); napi_disable(&adapter->napi); e1000_irq_disable(adapter); @@ -1392,7 +1394,10 @@ int e1000_open(struct net_device *netdev) /* From here on the code is the same as e1000_up() */ clear_bit(__E1000_DOWN, &adapter->flags); + netif_napi_set_irq(&adapter->napi, adapter->pdev->irq); napi_enable(&adapter->napi); + netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, &adapter->napi); + netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, &adapter->napi); e1000_irq_enable(adapter);