[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1393949476.26794.118.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Tue, 04 Mar 2014 08:11:16 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Hayes Wang <hayeswang@...ltek.com>
Cc: netdev@...r.kernel.org, nic_swsd@...ltek.com,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH net-next 08/12] r8152: support TSO
On Tue, 2014-03-04 at 20:01 +0800, Hayes Wang wrote:
> +static u32 r8152_xmit_frags(struct r8152 *tp, struct sk_buff *skb, u8 *data)
> +{
> + struct skb_shared_info *info = skb_shinfo(skb);
> + unsigned int cur_frag;
> + u32 total = skb_headlen(skb);
> +
> + memcpy(data, skb->data, total);
> + data += total;
> +
> + for (cur_frag = 0; cur_frag < info->nr_frags; cur_frag++) {
> + const skb_frag_t *frag = info->frags + cur_frag;
> + void *addr;
> + u32 len;
> +
> + len = skb_frag_size(frag);
> + addr = skb_frag_address(frag);
> + memcpy(data, addr, len);
> + data += len;
> + total += len;
> }
> +
> + return total;
> }
>
I would rather use skb_copy_bits(), because it correctly handles
kmap() case. (If a frag resides in high memory)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists