-
- do {
- inject = inject_buckets;
- } while (inject && !OSCompareAndSwap(inject, 0, (UInt32*)&inject_buckets));
-
- if (inject) {
- for (i = 0; i < PROTO_HASH_SLOTS; i++) {
- if ((inject & (1L << i)) != 0) {
- for (entry = proto_hash[i]; entry; entry = entry->next) {
- if (entry->first_packet) {
- proto_delayed_inject(entry);
+ }
+
+ /*
+ * Move everything from the lock protected list to the thread
+ * specific list.
+ */
+ for (i = 0; proto_total_waiting != 0 && i < PROTO_HASH_SLOTS; i++) {
+ for (entry = proto_hash[i];
+ entry != NULL && proto_total_waiting; entry = entry->next) {
+ if (entry->inject_first != NULL) {
+ lck_mtx_lock_spin(&inp->input_lck);
+ inp->input_waiting &= ~DLIL_PROTO_WAITING;
+
+ packet_list = entry->inject_first;
+
+ entry->inject_first = NULL;
+ entry->inject_last = NULL;
+ proto_total_waiting--;
+
+ lck_mtx_unlock(&inp->input_lck);
+
+ if (entry->domain != NULL && !(entry->domain->
+ dom_flags & DOM_REENTRANT)) {
+ lck_mtx_lock(entry->domain->dom_mtx);
+ locked = 1;
+ }
+
+ if (entry->chain) {
+ entry->input(entry->protocol,
+ packet_list);
+ } else {
+ mbuf_t packet;
+
+ for (packet = packet_list;
+ packet != NULL;
+ packet = packet_list) {
+ packet_list =
+ mbuf_nextpkt(packet);
+ mbuf_setnextpkt(packet, NULL);
+ entry->input(entry->protocol,
+ packet);