Re: [patch] fixed af_packet to not lose frames and made us crazy in

Andrea Arcangeli (andrea@e-mind.com)
Sun, 14 Mar 1999 20:23:12 +0100 (CET)


On Sun, 14 Mar 1999, Andrea Arcangeli wrote:

>A counter seems a best choice than a printk. Agreed.

In the SOCK_RAW code there's just something like that:

static int raw_rcv_skb(struct sock * sk, struct sk_buff * skb)
{
/* Charge it to the socket. */

if (sock_queue_rcv_skb(sk,skb)<0)
{
ip_statistics.IpInDiscards++;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kfree_skb(skb);
return -1;
}

ip_statistics.IpInDelivers++;
return 0;
}

If as you said af_packet is just backwards compatibity code, I think we
are just ok and for debugging we only need to increase rmem_default and
look at the number of discarded packets.

But I have to say that I tried to recompile tcpdump only changing the two
occourence of SOCK_PACKET to SOCK_RAW and tcpdump started working only on
`lo' and not `eth0'.

I am not going into this `packet/raw rcvbuf size' issue right now though.
I am just quite happy to know exactly the reason of the lost frames and
how to fast workaround the problem (or via rmem_default or with my
previous patches).

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/