[ovs-dev] [netlink v3 05/16] datapath: Change listing flows to use an iterator concept.

Ben Pfaff blp at nicira.com
Fri Jan 7 19:44:54 UTC 2011


On Fri, Jan 07, 2011 at 02:41:35PM -0500, Jesse Gross wrote:
> On Wed, Dec 29, 2010 at 7:56 PM, Ben Pfaff <blp at nicira.com> wrote:
> > diff --git a/lib/dpif.h b/lib/dpif.h
> > index dfd179b..0a41b77 100644
> > --- a/lib/dpif.h
> > +++ b/lib/dpif.h
> > @@ -79,10 +79,15 @@ int dpif_flow_put(struct dpif *, struct odp_flow_put *);
> >  int dpif_flow_del(struct dpif *, struct odp_flow *);
> >  int dpif_flow_get(const struct dpif *, struct odp_flow *);
> >  int dpif_flow_get_multiple(const struct dpif *, struct odp_flow[], size_t n);
> > -int dpif_flow_list(const struct dpif *, struct odp_flow[], size_t n,
> > -                   size_t *n_out);
> > -int dpif_flow_list_all(const struct dpif *,
> > -                       struct odp_flow **flowsp, size_t *np);
> > +
> > +struct dpif_flow_dump {
> > +    const struct dpif *dpif;
> > +    int error;
> > +    void *state;
> > +};
> > +void dpif_flow_dump_start(struct dpif_flow_dump *, const struct dpif *);
> 
> In all the other dpif_* functions, the dpif is the first argument.  I
> would expect this one to be the same.

I was regarding a "dpif_flow_dump" as a new object class.  Generally
functions that operation on an object pass the object itself as the
first parameter.

> That's minor though, so:
> Acked-by: Jesse Gross <jesse at nicira.com>

Thanks.

> (Subject to the caveat that I'd like to see this go away once we start
> using Netlink transport.)

I don't understand that caveat.  You want the implementation to change,
or you want "struct dpif_flow_dump" and related functions to go away?
The former is necessary, the latter I was not planning because the
iterator concept is better suited to Netlink transport anyhow.




More information about the dev mailing list