On Tue, Jul 08, 2014 at 11:04:04AM +1200, Joe Stringer wrote: > Change the interface to allow implementations to pass back a buffer, and > allow callers to specify which of actions, mask, and stats they wish to > receive. This will be used in the next commit. > > Signed-off-by: Joe Stringer <joestrin...@nicira.com> > --- > v4: Rebase against master. > v3: Set *bufp to NULL before calling ->flow_get(). > Allocate the correct size for the buffer in dpif_netdev_flow_get(). > Don't overwrite mask with actions in dpif_netdev_flow_get(). > Remove unneeded *bufp = NULL in dpif_netdev_flow_get(). > v2: First post.
dpif_netdev_flow_get() calls dp_netdev_flow_get_actions() twice. I did not check whether the actions could change in between. Please change the code to just retrieve the actions once. Acked-by: Ben Pfaff <b...@nicira.com> As an additional optimization I think it would be reasonable for dpif_netdev_flow_get() to return the actions from the dp_netdev_actions directly, without copying them, since they are immutable and RCU-protected from destruction, something like this: if (actionsp) { struct dp_netdev_actions *actions; actions = dp_netdev_flow_get_actions(netdev_flow); *actionsp = actions->actions; *actions_len = actions->size; } _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev