datapath: Dump flow actions only if there is room.
authorBen Pfaff <blp@nicira.com>
Tue, 1 Feb 2011 17:25:26 +0000 (09:25 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 1 Feb 2011 17:25:26 +0000 (09:25 -0800)
commit3005302426764a2f701bb3507ad9602e3fe2dbb9
tree1aff57f294aca72c3901e091138d59e1f85d92fb
parent0700107651b6a774f8f7ba873259a5d5011e3cb0
datapath: Dump flow actions only if there is room.

Expanding an skbuff in a netlink dump handler doesn't work well.  We
weren't updating the truesize of the skb or the allocation within the
socket that netlink_dump() had put the skb in.  The code had other bugs
too.

This commit fixes the problem (in my tests, anyway) by avoiding expanding
the reply skbuff to fill in the actions.  Instead, in such a case the
userspace client has to do a separate "get" action to get the actions.
This commit also updates userspace to do this automatically for dumps in
the cases where the caller cares (only "ovs-dpctl dump-flows" currently
cares).

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #4520.
datapath/datapath.c
lib/dpif-linux.c