From owner-svn-src-head@FreeBSD.ORG Thu May 24 16:38:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27F1C106575A; Thu, 24 May 2012 16:38:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9C22B8FC0A; Thu, 24 May 2012 16:38:25 +0000 (UTC) Message-ID: <4FBE6401.1010009@FreeBSD.org> Date: Thu, 24 May 2012 12:38:25 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0.1 MIME-Version: 1.0 To: "Alexander V. Chernikov" References: <201205212219.q4LMJKR9076035@svn.freebsd.org> <4FBD7E65.1060205@FreeBSD.org> <4FBE1120.8020704@FreeBSD.org> In-Reply-To: <4FBE1120.8020704@FreeBSD.org> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235746 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:38:26 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-05-24 06:44:48 -0400, Alexander V. Chernikov wrote: > Does the attached patch look ok to you? Generally looks good. Few nits: - --- bpf.c --- 1713: #ifdef BPF_JITTER 1714: bpf_jit_filter *ofunc, *jfunc; 1715: #endif Please add jfunc before ofunc, i.e., style(9). 1743: if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) != 0 || 1744: (bpf_validate(fcode, (int)flen) == 0)) { 1745: free(fcode, M_BPF); 1746: return (EINVAL); 1747: } Excessive parens @ L1744. 1752: #ifdef BPF_JITTER 1753: if (fp->bf_insns != NULL) 1754: jfunc = bpf_jitter(fcode, flen); 1755: else 1756: jfunc = NULL; /* Make compiler happy */ 1757: #endif Please test 'fcode' instead of 'fp->bf_insns' for consistency. - --- bpf_jitter.c --- 72: #ifdef _KERNEL 73: filter = (struct bpf_jit_filter *)malloc(sizeof(*filter), 74: M_BPFJIT, M_WAITOK); 75: #else This change is bogus because bpf_jit_compile() does more malloc(9) calls with M_NOWAIT, bpf_jitter() failures are not fatal (i.e., all consumers fall back to bpf_filter(9)), all consumers (e.g., ng_bpf.c) assume M_NOWAIT, etc, etc... Please note I haven't looked at other locking changes. Thanks, Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk++ZAAACgkQmlay1b9qnVObOgCfZmKOtPC8BhsnUK4I9LC5fW53 ePwAnipYRZFYNSi/5KFs2J3+L62zUMId =CASZ -----END PGP SIGNATURE-----