From: Jason Wang Date: Wed, 5 Jun 2013 23:54:38 +0000 (+0000) Subject: macvtap: eliminate linear search X-Git-Tag: v3.11-rc1~16^2~136 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=376b1aabe1f53aad80615d05ddb8c43670be6a5c;p=pandora-kernel.git macvtap: eliminate linear search Linear search were used in both get_slot() and macvtap_get_queue(), this is because: - macvtap didn't reshuffle the array of taps when create or destroy a queue, so when adding a new queue, macvtap must do linear search to find a location for the new queue. This will also complicate the TUNSETQUEUE implementation for multiqueue API. - the queue itself didn't track the queue index, so the we must do a linear search in the array to find the location of a existed queue. The solution is straightforward: reshuffle the array and introduce a queue_index to macvtap_queue. Signed-off-by: Jason Wang Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller --- Reading git-diff-tree failed