[ofa-general] Re: [PATCH 3/10 REV5] [sched] Modify qdisc_run to support batching

Evgeniy Polyakov johnpol at 2ka.mipt.ru
Fri Sep 14 05:15:19 PDT 2007


Hi Krishna.

On Fri, Sep 14, 2007 at 02:31:56PM +0530, Krishna Kumar (krkumar2 at in.ibm.com) wrote:
> +int dev_add_skb_to_blist(struct sk_buff *skb, struct net_device *dev)
> +{
> +	if (!list_empty(&ptype_all))
> +		dev_queue_xmit_nit(skb, dev);
> +
> +	if (netif_needs_gso(dev, skb)) {
> +		if (unlikely(dev_gso_segment(skb))) {
> +			kfree_skb(skb);
> +			return 0;
> +		}
> +
> +		if (skb->next) {
> +			int count = 0;
> +
> +			do {
> +				struct sk_buff *nskb = skb->next;
> +
> +				skb->next = nskb->next;
> +				__skb_queue_tail(dev->skb_blist, nskb);
> +				count++;
> +			} while (skb->next);

Could it be list_move()-like function for skb lists?
I'm pretty sure if you change first and the last skbs and ke of the
queue in one shot, result will be the same.
Actually how many skbs are usually batched in your load?

> +			/* Reset destructor for kfree_skb to work */
> +			skb->destructor = DEV_GSO_CB(skb)->destructor;
> +			kfree_skb(skb);

Why do you free first skb in the chain?

> +			return count;
> +		}
> +	}
> +	__skb_queue_tail(dev->skb_blist, skb);
> +	return 1;
> +}

-- 
	Evgeniy Polyakov



More information about the general mailing list