From owner-freebsd-ipfw@freebsd.org Sun Apr 12 21:01:08 2020 Return-Path: Delivered-To: freebsd-ipfw@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46A392A9203 for ; Sun, 12 Apr 2020 21:01:08 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 490kgR6823z4fQs for ; Sun, 12 Apr 2020 21:01:07 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id C54CB2A91F8; Sun, 12 Apr 2020 21:01:07 +0000 (UTC) Delivered-To: ipfw@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFD162A91F6 for ; Sun, 12 Apr 2020 21:01:07 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 490kgR2grPz4fQT for ; Sun, 12 Apr 2020 21:01:07 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C83CA7F3E for ; Sun, 12 Apr 2020 21:01:06 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 03CL16sb090774 for ; Sun, 12 Apr 2020 21:01:06 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 03CL16KR090767 for ipfw@FreeBSD.org; Sun, 12 Apr 2020 21:01:06 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <202004122101.03CL16KR090767@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: ipfw@FreeBSD.org Subject: Problem reports for ipfw@FreeBSD.org that need special attention Date: Sun, 12 Apr 2020 21:01:06 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2020 21:01:08 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- New | 215875 | [ipfw] ipfw lookup tables do not support mbuf_tag New | 232764 | [ipfw] share/examples/ipfw/change_rules.sh: Suppo 2 problems total for which you should take action. From owner-freebsd-ipfw@freebsd.org Sun Apr 12 23:14:06 2020 Return-Path: Delivered-To: freebsd-ipfw@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A77C12AC7DF; Sun, 12 Apr 2020 23:14:06 +0000 (UTC) (envelope-from abb@abbon.net) Received: from c4.eksi.net (c4.eksi.net [91.201.188.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "c4.eksi.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 490ncr1XXJz3Kly; Sun, 12 Apr 2020 23:14:03 +0000 (UTC) (envelope-from abb@abbon.net) Received: from C4.Eksi.Net (localhost [127.0.0.1]) by c4.eksi.net (OpenSMTPD) with ESMTP id 04de5379; Mon, 13 Apr 2020 02:13:53 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=abbon.net; h=reply-to :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=default; bh=9sBsHcyINHk+Y/Ph2zyOA/SbxPE=; b=hVkwpXnpxWk23Jd96tYzlWY4Bgnx QVqgH58CL623HhqvQ2Wry5VmdIn9LE4ld+eXw3EtlGL12SSapYVuGXfNxNEDtUSu WYuxzgWDWo/i8jSL5VKTl2tuAylIP9e8Q3vm3eARzp6itKAWypSKz9TDsQhaR+Pz Q4K+8y8GJhifgDPxgjpqTnZcCoO1rIJeKPfXqhCBpXISNJX5s9/WxSbby9RSt0uz 83RL4muGucg0MfcO5VzivW/M5dVL2brVxfkHT1nfWQkGHYWmPn0bNZWffA7L+N+7 OzXFYzKfA0fzo1H2pLrloR/Xa2rpzJ/02Znpj17DDuyN2zQK4KuTK6DNcA== DomainKey-Signature: a=rsa-sha1; c=nofws; d=abbon.net; h=reply-to :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; q=dns; s= default; b=D1xCuo1QHiEIdGbQczg1M9aUOSmkaSkGWX4GZfH3VVlYau6C2KGEt A8WDYHWV4peiIY9sxf07pgzPF9+SaV5ZpIllCQVxiTQ5LeK3rciWWyOMxPLkbtpw Qtvo8rw7fqCogqzb9T6VMZ1eOWx+sFPf1CygUT9WyX2JrFCSPczHxK8h45eWeUse pDVljQfATatur6RtgrUAwnzVkgVyqKX+1Ex7TrvdFCjbmJcVlUCQW9zCm+90GnZC 3AL/TCpFcOon64o8BSXvakK2sKJJzkFVXtSdAeGKaHNc9Yiuea0+LJcRZ4/mBlpD P3iY7TwVb5KgSoDVicePZfe8tV9ytFLww== Received: from [91.201.188.19] (h0-019.eksi.net [91.201.188.19]) by c4.eksi.net (OpenSMTPD) with ESMTPS id 77ed64d5 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Mon, 13 Apr 2020 02:13:53 +0300 (EEST) Reply-To: Alexandr Baryshnyev Subject: Re: dummynet performance To: "freebsd-net@freebsd.org" , freebsd-ipfw References: From: Alexandr Baryshnyev Message-ID: Date: Mon, 13 Apr 2020 02:13:53 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: ru Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 490ncr1XXJz3Kly X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=abbon.net header.s=default header.b=hVkwpXnp; dmarc=pass (policy=none) header.from=abbon.net; spf=pass (mx1.freebsd.org: domain of abb@abbon.net designates 91.201.188.2 as permitted sender) smtp.mailfrom=abb@abbon.net X-Spamd-Result: default: False [-2.98 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[abbon.net:s=default]; HAS_REPLYTO(0.00)[abb@abbon.net]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:91.201.188.2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(0.01)[country: UA(0.07)]; DKIM_TRACE(0.00)[abbon.net:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[abbon.net,none]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:44411, ipnet:91.201.188.0/22, country:UA]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2020 23:14:06 -0000 Dear Luigi! The fact that the regular FreeBSD shaper Dummynet is still single-threaded is the reason that many people switch to using Linux. This is a real problem that really limits the use of the FreeBSD system as a high-speed router and shaper. I understand that this is not an easy task, but most likely no one but you can do it now. Please, correct the source code of the Dummynet and make it multi-threaded! I think a lot of people who still use FreeBSD will be very grateful to you. Can we hope that this problem will be resolved by you in the foreseeable future? In any case, thank you very much for your work! 09.04.2020 20:28, Luigi Rizzo wrote: > On Thu, Apr 9, 2020 at 2:18 AM Özkan KIRIK wrote: >> >> Hello, >> >> I wonder if it is possible to update dummynet code multi-threading capable >> practically? >> My idea is below: >> - A new sysctl tunable will be defined as >> "net.inet.ip.dummynet.thread_count" (default 1) >> - To distribute tasks along threads, each sched instance can be assigned to >> different thread. >> - By default, all schedulers assigned to thread 0 if no thread_id is set. >> With a new option named "thr_id" affinity can be set. as below: >> ipfw sched 1 config type QFQ (by defaut thr_id = 0) >> ipfw sched 2 config type QFQ thr_id 1 >> ipfw sched 3 config type QFQ thr_id 2 >> ipfw sched 4 config type FIFO thr_id 3 >> ipfw sched 5 config type FIFO thr_id 3 ( sched 4 & 5 assigned to same >> thread 3 ) >> >> I think this approach is more easy then completely rewrite or other >> solutions. >> > > This change may not be completely trivial given that dummynet was designed as > single threaded and protected by a single lock. > > If you want to proceed, you should do as follows: > - some members of struct dn_parms need to be duplicated for each thread, > including prev_t, evheap, curr_time, the locks, and perhaps others. > Probably may be useful to create a new struct for them, with a back > pointer to the parent dn_parms, and include a refcount. > > - add another rwlock to protect access to dn_cfg > > - dummynet_io() does the initial demultiplexing calling dn_ht_find(), > currently protected DN_BH_WLOCK(). This could be changed to an RWLOCK > and I believe this initial step could be protected by a read lock > (maybe there are corner cases where you need to create a new entry > so you need to drop the lock, acquire in write mode and retry...) > > - once the demux has returned a dn_fsk, maybe you can use a refcount > to avoid the object being destroyed, release the read lock on > dn_cfg.fshash, acquire an exclusive lock on the thread handling the > dn_fsk, and proceed from there. > > - the kernel thread that process the heap should now run each on > one instance of the evheap > > cheers > luigi > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- Best regards, Alexandr B. Baryshnyev, e-mail: abb@abbon.net