2 * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 * Copyright (c) 1982, 1986, 1993
30 * The Regents of the University of California. All rights reserved.
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions
35 * 1. Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * 2. Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in the
39 * documentation and/or other materials provided with the distribution.
40 * 3. All advertising materials mentioning features or use of this software
41 * must display the following acknowledgement:
42 * This product includes software developed by the University of
43 * California, Berkeley and its contributors.
44 * 4. Neither the name of the University nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
48 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60 * @(#)if_loop.c 8.1 (Berkeley) 6/10/93
61 * $FreeBSD: src/sys/net/if_loop.c,v 1.47.2.5 2001/07/03 11:01:41 ume Exp $
64 * NOTICE: This file was modified by SPARTA, Inc. in 2006 to introduce
65 * support for mandatory and extensible security protections. This notice
66 * is included in support of clause 2.2 (b) of the Apple Public License,
71 * Loopback interface driver for protocol testing and timing.
77 #error "More than one loopback interface is not supported."
80 #include <sys/param.h>
81 #include <sys/systm.h>
82 #include <sys/kernel.h>
84 #include <sys/socket.h>
85 #include <sys/sockio.h>
86 #include <sys/mcache.h>
87 #include <sys/sysctl.h>
90 #include <net/if_types.h>
91 #include <net/route.h>
93 #include <sys/malloc.h>
96 #include <netinet/in.h>
97 #include <netinet/in_var.h>
102 #include <netinet/in.h>
104 #include <netinet6/in6_var.h>
105 #include <netinet/ip6.h>
108 #include <net/dlil.h>
109 #include <net/kpi_protocol.h>
112 #include <security/mac_framework.h>
115 #include <pexpert/pexpert.h>
118 #define LOSNDQ_MAXLEN 256
120 #define LO_BPF_TAP_OUT(_m) { \
121 if (lo_statics[0].bpf_callback != NULL) { \
122 bpf_tap_out(lo_ifp, DLT_NULL, _m, \
123 &((struct loopback_header *)_m->m_pkthdr.pkt_hdr)-> \
124 protocol, sizeof (u_int32_t)); \
128 #define LO_BPF_TAP_OUT_MULTI(_m) { \
129 if (lo_statics[0].bpf_callback != NULL) { \
131 for (_n = _m; _n != NULL; _n = _n->m_nextpkt) \
132 LO_BPF_TAP_OUT(_n); \
136 struct lo_statics_str
{
138 bpf_packet_func bpf_callback
;
141 static struct lo_statics_str lo_statics
[NLOOP
];
142 static int lo_txstart
= 0;
144 struct ifnet
*lo_ifp
= NULL
;
146 struct loopback_header
{
147 protocol_family_t protocol
;
150 /* Local forward declerations */
151 void loopattach(void);
152 static errno_t
lo_demux(struct ifnet
*, struct mbuf
*, char *,
153 protocol_family_t
*);
155 lo_framer(struct ifnet
*, struct mbuf
**, const struct sockaddr
*,
156 const char *, const char *, u_int32_t
*, u_int32_t
*);
157 static errno_t
lo_add_proto(struct ifnet
*, protocol_family_t
,
158 const struct ifnet_demux_desc
*, u_int32_t
);
159 static errno_t
lo_del_proto(struct ifnet
*, protocol_family_t
);
160 static int lo_output(struct ifnet
*, struct mbuf
*);
161 static errno_t
lo_pre_enqueue(struct ifnet
*, struct mbuf
*);
162 static void lo_start(struct ifnet
*);
163 static errno_t
lo_pre_output(struct ifnet
*, protocol_family_t
, struct mbuf
**,
164 const struct sockaddr
*, void *, char *, char *);
165 static errno_t
lo_input(struct ifnet
*, protocol_family_t
, struct mbuf
*);
166 static void lo_rtrequest(int, struct rtentry
*, struct sockaddr
*);
167 static errno_t
lo_ioctl(struct ifnet
*, u_long
, void *);
168 static errno_t
lo_attach_proto(struct ifnet
*, protocol_family_t
);
169 static void lo_reg_if_mods(void);
170 static errno_t
lo_set_bpf_tap(struct ifnet
*, bpf_tap_mode
, bpf_packet_func
);
171 static int sysctl_dequeue_max SYSCTL_HANDLER_ARGS
;
172 static int sysctl_sched_model SYSCTL_HANDLER_ARGS
;
173 static int sysctl_dequeue_scidx SYSCTL_HANDLER_ARGS
;
175 SYSCTL_DECL(_net_link
);
177 SYSCTL_NODE(_net_link
, OID_AUTO
, loopback
, CTLFLAG_RW
| CTLFLAG_LOCKED
, 0,
178 "loopback interface");
180 static u_int32_t lo_dequeue_max
= LOSNDQ_MAXLEN
;
181 SYSCTL_PROC(_net_link_loopback
, OID_AUTO
, max_dequeue
,
182 CTLTYPE_INT
| CTLFLAG_RW
| CTLFLAG_LOCKED
, &lo_dequeue_max
, LOSNDQ_MAXLEN
,
183 sysctl_dequeue_max
, "I", "Maximum number of packets dequeued at a time");
185 static u_int32_t lo_sched_model
= IFNET_SCHED_MODEL_NORMAL
;
186 SYSCTL_PROC(_net_link_loopback
, OID_AUTO
, sched_model
,
187 CTLTYPE_INT
| CTLFLAG_RW
| CTLFLAG_LOCKED
, &lo_sched_model
,
188 IFNET_SCHED_MODEL_NORMAL
, sysctl_sched_model
, "I", "Scheduling model");
190 static u_int32_t lo_dequeue_sc
= MBUF_SC_BE
;
191 static int lo_dequeue_scidx
= MBUF_SCIDX(MBUF_SC_BE
);
192 SYSCTL_PROC(_net_link_loopback
, OID_AUTO
, dequeue_sc
,
193 CTLTYPE_INT
| CTLFLAG_RW
| CTLFLAG_LOCKED
, &lo_dequeue_scidx
,
194 MBUF_SC_BE
, sysctl_dequeue_scidx
, "I", "Dequeue a specific SC index");
197 lo_demux(struct ifnet
*ifp
, struct mbuf
*m
, char *frame_header
,
198 protocol_family_t
*protocol_family
)
200 #pragma unused(ifp, m)
201 struct loopback_header
*header
=
202 (struct loopback_header
*)(void *)frame_header
;
204 *protocol_family
= header
->protocol
;
210 lo_framer(struct ifnet
*ifp
, struct mbuf
**m
, const struct sockaddr
*dest
,
211 const char *dest_linkaddr
, const char *frame_type
,
212 u_int32_t
*prepend_len
, u_int32_t
*postpend_len
)
214 #pragma unused(ifp, dest, dest_linkaddr)
215 struct loopback_header
*header
;
217 M_PREPEND(*m
, sizeof(struct loopback_header
), M_WAITOK
, 1);
219 /* Tell caller not to try to free passed-in mbuf */
223 if (prepend_len
!= NULL
) {
224 *prepend_len
= sizeof(struct loopback_header
);
226 if (postpend_len
!= NULL
) {
230 header
= mtod(*m
, struct loopback_header
*);
231 bcopy(frame_type
, &header
->protocol
, sizeof(u_int32_t
));
236 lo_add_proto(struct ifnet
*interface
, protocol_family_t protocol_family
,
237 const struct ifnet_demux_desc
*demux_array
, u_int32_t demux_count
)
239 #pragma unused(interface, protocol_family, demux_array, demux_count)
244 lo_del_proto(struct ifnet
*ifp
, protocol_family_t protocol
)
246 #pragma unused(ifp, protocol)
251 lo_tx_compl(struct ifnet
*ifp
, struct mbuf
*m
)
255 if ((ifp
->if_xflags
& IFXF_TIMESTAMP_ENABLED
) != 0) {
258 error
= mbuf_get_timestamp_requested(m
, &requested
);
264 net_timernsec(&now
, &ts
);
266 error
= mbuf_set_timestamp(m
, ts
, TRUE
);
268 printf("%s: mbuf_set_timestamp() failed %d\n",
273 error
= mbuf_set_status(m
, KERN_SUCCESS
);
275 printf("%s: mbuf_set_status() failed %d\n",
279 ifnet_tx_compl(ifp
, m
);
285 * This routine is called only when lo_txstart is disabled.
288 lo_output(struct ifnet
*ifp
, struct mbuf
*m_list
)
290 struct mbuf
*m
, *m_tail
= NULL
;
291 struct ifnet_stat_increment_param s
;
292 u_int32_t cnt
= 0, len
= 0;
294 bzero(&s
, sizeof(s
));
296 for (m
= m_list
; m
; m
= m
->m_nextpkt
) {
297 VERIFY(m
->m_flags
& M_PKTHDR
);
299 len
+= m
->m_pkthdr
.len
;
302 * Don't overwrite the rcvif field if it is in use.
303 * This is used to match multicast packets, sent looping
304 * back, with the appropriate group record on input.
306 if (m
->m_pkthdr
.rcvif
== NULL
) {
307 m
->m_pkthdr
.rcvif
= ifp
;
310 m
->m_pkthdr
.pkt_flags
|= PKTF_LOOP
;
311 m
->m_pkthdr
.pkt_hdr
= mtod(m
, char *);
313 /* loopback checksums are always OK */
314 m
->m_pkthdr
.csum_data
= 0xffff;
315 m
->m_pkthdr
.csum_flags
=
316 CSUM_DATA_VALID
| CSUM_PSEUDO_HDR
|
317 CSUM_IP_CHECKED
| CSUM_IP_VALID
;
319 m_adj(m
, sizeof(struct loopback_header
));
322 if (m
->m_nextpkt
== NULL
) {
333 return ifnet_input_extended(ifp
, m_list
, m_tail
, &s
);
337 * Pre-enqueue callback.
339 * This routine is called only when lo_txstart is enabled.
342 lo_pre_enqueue(struct ifnet
*ifp
, struct mbuf
*m0
)
344 struct mbuf
*m
= m0
, *n
;
348 VERIFY(m
->m_flags
& M_PKTHDR
);
354 * Don't overwrite the rcvif field if it is in use.
355 * This is used to match multicast packets, sent looping
356 * back, with the appropriate group record on input.
358 if (m
->m_pkthdr
.rcvif
== NULL
) {
359 m
->m_pkthdr
.rcvif
= ifp
;
362 m
->m_pkthdr
.pkt_flags
|= PKTF_LOOP
;
363 m
->m_pkthdr
.pkt_hdr
= mtod(m
, char *);
365 /* loopback checksums are always OK */
366 m
->m_pkthdr
.csum_data
= 0xffff;
367 m
->m_pkthdr
.csum_flags
=
368 CSUM_DATA_VALID
| CSUM_PSEUDO_HDR
|
369 CSUM_IP_CHECKED
| CSUM_IP_VALID
;
371 m_adj(m
, sizeof(struct loopback_header
));
374 * Let the callee free it in case of error,
375 * and perform any necessary accounting.
377 (void) ifnet_enqueue(ifp
, m
);
386 * Start output callback.
388 * This routine is invoked by the start worker thread; because we never call
389 * it directly, there is no need do deploy any serialization mechanism other
390 * than what's already used by the worker thread, i.e. this is already single
393 * This routine is called only when lo_txstart is enabled.
396 lo_start(struct ifnet
*ifp
)
398 struct ifnet_stat_increment_param s
;
400 bzero(&s
, sizeof(s
));
403 struct mbuf
*m
= NULL
, *m_tail
= NULL
;
404 u_int32_t cnt
, len
= 0;
406 if (lo_sched_model
== IFNET_SCHED_MODEL_NORMAL
) {
407 if (ifnet_dequeue_multi(ifp
, lo_dequeue_max
, &m
,
408 &m_tail
, &cnt
, &len
) != 0) {
412 if (ifnet_dequeue_service_class_multi(ifp
,
413 lo_dequeue_sc
, lo_dequeue_max
, &m
,
414 &m_tail
, &cnt
, &len
) != 0) {
419 LO_BPF_TAP_OUT_MULTI(m
);
422 /* stats are required for extended variant */
428 (void) ifnet_input_extended(ifp
, m
, m_tail
, &s
);
433 * This is a common pre-output route used by INET and INET6. This could
434 * (should?) be split into separate pre-output routines for each protocol.
437 lo_pre_output(struct ifnet
*ifp
, protocol_family_t protocol_family
,
438 struct mbuf
**m
, const struct sockaddr
*dst
, void *route
, char *frame_type
,
441 #pragma unused(ifp, dst, dst_addr)
442 struct rtentry
*rt
= route
;
444 VERIFY((*m
)->m_flags
& M_PKTHDR
);
446 (*m
)->m_flags
|= M_LOOP
;
449 u_int32_t rt_flags
= rt
->rt_flags
;
450 if (rt_flags
& (RTF_REJECT
| RTF_BLACKHOLE
)) {
451 if (rt_flags
& RTF_BLACKHOLE
) {
455 return (rt_flags
& RTF_HOST
) ?
456 EHOSTUNREACH
: ENETUNREACH
;
461 bcopy(&protocol_family
, frame_type
, sizeof(protocol_family
));
467 * lo_input - This should work for all attached protocols that use the
468 * ifq/schednetisr input mechanism.
471 lo_input(struct ifnet
*ifp
, protocol_family_t protocol_family
, struct mbuf
*m
)
473 #pragma unused(ifp, protocol_family)
475 if ((ifp
->if_xflags
& IFXF_TIMESTAMP_ENABLED
) != 0) {
481 net_timernsec(&now
, &ts
);
483 error
= mbuf_set_timestamp(m
, ts
, TRUE
);
485 printf("%s: mbuf_set_timestamp() failed %d\n",
490 if (proto_input(protocol_family
, m
) != 0) {
498 lo_rtrequest(int cmd
, struct rtentry
*rt
, struct sockaddr
*sa
)
500 #pragma unused(cmd, sa)
502 RT_LOCK_ASSERT_HELD(rt
);
503 rt
->rt_rmx
.rmx_mtu
= rt
->rt_ifp
->if_mtu
; /* for ISO */
505 * For optimal performance, the send and receive buffers
506 * should be at least twice the MTU plus a little more for
509 rt
->rt_rmx
.rmx_recvpipe
= rt
->rt_rmx
.rmx_sendpipe
= 3 * LOMTU
;
514 * Process an ioctl request.
517 lo_ioctl(struct ifnet
*ifp
, u_long cmd
, void *data
)
522 case SIOCSIFADDR
: { /* struct ifaddr pointer */
523 struct ifaddr
*ifa
= data
;
525 ifnet_set_flags(ifp
, IFF_UP
| IFF_RUNNING
, IFF_UP
| IFF_RUNNING
);
527 ifa
->ifa_rtrequest
= lo_rtrequest
;
530 * Everything else is done at a higher level.
535 case SIOCADDMULTI
: /* struct ifreq */
536 case SIOCDELMULTI
: { /* struct ifreq */
537 struct ifreq
*ifr
= data
;
540 error
= EAFNOSUPPORT
; /* XXX */
543 switch (ifr
->ifr_addr
.sa_family
) {
554 error
= EAFNOSUPPORT
;
560 case SIOCSIFMTU
: { /* struct ifreq */
561 struct ifreq
*ifr
= data
;
563 bcopy(&ifr
->ifr_mtu
, &ifp
->if_mtu
, sizeof(int));
567 case SIOCSIFFLAGS
: /* struct ifreq */
568 case SIOCSIFTIMESTAMPENABLE
:
569 case SIOCSIFTIMESTAMPDISABLE
:
578 #endif /* NLOOP > 0 */
582 lo_attach_proto(struct ifnet
*ifp
, protocol_family_t protocol_family
)
584 struct ifnet_attach_proto_param_v2 proto
;
587 bzero(&proto
, sizeof(proto
));
588 proto
.input
= lo_input
;
589 proto
.pre_output
= lo_pre_output
;
591 result
= ifnet_attach_protocol_v2(ifp
, protocol_family
, &proto
);
593 if (result
&& result
!= EEXIST
) {
594 printf("lo_attach_proto: ifnet_attach_protocol for %u "
595 "returned=%d\n", protocol_family
, result
);
606 /* Register protocol registration functions */
607 if ((error
= proto_register_plumber(PF_INET
,
608 APPLE_IF_FAM_LOOPBACK
, lo_attach_proto
, NULL
)) != 0) {
609 printf("proto_register_plumber failed for AF_INET "
610 "error=%d\n", error
);
613 if ((error
= proto_register_plumber(PF_INET6
,
614 APPLE_IF_FAM_LOOPBACK
, lo_attach_proto
, NULL
)) != 0) {
615 printf("proto_register_plumber failed for AF_INET6 "
616 "error=%d\n", error
);
621 lo_set_bpf_tap(struct ifnet
*ifp
, bpf_tap_mode mode
,
622 bpf_packet_func bpf_callback
)
624 VERIFY(ifp
== lo_ifp
);
626 lo_statics
[0].bpf_mode
= mode
;
629 case BPF_TAP_DISABLE
:
631 lo_statics
[0].bpf_callback
= NULL
;
635 case BPF_TAP_INPUT_OUTPUT
:
636 lo_statics
[0].bpf_callback
= bpf_callback
;
647 struct ifnet_init_eparams lo_init
;
650 PE_parse_boot_argn("lo_txstart", &lo_txstart
, sizeof(lo_txstart
));
654 lo_statics
[0].bpf_callback
= NULL
;
655 lo_statics
[0].bpf_mode
= BPF_TAP_DISABLE
;
657 bzero(&lo_init
, sizeof(lo_init
));
658 lo_init
.ver
= IFNET_INIT_CURRENT_VERSION
;
659 lo_init
.len
= sizeof(lo_init
);
660 lo_init
.sndq_maxlen
= LOSNDQ_MAXLEN
;
663 lo_init
.pre_enqueue
= lo_pre_enqueue
;
664 lo_init
.start
= lo_start
;
665 lo_init
.output_sched_model
= lo_sched_model
;
667 lo_init
.flags
= IFNET_INIT_LEGACY
;
668 lo_init
.output
= lo_output
;
670 lo_init
.flags
|= IFNET_INIT_NX_NOAUTO
;
673 lo_init
.family
= IFNET_FAMILY_LOOPBACK
;
674 lo_init
.type
= IFT_LOOP
;
675 lo_init
.demux
= lo_demux
;
676 lo_init
.add_proto
= lo_add_proto
;
677 lo_init
.del_proto
= lo_del_proto
;
678 lo_init
.framer_extended
= lo_framer
;
679 lo_init
.softc
= &lo_statics
[0];
680 lo_init
.ioctl
= lo_ioctl
;
681 lo_init
.set_bpf_tap
= lo_set_bpf_tap
;
683 result
= ifnet_allocate_extended(&lo_init
, &lo_ifp
);
685 panic("%s: couldn't allocate loopback ifnet (%d)\n",
690 ifnet_set_mtu(lo_ifp
, LOMTU
);
691 ifnet_set_flags(lo_ifp
, IFF_LOOPBACK
| IFF_MULTICAST
,
692 IFF_LOOPBACK
| IFF_MULTICAST
);
693 ifnet_set_offload(lo_ifp
,
694 IFNET_CSUM_IP
| IFNET_CSUM_TCP
| IFNET_CSUM_UDP
|
695 IFNET_CSUM_TCPIPV6
| IFNET_CSUM_UDPIPV6
| IFNET_IPV6_FRAGMENT
|
696 IFNET_CSUM_FRAGMENT
| IFNET_IP_FRAGMENT
| IFNET_MULTIPAGES
|
697 IFNET_TX_STATUS
| IFNET_SW_TIMESTAMP
);
698 ifnet_set_hdrlen(lo_ifp
, sizeof(struct loopback_header
));
699 ifnet_set_eflags(lo_ifp
, IFEF_SENDLIST
, IFEF_SENDLIST
);
702 mac_ifnet_label_init(ifp
);
705 result
= ifnet_attach(lo_ifp
, NULL
);
707 panic("%s: couldn't attach loopback ifnet (%d)\n",
712 * Disable ECN on loopback as ECN serves no purpose and otherwise
713 * TCP connections are subject to heuristics like SYN retransmits on RST
715 lo_ifp
->if_eflags
&= ~IFEF_ECN_ENABLE
;
716 lo_ifp
->if_eflags
|= IFEF_ECN_DISABLE
;
718 bpfattach(lo_ifp
, DLT_NULL
, sizeof(u_int32_t
));
722 sysctl_dequeue_max SYSCTL_HANDLER_ARGS
724 #pragma unused(arg1, arg2)
730 err
= sysctl_handle_int(oidp
, &i
, 0, req
);
731 if (err
!= 0 || req
->newptr
== USER_ADDR_NULL
) {
737 } else if (i
> LOSNDQ_MAXLEN
) {
747 sysctl_sched_model SYSCTL_HANDLER_ARGS
749 #pragma unused(arg1, arg2)
755 err
= sysctl_handle_int(oidp
, &i
, 0, req
);
756 if (err
!= 0 || req
->newptr
== USER_ADDR_NULL
) {
761 case IFNET_SCHED_MODEL_NORMAL
:
762 case IFNET_SCHED_MODEL_DRIVER_MANAGED
:
763 case IFNET_SCHED_MODEL_FQ_CODEL
:
771 if (err
== 0 && (err
= ifnet_set_output_sched_model(lo_ifp
, i
)) == 0) {
779 sysctl_dequeue_scidx SYSCTL_HANDLER_ARGS
781 #pragma unused(arg1, arg2)
785 i
= lo_dequeue_scidx
;
787 err
= sysctl_handle_int(oidp
, &i
, 0, req
);
788 if (err
!= 0 || req
->newptr
== USER_ADDR_NULL
) {
792 if (!MBUF_VALID_SCIDX(i
)) {
796 if (lo_sched_model
!= IFNET_SCHED_MODEL_DRIVER_MANAGED
) {
800 lo_dequeue_sc
= m_service_class_from_idx(i
);
801 lo_dequeue_scidx
= MBUF_SCIDX(lo_dequeue_sc
);