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 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@ -2479,7 +2479,10 @@ edget(sc, src, total_len)
} }
if (total_len >= MINCLSIZE) { if (total_len >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT); MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT) if ((m->m_flags & M_EXT) == 0)
m_freem(top);
return 0;
}
len = MCLBYTES; len = MCLBYTES;
} }
m->m_len = len = min(total_len, len); m->m_len = len = min(total_len, 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> * Copyright (c) 1993 Dean Huxley <dean@fsa.ca>
@ -811,7 +811,10 @@ egget(sc, buf, totlen)
} }
if (totlen >= MINCLSIZE) { if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT); MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT) if ((m->m_flags & M_EXT) == 0)
m_freem(top);
return 0;
}
len = MCLBYTES; len = MCLBYTES;
} }
m->m_len = len = min(totlen, len); m->m_len = len = min(totlen, 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 * Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted
@ -653,7 +653,10 @@ elget(sc, totlen)
} }
if (totlen >= MINCLSIZE) { if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT); MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT) if ((m->m_flags & M_EXT) == 0)
m_freem(top);
return 0;
}
len = MCLBYTES; len = MCLBYTES;
} }
m->m_len = len = min(totlen, len); m->m_len = len = min(totlen, 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. * Copyright (c) 1993, 1994, 1995 Charles Hannum.
@ -1307,7 +1307,10 @@ ieget(sc, ehp, to_bpf)
} }
if (totlen >= MINCLSIZE) { if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT); MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT) if ((m->m_flags & M_EXT) == 0)
m_freem(top);
return 0;
}
len = MCLBYTES; len = MCLBYTES;
} }
m->m_len = len = min(totlen, len); m->m_len = len = min(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 IYDEBUG */
/* #define IYMEMDEBUG */ /* #define IYMEMDEBUG */
/*- /*-
@ -887,7 +887,10 @@ iyget(sc, iot, ioh, rxlen)
} }
if (rxlen >= MINCLSIZE) { if (rxlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT); MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT) if ((m->m_flags & M_EXT) == 0)
m_freem(top);
goto dropped;
}
len = MCLBYTES; len = MCLBYTES;
} }
len = min(rxlen, len); len = min(rxlen, len);

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. * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -221,7 +221,11 @@ ofnread(of)
} }
if (len >= MINCLSIZE) { if (len >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT); MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT) if ((m->m_flags & M_EXT) == 0)
m_freem(head);
head = 0;
break;
}
l = MCLBYTES; l = MCLBYTES;
} }
m->m_len = l = min(len, l); m->m_len = l = min(len, l);