Am Mittwoch, 4. Juli 2007 schrieb Rusty Russell:
> +static void try_fill_recv(struct virtnet_info *vi)
> +{
> +     struct sk_buff *skb;
> +     struct scatterlist sg[MAX_SKB_FRAGS];
> +     int num, err;
> +
> +     for (;;) {
> +             skb = netdev_alloc_skb(vi->ndev, MAX_PACKET_LEN);
> +             if (unlikely(!skb))
> +                     break;
> +
> +             skb_put(skb, MAX_PACKET_LEN);
> +             num = skb_to_sgvec(skb, sg, 0, skb->len);
> +             skb_queue_head(&vi->recv, skb);
> +
> +             err = vi->vq_recv->ops->add_buf(vi->vq_recv, sg, 0, num, skb);
> +             if (err) {
> +                     skb_unlink(skb, &vi->recv);
> +                     kfree_skb(skb);
> +                     break;
> +             }
> +             vi->num++;
> +     }

Hmm, so it allocates skbs until oom or until add_buf fails, right?

Do you expect the add_buf call to fail if we have enough buffers? Who defines 
the amount of buffers we can add via add_buf?


-- 
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Herbert Kircher 
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/virtualization

Reply via email to