netxen: fix rx dropped stats

Don't count rx dropped packets based on return value of netif_receive_skb(),
which is misleading.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Tested-by: Vernon Mauery <mauery@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Dhananjay Phadke 2008-03-17 19:59:51 -07:00 committed by Jeff Garzik
parent ba53e6b487
commit d1847a722e
4 changed files with 3 additions and 45 deletions

View File

@ -818,12 +818,7 @@ struct netxen_adapter_stats {
u64 badskblen;
u64 nocmddescriptor;
u64 polled;
u64 uphappy;
u64 updropped;
u64 uplcong;
u64 uphcong;
u64 upmcong;
u64 updunno;
u64 rxdropped;
u64 txdropped;
u64 csummed;
u64 no_rcv;

View File

@ -64,12 +64,6 @@ static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = {
{"bad_skb_len", NETXEN_NIC_STAT(stats.badskblen)},
{"no_cmd_desc", NETXEN_NIC_STAT(stats.nocmddescriptor)},
{"polled", NETXEN_NIC_STAT(stats.polled)},
{"uphappy", NETXEN_NIC_STAT(stats.uphappy)},
{"updropped", NETXEN_NIC_STAT(stats.updropped)},
{"uplcong", NETXEN_NIC_STAT(stats.uplcong)},
{"uphcong", NETXEN_NIC_STAT(stats.uphcong)},
{"upmcong", NETXEN_NIC_STAT(stats.upmcong)},
{"updunno", NETXEN_NIC_STAT(stats.updunno)},
{"tx_dropped", NETXEN_NIC_STAT(stats.txdropped)},
{"csummed", NETXEN_NIC_STAT(stats.csummed)},
{"no_rcv", NETXEN_NIC_STAT(stats.no_rcv)},

View File

@ -1089,7 +1089,7 @@ static void netxen_process_rcv(struct netxen_adapter *adapter, int ctxid,
skb = (struct sk_buff *)buffer->skb;
if (likely(adapter->rx_csum &&
netxen_get_sts_status(sts_data) == STATUS_CKSUM_OK)) {
netxen_get_sts_status(sts_data) == STATUS_CKSUM_OK)) {
adapter->stats.csummed++;
skb->ip_summed = CHECKSUM_UNNECESSARY;
} else
@ -1106,37 +1106,6 @@ static void netxen_process_rcv(struct netxen_adapter *adapter, int ctxid,
skb->protocol = eth_type_trans(skb, netdev);
ret = netif_receive_skb(skb);
/*
* RH: Do we need these stats on a regular basis. Can we get it from
* Linux stats.
*/
switch (ret) {
case NET_RX_SUCCESS:
adapter->stats.uphappy++;
break;
case NET_RX_CN_LOW:
adapter->stats.uplcong++;
break;
case NET_RX_CN_MOD:
adapter->stats.upmcong++;
break;
case NET_RX_CN_HIGH:
adapter->stats.uphcong++;
break;
case NET_RX_DROP:
adapter->stats.updropped++;
break;
default:
adapter->stats.updunno++;
break;
}
netdev->last_rx = jiffies;
rcv_desc->rcv_pending--;

View File

@ -59,7 +59,7 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev)
/* packet transmit problems */
stats->tx_errors = adapter->stats.nocmddescriptor;
/* no space in linux buffers */
stats->rx_dropped = adapter->stats.updropped;
stats->rx_dropped = adapter->stats.rxdropped;
/* no space available in linux */
stats->tx_dropped = adapter->stats.txdropped;