[ovs-dev] [PATCH 5/7] datapath: Change listing flows to use an iterator concept.
Jesse Gross
jesse at nicira.com
Mon Dec 27 23:16:19 UTC 2010
One other thing:
On Thu, Dec 23, 2010 at 8:15 PM, Ben Pfaff <blp at nicira.com> wrote:
> int
> -dpif_flow_list_all(const struct dpif *dpif,
> - struct odp_flow **flowsp, size_t *np)
> +dpif_dump_next(const struct dpif *dpif, struct dpif_dump *dump,
> + struct odp_flow *flow)
> {
> - struct odp_stats stats;
> - struct odp_flow *flows;
> - size_t n_flows;
> int error;
>
> - *flowsp = NULL;
> - *np = 0;
> -
> - error = dpif_get_dp_stats(dpif, &stats);
> - if (error) {
> - return error;
> - }
> + check_rw_odp_flow(flow);
> + error = dpif->dpif_class->flow_dump(dpif, dump, flow);
>
> - flows = xmalloc(sizeof *flows * stats.n_flows);
> - error = dpif_flow_list(dpif, flows, stats.n_flows, &n_flows);
> - if (error) {
> - free(flows);
> - return error;
> + if (error == EOF) {
> + VLOG_DBG_RL(&dpmsg_rl, "%s: dumped all flows", dpif_name(dpif));
> + } else {
> + if (error) {
> + flow->key_len = 0;
struct odp_flow does not have a key_len field as of this patch, so
this causes a compile failure.
More information about the dev
mailing list