From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [patch iproute2 v10 0/2] tc: Add batchsize feature to batch mode Date: Mon, 15 Jan 2018 09:40:39 -0700 Message-ID: <680aeeb2-b151-c746-bb3b-502491908373@gmail.com> References: <20180112051316.30220-1-chrism@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: gerlitz.or@gmail.com, stephen@networkplumber.org, marcelo.leitner@gmail.com, phil@nwl.cc To: Chris Mi , netdev@vger.kernel.org Return-path: Received: from mail-pg0-f68.google.com ([74.125.83.68]:35965 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933790AbeAOQkl (ORCPT ); Mon, 15 Jan 2018 11:40:41 -0500 Received: by mail-pg0-f68.google.com with SMTP id k68so576702pga.3 for ; Mon, 15 Jan 2018 08:40:41 -0800 (PST) In-Reply-To: <20180112051316.30220-1-chrism@mellanox.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 1/11/18 10:13 PM, Chris Mi wrote: > Currently in tc batch mode, only one command is read from the batch > file and sent to kernel to process. With this patchset, at most 128 > commands can be accumulated before sending to kernel. > > We introduced a new function in patch 1 to support for sending > multiple messages. In patch 2, we add this support for filter > add/delete/change/replace and actions add/change/replace commands. > > But please note that kernel still processes the requests one by one. > To process the requests in parallel in kernel is another effort. > The time we're saving in this patchset is the user mode and kernel mode > context switch. So this patchset works on top of the current kernel. > > Using the following script in kernel, we can generate 1,000,000 rules. > tools/testing/selftests/tc-testing/tdc_batch.py > > Without this patchset, 'tc -b $file' exection time is: > > real 0m15.555s > user 0m7.211s > sys 0m8.284s > > With this patchset, 'tc -b $file' exection time is: > > real 0m12.360s > user 0m6.082s > sys 0m6.213s > > The insertion rate is improved more than 10%. LGTM. Applied to iproute2-next.