[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1290153111.29509.2.camel@edumazet-laptop>
Date: Fri, 19 Nov 2010 08:51:51 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Changli Gao <xiaosuo@...il.com>
Cc: Hagen Paul Pfeifer <hagen@...u.net>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] net: reduce the lines of code
Le vendredi 19 novembre 2010 à 15:17 +0800, Changli Gao a écrit :
> On Fri, Nov 19, 2010 at 2:35 PM, Hagen Paul Pfeifer <hagen@...u.net> wrote:
> >
> > On Fri, 19 Nov 2010 10:04:44 +0800, Changli Gao <xiaosuo@...il.com> wrote:
> >> Use macros to reduce the regularity lines.
> >
> > This is complete awkward and does not fix anything - on the contrary it
> > makes it harder to understand the code and no advantage is achieved.
> >
>
> Although it doesn't fix anything, It can simplify the adding of new
> BPF instructions, one place in filter_def.h instead of two in
> filter.c. I think if some code can be generated automatically, we'd
> better not write it manually, as the chance of error is less when the
> code is generated automatically.
>
Idea is good, but the way you did it is not.
I have two patches in testing. I'll post them today.
One to remove all the "+ 1" we do in codes[] init
One at check time to replace the divide by a constant instruction
(DIV_K) by a reciprocal one (a multiply at exec time)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists