[ovs-dev] [bug 7759 04/11] dpif-netdev: Implement OVS_ACTION_ATTR_SAMPLE action.
blp at nicira.com
Tue Oct 11 11:08:22 PDT 2011
On Tue, Oct 11, 2011 at 10:31:52AM -0700, Jesse Gross wrote:
> On Wed, Oct 5, 2011 at 11:27 AM, Ben Pfaff <blp at nicira.com> wrote:
> > dpif-netdev got overlooked when OVS_ACTION_ATTR_SAMPLE was introduced.
> > This commit implements it and adds a cast to enum ovs_action_type in the
> > switch statement that checks the action type, so that GCC complains if we
> > forget to add a case for a new action type.
> > I had to assign the return value of nl_attr_type() to a temporary variable,
> > because "switch ((enum ovs_action_type) nl_attr_type(a))" provoked a GCC
> > warning that I've never seen before:
> > ../lib/dpif-netdev.c:1260: warning: cast from function call of type 'int'
> > ?? ?? to non-matching type 'enum ovs_action_type'
> I don't think it was overlooked so much as sFlow was never implemented
> in userspace. However, now that it is much simpler it makes sense to
> do so (and so that we don't have to have validation to reject it).
> Regardless, this looks good.
I changed the wording to "OVS_ACTION_ATTR_SAMPLE has never been
implemented in dpif-netdev." to avoid saying that it was overlooked;
as you say, perhaps it was intentional.
More information about the dev