From owner-p4-projects@FreeBSD.ORG Tue Sep 30 21:44:14 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 658D01065699; Tue, 30 Sep 2008 21:44:14 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29EA91065696 for ; Tue, 30 Sep 2008 21:44:14 +0000 (UTC) (envelope-from rfrench@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 15B748FC28 for ; Tue, 30 Sep 2008 21:44:14 +0000 (UTC) (envelope-from rfrench@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m8ULiD1N048407 for ; Tue, 30 Sep 2008 21:44:13 GMT (envelope-from rfrench@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m8ULiDEF048403 for perforce@freebsd.org; Tue, 30 Sep 2008 21:44:13 GMT (envelope-from rfrench@FreeBSD.org) Date: Tue, 30 Sep 2008 21:44:13 GMT Message-Id: <200809302144.m8ULiDEF048403@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rfrench@FreeBSD.org using -f From: Ryan French To: Perforce Change Reviews Cc: Subject: PERFORCE change 150728 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2008 21:44:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=150728 Change 150728 by rfrench@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