Re: [PATCH] net/ipv4/route.c, kernel 2.4.20

David S. Miller (davem@redhat.com)
03 May 2003 00:29:01 -0700


On Fri, 2003-04-18 at 04:22, Arcady Stepanov wrote:
> The patch is trivial:

This patch is wrong.

> /* IP route accounting ptr for this logical cpu number. */
> -#define IP_RT_ACCT_CPU(i) (ip_rt_acct + cpu_logical_map(i) * 256)
> +#define IP_RT_ACCT_CPU(i) ((u8*)ip_rt_acct + cpu_logical_map(i) * 256)

There is no way this can be correct. Look at the formula used
by ip_input.c, which is:

struct ip_rt_acct *st = ip_rt_acct + 256*smp_processor_id();

So there is only two possibilities, either your patch is wrong
or this code in ip_input.c is wrong.

You probably want to keep IP_RT_ACCT_CPU() how it is, cast _THAT_
to "u8 *" then add in the offset.

Also, you'd get a response more quickly if you had sent this to
the networking development lists (linux-net and netdev@oss.sgi.com)
CC:'ing the networking maintainers (myself and Alexey Kuznetsov).
I came across this posting by pure luck.

linux-kernel is effectively /dev/null for some of us on many days.
Just like ipv4 and ipv6, linux kernel is an unreliable transport.

-- 
David S. Miller <davem@redhat.com>
-
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/