From owner-svn-src-user@FreeBSD.ORG Sat Feb 6 23:47:56 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EABAD1065676; Sat, 6 Feb 2010 23:47:55 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB1EC8FC16; Sat, 6 Feb 2010 23:47:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o16NltwO074932; Sat, 6 Feb 2010 23:47:55 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o16NltC8074929; Sat, 6 Feb 2010 23:47:55 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201002062347.o16NltC8074929@svn.freebsd.org> From: Kip Macy Date: Sat, 6 Feb 2010 23:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203580 - user/kmacy/head_flowtable_v6/sys/net X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2010 23:47:56 -0000 Author: kmacy Date: Sat Feb 6 23:47:55 2010 New Revision: 203580 URL: http://svn.freebsd.org/changeset/base/203580 Log: narrow debugging output Modified: user/kmacy/head_flowtable_v6/sys/net/flowtable.c user/kmacy/head_flowtable_v6/sys/net/flowtable.h Modified: user/kmacy/head_flowtable_v6/sys/net/flowtable.c ============================================================================== --- user/kmacy/head_flowtable_v6/sys/net/flowtable.c Sat Feb 6 23:30:09 2010 (r203579) +++ user/kmacy/head_flowtable_v6/sys/net/flowtable.c Sat Feb 6 23:47:55 2010 (r203580) @@ -187,14 +187,14 @@ static struct mtx flowclean_lock; static uint32_t flowclean_cycles; #ifdef FLOWTABLE_DEBUG -#define FLDPRINTF(ft, fmt, ...) \ +#define FLDPRINTF(ft, flags, fmt, ...) \ do { \ - if ((ft)->ft_flags & FL_DEBUG) \ + if ((ft)->ft_flags & (flags)) \ printf((fmt), __VA_ARGS__); \ } while (0); \ #else -#define FLDPRINTF(ft, fmt, ...) +#define FLDPRINTF(ft, flags, fmt, ...) #endif @@ -473,7 +473,7 @@ ipv4_mbuf_demarshal(struct flowtable *ft ssin->sin_addr = ip->ip_dst; if ((*flags & FL_HASH_ALL) == 0) { - FLDPRINTF(ft, "skip port check flags=0x%x ", + FLDPRINTF(ft, FL_DEBUG_ALL, "skip port check flags=0x%x ", *flags); goto skipports; } @@ -501,7 +501,7 @@ ipv4_mbuf_demarshal(struct flowtable *ft dport = sh->dest_port; break; default: - FLDPRINTF(ft, "proto=0x%x not supported\n", proto); + FLDPRINTF(ft, FL_DEBUG_ALL, "proto=0x%x not supported\n", proto); return (ENOTSUP); /* no port - hence not a protocol we care about */ break; @@ -513,16 +513,16 @@ skipports: ssin->sin_port = sport; dsin->sin_port = dport; #ifdef FLOWTABLE_DEBUG - if (*flags & FL_HASH_ALL) { + if (*flags & (FL_HASH_ALL|FL_DEBUG_ALL)) { char saddr[4*sizeof "123"], daddr[4*sizeof "123"]; inet_ntoa_r(*(struct in_addr *) &ip->ip_dst, daddr); inet_ntoa_r(*(struct in_addr *) &ip->ip_src, saddr); - FLDPRINTF(ft, "proto=%d %s:%d->%s:%d\n", + FLDPRINTF(ft, FL_DEBUG_ALL, "proto=%d %s:%d->%s:%d\n", proto, saddr, ntohs(sport), daddr, ntohs(dport)); } else { char daddr[4*sizeof "123"]; inet_ntoa_r(*(struct in_addr *) &ip->ip_dst, daddr); - FLDPRINTF(ft, "proto=%d %s\n", proto, daddr); + FLDPRINTF(ft, FL_DEBUG_ALL, "proto=%d %s\n", proto, daddr); } #endif return (0); @@ -951,7 +951,8 @@ kern_flowtable_insert(struct flowtable * if (ro->ro_rt == NULL || ro->ro_lle == NULL) return (EINVAL); - FLDPRINTF(ft, "kern_flowtable_insert: hash=0x%x fibnum=%d flags=0x%x\n", + FLDPRINTF(ft, FL_DEBUG, + "kern_flowtable_insert: hash=0x%x fibnum=%d flags=0x%x\n", hash, fibnum, flags); return (flowtable_insert(ft, hash, key, fibnum, ro, flags)); } @@ -1051,7 +1052,7 @@ flowtable_lookup(struct flowtable *ft, s goto uncached; } keycheck: - FLDPRINTF(ft, "doing keycheck on fle=%p hash=0x%x\n", + FLDPRINTF(ft, FL_DEBUG, "doing keycheck on fle=%p hash=0x%x\n", fle, fle->f_fhash); proto = flags_to_proto(flags); rt = __DEVOLATILE(struct rtentry *, fle->f_rt); Modified: user/kmacy/head_flowtable_v6/sys/net/flowtable.h ============================================================================== --- user/kmacy/head_flowtable_v6/sys/net/flowtable.h Sat Feb 6 23:30:09 2010 (r203579) +++ user/kmacy/head_flowtable_v6/sys/net/flowtable.h Sat Feb 6 23:47:55 2010 (r203580) @@ -42,6 +42,7 @@ $FreeBSD$ #define FL_SCTP (1<<12) #define FL_UDP (1<<13) #define FL_DEBUG (1<<14) +#define FL_DEBUG_ALL (1<<15) struct flowtable; struct flentry;