From 1608c584296089cd80bac9038083f8b741a9fb50 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Tue, 21 May 1996 19:05:31 +0000 Subject: [PATCH] Let the user know what errors are experienced on received packets. I spent the better part of a day trying to figure out why my experiment didn't work the way I expected, only to find out that the router was dropping huge numbers of packets because of PCI bus priblems. This does not fix the bug that errors are counted as input packets because my patch doesn't apply cleanly. --- sys/dev/de/if_de.c | 15 +++++++++++++-- sys/pci/if_de.c | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 274647c8bdf..5dee4f05922 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_de.c,v 1.45 1996/05/02 14:20:44 phk Exp $ + * $Id: if_de.c,v 1.46 1996/05/03 21:01:34 phk Exp $ * */ @@ -1092,7 +1092,18 @@ tulip_rx_intr( accept = 1; total_len -= sizeof(struct ether_header); } else { - ifp->if_ierrors++; +#define RXERR(which, what) \ + if (eop->d_status & which) \ + printf("de%d: receiver: %s\n", ifp->if_unit, what) + + RXERR(TULIP_DSTS_RxBADLENGTH, "packet length error"); + RXERR(TULIP_DSTS_RxRUNT, "runt frame"); + RXERR(TULIP_DSTS_RxTOOLONG, "frame too long"); + RXERR(TULIP_DSTS_RxCOLLSEEN, "late collision"); + RXERR(TULIP_DSTS_RxBADCRC, "CRC error"); + RXERR(TULIP_DSTS_RxOVERFLOW, "FIFO overflow"); +#undef RXERR + ifp->if_ierrors++; } next: ifp->if_ipackets++; diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c index 274647c8bdf..5dee4f05922 100644 --- a/sys/pci/if_de.c +++ b/sys/pci/if_de.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_de.c,v 1.45 1996/05/02 14:20:44 phk Exp $ + * $Id: if_de.c,v 1.46 1996/05/03 21:01:34 phk Exp $ * */ @@ -1092,7 +1092,18 @@ tulip_rx_intr( accept = 1; total_len -= sizeof(struct ether_header); } else { - ifp->if_ierrors++; +#define RXERR(which, what) \ + if (eop->d_status & which) \ + printf("de%d: receiver: %s\n", ifp->if_unit, what) + + RXERR(TULIP_DSTS_RxBADLENGTH, "packet length error"); + RXERR(TULIP_DSTS_RxRUNT, "runt frame"); + RXERR(TULIP_DSTS_RxTOOLONG, "frame too long"); + RXERR(TULIP_DSTS_RxCOLLSEEN, "late collision"); + RXERR(TULIP_DSTS_RxBADCRC, "CRC error"); + RXERR(TULIP_DSTS_RxOVERFLOW, "FIFO overflow"); +#undef RXERR + ifp->if_ierrors++; } next: ifp->if_ipackets++;