Commit ID 8742a7939f22e2d9359755453abf362b012b5ad3
|Contributor:||Eduardo Habkost||Files Modified:||1|
|Date:||08-October-2008 at 20:02||Lines Added:||4|
|Repository:||git://git.ipxe.org/mirror/etherboot.git master||Lines Removed:||2|
|Commit Comment:||[virtio-net] Fix kick/wait logic
The virtnet_transmit() logic for waiting the packet to be transmitted is
reversed: we can't wait the packet to be transmitted if we didn't kick()
the ring yet. The vring_more_used() while loop logic is reversed also,
that explains why the code works today.
The current code risks trying to free a buffer from the used ring
when none was available, that will happen most times because KVM
doesn't handle the packet immediately on kick(). Luckily it was working
because it was unlikely to have a buffer still queued for transmit when
virtnet_transmit() was called.
Also, adds a BUG_ON() to vring_get_buf(), to catch cases where we try
to free a buffer from the used ring when there was none available.
Signed-off-by: Stefan Hajnoczi <stef...@gmail.com>
|Language||Code Added||Code Removed||Comments Added||Comment Removed||Blanks Added||Blanks Removed|
|File||Language||Code Added||Code Removed||Comments Added||Comment Removed||Blanks Added||Blanks Removed|
Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.