If we fail to allocate a cluster to hold a large packet, simply

drop it rather than using a chain of tiny mbufs.
This commit is contained in:
mycroft 1997-04-24 02:04:33 +00:00
parent db2332eb26
commit 030c7010ee
6 changed files with 37 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ed.c,v 1.107 1997/03/15 18:11:39 is Exp $ */
/* $NetBSD: if_ed.c,v 1.108 1997/04/24 02:04:33 mycroft Exp $ */
/*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@ -2479,8 +2479,11 @@ edget(sc, src, total_len)
}
if (total_len >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT)
len = MCLBYTES;
if ((m->m_flags & M_EXT) == 0)
m_freem(top);
return 0;
}
len = MCLBYTES;
}
m->m_len = len = min(total_len, len);
src = ed_ring_copy(sc, src, mtod(m, caddr_t), len);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_eg.c,v 1.33 1997/03/15 18:11:40 is Exp $ */
/* $NetBSD: if_eg.c,v 1.34 1997/04/24 02:04:35 mycroft Exp $ */
/*
* Copyright (c) 1993 Dean Huxley <dean@fsa.ca>
@ -811,8 +811,11 @@ egget(sc, buf, totlen)
}
if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT)
len = MCLBYTES;
if ((m->m_flags & M_EXT) == 0)
m_freem(top);
return 0;
}
len = MCLBYTES;
}
m->m_len = len = min(totlen, len);
bcopy((caddr_t)buf, mtod(m, caddr_t), len);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_el.c,v 1.44 1997/03/15 18:11:41 is Exp $ */
/* $NetBSD: if_el.c,v 1.45 1997/04/24 02:04:36 mycroft Exp $ */
/*
* Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted
@ -653,8 +653,11 @@ elget(sc, totlen)
}
if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT)
len = MCLBYTES;
if ((m->m_flags & M_EXT) == 0)
m_freem(top);
return 0;
}
len = MCLBYTES;
}
m->m_len = len = min(totlen, len);
bus_space_read_multi_1(iot, ioh, EL_BUF, mtod(m, u_int8_t *), len);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ie.c,v 1.57 1997/03/15 18:11:46 is Exp $ */
/* $NetBSD: if_ie.c,v 1.58 1997/04/24 02:04:38 mycroft Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum.
@ -1307,8 +1307,11 @@ ieget(sc, ehp, to_bpf)
}
if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT)
len = MCLBYTES;
if ((m->m_flags & M_EXT) == 0)
m_freem(top);
return 0;
}
len = MCLBYTES;
}
m->m_len = len = min(totlen, len);
totlen -= len;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_iy.c,v 1.10 1997/03/15 18:11:47 is Exp $ */
/* $NetBSD: if_iy.c,v 1.11 1997/04/24 02:04:39 mycroft Exp $ */
/* #define IYDEBUG */
/* #define IYMEMDEBUG */
/*-
@ -887,8 +887,11 @@ iyget(sc, iot, ioh, rxlen)
}
if (rxlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT)
len = MCLBYTES;
if ((m->m_flags & M_EXT) == 0)
m_freem(top);
goto dropped;
}
len = MCLBYTES;
}
len = min(rxlen, len);
if (len > 1) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofnet.c,v 1.6 1997/04/16 23:41:19 thorpej Exp $ */
/* $NetBSD: ofnet.c,v 1.7 1997/04/24 02:08:46 mycroft Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -221,8 +221,12 @@ ofnread(of)
}
if (len >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT)
l = MCLBYTES;
if ((m->m_flags & M_EXT) == 0)
m_freem(head);
head = 0;
break;
}
l = MCLBYTES;
}
m->m_len = l = min(len, l);
bcopy(bufp, mtod(m, char *), l);