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/dev/hea/eni_transmit.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/dev/hea/eni_transmit.c')
-rw-r--r-- | sys/dev/hea/eni_transmit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/hea/eni_transmit.c b/sys/dev/hea/eni_transmit.c index 2f6f945..2fd5b24 100644 --- a/sys/dev/hea/eni_transmit.c +++ b/sys/dev/hea/eni_transmit.c @@ -271,7 +271,7 @@ eni_xmit_drain ( eup ) /* * Pull the top element (PDU) off */ - IF_DEQUEUE ( &eup->eu_txqueue, m ); + _IF_DEQUEUE ( &eup->eu_txqueue, m ); /* * As long as there are valid elements */ @@ -317,7 +317,7 @@ eni_xmit_drain ( eup ) * Haven't finished this PDU yet - replace * it as the head of list. */ - IF_PREPEND ( &eup->eu_txqueue, m ); + _IF_PREPEND ( &eup->eu_txqueue, m ); /* * If this one isn't done, none of the others * are either. @@ -331,7 +331,7 @@ eni_xmit_drain ( eup ) * Haven't finished this PDU yet - replace * it as the head of list. */ - IF_PREPEND ( &eup->eu_txqueue, m ); + _IF_PREPEND ( &eup->eu_txqueue, m ); /* * If this one isn't done, none of the others * are either. @@ -388,7 +388,7 @@ eni_xmit_drain ( eup ) /* * Look for next completed transmit PDU */ - IF_DEQUEUE ( &eup->eu_txqueue, m ); + _IF_DEQUEUE ( &eup->eu_txqueue, m ); } /* * We've drained the queue... @@ -823,7 +823,7 @@ retry: * Place buffers onto transmit queue for draining */ s2 = splimp(); - IF_ENQUEUE ( &eup->eu_txqueue, m ); + _IF_ENQUEUE ( &eup->eu_txqueue, m ); (void) splx(s2); /* |