All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5]  Ethernet low-level frame debugging support.
@ 2011-06-18 20:47 greearb
  2011-06-18 20:47 ` [PATCH v2 1/5] net: Support ethtool ops for rx of errored frames greearb
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: greearb @ 2011-06-18 20:47 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

This builds on the previous patches to allow receiving the
Ethernet FCS.

These patches let one receive errored frames up the stack
and generate frames with customized FCS.  This allows one
to generate and receive frames with bad CRC for testing
and sniffing purposes.

I'll finish send/rcv support for e100,e1000, and e1000e
if these patches are acceptable.

v2:  Change 'kludge' to fcs_len in af_packet.c
     Add SO_NOFCS to the rest of the various arch socket.h files.

*** BLURB HERE ***

Ben Greear (5):
  net:  Support ethtool ops for rx of errored frames.
  net:  Add pkt-type PACKET_INVALID
  e100:  Support receiving errored frames.
  net:  Support sending frame with specified FCS.
  e1000e:  Support sending frame with custom FCS.

 arch/alpha/include/asm/socket.h   |    1 +
 arch/arm/include/asm/socket.h     |    1 +
 arch/avr32/include/asm/socket.h   |    1 +
 arch/cris/include/asm/socket.h    |    1 +
 arch/frv/include/asm/socket.h     |    1 +
 arch/h8300/include/asm/socket.h   |    1 +
 arch/ia64/include/asm/socket.h    |    1 +
 arch/m32r/include/asm/socket.h    |    1 +
 arch/m68k/include/asm/socket.h    |    1 +
 arch/mips/include/asm/socket.h    |    1 +
 arch/mn10300/include/asm/socket.h |    1 +
 arch/parisc/include/asm/socket.h  |    1 +
 arch/powerpc/include/asm/socket.h |    1 +
 arch/s390/include/asm/socket.h    |    1 +
 arch/sparc/include/asm/socket.h   |    1 +
 arch/xtensa/include/asm/socket.h  |    1 +
 drivers/net/e100.c                |   42 +++++++++++++++++++++++++++++++++++-
 drivers/net/e1000e/netdev.c       |   11 +++++++++
 include/asm-generic/socket.h      |    7 ++++++
 include/linux/ethtool.h           |    7 ++++++
 include/linux/if_packet.h         |    7 ++++-
 include/linux/skbuff.h            |    5 +++-
 include/net/sock.h                |    6 +++++
 net/core/ethtool.c                |    8 +++++++
 net/core/skbuff.c                 |    1 +
 net/core/sock.c                   |    7 ++++++
 net/packet/af_packet.c            |   18 ++++++++++++++-
 27 files changed, 128 insertions(+), 7 deletions(-)

-- 
1.7.3.4


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2 1/5] net:  Support ethtool ops for rx of errored frames.
  2011-06-18 20:47 [PATCH v2 0/5] Ethernet low-level frame debugging support greearb
@ 2011-06-18 20:47 ` greearb
  2011-06-18 21:34   ` Francois Romieu
  2011-06-18 20:47 ` [PATCH v2 2/5] net: Add pkt-type PACKET_INVALID greearb
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: greearb @ 2011-06-18 20:47 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

This can be useful when sniffing dodgy networks.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 675ddc0... fb0fac9... M	include/linux/ethtool.h
:100644 100644 0e01860... 443a63c... M	net/core/ethtool.c
 include/linux/ethtool.h |    7 +++++++
 net/core/ethtool.c      |    8 ++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 675ddc0..fb0fac9 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -880,6 +880,9 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
  * @set_save_rxfcs:  Set flag to save (1), or discard (0), the Ethernet
  *	Frame Checksum for received packets.
  * @get_save_rxfcs:  Get current value for Save RX-FCS flag.
+ * @set_save_rxerr:  Set flag to save (1), or discard (0), received Ethernet
+ *	frames with errors (bad checksum, etc)
+ * @get_save_rxerr:  Get current value for Save RX-ERR flag.
  *
  * All operations are optional (i.e. the function pointer may be set
  * to %NULL) and callers must take this into account.  Callers must
@@ -960,6 +963,8 @@ struct ethtool_ops {
 	int	(*set_dump)(struct net_device *, struct ethtool_dump *);
 	int	(*set_save_rxfcs)(struct net_device *, u32);
 	u32	(*get_save_rxfcs)(struct net_device *);
+	int	(*set_save_rxerr)(struct net_device *, u32);
+	u32	(*get_save_rxerr)(struct net_device *);
 
 };
 #endif /* __KERNEL__ */
@@ -1036,6 +1041,8 @@ struct ethtool_ops {
 #define ETHTOOL_GET_DUMP_DATA	0x00000040 /* Get dump data */
 #define ETHTOOL_GET_SAVE_RXFCS	0x00000041 /* Get RX Save Frame Checksum */
 #define ETHTOOL_SET_SAVE_RXFCS	0x00000042 /* Set RX Save Frame Checksum */
+#define ETHTOOL_GET_SAVE_RXERR	0x00000043 /* Get RX Save Errored Frames */
+#define ETHTOOL_SET_SAVE_RXERR	0x00000044 /* Set RX Save Errored Frames */
 
 
 /* compatibility with older code */
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 0e01860..443a63c 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -2160,6 +2160,14 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
 		rc =  ethtool_get_value(dev, useraddr, ethcmd,
 					dev->ethtool_ops->get_save_rxfcs);
 		break;
+	case ETHTOOL_SET_SAVE_RXERR:
+		rc = ethtool_set_value(dev, useraddr,
+				       dev->ethtool_ops->set_save_rxerr);
+		break;
+	case ETHTOOL_GET_SAVE_RXERR:
+		rc =  ethtool_get_value(dev, useraddr, ethcmd,
+					dev->ethtool_ops->get_save_rxerr);
+		break;
 	default:
 		rc = -EOPNOTSUPP;
 	}
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 2/5] net:  Add pkt-type PACKET_INVALID
  2011-06-18 20:47 [PATCH v2 0/5] Ethernet low-level frame debugging support greearb
  2011-06-18 20:47 ` [PATCH v2 1/5] net: Support ethtool ops for rx of errored frames greearb
@ 2011-06-18 20:47 ` greearb
  2011-06-18 20:47 ` [PATCH v2 3/5] e100: Support receiving errored frames greearb
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: greearb @ 2011-06-18 20:47 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

This will be used for errored frames received from NICs.
It re-uses the un-used PACKET_FASTROUTE value, but leaves that
define in just in case some user-space app requires it.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 7b31863... 86f06e4... M	include/linux/if_packet.h
 include/linux/if_packet.h |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index 7b31863..86f06e4 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -26,9 +26,12 @@ struct sockaddr_ll {
 #define PACKET_MULTICAST	2		/* To group		*/
 #define PACKET_OTHERHOST	3		/* To someone else 	*/
 #define PACKET_OUTGOING		4		/* Outgoing of any type */
-/* These ones are invisible by user level */
+/* This one is invisible by user level */
 #define PACKET_LOOPBACK		5		/* MC/BRD frame looped back */
-#define PACKET_FASTROUTE	6		/* Fastrouted frame	*/
+#define PACKET_FASTROUTE	6		/* Fastrouted frame, not used */
+#define PACKET_INVALID		6		/* Packet has errors, perhaps
+						 * received with bad FCS
+						 */
 
 /* Packet socket options */
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 3/5] e100:  Support receiving errored frames.
  2011-06-18 20:47 [PATCH v2 0/5] Ethernet low-level frame debugging support greearb
  2011-06-18 20:47 ` [PATCH v2 1/5] net: Support ethtool ops for rx of errored frames greearb
  2011-06-18 20:47 ` [PATCH v2 2/5] net: Add pkt-type PACKET_INVALID greearb
@ 2011-06-18 20:47 ` greearb
  2011-06-20 17:57   ` Ben Hutchings
  2011-06-18 20:47 ` [PATCH v2 4/5] net: Support sending frame with specified FCS greearb
  2011-06-18 20:47 ` [PATCH v2 5/5] e1000e: Support sending frame with custom FCS greearb
  4 siblings, 1 reply; 13+ messages in thread
From: greearb @ 2011-06-18 20:47 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

This can be helpful when sniffing dodgy networks.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 647d8c6... aad303d... M	drivers/net/e100.c
 drivers/net/e100.c |   42 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 647d8c6..aad303d 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -588,6 +588,7 @@ struct nic {
 		wol_magic          = (1 << 3),
 		ich_10h_workaround = (1 << 4),
 		save_rxfcs         = (1 << 5),
+		save_rxerr         = (1 << 6),
 	} flags					____cacheline_aligned;
 
 	enum mac mac;
@@ -1126,9 +1127,13 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
 		config->full_duplex_force = 0x1;	/* 1=force, 0=auto */
 
 	if (nic->flags & promiscuous || nic->loopback) {
+		config->promiscuous_mode = 0x1;		/* 1=on, 0=off */
+	}
+
+	if (nic->flags & save_rxerr) {
+		config->rx_discard_overruns = 0x1;	/* 1=save, 0=discard */
 		config->rx_save_bad_frames = 0x1;	/* 1=save, 0=discard */
 		config->rx_discard_short_frames = 0x0;	/* 1=discard, 0=save */
-		config->promiscuous_mode = 0x1;		/* 1=on, 0=off */
 	}
 
 	if (nic->flags & save_rxfcs)
@@ -1983,7 +1988,18 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 	skb_put(skb, actual_size);
 	skb->protocol = eth_type_trans(skb, nic->netdev);
 
-	if (unlikely(!(rfd_status & cb_ok))) {
+	if (unlikely(nic->flags & save_rxerr)) {
+		if (!(rfd_status & cb_ok)) {
+			skb->pkt_type = PACKET_INVALID;
+		} else if (actual_size >
+			   ETH_DATA_LEN + VLAN_ETH_HLEN + rxfcs_pad) {
+			nic->rx_over_length_errors++;
+			skb->pkt_type = PACKET_INVALID;
+		}
+		goto process_skb;
+	}
+
+	if (unlikely((nic->flags & save_rxerr) && !(rfd_status & cb_ok))) {
 		/* Don't indicate if hardware indicates errors */
 		dev_kfree_skb_any(skb);
 	} else if (actual_size > ETH_DATA_LEN + VLAN_ETH_HLEN + rxfcs_pad) {
@@ -1991,6 +2007,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 		nic->rx_over_length_errors++;
 		dev_kfree_skb_any(skb);
 	} else {
+process_skb:
 		dev->stats.rx_packets++;
 		dev->stats.rx_bytes += actual_size;
 		netif_receive_skb(skb);
@@ -2397,6 +2414,25 @@ static u32 e100_get_save_rxfcs(struct net_device *netdev)
 	return !!(nic->flags & save_rxfcs);
 }
 
+static int e100_set_save_rxerr(struct net_device *netdev, u32 data)
+{
+	struct nic *nic = netdev_priv(netdev);
+	if (data)
+		nic->flags |= save_rxerr;
+	else
+		nic->flags &= ~save_rxerr;
+
+	e100_exec_cb(nic, NULL, e100_configure);
+
+	return 0;
+}
+
+static u32 e100_get_save_rxerr(struct net_device *netdev)
+{
+	struct nic *nic = netdev_priv(netdev);
+	return !!(nic->flags & save_rxerr);
+}
+
 static void e100_get_drvinfo(struct net_device *netdev,
 	struct ethtool_drvinfo *info)
 {
@@ -2718,6 +2754,8 @@ static const struct ethtool_ops e100_ethtool_ops = {
 	.get_sset_count		= e100_get_sset_count,
 	.set_save_rxfcs		= e100_set_save_rxfcs,
 	.get_save_rxfcs		= e100_get_save_rxfcs,
+	.set_save_rxerr		= e100_set_save_rxerr,
+	.get_save_rxerr		= e100_get_save_rxerr,
 };
 
 static int e100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 4/5] net:  Support sending frame with specified FCS.
  2011-06-18 20:47 [PATCH v2 0/5] Ethernet low-level frame debugging support greearb
                   ` (2 preceding siblings ...)
  2011-06-18 20:47 ` [PATCH v2 3/5] e100: Support receiving errored frames greearb
@ 2011-06-18 20:47 ` greearb
  2011-06-18 20:47 ` [PATCH v2 5/5] e1000e: Support sending frame with custom FCS greearb
  4 siblings, 0 replies; 13+ messages in thread
From: greearb @ 2011-06-18 20:47 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

This allows user-space to send a packet with the
ethernet FCS appended to the end.  Supporting NICs
will know to disable their own FCS calculations and
send frame as is.

This is useful for injecting bad frames on a network
for testing.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 06edfef... 655fbe7... M	arch/alpha/include/asm/socket.h
:100644 100644 90ffd04... 4aa1c92... M	arch/arm/include/asm/socket.h
:100644 100644 c8d1fae... b70cfa3... M	arch/avr32/include/asm/socket.h
:100644 100644 1a4a619... 54d2d2b... M	arch/cris/include/asm/socket.h
:100644 100644 a6b2688... c77015c... M	arch/frv/include/asm/socket.h
:100644 100644 04c0f45... 5c8a75d... M	arch/h8300/include/asm/socket.h
:100644 100644 51427ea... f0062e6... M	arch/ia64/include/asm/socket.h
:100644 100644 469787c3.. a259a66... M	arch/m32r/include/asm/socket.h
:100644 100644 9bf49c8... 2442b97... M	arch/m68k/include/asm/socket.h
:100644 100644 9de5190... 9b1fe294.. M	arch/mips/include/asm/socket.h
:100644 100644 4e60c42... 1eb5bf5... M	arch/mn10300/include/asm/socket.h
:100644 100644 225b7d6... 22538f0... M	arch/parisc/include/asm/socket.h
:100644 100644 866f760... d1ecf79... M	arch/powerpc/include/asm/socket.h
:100644 100644 fdff1e9... c4ab6ea... M	arch/s390/include/asm/socket.h
:100644 100644 9d3fefc... af8b622... M	arch/sparc/include/asm/socket.h
:100644 100644 cbdf2ff... 4c0cf9c... M	arch/xtensa/include/asm/socket.h
:100644 100644 9a6115e... 22193a2... M	include/asm-generic/socket.h
:100644 100644 c0a4f3a... 05b15be... M	include/linux/skbuff.h
:100644 100644 f2046e4... d7e0d88... M	include/net/sock.h
:100644 100644 46cbd28... a552560... M	net/core/skbuff.c
:100644 100644 6e81978... 0c5f827... M	net/core/sock.c
:100644 100644 c0c3cda... 7b39092... M	net/packet/af_packet.c
 arch/alpha/include/asm/socket.h   |    1 +
 arch/arm/include/asm/socket.h     |    1 +
 arch/avr32/include/asm/socket.h   |    1 +
 arch/cris/include/asm/socket.h    |    1 +
 arch/frv/include/asm/socket.h     |    1 +
 arch/h8300/include/asm/socket.h   |    1 +
 arch/ia64/include/asm/socket.h    |    1 +
 arch/m32r/include/asm/socket.h    |    1 +
 arch/m68k/include/asm/socket.h    |    1 +
 arch/mips/include/asm/socket.h    |    1 +
 arch/mn10300/include/asm/socket.h |    1 +
 arch/parisc/include/asm/socket.h  |    1 +
 arch/powerpc/include/asm/socket.h |    1 +
 arch/s390/include/asm/socket.h    |    1 +
 arch/sparc/include/asm/socket.h   |    1 +
 arch/xtensa/include/asm/socket.h  |    1 +
 include/asm-generic/socket.h      |    7 +++++++
 include/linux/skbuff.h            |    5 ++++-
 include/net/sock.h                |    6 ++++++
 net/core/skbuff.c                 |    1 +
 net/core/sock.c                   |    7 +++++++
 net/packet/af_packet.c            |   18 ++++++++++++++++--
 22 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h
index 06edfef..655fbe7 100644
--- a/arch/alpha/include/asm/socket.h
+++ b/arch/alpha/include/asm/socket.h
@@ -68,6 +68,7 @@
 #define SCM_TIMESTAMPING	SO_TIMESTAMPING
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 /* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
  * have to define SOCK_NONBLOCK to a different value here.
diff --git a/arch/arm/include/asm/socket.h b/arch/arm/include/asm/socket.h
index 90ffd04..4aa1c92 100644
--- a/arch/arm/include/asm/socket.h
+++ b/arch/arm/include/asm/socket.h
@@ -61,5 +61,6 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/avr32/include/asm/socket.h b/arch/avr32/include/asm/socket.h
index c8d1fae..b70cfa3 100644
--- a/arch/avr32/include/asm/socket.h
+++ b/arch/avr32/include/asm/socket.h
@@ -61,5 +61,6 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/cris/include/asm/socket.h b/arch/cris/include/asm/socket.h
index 1a4a619..54d2d2b 100644
--- a/arch/cris/include/asm/socket.h
+++ b/arch/cris/include/asm/socket.h
@@ -63,6 +63,7 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif /* _ASM_SOCKET_H */
 
diff --git a/arch/frv/include/asm/socket.h b/arch/frv/include/asm/socket.h
index a6b2688..c77015c 100644
--- a/arch/frv/include/asm/socket.h
+++ b/arch/frv/include/asm/socket.h
@@ -61,6 +61,7 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif /* _ASM_SOCKET_H */
 
diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/asm/socket.h
index 04c0f45..5c8a75d 100644
--- a/arch/h8300/include/asm/socket.h
+++ b/arch/h8300/include/asm/socket.h
@@ -61,5 +61,6 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h
index 51427ea..f0062e6 100644
--- a/arch/ia64/include/asm/socket.h
+++ b/arch/ia64/include/asm/socket.h
@@ -70,5 +70,6 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/m32r/include/asm/socket.h b/arch/m32r/include/asm/socket.h
index 469787c3..a259a66 100644
--- a/arch/m32r/include/asm/socket.h
+++ b/arch/m32r/include/asm/socket.h
@@ -61,5 +61,6 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/asm/socket.h
index 9bf49c8..2442b97 100644
--- a/arch/m68k/include/asm/socket.h
+++ b/arch/m68k/include/asm/socket.h
@@ -61,5 +61,6 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/mips/include/asm/socket.h b/arch/mips/include/asm/socket.h
index 9de5190..9b1fe294 100644
--- a/arch/mips/include/asm/socket.h
+++ b/arch/mips/include/asm/socket.h
@@ -81,6 +81,7 @@ To add: #define SO_REUSEPORT 0x0200	/* Allow local address and port reuse.  */
 #define SCM_TIMESTAMPING	SO_TIMESTAMPING
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #ifdef __KERNEL__
 
diff --git a/arch/mn10300/include/asm/socket.h b/arch/mn10300/include/asm/socket.h
index 4e60c42..1eb5bf5 100644
--- a/arch/mn10300/include/asm/socket.h
+++ b/arch/mn10300/include/asm/socket.h
@@ -61,5 +61,6 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h
index 225b7d6..22538f0 100644
--- a/arch/parisc/include/asm/socket.h
+++ b/arch/parisc/include/asm/socket.h
@@ -60,6 +60,7 @@
 #define SCM_TIMESTAMPING	SO_TIMESTAMPING
 
 #define SO_RXQ_OVFL             0x4021
+#define SO_NOFCS		0x4022
 
 /* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
  * have to define SOCK_NONBLOCK to a different value here.
diff --git a/arch/powerpc/include/asm/socket.h b/arch/powerpc/include/asm/socket.h
index 866f760..d1ecf79 100644
--- a/arch/powerpc/include/asm/socket.h
+++ b/arch/powerpc/include/asm/socket.h
@@ -68,5 +68,6 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif	/* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/s390/include/asm/socket.h b/arch/s390/include/asm/socket.h
index fdff1e9..c4ab6ea 100644
--- a/arch/s390/include/asm/socket.h
+++ b/arch/s390/include/asm/socket.h
@@ -69,5 +69,6 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/sparc/include/asm/socket.h b/arch/sparc/include/asm/socket.h
index 9d3fefc..af8b622 100644
--- a/arch/sparc/include/asm/socket.h
+++ b/arch/sparc/include/asm/socket.h
@@ -57,6 +57,7 @@
 #define SCM_TIMESTAMPING	SO_TIMESTAMPING
 
 #define SO_RXQ_OVFL             0x0024
+#define SO_NOFCS		0x0025
 
 /* Security levels - as per NRL IPv6 - don't actually do anything */
 #define SO_SECURITY_AUTHENTICATION		0x5001
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h
index cbdf2ff..4c0cf9c 100644
--- a/arch/xtensa/include/asm/socket.h
+++ b/arch/xtensa/include/asm/socket.h
@@ -72,5 +72,6 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+#define SO_NOFCS		41
 
 #endif	/* _XTENSA_SOCKET_H */
diff --git a/include/asm-generic/socket.h b/include/asm-generic/socket.h
index 9a6115e..22193a2 100644
--- a/include/asm-generic/socket.h
+++ b/include/asm-generic/socket.h
@@ -64,4 +64,11 @@
 #define SO_DOMAIN		39
 
 #define SO_RXQ_OVFL             40
+
+/* Instruct lower device to not calculate the frame
+ * checksum.  Useful for generating Ethernet frames
+ * with custom checksums.
+ */
+#define SO_NOFCS		41
+
 #endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c0a4f3a..05b15be 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -307,6 +307,8 @@ typedef unsigned char *sk_buff_data_t;
  *	@peeked: this packet has been seen already, so stats have been
  *		done for it, don't do them again
  *	@nf_trace: netfilter packet trace flag
+ *	@use_specified_ether_crc: skb is Ethernet frame with FCS already
+ *		appended.  Use that FCS.  Requires special support in NIC.
  *	@nfctinfo: Relationship of this skb to the connection
  *	@nfct_reasm: netfilter conntrack re-assembly pointer
  *	@nf_bridge: Saved data about a bridged frame - see br_netfilter.c
@@ -396,7 +398,8 @@ struct sk_buff {
 #ifdef CONFIG_IPV6_NDISC_NODETYPE
 	__u8			ndisc_nodetype:2;
 #endif
-	__u8			ooo_okay:1;
+	__u8			ooo_okay:1,
+				use_specified_ether_crc:1;
 	kmemcheck_bitfield_end(flags2);
 
 	/* 0/13 bit hole */
diff --git a/include/net/sock.h b/include/net/sock.h
index f2046e4..d7e0d88 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -563,6 +563,12 @@ enum sock_flags {
 	SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */
 	SOCK_FASYNC, /* fasync() active */
 	SOCK_RXQ_OVFL,
+	SOCK_DONT_DO_LL_FCS, /* Tell NIC not to do the Ethernet FCS.
+			      * Will use last 4 bytes of packet sent from
+			      * user-space instead.  Requires special
+			      * support in NIC.
+			      */
+
 };
 
 static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 46cbd28..a552560 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -541,6 +541,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
 	new->tc_verd		= old->tc_verd;
 #endif
 #endif
+	new->use_specified_ether_crc = old->use_specified_ether_crc;
 	new->vlan_tci		= old->vlan_tci;
 
 	skb_copy_secmark(new, old);
diff --git a/net/core/sock.c b/net/core/sock.c
index 6e81978..0c5f827 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -641,6 +641,13 @@ set_rcvbuf:
 		sock_warn_obsolete_bsdism("setsockopt");
 		break;
 
+	case SO_NOFCS:
+		if (valbool)
+			sk->sk_flags |= SOCK_DONT_DO_LL_FCS;
+		else
+			sk->sk_flags &= ~(SOCK_DONT_DO_LL_FCS);
+		break;
+
 	case SO_PASSCRED:
 		if (valbool)
 			set_bit(SOCK_PASSCRED, &sock->flags);
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index c0c3cda..7b39092 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -430,6 +430,10 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
 	struct net_device *dev;
 	__be16 proto = 0;
 	int err;
+	int fcs_len = 0;
+
+	if (unlikely(sk->sk_flags & SOCK_DONT_DO_LL_FCS))
+		fcs_len = 4; /* We're doing our own FCS */
 
 	/*
 	 *	Get and verify the address.
@@ -465,7 +469,7 @@ retry:
 	 */
 
 	err = -EMSGSIZE;
-	if (len > dev->mtu + dev->hard_header_len + VLAN_HLEN)
+	if (len > dev->mtu + dev->hard_header_len + VLAN_HLEN + fcs_len)
 		goto out_unlock;
 
 	if (!skb) {
@@ -518,6 +522,9 @@ retry:
 	if (err < 0)
 		goto out_unlock;
 
+	if (unlikely(sk->sk_flags & SOCK_DONT_DO_LL_FCS))
+		skb->use_specified_ether_crc = 1;
+
 	dev_queue_xmit(skb);
 	rcu_read_unlock();
 	return len;
@@ -1134,6 +1141,10 @@ static int packet_snd(struct socket *sock,
 	int vnet_hdr_len;
 	struct packet_sock *po = pkt_sk(sk);
 	unsigned short gso_type = 0;
+	int fcs_len = 0;
+
+	if (unlikely(sk->sk_flags & SOCK_DONT_DO_LL_FCS))
+		fcs_len = 4; /* We're doing our own Ethernet FCS */
 
 	/*
 	 *	Get and verify the address.
@@ -1215,7 +1226,7 @@ static int packet_snd(struct socket *sock,
 	}
 
 	err = -EMSGSIZE;
-	if (!gso_type && (len > dev->mtu + reserve + VLAN_HLEN))
+	if (!gso_type && (len > dev->mtu + reserve + VLAN_HLEN + fcs_len))
 		goto out_unlock;
 
 	err = -ENOBUFS;
@@ -1278,6 +1289,9 @@ static int packet_snd(struct socket *sock,
 		len += vnet_hdr_len;
 	}
 
+	if (unlikely(sk->sk_flags & SOCK_DONT_DO_LL_FCS))
+		skb->use_specified_ether_crc = 1;
+
 	/*
 	 *	Now send it
 	 */
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 5/5] e1000e:  Support sending frame with custom FCS.
  2011-06-18 20:47 [PATCH v2 0/5] Ethernet low-level frame debugging support greearb
                   ` (3 preceding siblings ...)
  2011-06-18 20:47 ` [PATCH v2 4/5] net: Support sending frame with specified FCS greearb
@ 2011-06-18 20:47 ` greearb
  4 siblings, 0 replies; 13+ messages in thread
From: greearb @ 2011-06-18 20:47 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

This is good for testing by injecting frames with invalid
FCS onto a network.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 3310c3d... 011a95f... M	drivers/net/e1000e/netdev.c
 drivers/net/e1000e/netdev.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 3310c3d..011a95f 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -4417,6 +4417,7 @@ link_up:
 #define E1000_TX_FLAGS_VLAN		0x00000002
 #define E1000_TX_FLAGS_TSO		0x00000004
 #define E1000_TX_FLAGS_IPV4		0x00000008
+#define E1000_TX_FLAGS_NO_FCS		0x00000010
 #define E1000_TX_FLAGS_VLAN_MASK	0xffff0000
 #define E1000_TX_FLAGS_VLAN_SHIFT	16
 
@@ -4681,6 +4682,9 @@ static void e1000_tx_queue(struct e1000_adapter *adapter,
 		txd_upper |= (tx_flags & E1000_TX_FLAGS_VLAN_MASK);
 	}
 
+	if (unlikely(tx_flags & E1000_TX_FLAGS_NO_FCS))
+		txd_lower &= ~(E1000_TXD_CMD_IFCS);
+
 	i = tx_ring->next_to_use;
 
 	do {
@@ -4698,6 +4702,10 @@ static void e1000_tx_queue(struct e1000_adapter *adapter,
 
 	tx_desc->lower.data |= cpu_to_le32(adapter->txd_cmd);
 
+	/* txd_cmd re-enables FCS, so we'll re-disable it here as desired. */
+	if (unlikely(tx_flags & E1000_TX_FLAGS_NO_FCS))
+		tx_desc->lower.data &= ~(cpu_to_le32(E1000_TXD_CMD_IFCS));
+
 	/*
 	 * Force memory writes to complete before letting h/w
 	 * know there are new descriptors to fetch.  (Only
@@ -4900,6 +4908,9 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 	if (skb->protocol == htons(ETH_P_IP))
 		tx_flags |= E1000_TX_FLAGS_IPV4;
 
+	if (unlikely(skb->use_specified_ether_crc))
+		tx_flags |= E1000_TX_FLAGS_NO_FCS;
+
 	/* if count is 0 then mapping error has occurred */
 	count = e1000_tx_map(adapter, skb, first, max_per_txd, nr_frags, mss);
 	if (count) {
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/5] net:  Support ethtool ops for rx of errored frames.
  2011-06-18 20:47 ` [PATCH v2 1/5] net: Support ethtool ops for rx of errored frames greearb
@ 2011-06-18 21:34   ` Francois Romieu
  2011-06-19 20:11     ` Ben Greear
  0 siblings, 1 reply; 13+ messages in thread
From: Francois Romieu @ 2011-06-18 21:34 UTC (permalink / raw)
  To: greearb; +Cc: netdev

greearb@candelatech.com <greearb@candelatech.com> :
[...]
> This can be useful when sniffing dodgy networks.

Do you plan to add something similar - i.e. not per packet - for the Tx path ?

-- 
Ueimor

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/5] net:  Support ethtool ops for rx of errored frames.
  2011-06-18 21:34   ` Francois Romieu
@ 2011-06-19 20:11     ` Ben Greear
  2011-06-19 22:48       ` Francois Romieu
  0 siblings, 1 reply; 13+ messages in thread
From: Ben Greear @ 2011-06-19 20:11 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev

On 06/18/2011 02:34 PM, Francois Romieu wrote:
> greearb@candelatech.com<greearb@candelatech.com>  :
> [...]
>> This can be useful when sniffing dodgy networks.
>
> Do you plan to add something similar - i.e. not per packet - for the Tx path ?

Ability to tx errored frames?  I posted a patch to enable sending
frames with custom (ie, invalid) Ethernet FCS, but you have to
enable it per-socket, and it will only work with AF_PACKET sockets.

Can you offer more details on what you are asking for?

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/5] net:  Support ethtool ops for rx of errored frames.
  2011-06-19 20:11     ` Ben Greear
@ 2011-06-19 22:48       ` Francois Romieu
  2011-06-19 23:15         ` Ben Greear
  0 siblings, 1 reply; 13+ messages in thread
From: Francois Romieu @ 2011-06-19 22:48 UTC (permalink / raw)
  To: Ben Greear; +Cc: netdev

Ben Greear <greearb@candelatech.com> :
> On 06/18/2011 02:34 PM, Francois Romieu wrote:
> >greearb@candelatech.com<greearb@candelatech.com>  :
> >[...]
> >>This can be useful when sniffing dodgy networks.
> >
> >Do you plan to add something similar - i.e. not per packet - for the Tx path ?
> 
> Ability to tx errored frames?  I posted a patch to enable sending
> frames with custom (ie, invalid) Ethernet FCS, but you have to
> enable it per-socket, and it will only work with AF_PACKET sockets.
> 
> Can you offer more details on what you are asking for?

Realtek's 816[89] and 810[23] have no room in their Tx descriptors to
control ethernet checksum generation. There is a global register (TxConfig)
though. Before looking at the per-socket information, the driver would need
to be instructed to disable Tx hardware ethernet checksumming globally.

-- 
Ueimor

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/5] net:  Support ethtool ops for rx of errored frames.
  2011-06-19 22:48       ` Francois Romieu
@ 2011-06-19 23:15         ` Ben Greear
  2011-06-19 23:24           ` David Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Ben Greear @ 2011-06-19 23:15 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev

On 06/19/2011 03:48 PM, Francois Romieu wrote:
> Ben Greear<greearb@candelatech.com>  :
>> On 06/18/2011 02:34 PM, Francois Romieu wrote:
>>> greearb@candelatech.com<greearb@candelatech.com>   :
>>> [...]
>>>> This can be useful when sniffing dodgy networks.
>>>
>>> Do you plan to add something similar - i.e. not per packet - for the Tx path ?
>>
>> Ability to tx errored frames?  I posted a patch to enable sending
>> frames with custom (ie, invalid) Ethernet FCS, but you have to
>> enable it per-socket, and it will only work with AF_PACKET sockets.
>>
>> Can you offer more details on what you are asking for?
>
> Realtek's 816[89] and 810[23] have no room in their Tx descriptors to
> control ethernet checksum generation. There is a global register (TxConfig)
> though. Before looking at the per-socket information, the driver would need
> to be instructed to disable Tx hardware ethernet checksumming globally.

Ok.  I think I'll take a stab at adding a more general low-level-flags
API to ethtool, with a bitfield that can be used to twiddle these sorts
of things.  That way, we won't have to add new methods every time we
poke a new feature in.

This would be separate from the 'features' patches that are floating around.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/5] net: Support ethtool ops for rx of errored frames.
  2011-06-19 23:15         ` Ben Greear
@ 2011-06-19 23:24           ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2011-06-19 23:24 UTC (permalink / raw)
  To: greearb; +Cc: romieu, netdev

From: Ben Greear <greearb@candelatech.com>
Date: Sun, 19 Jun 2011 16:15:56 -0700

> This would be separate from the 'features' patches that are floating
> around.

netdev->features is how you should implement your patch, please don't
create new facilities.

With netdev->features they can be validated against netdev->hw_features
which, in this case, r8169 would have this feature bit clear.

That's how all of this stuff is designed to work, the driver says what
the hardware can do and thus ethtool generically can validate attempts
to turn on features.

No new facilities are necessary at all.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 3/5] e100:  Support receiving errored frames.
  2011-06-18 20:47 ` [PATCH v2 3/5] e100: Support receiving errored frames greearb
@ 2011-06-20 17:57   ` Ben Hutchings
  2011-06-20 18:06     ` Ben Greear
  0 siblings, 1 reply; 13+ messages in thread
From: Ben Hutchings @ 2011-06-20 17:57 UTC (permalink / raw)
  To: greearb; +Cc: netdev

On Sat, 2011-06-18 at 13:47 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> This can be helpful when sniffing dodgy networks.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 647d8c6... aad303d... M	drivers/net/e100.c
>  drivers/net/e100.c |   42 ++++++++++++++++++++++++++++++++++++++++--
>  1 files changed, 40 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/e100.c b/drivers/net/e100.c
> index 647d8c6..aad303d 100644
> --- a/drivers/net/e100.c
> +++ b/drivers/net/e100.c
> @@ -588,6 +588,7 @@ struct nic {
>  		wol_magic          = (1 << 3),
>  		ich_10h_workaround = (1 << 4),
>  		save_rxfcs         = (1 << 5),
> +		save_rxerr         = (1 << 6),
>  	} flags					____cacheline_aligned;
>  
>  	enum mac mac;
> @@ -1126,9 +1127,13 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
>  		config->full_duplex_force = 0x1;	/* 1=force, 0=auto */
>  
>  	if (nic->flags & promiscuous || nic->loopback) {
> +		config->promiscuous_mode = 0x1;		/* 1=on, 0=off */
> +	}
> +
> +	if (nic->flags & save_rxerr) {
> +		config->rx_discard_overruns = 0x1;	/* 1=save, 0=discard */
>  		config->rx_save_bad_frames = 0x1;	/* 1=save, 0=discard */
>  		config->rx_discard_short_frames = 0x0;	/* 1=discard, 0=save */

Any idea why these were previously set in promiscuous or loopback mode?

> -		config->promiscuous_mode = 0x1;		/* 1=on, 0=off */
>  	}
>  
>  	if (nic->flags & save_rxfcs)
> @@ -1983,7 +1988,18 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
>  	skb_put(skb, actual_size);
>  	skb->protocol = eth_type_trans(skb, nic->netdev);
>  
> -	if (unlikely(!(rfd_status & cb_ok))) {
> +	if (unlikely(nic->flags & save_rxerr)) {
> +		if (!(rfd_status & cb_ok)) {
> +			skb->pkt_type = PACKET_INVALID;
> +		} else if (actual_size >
> +			   ETH_DATA_LEN + VLAN_ETH_HLEN + rxfcs_pad) {
> +			nic->rx_over_length_errors++;
> +			skb->pkt_type = PACKET_INVALID;
> +		}
> +		goto process_skb;
> +	}
> +
> +	if (unlikely((nic->flags & save_rxerr) && !(rfd_status & cb_ok))) {
[...]

You're adding an if-statement to cover the save_rxerr case, and the
existing if-else-statement should cover the !save_rxerr case - so you
are missing a '!'.  But since the new if-statement's body ends with a
goto, there should be no need to change the condition for the existing
if-else statement at all.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 3/5] e100:  Support receiving errored frames.
  2011-06-20 17:57   ` Ben Hutchings
@ 2011-06-20 18:06     ` Ben Greear
  0 siblings, 0 replies; 13+ messages in thread
From: Ben Greear @ 2011-06-20 18:06 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev

On 06/20/2011 10:57 AM, Ben Hutchings wrote:
> On Sat, 2011-06-18 at 13:47 -0700, greearb@candelatech.com wrote:
>> From: Ben Greear<greearb@candelatech.com>
>>
>> This can be helpful when sniffing dodgy networks.
>>
>> Signed-off-by: Ben Greear<greearb@candelatech.com>
>> ---
>> :100644 100644 647d8c6... aad303d... M	drivers/net/e100.c
>>   drivers/net/e100.c |   42 ++++++++++++++++++++++++++++++++++++++++--
>>   1 files changed, 40 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/e100.c b/drivers/net/e100.c
>> index 647d8c6..aad303d 100644
>> --- a/drivers/net/e100.c
>> +++ b/drivers/net/e100.c
>> @@ -588,6 +588,7 @@ struct nic {
>>   		wol_magic          = (1<<  3),
>>   		ich_10h_workaround = (1<<  4),
>>   		save_rxfcs         = (1<<  5),
>> +		save_rxerr         = (1<<  6),
>>   	} flags					____cacheline_aligned;
>>
>>   	enum mac mac;
>> @@ -1126,9 +1127,13 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
>>   		config->full_duplex_force = 0x1;	/* 1=force, 0=auto */
>>
>>   	if (nic->flags&  promiscuous || nic->loopback) {
>> +		config->promiscuous_mode = 0x1;		/* 1=on, 0=off */
>> +	}
>> +
>> +	if (nic->flags&  save_rxerr) {
>> +		config->rx_discard_overruns = 0x1;	/* 1=save, 0=discard */
>>   		config->rx_save_bad_frames = 0x1;	/* 1=save, 0=discard */
>>   		config->rx_discard_short_frames = 0x0;	/* 1=discard, 0=save */
>
> Any idea why these were previously set in promiscuous or loopback mode?

No, but it appears they would have been thrown away anyway, so I
think this change is safe.

>> -		config->promiscuous_mode = 0x1;		/* 1=on, 0=off */
>>   	}
>>
>>   	if (nic->flags&  save_rxfcs)
>> @@ -1983,7 +1988,18 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
>>   	skb_put(skb, actual_size);
>>   	skb->protocol = eth_type_trans(skb, nic->netdev);
>>
>> -	if (unlikely(!(rfd_status&  cb_ok))) {
>> +	if (unlikely(nic->flags&  save_rxerr)) {
>> +		if (!(rfd_status&  cb_ok)) {
>> +			skb->pkt_type = PACKET_INVALID;
>> +		} else if (actual_size>
>> +			   ETH_DATA_LEN + VLAN_ETH_HLEN + rxfcs_pad) {
>> +			nic->rx_over_length_errors++;
>> +			skb->pkt_type = PACKET_INVALID;
>> +		}
>> +		goto process_skb;
>> +	}
>> +
>> +	if (unlikely((nic->flags&  save_rxerr)&&  !(rfd_status&  cb_ok))) {
> [...]
>
> You're adding an if-statement to cover the save_rxerr case, and the
> existing if-else-statement should cover the !save_rxerr case - so you
> are missing a '!'.  But since the new if-statement's body ends with a
> goto, there should be no need to change the condition for the existing
> if-else statement at all.

Right..I will fix that.  I forgot to back that last chunk out
of some previous attempts at that code.

I'm going to have to re-spin this entire series after somehow
dealing with the FEATURES extension, so it will likely be a while.

Thanks,
Ben


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-06-20 18:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-18 20:47 [PATCH v2 0/5] Ethernet low-level frame debugging support greearb
2011-06-18 20:47 ` [PATCH v2 1/5] net: Support ethtool ops for rx of errored frames greearb
2011-06-18 21:34   ` Francois Romieu
2011-06-19 20:11     ` Ben Greear
2011-06-19 22:48       ` Francois Romieu
2011-06-19 23:15         ` Ben Greear
2011-06-19 23:24           ` David Miller
2011-06-18 20:47 ` [PATCH v2 2/5] net: Add pkt-type PACKET_INVALID greearb
2011-06-18 20:47 ` [PATCH v2 3/5] e100: Support receiving errored frames greearb
2011-06-20 17:57   ` Ben Hutchings
2011-06-20 18:06     ` Ben Greear
2011-06-18 20:47 ` [PATCH v2 4/5] net: Support sending frame with specified FCS greearb
2011-06-18 20:47 ` [PATCH v2 5/5] e1000e: Support sending frame with custom FCS greearb

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.