[ofa-general] 4K MTU patch review

Eli Cohen eli at mellanox.co.il
Thu Feb 7 00:54:29 PST 2008


On Wed, 2008-02-06 at 15:13 -0800, Shirley Ma wrote:
> Hello Eli,
> 
> To optimize ipoib_ud_skb_put_frags(), the patch could be like this
> since we know the first buf only has IPOIB_UD_HEAD_SIZE, how do you
> think?
> 
> static void ipoib_ud_skb_put_frags(struct sk_buff *skb, unsigned int
> length)
> {
> skb_frag_t *frag = &skb_shinfo(skb)->frags[0];
> if (skb_shinfo(skb)->nr_frags) {

I would take the above condition instead of this:

if (ipoib_ud_need_sg(priv->max_ib_mtu)) {

> /*
> * we know only two buffers here, first buf size is
> * IPOIB_UD_HEAD_SIZE
> */
> skb->tail += IPOIB_UD_HEAD_SIZE;
> frag->size = length - IPOIB_UD_HEAD_SIZE;
> skb->data_len += frag->size;
> skb->truesize += frag->size;
> skb->len += length;
> } else
> skb_put(skb, length);
> }
> 
> Thanks
> Shirley 
> 
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general




More information about the general mailing list