2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

dpif: Make caller of dpif_recv() provide buffer space.

This improves performance under heavy flow setup loads.

Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2012-04-06 16:23:28 -07:00
parent 26cd7e348b
commit 90a7c55e56
6 changed files with 39 additions and 35 deletions

View File

@@ -935,7 +935,8 @@ find_nonempty_queue(struct dpif *dpif)
}
static int
dpif_netdev_recv(struct dpif *dpif, struct dpif_upcall *upcall)
dpif_netdev_recv(struct dpif *dpif, struct dpif_upcall *upcall,
struct ofpbuf *buf)
{
struct dp_netdev_queue *q = find_nonempty_queue(dpif);
if (q) {
@@ -943,6 +944,9 @@ dpif_netdev_recv(struct dpif *dpif, struct dpif_upcall *upcall)
*upcall = *u;
free(u);
ofpbuf_uninit(buf);
*buf = *u->packet;
return 0;
} else {
return EAGAIN;