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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user