mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
dpif-netdev: Initialize upcall->packet when queuing to userspace.
Commit db73f7166a
(netdev-dpdk: Fix race condition with DPDK mempools in
non pmd threads) switched to a new way of setting up 'upcall->packet', but
only initialized two of the fields in the packet. This could cause
core dumps and other strange behavior. In particular it caused failures in
several unit tests on XenServer.
This commit fixes the problem by initializing the entire ofpbuf.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
This commit is contained in:
@@ -2153,6 +2153,7 @@ OVS_REQUIRES(q->mutex)
|
||||
struct ofpbuf *buf = &u->buf;
|
||||
size_t buf_size;
|
||||
struct flow flow;
|
||||
void *data;
|
||||
|
||||
upcall->type = type;
|
||||
|
||||
@@ -2179,8 +2180,8 @@ OVS_REQUIRES(q->mutex)
|
||||
/* We have to perform a copy of the packet, because we cannot send DPDK
|
||||
* mbufs to a non pmd thread. When the upcall processing will be done
|
||||
* in the pmd thread, this copy can be avoided */
|
||||
ofpbuf_set_data(&upcall->packet, ofpbuf_put(buf, ofpbuf_data(packet),
|
||||
ofpbuf_size(packet)));
|
||||
data = ofpbuf_put(buf, ofpbuf_data(packet), ofpbuf_size(packet));
|
||||
ofpbuf_use_stub(&upcall->packet, data, ofpbuf_size(packet));
|
||||
ofpbuf_set_size(&upcall->packet, ofpbuf_size(packet));
|
||||
|
||||
seq_change(q->seq);
|
||||
|
Reference in New Issue
Block a user