1. question about incrementing stats counters in network drivers
Hi!
If an error occur that falls into the "detailed errors" category, e.g. a
fifo overrun, are we supposed to increment both the total error count and
the detailed error count or just the detailed error count?
From isa-skeleton.c it seems that I'm supposed to increment both, but then I
spotted things like this in there as well:
------------< snip <------< snip <------< snip <------------
} else {
/* Malloc up new buffer. */
struct sk_buff *skb;
lp->stats.rx_bytes+=pkt_len;
skb = dev_alloc_skb(pkt_len);
if (skb == NULL) {
printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n",
dev->name);
lp->stats.rx_dropped++;
break;
}
skb->dev = dev;
/* 'skb->data' points to the start of sk_buff data area. */
memcpy(skb_put(skb,pkt_len), (void*)dev->rmem_start,
pkt_len);
/* or */
insw(ioaddr, skb->data, (pkt_len + 1) >> 1);
netif_rx(skb);
dev->last_rx = jiffies;
lp->stats.rx_packets++;
lp->stats.rx_bytes += pkt_len;
}
------------< snip <------< snip <------< snip <------------
Notice that rx_bytes gets incremented twice.
Also it doesn't make sense to increment both since the total count can be
derived from rx_errors+other rx errors or tx_errors+other tx errors, so I'm
not sure what to do.
--
Regards
Abraham
QOTD:
I love your outfit, does it come in your size?
__________________________________________________________
Abraham vd Merwe - 2d3D, Inc.
Device Driver Development, Outsourcing, Embedded Systems
Cell: +27 82 565 4451 Snailmail:
Tel: +27 21 761 7549 Block C, Aintree Park
Fax: +27 21 761 7648 Doncaster Road
Http: http://www.2d3d.com South Africa
|
|
application_pgp-signature_part
< 1K
Download
|
2. JDK for OpenBSD
3. Newbie Question? Repeated Incrementing in sh
4. emergency error (19)
5. bash shell question for URL incrementing
6. System Administrators! Test your UNIX knowledge at new site!
7. Script Question -- Incrementing filename
8. MAILING-LIST: Linux At Home
9. sed question: substitution with incrementing
10. Bourne Shell Problem - variable not incrementing within a while loop
11. set kiobuf io_count once, instead of increment
12. Incrementing module use count of a low level driver
13. Solaris atomic/interlocked increment/swap operations?