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]
Message-Id: <1408008560-1067-4-git-send-email-_govind@gmx.com>
Date:	Thu, 14 Aug 2014 14:59:20 +0530
From:	Govindarajulu Varadarajan <_govind@....com>
To:	davem@...emloft.net, netdev@...r.kernel.org
Cc:	ben@...adent.org.uk, stephen@...workplumber.org, ssujith@...co.com,
	benve@...co.com, Govindarajulu Varadarajan <_govind@....com>
Subject: [PATCH net-next v3 3/3] enic: Add tunable_ops support for rx_copybreak

This patch adds support for setting/getting rx_copybreak using
tunable_ops.

Defines enic_get_rx_copybreak() & enic_set_rx_copybreak() tunable_ops.

Signed-off-by: Govindarajulu Varadarajan <_govind@....com>
---
 drivers/net/ethernet/cisco/enic/enic_ethtool.c | 30 ++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/net/ethernet/cisco/enic/enic_ethtool.c b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
index 523c9ce..9bf53fc 100644
--- a/drivers/net/ethernet/cisco/enic/enic_ethtool.c
+++ b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
@@ -379,6 +379,30 @@ static int enic_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
 	return ret;
 }
 
+static int enic_get_rx_copybreak(struct net_device *dev,
+				 struct ethtool_tunable *tuna)
+{
+	struct enic *enic = netdev_priv(dev);
+
+	if (tuna->len < sizeof(tuna->data.rx_copybreak))
+		return -ENOSPC;
+	tuna->data.rx_copybreak = enic->rx_copybreak;
+
+	return 0;
+}
+
+static int enic_set_rx_copybreak(struct net_device *dev,
+				 struct ethtool_tunable *tuna)
+{
+	struct enic *enic = netdev_priv(dev);
+
+	if (tuna->len != sizeof(tuna->data.rx_copybreak))
+		return -EINVAL;
+	enic->rx_copybreak = tuna->data.rx_copybreak;
+
+	return 0;
+}
+
 static const struct ethtool_ops enic_ethtool_ops = {
 	.get_settings = enic_get_settings,
 	.get_drvinfo = enic_get_drvinfo,
@@ -391,6 +415,12 @@ static const struct ethtool_ops enic_ethtool_ops = {
 	.get_coalesce = enic_get_coalesce,
 	.set_coalesce = enic_set_coalesce,
 	.get_rxnfc = enic_get_rxnfc,
+	.tunable_ops = {
+		[ETHTOOL_RX_COPYBREAK] = {
+			.set = enic_set_rx_copybreak,
+			.get = enic_get_rx_copybreak,
+		},
+	},
 };
 
 void enic_set_ethtool_ops(struct net_device *netdev)
-- 
2.0.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