Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1207166

Re: [PATCH 6/6] MIPS: net: BPF: Introduce BPF ASM helpers

Path csiph.com!eternal-september.org!feeder.eternal-september.org!newsfeed.Update.UU.SE!news.Update.UU.SE!itgate.net!bofh.it!news.nic.it!robomod
From Aurelien Jarno <aurelien@aurel32.net>
Newsgroups linux.kernel, linux.debian.kernel
Subject Re: [PATCH 6/6] MIPS: net: BPF: Introduce BPF ASM helpers
Date Thu, 13 Aug 2015 23:10:02 +0200
Message-ID <pX7BL-62s-9@gated-at.bofh.it> (permalink)
References <pxB2p-6YZ-3@gated-at.bofh.it> <pxB2r-6YZ-49@gated-at.bofh.it>
X-Original-To Markos Chandras <markos.chandras@imgtec.com>
X-Greylist delayed 1323 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Aug 2015 17:05:01 EDT
Mail-Followup-To Markos Chandras <markos.chandras@imgtec.com>, linux-mips@linux-mips.org, netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>, Alexei Starovoitov <ast@plumgrid.com>, Daniel Borkmann <dborkman@redhat.com>, Hannes Frederic Sowa <hannes@stressinduktion.org>, linux-kernel@vger.kernel.org, debian-kernel@lists.debian.org
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 53
Organization linux.* mail to news gateway
X-Original-Cc linux-mips@linux-mips.org, netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>, Alexei Starovoitov <ast@plumgrid.com>, Daniel Borkmann <dborkman@redhat.com>, Hannes Frederic Sowa <hannes@stressinduktion.org>, linux-kernel@vger.kernel.org, debian-kernel@lists.debian.org
X-Original-Date Thu, 13 Aug 2015 22:42:46 +0200
X-Original-Message-ID <20150813204246.GA24857@aurel32.net>
X-Original-References <1433415376-20952-1-git-send-email-markos.chandras@imgtec.com> <1433415376-20952-7-git-send-email-markos.chandras@imgtec.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1207166 linux.debian.kernel:50506

Cross-posted to 2 groups.

Show key headers only | View raw


On 2015-06-04 11:56, Markos Chandras wrote:
> This commit introduces BPF ASM helpers for MIPS and MIPS64 kernels.
> The purpose of this patch is to twofold:
> 
> 1) We are now able to handle negative offsets instead of either
> falling back to the interpreter or to simply not do anything and
> bail out.
> 
> 2) Optimize reads from the packet header instead of calling the C
> helpers
> 
> Because of this patch, we are now able to get rid of quite a bit of
> code in the JIT generation process by using MIPS optimized assembly
> code. The new assembly code makes the test_bpf testsuite happy with
> all 60 test passing successfully compared to the previous
> implementation where 2 tests were failing.
> Doing some basic analysis in the results between the old
> implementation and the new one we can obtain the following
> summary running current mainline on an ER8 board (+/- 30us delta is
> ignored to prevent noise from kernel scheduling or IRQ latencies):
> 
> Summary: 22 tests are faster, 7 are slower and 47 saw no improvement
> 
> with the most notable improvement being the tcpdump tests. The 7 tests
> that seem to be a bit slower is because they all follow the slow path
> (bpf_internal_load_pointer_neg_helper) which is meant to be slow so
> that's not a problem.
> 
> Cc: netdev@vger.kernel.org
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Alexei Starovoitov <ast@plumgrid.com>
> Cc: Daniel Borkmann <dborkman@redhat.com>
> Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
> ---
> I have uploaded the script and the bpf result files in my LMO webspace
> in case you want to have a look. I didn't paste them in here because they
> are nearly 200 lines. Simply download all 3 files and run './bpf_analysis.py'

This patch relies on R2 instructions, and thus the Linux kernel fails to
build when targetting non-R2 CPUs. See for example:

https://buildd.debian.org/status/fetch.php?pkg=linux&arch=mipsel&ver=4.2%7Erc6-1%7Eexp1&stamp=1439480000

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 6/6] MIPS: net: BPF: Introduce BPF ASM helpers Aurelien Jarno <aurelien@aurel32.net> - 2015-08-13 23:10 +0200
  Re: [PATCH 6/6] MIPS: net: BPF: Introduce BPF ASM helpers Markos Chandras <markos.chandras@imgtec.com> - 2015-08-14 10:00 +0200

csiph-web