From: Jesse Gross Date: Fri, 19 Nov 2010 21:49:54 +0000 (-0800) Subject: vport: Remove unused error types. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d1d631e10b24d9528a4c436805205efcbefd983;p=openvswitch vport: Remove unused error types. 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 Acked-by: Ben Pfaff --- diff --git a/datapath/vport.c b/datapath/vport.c index 37d6d8ab..c68e1814 100644 --- a/datapath/vport.c +++ b/datapath/vport.c @@ -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); diff --git a/datapath/vport.h b/datapath/vport.h index 186d6bf7..641353cd 100644 --- a/datapath/vport.h +++ b/datapath/vport.h @@ -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 *);