Article View: linux.kernel.netdev
Article #512[PATCH net-next v16 7/7] r8169: add get_channel support for ethtool
From: javen
Date: Thu, 08 Oct 2026 06:57
Date: Thu, 08 Oct 2026 06:57
75 lines
8477 bytes
8477 bytes
From: Javen Xu <javen_xu@realsil.com.cn>
Add get_channel support for ethtool.
In multi-vector mode, it reports the active RX channel count and a
single TX channel. Additionly, it reports one other channel to account
for the dedicated link-change interrupt vector.
In single-vector mode, where RX, TX, link-change events share the same
interrupt, it reports a single combined channel.
Signed-off-by: Javen Xu <javen_xu@realsil.com.cn>
---
Changes in v11:
- new file, no change
Changes in v12:
- no changes
Changes in v13:
- no changes
Changes in v14:
- no changes
Changes in v15:
- no changes
Changes in v16:
- modify commit message
- add other msix count in get_channel function
---
drivers/net/ethernet/realtek/r8169_main.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index de0c860328ba..88354e7570f0 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -6741,6 +6741,24 @@ static void r8169_init_napi(struct rtl8169_private *tp)
}
}
+static void rtl8169_get_channels(struct net_device *dev,
+ struct ethtool_channels *ch)
+{
+ struct rtl8169_private *tp = netdev_priv(dev);
+
+ if (tp->irq_nvecs > 1) {
+ ch->max_rx = tp->hw_supp_num_rx_queues;
+ ch->max_tx = 1;
+ ch->max_other = 1;
+ ch->rx_count = tp->num_rx_rings;
+ ch->tx_count = 1;
+ ch->other_count = 1;
+ } else {
+ ch->max_combined = 1;
+ ch->combined_count = 1;
+ }
+}
+
static const struct ethtool_ops rtl8169_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
ETHTOOL_COALESCE_MAX_FRAMES,
@@ -6759,6 +6777,7 @@ static const struct ethtool_ops rtl8169_ethtool_ops = {
.nway_reset = rtl8169_nway_reset,
.get_eee = rtl8169_get_eee,
.set_eee = rtl8169_set_eee,
+ .get_channels = rtl8169_get_channels,
.get_link_ksettings = rtl8169_get_link_ksettings,
.set_link_ksettings = rtl8169_set_link_ksettings,
.get_ringparam = rtl8169_get_ringparam,
--
2.43.0
Technical Details
Message-ID:
<20261008065722.1026-8-javen_xu@realsil.com.cn>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342769-linux-kernel-netdev=dewy.ruReferences:
<20261008065722.1026-1-javen_xu@realsil.com.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342769-linux-kernel-netdev=dewy.ru From: javen_xu@realsil.com.cn (javen) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v16 7/7] r8169: add get_channel support for ethtool Date: Thu, 8 Oct 2026 14:57:22 +0800 Organization: Usenet Network Message-ID: <20261008065722.1026-8-javen_xu@realsil.com.cn> References: <20261008065722.1026-1-javen_xu@realsil.com.cn> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="821734"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:4tRNlQ6eeKYj3XjYIu8bB3/OTc8= sha256:qODhJOLLSgrQ8URlbe/+JMrRUddHD+MYADg3Sk495ls= sha1:Hf+WV3+a+Y+QamtYtXbC3IfptX0= sha256:9r53R8A6CdeXm6vyOVxciZe9zdEOMIFhDviYGdondOI= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id BADAD10F323; Thu, 8 Oct 2026 10:03:30 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=realsil.com.cn X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xJVZT9QwLXPO; Thu, 8 Oct 2026 10:03:23 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-342769-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=realsil.com.cn X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 5DE7910F260; Thu, 8 Oct 2026 10:03:17 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 0025629E73; Thu, 8 Oct 2026 07:03:15 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50B2B3D1CAE; Thu, 8 Oct 2026 07:03:13 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=realsil.com.cn header.i=@realsil.com.cn header.b="M6YOd5jD" X-Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 6FDD3347C6; Thu, 8 Oct 2026 07:03:10 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791442993; cv=none; b=A1qZ9Em/IL1HJwzWZmZAt/gx7UUWb7l0kOto+gNs+tBQNoZBifj3cd6D+GLg11BZf2gG204GHtA5LFVFK/TEqMYywZVrzkiKVexqzhG3Lq0+1tIV3RZ5a6c4UTKlpo98C7XbnDQvGIl01nbmrzSKc+gnD8WLyYArDgTQB+FwZBg= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791442993; c=relaxed/simple; bh=Cdyw1hTiLU37GgEJ3SHHwIUbg2hy2ux1Fk03H9yysqc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZrL5TQkGR4EoNEbncuNMBq6gX1AVapEyoFBV5EnKbf1dK8nwtOZ+SxKYYm1+is2fJxnHH6sn5LaeLPDzbG7p5jWSSWwaj+z6sl4qavGQkXaRI/TlCATMq3sQhs9jb4leKwUDfD0OD3WdLWcc9Nz3dHnktgjDRPkFpIviZ9vtv5M= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realsil.com.cn; spf=pass smtp.mailfrom=realsil.com.cn; dkim=pass (2048-bit key) header.d=realsil.com.cn header.i=@realsil.com.cn header.b=M6YOd5jD; arc=none smtp.client-ip=211.75.126.72 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realsil.com.cn X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realsil.com.cn X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 6986vRPT1281951, This message is accepted by code: ctloc85258 X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realsil.com.cn; s=dkim; t=1791442647; bh=LZ6cNLA2XSFAhEEMraHLx/4pOo60AzCLnS3bC055tIo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=M6YOd5jDo71AV5bNcanNkEX7XMwkF31nZdEENJLICN++qJhh0azUVSoI7R+Om6fro fv6ywwL55RM1MDU2gE0q8M4wpEzOpLUA7g2W7E037Y58JHVvsph0oKUDTF5vGlzgBk QJ32ksmZeyRael8nZlvbEWjvM6iuznj65C2kwZb5xL5QYl5bpC00jKSiXpc4GWVuDX W1rOZnPn0O7ep50+GrcIrXmocBmkwnaUocghfLI2/hGfbZpG6OFJI48Gk6R7U8ISaI WjW7qLitQCUVzRKqbxUeKxYff30JNpqSq+PuHfi/aGpnjV5Q4B0JU3G9HB/WAC/wtj 8Ix+7AahmkUlQ== X-Received: from RS-EX-MBS2.realsil.com.cn ([172.29.17.102]) by rtits2.realtek.com.tw (8.15.2/3.29/5.94) with ESMTPS id 6986vRPT1281951 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Oct 2026 14:57:27 +0800 X-Received: from RS-EX-MBS1.realsil.com.cn (172.29.17.101) by RS-EX-MBS2.realsil.com.cn (172.29.17.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49; Thu, 8 Oct 2026 14:57:26 +0800 X-Received: from 172.29.37.154 (172.29.37.152) by RS-EX-MBS1.realsil.com.cn (172.29.17.101) with Microsoft SMTP Server id 15.2.2562.49 via Frontend Transport; Thu, 8 Oct 2026 14:57:26 +0800 X-CC: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux@armlinux.org.uk>, Javen Xu <javen_xu@realsil.com.cn> X-Mailer: git-send-email 2.50.1.windows.1 X-In-Reply-To: <20261008065722.1026-1-javen_xu@realsil.com.cn> X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>