Re: [PATCH net-next 08/12] r8152: support TSO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux