diff options
author | jlemon <jlemon@FreeBSD.org> | 2000-11-25 07:35:38 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2000-11-25 07:35:38 +0000 |
commit | 954e1d2ccdb661d5c8b7f69340d118fa7ba7fb85 (patch) | |
tree | 0a4e9f6dcd5fa64a78f5991ac425f3ca97aba154 /sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c | |
parent | 2daca11cae375091daf49a7cd704e5e4e1be27db (diff) | |
download | FreeBSD-src-954e1d2ccdb661d5c8b7f69340d118fa7ba7fb85.zip FreeBSD-src-954e1d2ccdb661d5c8b7f69340d118fa7ba7fb85.tar.gz |
Lock down the network interface queues. The queue mutex must be obtained
before adding/removing packets from the queue. Also, the if_obytes and
if_omcasts fields should only be manipulated under protection of the mutex.
IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on
the queue. An IF_LOCK macro is provided, as well as the old (mutex-less)
versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which
needs them, but their use is discouraged.
Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF,
which takes care of locking/enqueue, and also statistics updating/start
if necessary.
Diffstat (limited to 'sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c')
-rw-r--r-- | sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c b/sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c index 5b9e6cf..4bb59f0 100644 --- a/sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c +++ b/sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c @@ -127,7 +127,7 @@ ihfc_ph_data_req(int unit, struct mbuf *m, int freeflag) if (freeflag == MBUF_DONTFREE) m = m_copypacket(m, M_DONTWAIT); - if (!IF_QFULL(&S_IFQUEUE) && m) + if (!_IF_QFULL(&S_IFQUEUE) && m) { IF_ENQUEUE(&S_IFQUEUE, m); @@ -300,7 +300,7 @@ ihfc_putmbuf (ihfc_sc_t *sc, u_char chan, struct mbuf *m) S_BDRVLINK->bch_activity(S_BDRVLINK->unit, ACT_RX); } - if (!IF_QFULL(&S_IFQUEUE)) + if (!_IF_QFULL(&S_IFQUEUE)) { S_BYTES += m->m_len; IF_ENQUEUE(&S_IFQUEUE, m); |