summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2008-03-25 09:39:02 +0000
committerru <ru@FreeBSD.org>2008-03-25 09:39:02 +0000
commit3b1bf8c2e9222b7d27e8b9084e637a84005de7ba (patch)
treecf0376c9359f2d1ca6e4e8e4ad4a4f722dba61a7 /sys/pci
parent0655a583e2ccba8b534e710284a730a0d6af1375 (diff)
downloadFreeBSD-src-3b1bf8c2e9222b7d27e8b9084e637a84005de7ba.zip
FreeBSD-src-3b1bf8c2e9222b7d27e8b9084e637a84005de7ba.tar.gz
Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true since the advent of MBUMA. Reviewed by: arch There are ongoing disputes as to whether we want to switch to directly using UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_mn.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/sys/pci/if_mn.c b/sys/pci/if_mn.c
index ebe421f..e8b3dc6 100644
--- a/sys/pci/if_mn.c
+++ b/sys/pci/if_mn.c
@@ -693,9 +693,7 @@ ngmn_connect(hook_p hook)
/* Setup a transmit chain with one descriptor */
/* XXX: we actually send a 1 byte packet */
dp = mn_alloc_desc();
- MGETHDR(m, M_TRYWAIT, MT_DATA);
- if (m == NULL)
- return ENOBUFS;
+ MGETHDR(m, M_WAIT, MT_DATA);
m->m_pkthdr.len = 0;
dp->m = m;
dp->flags = 0xc0000000 + (1 << 16);
@@ -710,17 +708,8 @@ ngmn_connect(hook_p hook)
dp = mn_alloc_desc();
m = NULL;
- MGETHDR(m, M_TRYWAIT, MT_DATA);
- if (m == NULL) {
- mn_free_desc(dp);
- return (ENOBUFS);
- }
- MCLGET(m, M_TRYWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- mn_free_desc(dp);
- m_freem(m);
- return (ENOBUFS);
- }
+ MGETHDR(m, M_WAIT, MT_DATA);
+ MCLGET(m, M_WAIT);
dp->m = m;
dp->data = vtophys(m->m_data);
dp->flags = 0x40000000;
@@ -733,18 +722,8 @@ ngmn_connect(hook_p hook)
dp2 = dp;
dp = mn_alloc_desc();
m = NULL;
- MGETHDR(m, M_TRYWAIT, MT_DATA);
- if (m == NULL) {
- mn_free_desc(dp);
- m_freem(m);
- return (ENOBUFS);
- }
- MCLGET(m, M_TRYWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- mn_free_desc(dp);
- m_freem(m);
- return (ENOBUFS);
- }
+ MGETHDR(m, M_WAIT, MT_DATA);
+ MCLGET(m, M_WAIT);
dp->m = m;
dp->data = vtophys(m->m_data);
dp->flags = 0x00000000;
OpenPOWER on IntegriCloud