aboutsummaryrefslogtreecommitdiff
path: root/lib/dpif.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-01-17 14:40:58 -0800
committerBen Pfaff <blp@nicira.com>2011-01-27 21:08:38 -0800
commitbc4a05c639ee3789d009bb6143345cf121b2d4d4 (patch)
treee4e34cbfab0805f167b14c7ffc5ba47743b41bfb /lib/dpif.c
parent996c1b3d7a4d6e82e1831ff8821e5fd7e1a5522c (diff)
datapath: Change ODP_FLOW_GET to retrieve only a single flow at a time.
This brings the code closer to what the Netlink interface will need to implement. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'lib/dpif.c')
-rw-r--r--lib/dpif.c50
1 files changed, 1 insertions, 49 deletions
diff --git a/lib/dpif.c b/lib/dpif.c
index d7441967..463d4e7f 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -723,10 +723,7 @@ dpif_flow_get(const struct dpif *dpif, struct odp_flow *flow)
COVERAGE_INC(dpif_flow_get);
check_rw_flow_actions(flow);
- error = dpif->dpif_class->flow_get(dpif, flow, 1);
- if (!error) {
- error = flow->stats.error;
- }
+ error = dpif->dpif_class->flow_get(dpif, flow);
if (error) {
/* Make the results predictable on error. */
memset(&flow->stats, 0, sizeof flow->stats);
@@ -738,51 +735,6 @@ dpif_flow_get(const struct dpif *dpif, struct odp_flow *flow)
return error;
}
-/* For each flow 'flow' in the 'n' flows in 'flows':
- *
- * - If a flow matching 'flow->key' exists in 'dpif':
- *
- * Stores 0 into 'flow->stats.error' and stores statistics for the flow
- * into 'flow->stats'.
- *
- * If 'flow->actions_len' is zero, then 'flow->actions' is ignored. If
- * 'flow->actions_len' is nonzero, then 'flow->actions' should point to an
- * array of the specified number of bytes. At most that amount of flow's
- * actions will be copied into that array. 'flow->actions_len' will be
- * updated to the number of bytes of actions actually present in the flow,
- * which may be greater than the amount stored if the flow's actions are
- * longer than the available space.
- *
- * - Flow-specific errors are indicated by a positive errno value in
- * 'flow->stats.error'. In particular, ENOENT indicates that no flow
- * matching 'flow->key' exists in 'dpif'. When an error value is stored, the
- * contents of 'flow->key' are preserved but other members of 'flow' should
- * be treated as indeterminate.
- *
- * Returns 0 if all 'n' flows in 'flows' were updated (whether they were
- * individually successful or not is indicated by 'flow->stats.error',
- * however). Returns a positive errno value if an error that prevented this
- * update occurred, in which the caller must not depend on any elements in
- * 'flows' being updated or not updated.
- */
-int
-dpif_flow_get_multiple(const struct dpif *dpif,
- struct odp_flow flows[], size_t n)
-{
- int error;
- size_t i;
-
- COVERAGE_ADD(dpif_flow_get, n);
-
- for (i = 0; i < n; i++) {
- check_rw_flow_actions(&flows[i]);
- }
-
- error = dpif->dpif_class->flow_get(dpif, flows, n);
- log_operation(dpif, "flow_get_multiple", error);
- return error;
-}
-
/* Adds or modifies a flow in 'dpif' as specified in 'put':
*
* - If the flow specified in 'put->flow' does not exist in 'dpif', then