From nobody Thu Nov 28 03:43:46 2024 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 EF75115539F for ; Sat, 5 Oct 2024 14:57:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728140249; cv=none; b=XG3ej+/Dei1jxTklDXT93rMOk5mMBVP8BQaQgzxLIVyelSRamUvRdRYJrsKP9DU7dsPckOSFpsxHzqDdO8l9R9gdHnHYq2v7AUVXq/OWpfpjbddrgcyjLRc8YSeCQPzDag1SnEeY9nybOdVGism+o1u6KfBsb41epGDLLPIlVWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728140249; c=relaxed/simple; bh=ysbX5l1vLBzimCzPDgAViVv+ZxYYBsLYzrBE1+8ybHo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mHTKFwS3rzUkEYUourYnen3WVumWCLbJSkJ/UDVzQEc4xcXRWv2qzq5/zDwZzxyrh16VKHI7utWE3OxVkq5kZkq3STGv+ep3VbqwMtvh+CMgScflY3M9BnoP+uBXktIavV0xb7SEUja/2l7eufbcawPQUv0Xg/zcCtsKp27y7vU= 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=DpSz7gUq; arc=none smtp.client-ip=209.85.215.170 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="DpSz7gUq" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-7e9ff6fb4c6so377083a12.3 for ; Sat, 05 Oct 2024 07:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1728140247; x=1728745047; 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=zIZerHGyKKkDkl5U8HwNES4+6GKUJadKoubjuPnUQug=; b=DpSz7gUqNylgUxdP9uUfImzXxW9zxYUYTacoYO55ZtSOxfaPOczx2m2YveO7yqMd6C d26Rpx0VOQxPLlcE/N/T9TVROgiYalO7CcTDs/+Jip3yX4lqnoCLHIaQws8/+mhoIgQX eveTdKYSH1z6zuCQB6HQu/OcKN5tqJuZc5a7w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728140247; x=1728745047; 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=zIZerHGyKKkDkl5U8HwNES4+6GKUJadKoubjuPnUQug=; b=ur/K2Yevz46afPagxFHfn0PVmHo5KOUhpxTx5H5pNlGOPTJGghe/l7snWsnvjN+n6e uDnF+jYoLwRsOxMaceMXl2BygzCF5PGd8MLN/QkRNlxFzN2ahAWcciEvTBTVSo9yjeMQ VpC0ynPLrLv9hDTB93U5czV5PKiVqeb/oWkgzAM5rcLnx8VSSDB0HldcsYAyJgGbpyBl IRvgt1T2UhRAPSTH8vi9dxxT9h6R7iXOYr8yJ7H1KpGfIOuRBcYDlwefC4w6G/nMf9Jc gWao4fsXgy2ttHgre/aCz/RGesjbKeReDNrk7ElUdozIVqOb5hTD1IGomzaTIODbA8pP VYOQ== X-Forwarded-Encrypted: i=1; AJvYcCX9cgtudA2ThRV3XIqAtzMSzGW8emUTQ+cElU26toOAT8OdReiPEsSk/IHGr9jJNNJUl05xWkFm+rhDUIM=@vger.kernel.org X-Gm-Message-State: AOJu0YwrgAqRdhX/22g06qTOrMpfXw891Hegs3TDZWiqgRxPjIk0pH5b wuXZsWlGJ/rlE34mR126KnEiXulVFXztcq5VeRsFMCvoLV3GiUckECKrJg7TCDI= X-Google-Smtp-Source: AGHT+IEiERjQcTgt7RF6P0SsPQ0UjCg+IJotQMwFZzgz0muvxhy1nyS1UI6dlzjI4j/sBinrRL+JlA== X-Received: by 2002:a05:6a21:3983:b0:1d6:236f:bd6b with SMTP id adf61e73a8af0-1d6df72467cmr11886207637.0.1728140247287; Sat, 05 Oct 2024 07:57:27 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0d7d3b5sm1569273b3a.215.2024.10.05.07.57.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 07:57:26 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Cc: Joe Damato , Pavan Chebbi , Michael Chan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org (open list) Subject: [net-next v3 1/2] tg3: Link IRQs to NAPI instances Date: Sat, 5 Oct 2024 14:57:16 +0000 Message-Id: <20241005145717.302575-2-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241005145717.302575-1-jdamato@fastly.com> References: <20241005145717.302575-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 with netif_napi_set_irq. This information can be queried with the netdev-genl API. Compare the output of /proc/interrupts for my tg3 device with the output of netdev-genl after applying this patch: $ cat /proc/interrupts | grep eth0 | cut -f1 --delimiter=3D':' 343 344 345 346 347 $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \ --dump napi-get --json=3D'{"ifindex": 2}' [{'id': 8197, 'ifindex': 2, 'irq': 347}, {'id': 8196, 'ifindex': 2, 'irq': 346}, {'id': 8195, 'ifindex': 2, 'irq': 345}, {'id': 8194, 'ifindex': 2, 'irq': 344}, {'id': 8193, 'ifindex': 2, 'irq': 343}] Signed-off-by: Joe Damato Reviewed-by: Pavan Chebbi --- rfcv3: - wrapped the netif_napi_add call to 80 characters drivers/net/ethernet/broadcom/tg3.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/bro= adcom/tg3.c index 378815917741..6564072b47ba 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -7413,9 +7413,11 @@ static void tg3_napi_init(struct tg3 *tp) { int i; =20 - netif_napi_add(tp->dev, &tp->napi[0].napi, tg3_poll); - for (i =3D 1; i < tp->irq_cnt; i++) - netif_napi_add(tp->dev, &tp->napi[i].napi, tg3_poll_msix); + for (i =3D 0; i < tp->irq_cnt; i++) { + netif_napi_add(tp->dev, &tp->napi[i].napi, + i ? tg3_poll_msix : tg3_poll); + netif_napi_set_irq(&tp->napi[i].napi, tp->napi[i].irq_vec); + } } =20 static void tg3_napi_fini(struct tg3 *tp) --=20 2.25.1