PERFORCE change 150728 for review
Ryan French
rfrench at FreeBSD.org
Tue Sep 30 21:44:14 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=150728
Change 150728 by rfrench at rfrench_mpls on 2008/09/30 21:44:01
Receiving of MPLS packets now work as far as I can tell. When a packet is received it is correctly taken off the queue and decoded. I have to setup routing tables now so that the packet can be forwarded appropriately.
Affected files ...
.. //depot/projects/soc2008/rfrench_mpls/net/if_ethersubr.c#9 edit
.. //depot/projects/soc2008/rfrench_mpls/net/netisr.c#2 edit
.. //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_input.c#7 edit
Differences ...
==== //depot/projects/soc2008/rfrench_mpls/net/if_ethersubr.c#9 (text+ko) ====
@@ -869,6 +869,11 @@
#endif /* NETATALK */
goto discard;
}
+#ifdef MPLS_DEBUG
+ if(isr == NETISR_MPLS) {
+ printf("calling netisr_dispatch\n");
+ }
+#endif
netisr_dispatch(isr, m);
return;
==== //depot/projects/soc2008/rfrench_mpls/net/netisr.c#2 (text+ko) ====
@@ -150,8 +150,18 @@
void
netisr_dispatch(int num, struct mbuf *m)
{
+#ifdef MPLS_DEBUG
+ if(num == 4)
+ printf("entered dispatch\n");
+#endif
+
struct netisr *ni;
+#ifdef MPLS_DEBUG
+ if(num == 4 || num == 5)
+ printf("netisr num = %d\n", num);
+#endif
+
isrstat.isrs_count++; /* XXX redundant */
KASSERT(!(num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs))),
("bad isr %d", num));
@@ -185,6 +195,10 @@
ni->ni_handler(m);
} else {
isrstat.isrs_deferred++;
+#ifdef MPLS_DEBUG
+ if (m == NULL)
+ printf("m is NULL\n");
+#endif
if (IF_HANDOFF(ni->ni_queue, m, NULL))
schednetisr(num);
}
@@ -265,6 +279,5 @@
if (swi_add(NULL, "net", swi_net, NULL, SWI_NET, INTR_MPSAFE, &net_ih))
panic("start_netisr");
- printf("Welcome to Ryan's Fucking Kernel\n");
}
SYSINIT(start_netisr, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_netisr, NULL)
==== //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_input.c#7 (text+ko) ====
@@ -42,7 +42,8 @@
mpls_init(void)
{
mplsintrq.ifq_maxlen = mplsqmaxlen;
- netisr_register(NETISR_MPLS, mpls_input, &mplsintrq, 0);
+ mtx_init(&mplsintrq.ifq_mtx, "mpls_inq", NULL, MTX_DEF);
+ netisr_register(NETISR_MPLS, mpls_input, &mplsintrq, 0);
#ifdef MPLS_DEBUG
printf("mpls initialised\n");
#endif
More information about the p4-projects
mailing list