DEFPA FDDI network stats

Doug Nazar (NazarD@btib.css.gov.on.ca)
Tue, 21 Apr 1998 02:43:11 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------ =_NextPart_000_01BD6CF0.C19FF3ED
Content-Type: text/plain

Here's a quick patch which fixes the network stats of the DEFPA FDDI
adapters. They use their own statistics struct which wasn't updated to
match the changes in net_device_stats.

Doug Nazar

<<fddi.patch>>

------ =_NextPart_000_01BD6CF0.C19FF3ED
Content-Type: application/octet-stream;
name="fddi.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="fddi.patch"

diff -u -r linux-2.1.97/drivers/net/defxx.c =
linux/drivers/net/defxx.c=0A=
--- linux-2.1.97/drivers/net/defxx.c Tue Apr 21 01:24:22 1998=0A=
+++ linux/drivers/net/defxx.c Mon Apr 20 06:16:17 1998=0A=
@@ -2013,6 +2013,8 @@=0A=
=0A=
bp->stats.rx_packets =3D bp->rcv_total_frames;=0A=
bp->stats.tx_packets =3D bp->xmt_total_frames;=0A=
+ bp->stats.rx_bytes =3D bp->rcv_total_bytes;=0A=
+ bp->stats.tx_bytes =3D bp->xmt_total_bytes;=0A=
bp->stats.rx_errors =3D (u32)(bp->rcv_crc_errors + =
bp->rcv_frame_status_errors + bp->rcv_length_errors);=0A=
bp->stats.tx_errors =3D bp->xmt_length_errors;=0A=
bp->stats.rx_dropped =3D bp->rcv_discards;=0A=
@@ -3099,6 +3101,8 @@=0A=
bp->rcv_total_frames++;=0A=
if (*(p_buff + RCV_BUFF_K_DA) & 0x01)=0A=
bp->rcv_multicast_frames++;=0A=
+ =0A=
+ bp->rcv_total_bytes +=3D skb->len;=0A=
}=0A=
}=0A=
}=0A=
@@ -3375,13 +3379,14 @@=0A=
=0A=
p_xmt_drv_descr =3D =
&(bp->xmt_drv_descr_blk[bp->rcv_xmt_reg.index.xmt_comp]);=0A=
=0A=
- /* Return skb to operating system */=0A=
-=0A=
- dev_kfree_skb(p_xmt_drv_descr->p_skb);=0A=
-=0A=
/* Increment transmit counters */=0A=
=0A=
bp->xmt_total_frames++;=0A=
+ bp->xmt_total_bytes +=3D p_xmt_drv_descr->p_skb->len;=0A=
+=0A=
+ /* Return skb to operating system */=0A=
+=0A=
+ dev_kfree_skb(p_xmt_drv_descr->p_skb);=0A=
=0A=
/*=0A=
* Move to start of next packet by updating completion index=0A=
diff -u -r linux-2.1.97/drivers/net/defxx.h =
linux/drivers/net/defxx.h=0A=
--- linux-2.1.97/drivers/net/defxx.h Tue Apr 21 01:24:22 1998=0A=
+++ linux/drivers/net/defxx.h Mon Apr 20 06:18:11 1998=0A=
@@ -1771,9 +1771,12 @@=0A=
u32 rcv_length_errors;=0A=
u32 rcv_total_frames;=0A=
u32 rcv_multicast_frames;=0A=
+ u32 rcv_total_bytes;=0A=
+=0A=
u32 xmt_discards;=0A=
u32 xmt_length_errors;=0A=
u32 xmt_total_frames;=0A=
+ u32 xmt_total_bytes;=0A=
} DFX_board_t;=0A=
=0A=
#endif /* #ifndef _DEFXX_H_ */=0A=
diff -u -r linux-2.1.97/include/linux/if_fddi.h =
linux/include/linux/if_fddi.h=0A=
--- linux-2.1.97/include/linux/if_fddi.h Tue Apr 21 01:23:46 1998=0A=
+++ linux/include/linux/if_fddi.h Mon Apr 20 06:33:54 1998=0A=
@@ -107,6 +107,8 @@=0A=
{=0A=
__u32 rx_packets; /* total packets received */=0A=
__u32 tx_packets; /* total packets transmitted */=0A=
+ __u32 rx_bytes; /* total bytes received */=0A=
+ __u32 tx_bytes; /* total bytes transmitted */=0A=
__u32 rx_errors; /* bad packets received */=0A=
__u32 tx_errors; /* packet transmit problems */=0A=
__u32 rx_dropped; /* no space in linux buffers */=0A=
@@ -114,6 +116,25 @@=0A=
__u32 multicast; /* multicast packets received */=0A=
__u32 transmit_collision; /* always 0 for FDDI */=0A=
=0A=
+ /* detailed rx_errors: NOT CURRENTLY FILLED FIXME*/=0A=
+ __u32 rx_length_errors;=0A=
+ __u32 rx_over_errors; /* receiver ring buff overflow */=0A=
+ __u32 rx_crc_errors; /* recved pkt with crc error */=0A=
+ __u32 rx_frame_errors; /* recv'd frame alignment error */=0A=
+ __u32 rx_fifo_errors; /* recv'r fifo overrun */=0A=
+ __u32 rx_missed_errors; /* receiver missed packet */=0A=
+=0A=
+ /* detailed tx_errors NOT CURRENTLY FILLED FIXME*/=0A=
+ __u32 tx_aborted_errors;=0A=
+ __u32 tx_carrier_errors;=0A=
+ __u32 tx_fifo_errors;=0A=
+ __u32 tx_heartbeat_errors;=0A=
+ __u32 tx_window_errors;=0A=
+ =0A=
+ /* for cslip etc NOT CURRENTLY FILLED FIXME*/=0A=
+ __u32 rx_compressed;=0A=
+ __u32 tx_compressed;=0A=
+ =0A=
/* Detailed FDDI statistics. Adopted from RFC 1512 */=0A=
=0A=
__u8 smt_station_id[8];=0A=

------ =_NextPart_000_01BD6CF0.C19FF3ED--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu