From owner-freebsd-pf@freebsd.org Thu Mar 15 19:50:24 2018 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 986D3F4D987 for ; Thu, 15 Mar 2018 19:50:24 +0000 (UTC) (envelope-from srs0=ylaz=gf=sigsegv.be=kristof@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33A2D7495D for ; Thu, 15 Mar 2018 19:50:23 +0000 (UTC) (envelope-from srs0=ylaz=gf=sigsegv.be=kristof@codepro.be) Received: from [10.0.2.164] (ptr-8ripyyfm83ivzb6penw.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:502c:15e7:1d57:d87c]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 705D624A43; Thu, 15 Mar 2018 20:50:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sigsegv.be; s=mail; t=1521143422; bh=euMEk7PPCPi2MuMNKVm6+F4SpwjCKRe8OkVqvNzuE0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BCD6//MPpi8EekMTQcMPeW6LcRtf4FehStPJ506198m1gVYa5ZSJzPFslcc2Fsbbh 9YJB7MDSoGQuemn7CjkP+CfSBNlHqmp71coWZpwdGgdAbpILEXgDLyO7JzQHlCt9Vg s251Ckayv+Rew/vIl17/1EmHwl1eCDet4YcrS4y8= From: "Kristof Provost" To: "Steven Crangle" Cc: freebsd-pf@freebsd.org Subject: Re: Required modification for round robin napt with ip address prefixes Date: Thu, 15 Mar 2018 20:50:45 +0100 X-Mailer: MailMate (2.0BETAr6106) Message-ID: <8AE55F12-E53E-40BE-A99A-CB8D9B306806@sigsegv.be> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 19:50:24 -0000 On 14 Mar 2018, at 18:30, Steven Crangle wrote: > I was looking for some advice on the type of locking required to stop > a box panicking that utilises both napt and ip address prefixes. > > My colleague made a post a while ago, and we ended up getting > distracted fixing other panics that showed up. But we've now returned > to try and figure out the issue. > > > The relevant code is in pf_lb.c : 424 > I’d recommend talking to glebius@. He did the locking code and wrote the comment block discussing the locking choices around PF_POOL_ROUNDROBIN. I suspect it’s a bit more complicated that a straightforward PF_RULES_WLOCK() would fix. The locking model for pf is pretty complex. I’ve not had the time to really dig into this, so I can’t give more advice right now. Regards, Kristof