On Wed, 2007-07-04 at 08:33 +0200, Bernd Eckenfels wrote:
> In article <[EMAIL PROTECTED]> you wrote:
> > Search for UDP_MIB_INERRORS in linux/net/**.c
> 
> ... but most likely if you see nothing in dmesg (checksum error) it was
> dropped due to a filled up socket buffer.
> 

I checked this and I see that indeed the socket buffer is exhausted; I
fail here:

int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{
        int err = 0;
        int skb_len;

        /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
           number of warnings when compiling with -W --ANK
         */
*here*  if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
            (unsigned)sk->sk_rcvbuf) {
                err = -ENOMEM;
                goto out;
        }

My receive ring allocates 2KB SKBs - when the sender sends small
messages, the packet rate is high and I fail the condition above. To
check my assumption and possibly use as a solution, I would like to
check for all incoming SKBs if they are small to a certain extent, I
will create a new SKB of smaller size and copy the data from the
original SKB. This way I expect to not fail as before. The problem is
that I can't find a proper function from the kernel to do this.
copy_skb() will allocate an SKB with the original size so I don't earn
anything. Can you suggest a way to do this?

Thanks,
Eli

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

Reply via email to