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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 4F2C6CCF9E3 for ; Sat, 25 Oct 2025 15:03:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0C4F2811EF; Sat, 25 Oct 2025 15:03:12 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id s5gAugTE74gB; Sat, 25 Oct 2025 15:03:11 +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 smtp1.osuosl.org 3ECFB81197 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1761404591; bh=Tsq9w8JRKEL450WkTNkNXkuHrLaLkKptl+VicofTqXY=; h=From:To:CC:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sJgi066QIvtb4rktsphIZV0Wt4owkDTodB2mG9TGD6UMdL0/g2LbJKS1z7mHdzOeS rg1pHPWYtyEPuNo8K5DuqLh4bLPWSfT1ypHZATjkggdGIgMEGSYM/lLUsHy3itkRXz 1iDoQgjCm6qIrMtIrwuvOApoc8qnPuZ67wSoivHSWR+4ZE/s84MOKCnc+hNzg9ilOZ 8u1X4YY2jJzH9sX6NwDtvMoP/iB6aGN2/CWTSo863MjVsMYwn92is7xh2lMGFZsg2X Nd1JjkH01jjBaXwRT0zCFf+ZqlY4BlhzYEZuk0axkD1tYwnTc3HFdZLeRTAXIXVGBs 6EOqUCcnFOhXQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 3ECFB81197; Sat, 25 Oct 2025 15:03:11 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists1.osuosl.org (Postfix) with ESMTP id C5D8BD7 for ; Sat, 25 Oct 2025 15:03:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C2D84403D2 for ; Sat, 25 Oct 2025 15:03:10 +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 ldm875YEn1ja for ; Sat, 25 Oct 2025 15:03:10 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=50.112.246.219; helo=pdx-out-015.esa.us-west-2.outbound.mail-perimeter.amazon.com; envelope-from=prvs=3869390cb=enjuk@amazon.co.jp; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org D9840404E1 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D9840404E1 Received: from pdx-out-015.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-015.esa.us-west-2.outbound.mail-perimeter.amazon.com [50.112.246.219]) by smtp4.osuosl.org (Postfix) with ESMTPS id D9840404E1 for ; Sat, 25 Oct 2025 15:03:09 +0000 (UTC) X-CSE-ConnectionGUID: XmkJ5SMmSmyLaeUyMUEudA== X-CSE-MsgGUID: xW9kgsUVTLq2eZ2O2lIOGg== X-IronPort-AV: E=Sophos;i="6.19,255,1754956800"; d="scan'208";a="5508493" Received: from ip-10-5-0-115.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.0.115]) by internal-pdx-out-015.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2025 15:03:07 +0000 Received: from EX19MTAUWB001.ant.amazon.com [205.251.233.104:17402] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.8.44:2525] with esmtp (Farcaster) id f0b63301-7608-493c-a890-145cbbb0f4f6; Sat, 25 Oct 2025 15:03:07 +0000 (UTC) X-Farcaster-Flow-ID: f0b63301-7608-493c-a890-145cbbb0f4f6 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWB001.ant.amazon.com (10.250.64.248) 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:03:07 +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:03:04 +0000 From: Kohei Enju To: , CC: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , , Kohei Enju Date: Sun, 26 Oct 2025 00:01:32 +0900 Message-ID: <20251025150136.47618-4-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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.37.244.8] X-ClientProxiedBy: EX19D043UWC002.ant.amazon.com (10.13.139.222) To EX19D001UWA001.ant.amazon.com (10.13.138.214) X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1761404589; x=1792940589; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Tsq9w8JRKEL450WkTNkNXkuHrLaLkKptl+VicofTqXY=; b=WoYgeTtYIGeWpuA79GJBQ/FV0h6M1pRWSg0U62bS0GoL20n+ejnQnOxG nmN105rKhM4GOMPdahG7R5znGxLmBcn0QJUv++w5qT+K8A8OmEAbSv2Lv 1MvQFn4Tuigm8J5foViU6O+ExuSpyvyN4j/4sGUju/cTkoEZb+oK+mqZN cf+avhlnIJu7MhoNqj4+qpjgNm8cpuvIFTAefPvT2kQIyTVmyg7mfDC+Q biXR7xRIFtlksdnmei+ctgQ6hah7gUGfxloTHBdXvFsbjC6iv2OMqDqdg UDbe1I0wFTK1mYRo+sETWusN+IbmPrj2IjRhAWP/lr8dMzO8R13QsWBoH w==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=amazon.com header.i=@amazon.com header.a=rsa-sha256 header.s=amazoncorp2 header.b=WoYgeTtY Subject: [Intel-wired-lan] [PATCH iwl-next v1 3/3] igc: allow configuring RSS key via ethtool set_rxfh 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" Change igc_ethtool_set_rxfh() to accept and save a userspace-provided RSS key. When a key is provided, store it in the adapter and write the RSSRK registers accordingly. This can be tested using `ethtool -X hkey `. Signed-off-by: Kohei Enju --- drivers/net/ethernet/intel/igc/igc.h | 1 + drivers/net/ethernet/intel/igc/igc_ethtool.c | 31 ++++++++++++-------- drivers/net/ethernet/intel/igc/igc_main.c | 3 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h index dd159397d191..c894a5a99fc0 100644 --- a/drivers/net/ethernet/intel/igc/igc.h +++ b/drivers/net/ethernet/intel/igc/igc.h @@ -304,6 +304,7 @@ struct igc_adapter { u8 rss_indir_tbl[IGC_RETA_SIZE]; u8 rss_key[IGC_RSS_KEY_SIZE]; + bool has_user_rss_key; unsigned long link_check_timeout; struct igc_info ei; diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index 0482e590bc5a..64eac1ccb3ff 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -1527,24 +1527,29 @@ static int igc_ethtool_set_rxfh(struct net_device *netdev, int i; /* We do not allow change in unsupported parameters */ - if (rxfh->key || - (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE && - rxfh->hfunc != ETH_RSS_HASH_TOP)) + if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE && + rxfh->hfunc != ETH_RSS_HASH_TOP) return -EOPNOTSUPP; - if (!rxfh->indir) - return 0; - num_queues = adapter->rss_queues; + if (rxfh->indir) { + num_queues = adapter->rss_queues; - /* Verify user input. */ - for (i = 0; i < IGC_RETA_SIZE; i++) - if (rxfh->indir[i] >= num_queues) - return -EINVAL; + /* Verify user input. */ + for (i = 0; i < IGC_RETA_SIZE; i++) + if (rxfh->indir[i] >= num_queues) + return -EINVAL; - for (i = 0; i < IGC_RETA_SIZE; i++) - adapter->rss_indir_tbl[i] = rxfh->indir[i]; + for (i = 0; i < IGC_RETA_SIZE; i++) + adapter->rss_indir_tbl[i] = rxfh->indir[i]; - igc_write_rss_indir_tbl(adapter); + igc_write_rss_indir_tbl(adapter); + } + + if (rxfh->key) { + adapter->has_user_rss_key = true; + memcpy(adapter->rss_key, rxfh->key, sizeof(adapter->rss_key)); + igc_write_rss_key(adapter); + } return 0; } diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 1f0a601cbcef..e977661bed2f 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -779,7 +779,8 @@ static void igc_setup_mrqc(struct igc_adapter *adapter) u32 j, num_rx_queues; u32 mrqc, rxcsum; - netdev_rss_key_fill(adapter->rss_key, sizeof(adapter->rss_key)); + if (!adapter->has_user_rss_key) + netdev_rss_key_fill(adapter->rss_key, sizeof(adapter->rss_key)); igc_write_rss_key(adapter); num_rx_queues = adapter->rss_queues; -- 2.51.0