From patchwork Thu Nov 17 20:14:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerhard Engleder X-Patchwork-Id: 13047232 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34EF5C4332F for ; Thu, 17 Nov 2022 20:15:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239502AbiKQUPH (ORCPT ); Thu, 17 Nov 2022 15:15:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240102AbiKQUOz (ORCPT ); Thu, 17 Nov 2022 15:14:55 -0500 Received: from mx18lb.world4you.com (mx18lb.world4you.com [81.19.149.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54CA087571 for ; Thu, 17 Nov 2022 12:14:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=engleder-embedded.com; s=dkim11; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4/EVpN20mx+fHkYApdsyx7bAthPWTzcuZjpTPREdJhQ=; b=qVSYwkX1VgBBQcdr+WZ+AzTPNE csn+2eaOm6MKylJ5P8arp7t3Ix6mbkAMGSPatakolMT52q8JE139kz9YAPuCE/IMQb09qC1hdRxs2 m/yXB8bvTaj32rR9aZk8uh84KgZ33vhCoaLk3da6q99LhbVek8cOre1tHCM5Q3q14PG4=; Received: from 88-117-56-227.adsl.highway.telekom.at ([88.117.56.227] helo=hornet.engleder.at) by mx18lb.world4you.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ovlHc-0001s8-NW; Thu, 17 Nov 2022 21:14:48 +0100 From: Gerhard Engleder To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, Gerhard Engleder Subject: [PATCH net-next 3/4] tsnep: Add ethtool get_channels support Date: Thu, 17 Nov 2022 21:14:39 +0100 Message-Id: <20221117201440.21183-4-gerhard@engleder-embedded.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221117201440.21183-1-gerhard@engleder-embedded.com> References: <20221117201440.21183-1-gerhard@engleder-embedded.com> MIME-Version: 1.0 X-AV-Do-Run: Yes Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Allow user space to read number of TX and RX queue. This is useful for device dependent qdisc configurations like TAPRIO with hardware offload. Signed-off-by: Gerhard Engleder --- drivers/net/ethernet/engleder/tsnep_ethtool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/engleder/tsnep_ethtool.c b/drivers/net/ethernet/engleder/tsnep_ethtool.c index a713a126b227..3da5cb75aa55 100644 --- a/drivers/net/ethernet/engleder/tsnep_ethtool.c +++ b/drivers/net/ethernet/engleder/tsnep_ethtool.c @@ -288,6 +288,17 @@ static int tsnep_ethtool_set_rxnfc(struct net_device *dev, } } +static void tsnep_ethtool_get_channels(struct net_device *dev, + struct ethtool_channels *ch) +{ + struct tsnep_adapter *adapter = netdev_priv(dev); + + ch->max_rx = adapter->num_rx_queues; + ch->max_tx = adapter->num_tx_queues; + ch->rx_count = adapter->num_rx_queues; + ch->tx_count = adapter->num_tx_queues; +} + static int tsnep_ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) { @@ -327,6 +338,7 @@ const struct ethtool_ops tsnep_ethtool_ops = { .get_sset_count = tsnep_ethtool_get_sset_count, .get_rxnfc = tsnep_ethtool_get_rxnfc, .set_rxnfc = tsnep_ethtool_set_rxnfc, + .get_channels = tsnep_ethtool_get_channels, .get_ts_info = tsnep_ethtool_get_ts_info, .get_link_ksettings = phy_ethtool_get_link_ksettings, .set_link_ksettings = phy_ethtool_set_link_ksettings,