sfc: Don't count RX checksum errors during loopback self-test
authorBen Hutchings <bhutchings@solarflare.com>
Sat, 13 Dec 2008 05:42:42 +0000 (21:42 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Dec 2008 05:57:56 +0000 (21:57 -0800)
The loopback self-test checks that IP packets with incorrect checksums
are not altered when sent on a queue with checksum generation off.
These should not contribute to RX error statistics.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sfc/falcon.c

index e32be4c83d9015c44b9f9c53316ee17e13c66dda..97cc037a10c55aa8845b888a31aff4643ddcf3e8 100644 (file)
@@ -784,15 +784,18 @@ static void falcon_handle_rx_not_ok(struct efx_rx_queue *rx_queue,
                           rx_ev_buf_owner_id_err | rx_ev_eth_crc_err |
                           rx_ev_frm_trunc | rx_ev_ip_hdr_chksum_err);
 
-       /* Count errors that are not in MAC stats. */
+       /* Count errors that are not in MAC stats.  Ignore expected
+        * checksum errors during self-test. */
        if (rx_ev_frm_trunc)
                ++rx_queue->channel->n_rx_frm_trunc;
        else if (rx_ev_tobe_disc)
                ++rx_queue->channel->n_rx_tobe_disc;
-       else if (rx_ev_ip_hdr_chksum_err)
-               ++rx_queue->channel->n_rx_ip_hdr_chksum_err;
-       else if (rx_ev_tcp_udp_chksum_err)
-               ++rx_queue->channel->n_rx_tcp_udp_chksum_err;
+       else if (!efx->loopback_selftest) {
+               if (rx_ev_ip_hdr_chksum_err)
+                       ++rx_queue->channel->n_rx_ip_hdr_chksum_err;
+               else if (rx_ev_tcp_udp_chksum_err)
+                       ++rx_queue->channel->n_rx_tcp_udp_chksum_err;
+       }
        if (rx_ev_ip_frag_err)
                ++rx_queue->channel->n_rx_ip_frag_err;