Re: token ring driver lacks byte counts

Steven Clarke (Steven.Clarke@ThePLAnet.net)
Mon, 2 Feb 1998 17:00:52 +0000 (GMT)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

---1732065984-706762237-886438728=:21059
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.LNX.3.95.980202165942.21059F@thingy.theplanet.net>

On Wed, 28 Jan 1998, Alan Cox wrote:

> > tr0: 0 18070328 0 9 0 0 0 3671525 0 0 0
> > ^ ^
> > missing missing
>
> Nobody has submitted a byte count patch for the token ring drivers yet

OK. There's one attached below.

Steve Clarke

diff -u --recursive --new-file linux-2.1.84.orig/drivers/net/ibmtr.c linux-2.1.84/drivers/net/ibmtr.c
--- linux-2.1.84.orig/drivers/net/ibmtr.c Sat Nov 29 18:33:19 1997
+++ linux-2.1.84/drivers/net/ibmtr.c Mon Feb 2 12:19:15 1998
@@ -1304,6 +1304,7 @@
memcpy_toio(dhb, ti->current_skb->data, ti->current_skb->len);

writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
+ ti->tr_stats.tx_bytes+=ti->current_skb->len;
dev->tbusy=0;
dev_kfree_skb(ti->current_skb,FREE_WRITE);
ti->current_skb=NULL;
@@ -1453,6 +1454,7 @@
writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);

ti->tr_stats..rx_packets++;
+ ti->tr_stats.rx_bytes+=skb->len;

tr_reformat(skb, lan_hdr_len);
skb->protocol = tr_type_trans(skb,dev);
diff -u --recursive --new-file linux-2.1.84.orig/include/linux/if_tr.h linux-2.1.84/include/linux/if_tr.h
--- linux-2.1.84.orig/include/linux/if_tr.h Sat Nov 29 18:33:21 1997
+++ linux-2.1.84/include/linux/if_tr.h Mon Feb 2 11:49:27 1998
@@ -59,29 +59,31 @@

/* Token-Ring statistics collection data. */
struct tr_statistics {
- int rx_packets; /* total packets received */
- int tx_packets; /* total packets transmitted */
- int rx_errors; /* bad packets received */
- int tx_errors; /* packet transmit problems */
- int rx_dropped; /* no space in linux buffers */
- int tx_dropped; /* no space available in linux */
- int multicast; /* multicast packets received */
- int transmit_collision;
+ unsigned long rx_packets; /* total packets received */
+ unsigned long tx_packets; /* total packets transmitted */
+ unsigned long rx_bytes; /* total bytes received */
+ unsigned long tx_bytes; /* total bytes transmitted */
+ unsigned long rx_errors; /* bad packets received */
+ unsigned long tx_errors; /* packet transmit problems */
+ unsigned long rx_dropped; /* no space in linux buffers */
+ unsigned long tx_dropped; /* no space available in linux */
+ unsigned long multicast; /* multicast packets received */
+ unsigned long transmit_collision;

/* detailed Token-Ring errors. See IBM Token-Ring Network
Architecture for more info */

- int line_errors;
- int internal_errors;
- int burst_errors;
- int A_C_errors;
- int abort_delimiters;
- int lost_frames;
- int recv_congest_count;
- int frame_copied_errors;
- int frequency_errors;
- int token_errors;
- int dummy1;
+ unsigned long line_errors;
+ unsigned long internal_errors;
+ unsigned long burst_errors;
+ unsigned long A_C_errors;
+ unsigned long abort_delimiters;
+ unsigned long lost_frames;
+ unsigned long recv_congest_count;
+ unsigned long frame_copied_errors;
+ unsigned long frequency_errors;
+ unsigned long token_errors;
+ unsigned dummy1;
};

/* source routing stuff */

---1732065984-706762237-886438728=:21059--