lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 17 Jul 2013 09:50:06 +0300
From:	Laura Mihaela Vasilescu <laura.vasilescu@...edu.org>
To:	netdev@...r.kernel.org
Cc:	jeffrey.t.kirsher@...el.com, carolyn.wyborny@...el.com,
	anjali.singhai@...el.com,
	Laura Mihaela Vasilescu <laura.vasilescu@...edu.org>
Subject: [PATCH 2/2] igb: Expose RSS indirection table for ethtool

Signed-off-by: Laura Mihaela Vasilescu <laura.vasilescu@...edu.org>
---
 drivers/net/ethernet/intel/igb/igb_ethtool.c |   32 ++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 85fe7b5..7e18dfa 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -2771,6 +2771,35 @@ static void igb_ethtool_complete(struct net_device *netdev)
 	pm_runtime_put(&adapter->pdev->dev);
 }
 
+static u32 igb_get_rss_table_size(struct net_device *netdev)
+{
+	return IGB_RETA_SIZE;
+}
+
+static int igb_get_rss_table(struct net_device *netdev, u32 *rxfh_indir_tbl)
+{
+	struct igb_adapter *adapter = netdev_priv(netdev);
+	struct e1000_hw *hw = &adapter->hw;
+	int i;
+
+	for (i = 0; i < IGB_RETA_SIZE; i++)
+		rxfh_indir_tbl[i] = rd32(E1000_RETA(i));
+
+	return 0;
+}
+
+static int igb_set_rss_table(struct net_device *netdev, const u32 *rxfh_indir_tbl)
+{
+	struct igb_adapter *adapter = netdev_priv(netdev);
+	struct e1000_hw *hw = &adapter->hw;
+	int i;
+
+	for (i = 0; i < IGB_RETA_SIZE; i++)
+		wr32(E1000_RETA(i), rxfh_indir_tbl[i]);
+
+	return 0;
+}
+
 static const struct ethtool_ops igb_ethtool_ops = {
 	.get_settings		= igb_get_settings,
 	.set_settings		= igb_set_settings,
@@ -2804,6 +2833,9 @@ static const struct ethtool_ops igb_ethtool_ops = {
 	.set_eee		= igb_set_eee,
 	.get_module_info	= igb_get_module_info,
 	.get_module_eeprom	= igb_get_module_eeprom,
+	.get_rxfh_indir_size	= igb_get_rss_table_size,
+	.get_rxfh_indir		= igb_get_rss_table,
+	.set_rxfh_indir		= igb_set_rss_table,
 	.begin			= igb_ethtool_begin,
 	.complete		= igb_ethtool_complete,
 };
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ