From: Ben Pfaff Date: Wed, 15 Apr 2009 16:57:39 +0000 (-0700) Subject: dpif: Remove duplicated functionality. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0721f5364fa113309e14470c174725635fac92d8;p=openvswitch dpif: Remove duplicated functionality. dpif_flow_flush() does the same thing as dpif_flow_del_all(). --- diff --git a/lib/dpif.c b/lib/dpif.c index d52c52ea..119b40c3 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -553,44 +553,6 @@ dpif_flow_list_all(const struct dpif *dpif, return 0; } -int -dpif_flow_del_all(struct dpif *dpif) -{ - struct odp_stats stats; - struct odp_flow *flows; - size_t n_flows; - size_t i; - int error; - - error = dpif_get_dp_stats(dpif, &stats); - if (error) { - return error; - } - - 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 (stats.n_flows != n_flows) { - VLOG_WARN_RL(&error_rl, "dp%u: datapath stats reported %"PRIu32" " - "flows but flow listing reported %zu", - dpif->minor, stats.n_flows, n_flows); - } - - for (i=0; iminor); - return error; - } - } - return 0; -} - int dpif_execute(struct dpif *dpif, uint16_t in_port, const union odp_action actions[], size_t n_actions, diff --git a/utilities/dpctl.c b/utilities/dpctl.c index 93651f5a..3e0227e7 100644 --- a/utilities/dpctl.c +++ b/utilities/dpctl.c @@ -574,7 +574,7 @@ do_dp_del_flows(const struct settings *s UNUSED, struct dpif dpif; run(dpif_open(argv[1], &dpif), "opening datapath"); - run(dpif_flow_del_all(&dpif), "deleting all flows"); + run(dpif_flow_flush(&dpif), "deleting all flows"); dpif_close(&dpif); }