Received: from pdx-out-011.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-011.esa.us-west-2.outbound.mail-perimeter.amazon.com [52.35.192.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 491A23002DF for ; Sat, 25 Oct 2025 15:02:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.35.192.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761404571; cv=none; b=S+PKmlYEY6Whrf/F7e8logel6Y71Gd3cooCWj7d9pILWx6SnAUElWLi9w61kawJ+tQu8cMZGNkX/9YMVSgZZ0vNUWjrNif4KvTJJLi9p68I1M8OPOZ05pm6qj8kpHdL7oZwK9Sxf4DHDbqsOfS4IJ9sXXT7N+1o5nmxNv8zYFT8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761404571; c=relaxed/simple; bh=1ezpbTujOG/3uAec3FrvRf9xuLV7HLmBK7hWzgSjEzg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OV8xeX7IacZBQy3yF6Zbjov5je5+L+ggeyZz8Id2pThgBAzTOZ11fFuQpgWn4SdxOiIRqjaTiW2lShUVveaDwFdAHqn9BvANORwBUQOfxCxWLWSni9o6IMhJVPDPnoTJGgvedNQcvaypG0dnN+8UhfeO+E5pfCpdV9BLf5eQcNk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.jp; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=JYtrq9Eq; arc=none smtp.client-ip=52.35.192.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="JYtrq9Eq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1761404569; x=1792940569; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YDmjnW0AsEL/okhqqHN2hED4Om4KL/j086oBDjwzykk=; b=JYtrq9EqhuMOGjGOGG11RFtjbihhNKzTsDS1Mdbc92pmlv8ACnouASC6 8nMWN0wvSdYnWMSIwaepzx4pE9omjK/ChgoSPtBOCrSDxsRxJNPCqqG1i eX4v0oAV6tlKBGW3MQRfSOJwCdXcGrrPi2X4FswMxFvH0maozrwQoaLY7 7ddfWJYoY7k8wrcoOL7RP1PPLxzoJ9Nt3EW9eYbpXtx/xMhszq0TxfA70 LFQ0BhyccOWc2KectIguAWDtnk074FFWJcrpWRORmPfA8cKR+Qjmd1Dsf 05cfRT74BX0485/3T32+kb1f2DawngLO7wXZmkAuyt3el1ffVrJceB9us A==; X-CSE-ConnectionGUID: SEaP4e3cS96GDA4Bx9RUeg== X-CSE-MsgGUID: a3+tNW4yS+SM8ZCHpzI1FQ== X-IronPort-AV: E=Sophos;i="6.19,255,1754956800"; d="scan'208";a="5490755" Received: from ip-10-5-9-48.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.9.48]) by internal-pdx-out-011.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2025 15:02:48 +0000 Received: from EX19MTAUWA002.ant.amazon.com [205.251.233.234:23899] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.16.196:2525] with esmtp (Farcaster) id 3f31c109-dc24-4606-b5e4-47a8e8aaa521; Sat, 25 Oct 2025 15:02:48 +0000 (UTC) X-Farcaster-Flow-ID: 3f31c109-dc24-4606-b5e4-47a8e8aaa521 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWA002.ant.amazon.com (10.250.64.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Sat, 25 Oct 2025 15:02:41 +0000 Received: from b0be8375a521.amazon.com (10.37.244.8) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.29; Sat, 25 Oct 2025 15:02:39 +0000 From: Kohei Enju To: , CC: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , , Kohei Enju Subject: [PATCH iwl-next v1 2/3] igc: expose RSS key via ethtool get_rxfh Date: Sun, 26 Oct 2025 00:01:31 +0900 Message-ID: <20251025150136.47618-3-enjuk@amazon.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20251025150136.47618-1-enjuk@amazon.com> References: <20251025150136.47618-1-enjuk@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EX19D038UWC003.ant.amazon.com (10.13.139.209) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Implement igc_ethtool_get_rxfh_key_size() and extend igc_ethtool_get_rxfh() to return the RSS key to userspace. This can be tested using `ethtool -x `. Signed-off-by: Kohei Enju --- drivers/net/ethernet/intel/igc/igc_ethtool.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index f89c2cbaace0..0482e590bc5a 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -1490,6 +1490,11 @@ void igc_write_rss_indir_tbl(struct igc_adapter *adapter) } } +static u32 igc_ethtool_get_rxfh_key_size(struct net_device *netdev) +{ + return IGC_RSS_KEY_SIZE; +} + static u32 igc_ethtool_get_rxfh_indir_size(struct net_device *netdev) { return IGC_RETA_SIZE; @@ -1502,10 +1507,13 @@ static int igc_ethtool_get_rxfh(struct net_device *netdev, int i; rxfh->hfunc = ETH_RSS_HASH_TOP; - if (!rxfh->indir) - return 0; - for (i = 0; i < IGC_RETA_SIZE; i++) - rxfh->indir[i] = adapter->rss_indir_tbl[i]; + + if (rxfh->indir) + for (i = 0; i < IGC_RETA_SIZE; i++) + rxfh->indir[i] = adapter->rss_indir_tbl[i]; + + if (rxfh->key) + memcpy(rxfh->key, adapter->rss_key, sizeof(adapter->rss_key)); return 0; } @@ -2182,6 +2190,7 @@ static const struct ethtool_ops igc_ethtool_ops = { .set_coalesce = igc_ethtool_set_coalesce, .get_rxnfc = igc_ethtool_get_rxnfc, .set_rxnfc = igc_ethtool_set_rxnfc, + .get_rxfh_key_size = igc_ethtool_get_rxfh_key_size, .get_rxfh_indir_size = igc_ethtool_get_rxfh_indir_size, .get_rxfh = igc_ethtool_get_rxfh, .set_rxfh = igc_ethtool_set_rxfh, -- 2.51.0