summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2012-02-11 15:39:45 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-02-24 01:42:07 -0800
commit5e0c03c8cd40e5c3b7ba624b8ba9a343de79ade1 (patch)
tree01d52570bbe5c9392d7e0c47efff0c4947cf92a2
parent943146de22d3658de26d94512beae7223282ed1c (diff)
downloadop-kernel-dev-5e0c03c8cd40e5c3b7ba624b8ba9a343de79ade1.zip
op-kernel-dev-5e0c03c8cd40e5c3b7ba624b8ba9a343de79ade1.tar.gz
net: Support RX-ALL feature flag.
This flag requests that network devices pass all received frames up the stack, even ones with errors such as invalid FCS (frame check sum). This will allow sniffers to see bad packets and perhaps give the user some idea how to fix the problem. Signed-off-by: Ben Greear <greearb@candelatech.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--Documentation/networking/netdev-features.txt7
-rw-r--r--include/linux/netdev_features.h2
-rw-r--r--net/core/ethtool.c1
3 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/networking/netdev-features.txt b/Documentation/networking/netdev-features.txt
index 7d27812..4164f5c 100644
--- a/Documentation/networking/netdev-features.txt
+++ b/Documentation/networking/netdev-features.txt
@@ -158,3 +158,10 @@ VLANs. This may be not useful, though.]
This requests that the NIC append the Ethernet Frame Checksum (FCS)
to the end of the skb data. This allows sniffers and other tools to
read the CRC recorded by the NIC on receipt of the packet.
+
+* rx-all
+
+This requests that the NIC receive all possible frames, including errored
+frames (such as bad FCS, etc). This can be helpful when sniffing a link with
+bad packets on it. Some NICs may receive more packets if also put into normal
+PROMISC mdoe.
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index d133186..5ac3212 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -55,6 +55,7 @@ enum {
NETIF_F_NOCACHE_COPY_BIT, /* Use no-cache copyfromuser */
NETIF_F_LOOPBACK_BIT, /* Enable loopback */
NETIF_F_RXFCS_BIT, /* Append FCS to skb pkt data */
+ NETIF_F_RXALL_BIT, /* Receive errored frames too */
/*
* Add your fresh new feature above and remember to update
@@ -100,6 +101,7 @@ enum {
#define NETIF_F_UFO __NETIF_F(UFO)
#define NETIF_F_VLAN_CHALLENGED __NETIF_F(VLAN_CHALLENGED)
#define NETIF_F_RXFCS __NETIF_F(RXFCS)
+#define NETIF_F_RXALL __NETIF_F(RXALL)
/* Features valid for ethtool to change */
/* = all defined minus driver/device-class-related */
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 0801619..6d6d7d2 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -74,6 +74,7 @@ static const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN]
[NETIF_F_NOCACHE_COPY_BIT] = "tx-nocache-copy",
[NETIF_F_LOOPBACK_BIT] = "loopback",
[NETIF_F_RXFCS_BIT] = "rx-fcs",
+ [NETIF_F_RXALL_BIT] = "rx-all",
};
static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
OpenPOWER on IntegriCloud