From nobody Thu Nov 28 07:53:00 2024 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 D7BFF1CEE95 for ; Thu, 3 Oct 2024 23:39:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727998747; cv=none; b=ifWR9qUgP6jAF++dCqmQz6emVDn0wZiTBtF+Q5wLP0A/SRktng8cFURTKgqix7g4f44L1j3dw6vq4S7xnxdLoZs5d4hrwuX1Xn3Ti9Ake2wr3OdJw5QFoCwWlqWwK0CdfUIGZtZC8asqxlz9/ZxQOM5DweNnrVRVkd0BE1qqyws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727998747; c=relaxed/simple; bh=aOPeijS4l9gs82itlGqmWgc4L9/VH7+qNqQbZnpSjfs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=duzOtxn2jv2hcq4Jzt/PqAI5VyDKsY6qV0Sslp8aVKraK9WZCY6KlPsGDAQBAjL0x4IJ+rfEf8Kb36z1QtXQhSA+8Rus4L6gBhsDAZKXolH4lzVWR7Ee42JSqn6go6HaZZJiUUxK60pJ9IpFTp84fTXl2ZNlt1hsYCu1OFQhpBQ= 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=Ph+EI6vV; arc=none smtp.client-ip=209.85.214.178 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="Ph+EI6vV" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-20ba8d92af9so11701005ad.3 for ; Thu, 03 Oct 2024 16:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1727998745; x=1728603545; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WhYp0DiSsQbpO6IwfgRG0/juZs6Inw4x8enD4rVfZ6Y=; b=Ph+EI6vVHnN5Qki1onLS7NYJbUNz87WGE85rlcb12TjnB3CkTI94OYooLrYoY/Jhdr LvI2kNIbEzkkC5pMHqDyI4G9E4dOa+4piOHro2TCj4FACHP1Bm+KCk7NX3X9T2dlBC56 QOs+U47ZkdxfLc/hQbjaQAaH8U7MdDHosRzYY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727998745; x=1728603545; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WhYp0DiSsQbpO6IwfgRG0/juZs6Inw4x8enD4rVfZ6Y=; b=tEn8tjh4mG4NVkLHKlcETh/JFbMq2ZKvZfyPM1xSYhQN+i49YP8DoVrMYba0zDogIU /f4/8HCX/JBtDz4mwdPCXkQMTk1HR0y/6e2oCfVJXAxXky/7wmIY803XZ2NOyoHfVkgs CXCMU87zrCRxAJsUtt9a5/NwR9CPh/0So5JTLLhxD+brsvKeZ7+jZw8FZ9Jlo+JnOPDW JFvaAI9xft+SsJFOD+OT/J1YPNx1PjglEk2cjErV7PmzBtAeR5fGAzCcAHHbIHlCPWVd KcUdiCcMqCy8dyLvFypcq6XUf5DLzuqSZG9vMbhnH9PF+cFbaeyO35LBlzbafGrX3sQ5 wbsA== X-Forwarded-Encrypted: i=1; AJvYcCUbsepgmDCGIy5J9cC+nl/4x+tViX1iOOvbUiZwOy7mDY3RqgwyWipn1W/SMF8htcn1hgi67r/Ozd694Vc=@vger.kernel.org X-Gm-Message-State: AOJu0Yy9ClSOTE5KtDZKngLh/2NAScS7aaa/STmdzZdvI4kKOo0qntVW IauLXmdhFXoLX9CG25bk8MuWhowV4vNlMwUj5pbHky0QsbUPE4Cy7UlEYC6GQsU= X-Google-Smtp-Source: AGHT+IGTpJ2+WaujujgDrlAgiMjkPmANHMw7/ysggq4USb76kJULVyruSiv/pbcSPf0FW7LJGb0RPw== X-Received: by 2002:a17:903:2a85:b0:206:ae39:9f4 with SMTP id d9443c01a7336-20bfdfc6ff8mr15955935ad.20.1727998745106; Thu, 03 Oct 2024 16:39:05 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20beef8ec6bsm13960705ad.158.2024.10.03.16.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 16:39:04 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Cc: Joe Damato , Tony Nguyen , Przemek Kitszel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org (moderated list:INTEL ETHERNET DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [RFC net-next 1/2] igc: Link IRQs to NAPI instances Date: Thu, 3 Oct 2024 23:38:49 +0000 Message-Id: <20241003233850.199495-2-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241003233850.199495-1-jdamato@fastly.com> References: <20241003233850.199495-1-jdamato@fastly.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Link IRQs to NAPI instances via netdev-genl API so that users can query this information with netlink. Compare the output of /proc/interrupts (noting that IRQ 144 is the "other" IRQ which does not appear to have a NAPI instance): $ cat /proc/interrupts | grep enp86s0 | cut --delimiter=3D":" -f1 144 145 146 147 148 The output from netlink shows the mapping of NAPI IDs to IRQs (again noting that 144 is absent as it is the "other" IRQ): $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \ --dump napi-get --json=3D'{"ifindex": 2}' [{'id': 8196, 'ifindex': 2, 'irq': 148}, {'id': 8195, 'ifindex': 2, 'irq': 147}, {'id': 8194, 'ifindex': 2, 'irq': 146}, {'id': 8193, 'ifindex': 2, 'irq': 145}] Signed-off-by: Joe Damato --- drivers/net/ethernet/intel/igc/igc.h | 1 + drivers/net/ethernet/intel/igc/igc_main.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/in= tel/igc/igc.h index eac0f966e0e4..e757ba53f165 100644 --- a/drivers/net/ethernet/intel/igc/igc.h +++ b/drivers/net/ethernet/intel/igc/igc.h @@ -593,6 +593,7 @@ struct igc_q_vector { =20 struct rcu_head rcu; /* to avoid race with update stats on free */ char name[IFNAMSIZ + 9]; + int irq; =20 /* for dynamic allocation of rings associated with this q_vector */ struct igc_ring ring[] ____cacheline_internodealigned_in_smp; diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethern= et/intel/igc/igc_main.c index 6e70bca15db1..7964bbedb16c 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -5576,6 +5576,9 @@ static int igc_request_msix(struct igc_adapter *adapt= er) q_vector); if (err) goto err_free; + + netif_napi_set_irq(&q_vector->napi, + adapter->msix_entries[vector].vector); } =20 igc_configure_msix(adapter); --=20 2.25.1