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: <8a12bc0824bce3b0678fcb68503cfaca97378c61.1308596963.git.mirq-linux@rere.qmqm.pl>
Date:	Mon, 20 Jun 2011 21:14:55 +0200 (CEST)
From:	Michał Mirosław <mirq-linux@...e.qmqm.pl>
To:	netdev@...r.kernel.org
Cc:	"David S. Miller" <davem@...emloft.net>,
	Ben Hutchings <bhutchings@...arflare.com>
Subject: [RFT PATCH 8/9] net: extend netdev_features_t to 64 bits

Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
---
 include/linux/netdev_features.h |    2 +-
 net/core/dev.c                  |   10 +++++-----
 net/core/net-sysfs.c            |    3 ++-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 2361e3ee..86d6193 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -12,7 +12,7 @@
 
 #include <linux/types.h>
 
-typedef u32 netdev_features_t;
+typedef u64 netdev_features_t;
 
 enum {
 	NETIF_F_SG_BIT,			/* Scatter/gather IO. */
diff --git a/net/core/dev.c b/net/core/dev.c
index a5a0e76..7e58353 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5271,18 +5271,18 @@ int __netdev_update_features(struct net_device *dev)
 	if (dev->features == features)
 		return 0;
 
-	BUILD_BUG_ON(sizeof(features) != sizeof(u32));	/* XXX: need: %Fx */
+	BUILD_BUG_ON(sizeof(features) != sizeof(u64));	/* XXX: need: %Fx */
 
-	netdev_dbg(dev, "Features changed: 0x%08x -> 0x%08x\n",
-		(u32)dev->features, (u32)features);
+	netdev_dbg(dev, "Features changed: 0x%016llx -> 0x%016llx\n",
+		(u64)dev->features, (u64)features);
 
 	if (dev->netdev_ops->ndo_set_features)
 		err = dev->netdev_ops->ndo_set_features(dev, features);
 
 	if (unlikely(err < 0)) {
 		netdev_err(dev,
-			"set_features() failed (%d); wanted 0x%08x, left 0x%08x\n",
-			err, (u32)features, (u32)dev->features);
+			"set_features() failed (%d); wanted 0x%016llx, left 0x%016llx\n",
+			err, (u64)features, (u64)dev->features);
 		return -1;
 	}
 
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index af35d90..b7feeab 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -27,6 +27,7 @@
 #ifdef CONFIG_SYSFS
 static const char fmt_hex[] = "%#x\n";
 static const char fmt_long_hex[] = "%#lx\n";
+static const char fmt_long_long_hex[] = "%#llx\n";
 static const char fmt_dec[] = "%d\n";
 static const char fmt_udec[] = "%u\n";
 static const char fmt_ulong[] = "%lu\n";
@@ -100,7 +101,7 @@ NETDEVICE_SHOW(addr_assign_type, fmt_dec);
 NETDEVICE_SHOW(addr_len, fmt_dec);
 NETDEVICE_SHOW(iflink, fmt_dec);
 NETDEVICE_SHOW(ifindex, fmt_dec);
-NETDEVICE_SHOW(features, fmt_hex);	/* XXX: need %Fx */
+NETDEVICE_SHOW(features, fmt_long_long_hex);	/* XXX: need %Fx */
 NETDEVICE_SHOW(type, fmt_dec);
 NETDEVICE_SHOW(link_mode, fmt_dec);
 
-- 
1.7.2.5

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