From nobody Tue Dec 26 15:22:22 2023 X-Original-To: freebsd-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Szz6K53tqz551DH for ; Tue, 26 Dec 2023 15:22:33 +0000 (UTC) (envelope-from shuriku@shurik.kiev.ua) Received: from mail.flex-it.com.ua (mail.flex-it.com.ua [193.239.74.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Szz6J60YXz4Nvc for ; Tue, 26 Dec 2023 15:22:32 +0000 (UTC) (envelope-from shuriku@shurik.kiev.ua) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of shuriku@shurik.kiev.ua designates 193.239.74.7 as permitted sender) smtp.mailfrom=shuriku@shurik.kiev.ua; dmarc=none Received: from 93.183.208.50.ipv4.datagroup.ua ([93.183.208.50] helo=[192.168.200.105]) by mail.flex-it.com.ua with esmtpsa (TLS1.3) tls TLS_AES_128_GCM_SHA256 (Exim 4.96.2 (FreeBSD)) (envelope-from ) id 1rI9GA-000BQo-2G for freebsd-bugs@freebsd.org; Tue, 26 Dec 2023 17:22:22 +0200 Message-ID: <334e52e6-11e1-4661-b343-f9f0b0496406@shurik.kiev.ua> Date: Tue, 26 Dec 2023 17:22:22 +0200 List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Bug 275943] PF Ether Rules : High Cpu Usage Content-Language: uk-UA To: freebsd-bugs@freebsd.org References: From: Oleksandr Kryvulia In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ACL-Warn: SPF failed. 93.183.208.50 is not allowed to send mail from shurik.kiev.ua. X-Spamd-Result: default: False [-3.26 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.971]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; MLMMJ_DEST(0.00)[freebsd-bugs@freebsd.org]; R_DKIM_NA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:35297, ipnet:193.239.72.0/22, country:UA]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[shurik.kiev.ua]; TO_DN_NONE(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4Szz6J60YXz4Nvc X-Spamd-Bar: --- 26.12.23 13:34, bugzilla-noreply@freebsd.org: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275943 > > Bug ID: 275943 > Summary: PF Ether Rules : High Cpu Usage > Product: Base System > Version: 14.0-RELEASE > Hardware: amd64 > OS: Any > Status: New > Severity: Affects Only Me > Priority: --- > Component: kern > Assignee: bugs@FreeBSD.org > Reporter: 32carleone@gmail.com > > Hi > > When I use pf as Layer3, I don't encounter any performance issues. However, > when I enable Layer2, the CPU usage goes up to 100% and I loose throughput. > > Below is htop and iperf during Layer3 > > ``` > 0[ 15.7% ] > 1[ 12.6% ] > 2[ 65.4% ] > 3[ 9.4% ] > Mem[ 1.74G/3.86G ] > Swp[ 0K/3.79G ] > > > # iperf3 -c 192.168.1.236 -t 30 -p 5201 > > [ ID] Interval Transfer Bitrate > [ 5] 0.00-1.00 sec 111 MBytes 930 Mbits/sec > [ 5] 1.00-2.00 sec 111 MBytes 933 Mbits/sec > [ 5] 2.00-3.00 sec 111 MBytes 933 Mbits/sec > [ 5] 3.00-4.00 sec 111 MBytes 934 Mbits/sec > [ 5] 4.00-5.00 sec 111 MBytes 933 Mbits/sec > > ``` > > And output for Layer2+Layer3 > > ``` > 0[ 12.0% ] > 1[ 7.7% ] > 2[ 100.0% ] > 3[ 4.3% ] > Mem[ 1.73G/3.86G ] > Swp[ 0K/3.79G ] > > > > # iperf3 -c 192.168.1.236 -t 30 -p 5201 > > [ ID] Interval Transfer Bitrate > [ 5] 0.00-1.00 sec 52.0 MBytes 436 Mbits/sec > [ 5] 1.00-2.00 sec 79.7 MBytes 669 Mbits/sec > [ 5] 2.00-3.00 sec 79.5 MBytes 667 Mbits/sec > [ 5] 3.00-4.00 sec 79.6 MBytes 668 Mbits/sec > [ 5] 4.00-5.00 sec 79.4 MBytes 666 Mbits/sec > > ``` > > > > > Issues arose after I added this rule to my config file > ``` > ether anchor "allowed_mac_igb1" on { igb1 } > ``` > > > And these are the rules in the anchor > ``` > ether pass in quick from 00:0c:29:4e:df:8e l3 all tag allowed_mac_igb1 dnpipe > 1002 > ether pass out quick to 00:0c:29:4e:df:8e l3 all tag allowed_mac_igb1 dnpipe 2 > ether pass in quick from 00:0c:29:97:15:80 l3 all tag allowed_mac_igb1 dnpipe > 1002 > ether pass out quick to 00:0c:29:97:15:80 l3 all tag allowed_mac_igb1 dnpipe 2 > ether pass in quick from 00:11:32:52:54:3a l3 all tag allowed_mac_igb1 dnpipe > 1002 > ether pass out quick to 00:11:32:52:54:3a l3 all tag allowed_mac_igb1 dnpipe 2 > .. +270 line > ``` > As I can see you have single core loaded to 100%. Can it be imact of using dnpipe and not layer2 filtering?