lkml.org 
[lkml]   [2014]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net-next v3 8/9] net: filter: rework/optimize internal BPF interpreter's instruction set
From
From: Daniel Borkmann <dborkman@redhat.com>
Date: Wed, 26 Mar 2014 22:06:09 +0100

> - Adds swab insns for 32/64-bit

I don't like this.

You don't want a swab instruction, you want "endian X to endian Y". Just
like we have "cpu_to_le32()", "le32_to_cpu()" et al. in the kernel.

That way the user can be completely oblivious as to the endianness of
the cpu it's running on.

So if you ask for a "to little endian" swab, if the chip is
little-endian then no code needs to be emitted at all, it's a nop.

There is zero reason for the BPF program emitted by userspace to be
dependant upon the cpu endianness.


\
 
 \ /
  Last update: 2014-03-27 20:41    [W:0.053 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site