Re: [RFC/PATCHv2 5/8] usb: cdc_ncm: initial version

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

 



Am Mittwoch, 14. April 2010 16:47:18 schrieb Yauheni Kaliuta:
>  > unless you provide your own hard_xmit() to do buffereing.
> 
> I have some ideas and your proposals are very important (it's RFC).
> Thank you!

You need to have at least two URBs submitted under load for
optimal performance.

So I suggest you implemet start_hard_xmit() with the following algorithm:

if (fits(skb, ncm->current_buffer) {
	copy_into_buffer(skb, ncm->current_buffer);
	if (!maximum_skb_fits(ncm->current_buffer)
		if (empty(ncm->free_buffers)
			stop_queue();
} else {
	add(ncm->current_buffer, ncm->used_buffers);
	submit(ncm->current_buffer);
	ncm->current_buffer = get_buffer(ncm->free_buffers);
	copy_into_buffer(skb, ncm->current_buffer);
}

tx_callback():

add(current_buffer, ncm->free_buffers);
if (empty(ncm->used_buffers)) {
	if (has_content(ncm->current_buffer)) {
		add(ncm->current_buffer, ncm->used_buffers);
		submit(ncm->current_buffer);
	}
}
start_queue();

I suggest you use buffers of 64Ks, alloc them coherently
and use usb_anchors to queue them associated with preallocated URBs.

	Regards
		Oliver
--
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