vport: Remove unused error types.
authorJesse Gross <jesse@nicira.com>
Fri, 19 Nov 2010 21:49:54 +0000 (13:49 -0800)
committerJesse Gross <jesse@nicira.com>
Fri, 3 Dec 2010 01:10:15 +0000 (17:10 -0800)
We currently track rx_over_errors, rx_crc_errors, rx_frame_errors,
and collisions but never increment these counters.  It seems likely
that we will never use them since they are primarily hardware errors
and we pull hardware stats directly from the NIC.  This removes those
counters, saving 32 bytes per port.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/vport.c
datapath/vport.h

index 37d6d8a..c68e181 100644 (file)
@@ -1032,17 +1032,10 @@ int vport_get_stats(struct vport *vport, struct rtnl_link_stats64 *stats)
 
                *stats = vport->offset_stats;
 
-               stats->rx_errors        += vport->err_stats.rx_errors
-                                               + vport->err_stats.rx_frame_err
-                                               + vport->err_stats.rx_over_err
-                                               + vport->err_stats.rx_crc_err;
+               stats->rx_errors        += vport->err_stats.rx_errors;
                stats->tx_errors        += vport->err_stats.tx_errors;
                stats->tx_dropped       += vport->err_stats.tx_dropped;
                stats->rx_dropped       += vport->err_stats.rx_dropped;
-               stats->rx_over_errors   += vport->err_stats.rx_over_err;
-               stats->rx_crc_errors    += vport->err_stats.rx_crc_err;
-               stats->rx_frame_errors  += vport->err_stats.rx_frame_err;
-               stats->collisions       += vport->err_stats.collisions;
 
                spin_unlock_bh(&vport->stats_lock);
 
@@ -1322,18 +1315,6 @@ void vport_record_error(struct vport *vport, enum vport_err_type err_type)
                        vport->err_stats.rx_errors++;
                        break;
 
-               case VPORT_E_RX_FRAME:
-                       vport->err_stats.rx_frame_err++;
-                       break;
-
-               case VPORT_E_RX_OVER:
-                       vport->err_stats.rx_over_err++;
-                       break;
-
-               case VPORT_E_RX_CRC:
-                       vport->err_stats.rx_crc_err++;
-                       break;
-
                case VPORT_E_TX_DROPPED:
                        vport->err_stats.tx_dropped++;
                        break;
@@ -1341,10 +1322,6 @@ void vport_record_error(struct vport *vport, enum vport_err_type err_type)
                case VPORT_E_TX_ERROR:
                        vport->err_stats.tx_errors++;
                        break;
-
-               case VPORT_E_COLLISION:
-                       vport->err_stats.collisions++;
-                       break;
                };
 
                spin_unlock_bh(&vport->stats_lock);
index 186d6bf..641353c 100644 (file)
@@ -90,12 +90,8 @@ struct vport_percpu_stats {
 struct vport_err_stats {
        u64 rx_dropped;
        u64 rx_errors;
-       u64 rx_frame_err;
-       u64 rx_over_err;
-       u64 rx_crc_err;
        u64 tx_dropped;
        u64 tx_errors;
-       u64 collisions;
 };
 
 struct vport {
@@ -200,12 +196,8 @@ struct vport_ops {
 enum vport_err_type {
        VPORT_E_RX_DROPPED,
        VPORT_E_RX_ERROR,
-       VPORT_E_RX_FRAME,
-       VPORT_E_RX_OVER,
-       VPORT_E_RX_CRC,
        VPORT_E_TX_DROPPED,
        VPORT_E_TX_ERROR,
-       VPORT_E_COLLISION,
 };
 
 struct vport *vport_alloc(int priv_size, const struct vport_ops *);