From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pdx-out-003.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-003.esa.us-west-2.outbound.mail-perimeter.amazon.com [44.246.68.102]) (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 B541920B7ED for ; Tue, 3 Feb 2026 12:55:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=44.246.68.102 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770123349; cv=none; b=eYm4sLc1DyLaJreNnHjBwJWt1qEUzHDZcgPwD0zPEnu2e9Zu86l3W+n2YPV3wIPE732Cetpo/WG4qj6y3imLG8is5YJnZdMIdrILvb15NWuhQZ90MpweU28FaYLDtn3Lus/PfLtTHFLofP6wlsJg+JKR4vKJVIexVZcHFs1kFII= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770123349; c=relaxed/simple; bh=88WCkUKCeylopa8f6zavlynP/N61uchOZlrmkfIMi90=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=P5EjMGcLxTxlXQgNtnGYlGo0cqQ3ibnDwgXjf0puoBoAXATOupMkGe00dg7MYlEiCdC/S5p2dJb7Qwo4TY+5heJMq5AhJqtoRHbJztVHK+oZnO/6csvODwUneVGjZ0mbvkY38oIek/TkeCTbgOUXDe2Shc8soBwtjPTE4loMEUI= 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=GfCt9Q1e; arc=none smtp.client-ip=44.246.68.102 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="GfCt9Q1e" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1770123348; x=1801659348; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W1p9ZU1anq8c3tA5/K3cU5JbzW1imGiGjezF2dcMG5o=; b=GfCt9Q1ec16i/HMExvGa8Q1esMz6M+SxKwPvyHyPmGBQC+Cc1z04lrKB oiZ1Vz0qSH80P5Y2818cANIGGsf7J+GLyug+GAm4QeyxpIzJ2D468FjC8 tSbX7GgZCZZO0isOsuD4JmSFQn4+mGtri6l/KOCbeyO2k6E9i3DhHv+Qt qGHZ6GB8PXkw9nD6Wfv28m4dIT4wVfWepzi1ogDyyyg8QqU1lYfG5/ynt E+0+zaEwCAe48932Y0zv68fXqPgUQlHVRIC0smPq+5kixjeDWTWDHJ2W4 jPoOSp7eFy2OQqiEjk5Kr4U8+RilF0ozuNj0Aw34pObAxwGqLYLlBgPbJ Q==; X-CSE-ConnectionGUID: BA2TFj8aRWKimPNqD0okYg== X-CSE-MsgGUID: yiaUqkMeT0i3/+jqQdUuRQ== X-IronPort-AV: E=Sophos;i="6.21,270,1763424000"; d="scan'208";a="12190615" Received: from ip-10-5-12-219.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.12.219]) by internal-pdx-out-003.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2026 12:55:46 +0000 Received: from EX19MTAUWB001.ant.amazon.com [205.251.233.104:29351] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.17.158:2525] with esmtp (Farcaster) id bea7ed2c-7832-42d6-9b20-8c0bec80b03f; Tue, 3 Feb 2026 12:55:45 +0000 (UTC) X-Farcaster-Flow-ID: bea7ed2c-7832-42d6-9b20-8c0bec80b03f 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.35; Tue, 3 Feb 2026 12:55:45 +0000 Received: from 603e5f7bc1fe.amazon.com (10.37.245.7) 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.35; Tue, 3 Feb 2026 12:55:43 +0000 From: Takashi Kozu To: CC: , , , , , , , , , , , , , Takashi Kozu Subject: [PATCH iwl-next v6 3/3] igb: allow configuring RSS key via ethtool set_rxfh Date: Tue, 3 Feb 2026 21:54:13 +0900 Message-ID: <20260203125417.37285-8-takkozu@amazon.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20260203125417.37285-5-takkozu@amazon.com> References: <20260203125417.37285-5-takkozu@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: EX19D044UWB003.ant.amazon.com (10.13.139.168) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Change igb_set_rxfh() to accept and save a userspace-provided RSS key. When a key is provided, store it in the adapter and write the E1000 registers accordingly. This can be tested using `ethtool -X hkey `. Reviewed-by: Simon Horman Signed-off-by: Takashi Kozu --- drivers/net/ethernet/intel/igb/igb_ethtool.c | 48 +++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index b387121f0ea7..b4eef14c09d5 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -3357,35 +3357,39 @@ static int igb_set_rxfh(struct net_device *netdev, u32 num_queues; /* 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; - switch (hw->mac.type) { - case e1000_82576: - /* 82576 supports 2 RSS queues for SR-IOV */ - if (adapter->vfs_allocated_count) - num_queues = 2; - break; - default: - break; - } + switch (hw->mac.type) { + case e1000_82576: + /* 82576 supports 2 RSS queues for SR-IOV */ + if (adapter->vfs_allocated_count) + num_queues = 2; + break; + default: + break; + } - /* Verify user input. */ - for (i = 0; i < IGB_RETA_SIZE; i++) - if (rxfh->indir[i] >= num_queues) - return -EINVAL; + /* Verify user input. */ + for (i = 0; i < IGB_RETA_SIZE; i++) + if (rxfh->indir[i] >= num_queues) + return -EINVAL; - for (i = 0; i < IGB_RETA_SIZE; i++) - adapter->rss_indir_tbl[i] = rxfh->indir[i]; + for (i = 0; i < IGB_RETA_SIZE; i++) + adapter->rss_indir_tbl[i] = rxfh->indir[i]; + + igb_write_rss_indir_tbl(adapter); + } - igb_write_rss_indir_tbl(adapter); + if (rxfh->key) { + memcpy(adapter->rss_key, rxfh->key, sizeof(adapter->rss_key)); + igb_write_rss_key(adapter); + } return 0; } -- 2.52.0