vhost: add unlikely annotations to error path
patch 'break out of polling loop on error' caused a minor performance regression on my machine: recover that performance by adding a bunch of unlikely annotations in the error handling. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
@@ -137,7 +137,7 @@ static void handle_tx(struct vhost_net *net)
|
||||
&out, &in,
|
||||
NULL, NULL);
|
||||
/* On error, stop handling until the next kick. */
|
||||
if (head < 0)
|
||||
if (unlikely(head < 0))
|
||||
break;
|
||||
/* Nothing new? Wait for eventfd to tell us they refilled. */
|
||||
if (head == vq->num) {
|
||||
@@ -234,7 +234,7 @@ static void handle_rx(struct vhost_net *net)
|
||||
&out, &in,
|
||||
vq_log, &log);
|
||||
/* On error, stop handling until the next kick. */
|
||||
if (head < 0)
|
||||
if (unlikely(head < 0))
|
||||
break;
|
||||
/* OK, now we need to know about added descriptors. */
|
||||
if (head == vq->num) {
|
||||
|
Reference in New Issue
Block a user