From nobody Mon Aug 30 07:30:35 2021 X-Original-To: freebsd-net@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 CD9C51789119 for ; Mon, 30 Aug 2021 07:30:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 4GyhnS47knz4bqb for ; Mon, 30 Aug 2021 07:30:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id AF43726026C; Mon, 30 Aug 2021 09:30:44 +0200 (CEST) Subject: Re: Creating/destroying bulk VLAN interfaces takes too long To: =?UTF-8?Q?=c3=96zkan_KIRIK?= , FreeBSD Net References: From: Hans Petter Selasky Message-ID: Date: Mon, 30 Aug 2021 09:30:35 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4GyhnS47knz4bqb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 8/30/21 9:13 AM, Özkan KIRIK wrote: > Hello, > > I'm using FreeBSD stable/12. Creating/destroying bulk vlan interfaces takes > too long to finish. Running parallel doesn't matter. > Is there any fast way to create 100 vlan interfaces? > > seq 1 100 | /usr/bin/time xargs -t -n 1 -I % ifconfig em1.% create > ... > ifconfig em1.99 create > ifconfig em1.100 create > 14.78 real 0.03 user 1.19 sys > > with 4 parallel workers: > seq 1 100 | /usr/bin/time xargs -t -P4 -n 1 -I % ifconfig em1.% create > ... > ifconfig em1.99 create > ifconfig em1.100 create > 14.46 real 0.03 user 1.20 sys > > destroying: > ifconfig -g vlan | /usr/bin/time xargs -t -n 1 -I % ifconfig % destroy > ... > ifconfig em1.98 destroy > ifconfig em1.100 destroy > 21.89 real 0.03 user 1.64 sys > > Any suggestions? > Creating VLAN interfaces sometimes involve firmware commands on the network devices which take time. --HPS