From mboxrd@z Thu Jan 1 00:00:00 1970 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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76CD0C02194 for ; Wed, 5 Feb 2025 10:06:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4012D417BE; Wed, 5 Feb 2025 10:06:41 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id svG2q5jgHft3; Wed, 5 Feb 2025 10:06:40 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7DED54198A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1738750000; bh=suHBE4qKRGIWWNKry9d5l0GLhTwwO1mu+DeNz8w65O0=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PH1DKZG9xD9zbNY5FMuS5vXjaYA5e2xsTHNzHbPezjfS2ZVViuG5C0CML69gHkdP+ HykUpJk8fXCrw2nSs3axJkzFg5tvXWzJKmIJ/jMsQSnUrC5PzHyc/bn21ojbQjYOOY HawDEOapnr6SRkWipnlCzYhk9Rxii/14Vkg35h3LTMmuzidXfzU9Qw0WpKUyrTmtAN MEbyrzu7V6kapbbdniudG+l4PX5dudu3pH8BCiWZj9VvuC2yGuxb3KZ8XgOm37IfN/ GtsPObNyKjjSfBBLlkBGR21d0uvREoSLg7etWo8nLzkYmiC/FRKGko+tCnPCBc4DgN zaFi8dhpGm7kQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 7DED54198A; Wed, 5 Feb 2025 10:06:40 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id CFE1212A for ; Wed, 5 Feb 2025 10:06:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C68A741954 for ; Wed, 5 Feb 2025 10:06:38 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 9adLeAVAh6yN for ; Wed, 5 Feb 2025 10:06:38 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=198.175.65.12; helo=mgamail.intel.com; envelope-from=faizal.abdul.rahim@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org CC8FF417BE DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org CC8FF417BE Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by smtp4.osuosl.org (Postfix) with ESMTPS id CC8FF417BE for ; Wed, 5 Feb 2025 10:06:37 +0000 (UTC) X-CSE-ConnectionGUID: ovH9E8AaSEa9oMggnjr6Qw== X-CSE-MsgGUID: 65ejb0MzQsasQhv07GW0jw== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50699253" X-IronPort-AV: E=Sophos;i="6.13,261,1732608000"; d="scan'208";a="50699253" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2025 02:06:37 -0800 X-CSE-ConnectionGUID: SO+z4F50SRGjNDyjQPY7bA== X-CSE-MsgGUID: cyzSz0zcRe66lFbCq+Qmpw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="111297759" Received: from mohdfai2-ilbpg12-1.png.intel.com ([10.88.227.73]) by orviesa007.jf.intel.com with ESMTP; 05 Feb 2025 02:06:30 -0800 From: Faizal Rahim To: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Simon Horman , Russell King , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Russell King , Furong Xu <0x1207@gmail.com>, Vladimir Oltean , Serge Semin , Xiaolei Wang , Suraj Jaiswal , Kory Maincent , Petr Tesarik , Faizal Rahim , Choong Yong Liang , Kunihiko Hayashi , Vinicius Costa Gomes , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org Date: Wed, 5 Feb 2025 05:05:23 -0500 Message-Id: <20250205100524.1138523-9-faizal.abdul.rahim@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250205100524.1138523-1-faizal.abdul.rahim@linux.intel.com> References: <20250205100524.1138523-1-faizal.abdul.rahim@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738749998; x=1770285998; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=LAGXwfWPNxonbtIoO1+jyMLnCooM8DQlGtdO0BdPI4I=; b=LiKIuj2J1YzKVAzHZBXIrAsXaLEVVBVygnznivGBkj4eYRpZ8B7ts6ad 5zUD39hE3Y3KLdAeLAZSUKmscqQocrZ2QO3cL/mwgDt44PFZhy/oEOqkG 9LW7u6hb+qG151y5gesaLdTQesbJJjonGRIs5JybWWHoUIVASZlX/fHfR Grtinvjc0+VF9aSRAsXRCb0OTi6peno0x+EFKorW93xw7NUg3bGQZbZat eMQHSA5g/4ycRCbWAJM0AgdjHagmhOeFtihbEGM8NTuyNxb39c3I08qkh q22agK/Y6HAyHbJlDUQV88ZM7YHaAQROV4OysVeVsTQ/sbGNsXL/0GNGN Q==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=none (p=none dis=none) header.from=linux.intel.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=LiKIuj2J Subject: [Intel-wired-lan] [PATCH iwl-next v2 8/9] igc: Add support to get MAC Merge data via ethtool X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Implement "ethtool --show-mm" callback for IGC. Tested with command: $ ethtool --show-mm enp1s0. MAC Merge layer state for enp1s0: pMAC enabled: on TX enabled: on TX active: on TX minimum fragment size: 64 RX minimum fragment size: 60 Verify enabled: on Verify time: 128 Max verify time: 128 Verification status: SUCCEEDED Verified that the fields value are retrieved correctly. Signed-off-by: Faizal Rahim --- drivers/net/ethernet/intel/igc/igc_ethtool.c | 14 ++++++++++++++ drivers/net/ethernet/intel/igc/igc_tsn.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index 83da59aec59e..0140f2258823 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -1782,6 +1782,19 @@ static int igc_ethtool_set_eee(struct net_device *netdev, return 0; } +static int igc_ethtool_get_mm(struct net_device *netdev, + struct ethtool_mm_state *cmd) +{ + struct igc_adapter *adapter = netdev_priv(netdev); + struct fpe_t *fpe = &adapter->fpe; + + ethtool_mmsv_get_mm(&fpe->mmsv, cmd); + cmd->tx_min_frag_size = fpe->tx_min_frag_size; + cmd->rx_min_frag_size = IGC_RX_MIN_FRAG_SIZE; + + return 0; +} + static int igc_ethtool_set_mm(struct net_device *netdev, struct ethtool_mm_cfg *cmd, struct netlink_ext_ack *extack) @@ -2091,6 +2104,7 @@ static const struct ethtool_ops igc_ethtool_ops = { .set_rxfh = igc_ethtool_set_rxfh, .get_ts_info = igc_ethtool_get_ts_info, .get_channels = igc_ethtool_get_channels, + .get_mm = igc_ethtool_get_mm, .set_mm = igc_ethtool_set_mm, .set_channels = igc_ethtool_set_channels, .get_priv_flags = igc_ethtool_get_priv_flags, diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.h b/drivers/net/ethernet/intel/igc/igc_tsn.h index 898c4630bc70..c82f9718cb85 100644 --- a/drivers/net/ethernet/intel/igc/igc_tsn.h +++ b/drivers/net/ethernet/intel/igc/igc_tsn.h @@ -4,6 +4,7 @@ #ifndef _IGC_TSN_H_ #define _IGC_TSN_H_ +#define IGC_RX_MIN_FRAG_SIZE 60 #define SMD_FRAME_SIZE 60 DECLARE_STATIC_KEY_FALSE(igc_fpe_enabled); -- 2.34.1