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:	Sat, 13 Sep 2014 15:26:46 +0530
From:	Govindarajulu Varadarajan <_govind@....com>
To:	ben@...adent.org.uk
Cc:	netdev@...r.kernel.org, ssujith@...co.com,
	Govindarajulu Varadarajan <_govind@....com>
Subject: [PATCH ethtool 2/3] ethtool: Add rx_copybreak support

Signed-off-by: Govindarajulu Varadarajan <_govind@....com>
---
 ethtool.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/ethtool.c b/ethtool.c
index 19b8b0c..09fdc95 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -1668,6 +1668,57 @@ static int do_spause(struct cmd_context *ctx)
 	return 0;
 }
 
+static int do_srx_copybreak(struct cmd_context *ctx)
+{
+	struct ethtool_tunable *etuna;
+	int ret;
+	__u32 *rx;
+
+	if (ctx->argc != 1)
+		exit_bad_args();
+	etuna = malloc(sizeof(*etuna) + sizeof(__u32));
+	if (!etuna)
+		return 1;
+	rx = (void *)etuna + sizeof(*etuna);
+	*rx = get_u32(ctx->argp[0], 0);
+	etuna->cmd = ETHTOOL_STUNABLE;
+	etuna->id = ETHTOOL_RX_COPYBREAK;
+	etuna->type_id = ETHTOOL_TUNABLE_U32;
+	etuna->len = sizeof(__u32);
+	ret = send_ioctl(ctx, etuna);
+	if (ret)
+		perror("Cannot set rx_copybreak");
+
+	free(etuna);
+	return ret;
+}
+
+static int do_grx_copybreak(struct cmd_context *ctx)
+{
+	struct ethtool_tunable *etuna;
+	int ret;
+	__u32 *rx_copybreak;
+
+	if (ctx->argc != 0)
+		exit_bad_args();
+	etuna = malloc(sizeof(*etuna) + sizeof(__u32));
+	if (!etuna)
+		return 1;
+	etuna->cmd = ETHTOOL_GTUNABLE;
+	etuna->id = ETHTOOL_RX_COPYBREAK;
+	etuna->type_id = ETHTOOL_TUNABLE_U32;
+	etuna->len = sizeof(__u32);
+	ret = send_ioctl(ctx, etuna);
+	rx_copybreak = (void *)etuna + sizeof(*etuna);
+	if (ret)
+		perror("Cannot get rx_copybreak");
+	else
+		fprintf(stdout, "rx_copybreak : %u\n", *rx_copybreak);
+
+	free(etuna);
+	return ret;
+}
+
 static int do_sring(struct cmd_context *ctx)
 {
 	struct ethtool_ringparam ering;
@@ -3787,6 +3838,9 @@ static const struct option {
 	  "		[ rx-mini N ]\n"
 	  "		[ rx-jumbo N ]\n"
 	  "		[ tx N ]\n" },
+	{ "-b|--show-rx_copybreak", 1, do_grx_copybreak, "Show rx_copybreak value" },
+	{ "-B|--set-rx_copybreak", 1, do_srx_copybreak, "Set rx_copybreak value",
+	  "		N\n" },
 	{ "-k|--show-features|--show-offload", 1, do_gfeatures,
 	  "Get state of protocol offload and other features" },
 	{ "-K|--features|--offload", 1, do_sfeatures,
-- 
2.1.0

--
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