Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netatalk Update for MBUFTRACE.



details:   https://anonhg.NetBSD.org/src/rev/b63fa848ad79
branches:  trunk
changeset: 543475:b63fa848ad79
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Feb 26 07:53:04 2003 +0000

description:
Update for MBUFTRACE.

diffstat:

 sys/netatalk/aarp.c       |  20 +++++++++++++-------
 sys/netatalk/at_extern.h  |   5 ++++-
 sys/netatalk/ddp_input.c  |  13 ++++++++-----
 sys/netatalk/ddp_output.c |   5 +++--
 sys/netatalk/ddp_usrreq.c |  16 ++++++++++++++--
 5 files changed, 42 insertions(+), 17 deletions(-)

diffs (212 lines):

diff -r 416aefea24e3 -r b63fa848ad79 sys/netatalk/aarp.c
--- a/sys/netatalk/aarp.c       Wed Feb 26 07:49:02 2003 +0000
+++ b/sys/netatalk/aarp.c       Wed Feb 26 07:53:04 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aarp.c,v 1.11 2003/01/28 22:26:35 wiz Exp $    */
+/*     $NetBSD: aarp.c,v 1.12 2003/02/26 07:53:04 matt Exp $   */
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aarp.c,v 1.11 2003/01/28 22:26:35 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aarp.c,v 1.12 2003/02/26 07:53:04 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -85,18 +85,21 @@
 extern u_char   etherbroadcastaddr[6];
 #endif /* __FreeBSD__ */
 
-u_char atmulticastaddr[6] = {
+const u_char atmulticastaddr[6] = {
        0x09, 0x00, 0x07, 0xff, 0xff, 0xff
 };
 
-u_char at_org_code[3] = {
+const u_char at_org_code[3] = {
        0x08, 0x00, 0x07
 };
-u_char aarp_org_code[3] = {
+const u_char aarp_org_code[3] = {
        0x00, 0x00, 0x00
 };
 
 struct callout aarptimer_callout;
+#ifdef MBUFTRACE
+struct mowner aarp_mowner = { "atalk", "arp" };
+#endif
 
 /*ARGSUSED*/
 static void
@@ -167,6 +170,7 @@
        if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL)
                return;
 
+       MCLAIM(m, &aarp_mowner);
        m->m_len = sizeof(*ea);
        m->m_pkthdr.len = sizeof(*ea);
        MH_ALIGN(m, sizeof(*ea));
@@ -508,6 +512,7 @@
                first = 0;
                callout_init(&aarptimer_callout);
                callout_reset(&aarptimer_callout, hz, aarptimer, NULL);
+               MOWNER_ATTACH(&aarp_mowner);
        }
        aat = &aarptab[AARPTAB_HASH(*addr) * AARPTAB_BSIZ];
        for (n = 0; n < AARPTAB_BSIZ; n++, aat++) {
@@ -568,9 +573,10 @@
                callout_reset(&aa->aa_probe_ch, hz / 5, aarpprobe, arp);
        }
 
-       if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL) {
+       if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL)
                return;
-       }
+
+       MCLAIM(m, &aarp_mowner);
        m->m_len = sizeof(*ea);
        m->m_pkthdr.len = sizeof(*ea);
        MH_ALIGN(m, sizeof(*ea));
diff -r 416aefea24e3 -r b63fa848ad79 sys/netatalk/at_extern.h
--- a/sys/netatalk/at_extern.h  Wed Feb 26 07:49:02 2003 +0000
+++ b/sys/netatalk/at_extern.h  Wed Feb 26 07:53:04 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: at_extern.h,v 1.5 2000/02/02 23:28:09 thorpej Exp $    */
+/*     $NetBSD: at_extern.h,v 1.6 2003/02/26 07:53:04 matt Exp $       */
 
 /*
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
@@ -38,6 +38,9 @@
 struct route;
 struct socket;
 
+extern struct mowner atalk_rx_mowner;
+extern struct mowner atalk_tx_mowner;
+
 void   atintr          __P((void));
 void   aarpprobe       __P((void *));
 int    aarpresolve     __P((struct ifnet *, struct mbuf *,
diff -r 416aefea24e3 -r b63fa848ad79 sys/netatalk/ddp_input.c
--- a/sys/netatalk/ddp_input.c  Wed Feb 26 07:49:02 2003 +0000
+++ b/sys/netatalk/ddp_input.c  Wed Feb 26 07:53:04 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ddp_input.c,v 1.7 2001/11/15 09:48:26 lukem Exp $       */
+/*     $NetBSD: ddp_input.c,v 1.8 2003/02/26 07:53:04 matt Exp $        */
 
 /*
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ddp_input.c,v 1.7 2001/11/15 09:48:26 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ddp_input.c,v 1.8 2003/02/26 07:53:04 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -73,9 +73,10 @@
 
                splx(s);
 
-               if (m == 0) {   /* no more queued packets */
+               if (m == 0)     /* no more queued packets */
                        break;
-               }
+
+               m_claim(m, &atalk_rx_mowner);
                ifp = m->m_pkthdr.rcvif;
                for (aa = at_ifaddr.tqh_first; aa; aa = aa->aa_list.tqe_next) {
                        if (aa->aa_ifp == ifp && (aa->aa_flags & AFA_PHASE2))
@@ -95,9 +96,11 @@
 
                splx(s);
 
-               if (m == 0) /* no more queued packets */
+               if (m == 0)     /* no more queued packets */
 
                        break;
+
+               m_claim(m, &atalk_rx_mowner);
                ifp = m->m_pkthdr.rcvif;
                for (aa = at_ifaddr.tqh_first; aa; aa = aa->aa_list.tqe_next) {
                        if (aa->aa_ifp == ifp &&
diff -r 416aefea24e3 -r b63fa848ad79 sys/netatalk/ddp_output.c
--- a/sys/netatalk/ddp_output.c Wed Feb 26 07:49:02 2003 +0000
+++ b/sys/netatalk/ddp_output.c Wed Feb 26 07:53:04 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ddp_output.c,v 1.5 2003/02/26 06:31:14 matt Exp $       */
+/*     $NetBSD: ddp_output.c,v 1.6 2003/02/26 07:53:04 matt Exp $       */
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ddp_output.c,v 1.5 2003/02/26 06:31:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ddp_output.c,v 1.6 2003/02/26 07:53:04 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -169,6 +169,7 @@
          */
        if (!(aa->aa_flags & AFA_PHASE2)) {
                m0 = m_get(M_WAIT, MT_HEADER);
+               MCLAIM(m0, m->m_owner);
                m0->m_next = m;
                /* XXX perhaps we ought to align the header? */
                m0->m_len = SZ_ELAPHDR;
diff -r 416aefea24e3 -r b63fa848ad79 sys/netatalk/ddp_usrreq.c
--- a/sys/netatalk/ddp_usrreq.c Wed Feb 26 07:49:02 2003 +0000
+++ b/sys/netatalk/ddp_usrreq.c Wed Feb 26 07:53:04 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ddp_usrreq.c,v 1.7 2002/05/12 21:43:23 matt Exp $       */
+/*     $NetBSD: ddp_usrreq.c,v 1.8 2003/02/26 07:53:05 matt Exp $       */
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.7 2002/05/12 21:43:23 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.8 2003/02/26 07:53:05 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/errno.h>
@@ -64,6 +64,11 @@
 u_long ddp_sendspace = DDP_MAXSZ;      /* Max ddp size + 1 (ddp_type) */
 u_long ddp_recvspace = 25 * (587 + sizeof(struct sockaddr_at));
 
+#ifdef MBUFTRACE
+struct mowner atalk_rx_mowner = { "atalk", "rx" };
+struct mowner atalk_tx_mowner = { "atalk", "tx" };
+#endif
+
 /* ARGSUSED */
 int
 ddp_usrreq(so, req, m, addr, rights, p)
@@ -450,6 +455,10 @@
 
        ddp->ddp_socket = so;
        so->so_pcb = (caddr_t) ddp;
+#ifdef MBUFTRACE
+       so->so_rcv.sb_mowner = &atalk_rx_mowner;
+       so->so_snd.sb_mowner = &atalk_tx_mowner;
+#endif
        return (0);
 }
 
@@ -549,6 +558,9 @@
        TAILQ_INIT(&at_ifaddr);
        atintrq1.ifq_maxlen = IFQ_MAXLEN;
        atintrq2.ifq_maxlen = IFQ_MAXLEN;
+
+       MOWNER_ATTACH(&atalk_tx_mowner);
+       MOWNER_ATTACH(&atalk_rx_mowner);
 }
 
 #if 0



Home | Main Index | Thread Index | Old Index