[ewg] [PATCH] ipoib_ud_skb_put optimization patch
Or Gerlitz
or.gerlitz at gmail.com
Wed Feb 13 11:19:25 PST 2008
On 2/12/08, Shirley Ma <mashirle at us.ibm.com> wrote:
Hello, where is the change-log comment that explains what the patch is
doing? is it relevant to 2.6.25-rc1? if yes, please send it to the
general list for review.
> Signed-off-by: Shirley Ma <xma at us.ibm.com>
> ---
>
> diff -urpN ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ofed_a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
> --- ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2008-02-12 10:53:00.000000000 -0800
> +++ ofed_a/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2008-02-12 11:04:54.000000000 -0800
> @@ -107,22 +107,17 @@ static void clean_pending_receives(struc
> static void ipoib_ud_skb_put_frags(struct ipoib_dev_priv *priv, struct sk_buff *skb,
> unsigned int length)
> {
> - if (ipoib_ud_need_sg(priv->max_ib_mtu)) {
> - unsigned int size;
> - skb_frag_t *frag = &skb_shinfo(skb)->frags[0];
> -
> - /* put header into skb */
> - size = min(length, (unsigned)IPOIB_UD_HEAD_SIZE);
> - skb->tail += size;
> - skb->len += size;
> - length -= size;
> -
> - size = min(length, (unsigned) PAGE_SIZE);
> - frag->size = size;
> - skb->data_len += size;
> - skb->truesize += size;
> - skb->len += size;
> - length -= size;
> + skb_frag_t *frag = &skb_shinfo(skb)->frags[0];
> + if (skb_shinfo(skb)->nr_frags) {
> + /*
> + * 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);
> }
More information about the ewg
mailing list