[ovs-dev] [PATCHv4 1/2] dpif: Support fetching flow mask via dpif_flow_get().

Ben Pfaff blp at nicira.com
Tue Jul 15 00:11:30 UTC 2014


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 <joestringer at 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 <blp at 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;
            }



More information about the dev mailing list