[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-net
Subject:    Re: IpInDelivers counter raw vs icmp bug/help?
From:       Mark Price <mkprice () us ! ibm ! com>
Date:       2001-08-31 17:18:38
[Download RAW message or body]


Andi & Folks,

I've been testing the modifications I made to a number of the network
counters, and I have issues with a couple of things I found in the code
and wanted to run it past the list.

In udp_queue_rcv_skb() we increment IpInDiscards and also decrement
IpInDelivers if it fails a checksum (in CONFIG_NETFILTER) or the receive
queue is full and the skb is dropped.

I don't think this is really a valid thing to do, IP successfully
delivered the packet to udp and should not have its delivered or discarded
counts modified by another layer. I think the correct thing to do in both
of these cases in increment UdpInErrors (which it already does) and drop
the skb.

Any feelings on this??

Cheers, Mark.


On Wed, 15 Aug 2001, Andi Kleen wrote:

> On Wed, Aug 15, 2001 at 11:00:47AM +0000, mprice wrote:
> >
> > Hi Folks,
> >
> > I've been working on fixing some of the kernel level network counters
> > which are used by SNMP, and need a little advice. This is in the 2.4.2
> > kernel, but appears to be the same in 2.4.7.
> >
> > One of bugs is related to IpInDelivers which is not incremented when an
> > incoming ICMP is delivered to icmp_rcv(). Looked like an easy enough fix
> > by calling IP_INC_STATS_BH(IpInDelivers) at the top of icmp_rcv().
>
> I think it would be a better fix to move the counter increase
> to ip_local_deliver and remove these from the protocols.
>
> There are also some other counters missing, for example there are still
> out of memory situations where packets are dropped silently without
> any counter getting increased.
>
> > increment the IpInDelivers. Sort of nasty, looking at different level.
> >
> > 2. Don't increment IpInDelivers at all in the raw code.
> >
> > 3. Let it increment it twice as it was delivered to two different
> > handlers. Although this then leads to rather odd counters where
> > IpInDelivers is larger than IpInReceives.
>
> If you move it to ip_local_deliver it comes natural -- increment it once
> either in the fast path or if flag != 0.
> Make sure to do it before the function call in the fast path to allow
> the compiler to do sibling call optimization.
>
>
> -Andi
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic