summaryrefslogtreecommitdiffstats
path: root/sys/dev/hatm/if_hatm_rx.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-10-29 13:14:39 +0000
committerharti <harti@FreeBSD.org>2003-10-29 13:14:39 +0000
commite0d0a97b8fc62bbf8d84b4ea74d6bf8673dfa51c (patch)
tree88eb2eb0b8a7880f39a0fcc057ebb85003e7a634 /sys/dev/hatm/if_hatm_rx.c
parent568c57f368a5b09aa3cac9b6d7ddb6fae11059c0 (diff)
downloadFreeBSD-src-e0d0a97b8fc62bbf8d84b4ea74d6bf8673dfa51c.zip
FreeBSD-src-e0d0a97b8fc62bbf8d84b4ea74d6bf8673dfa51c.tar.gz
Defer allocation of the actual receive mbuf until the external buffer
is returned from the card to the driver. Add a counter that shows how many times this allocation has failed. Note, that we could even further delay the allocation of the mbuf until we know, that we need it (there are no receive errors and the connection is open). This will be done in a later commit. Print the new statistics field in atmconfig.
Diffstat (limited to 'sys/dev/hatm/if_hatm_rx.c')
-rw-r--r--sys/dev/hatm/if_hatm_rx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/hatm/if_hatm_rx.c b/sys/dev/hatm/if_hatm_rx.c
index 15e568d..f42e821 100644
--- a/sys/dev/hatm/if_hatm_rx.c
+++ b/sys/dev/hatm/if_hatm_rx.c
@@ -116,6 +116,10 @@ hatm_rx(struct hatm_softc *sc, u_int cid, u_int flags, struct mbuf *m0,
}
goto drop;
}
+ if (m0 == NULL) {
+ sc->istats.no_rcv_mbuf++;
+ return;
+ }
if ((m0->m_len = len) == 0) {
sc->istats.empty_hbuf++;
OpenPOWER on IntegriCloud