From 154896e3b99978317d74b5c9847fe07ec01b54b3 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 26 Apr 2011 14:25:00 -0700 Subject: [PATCH] ofproto: Drop ofproto_rule_lookup(). There's no reason not to implement this trivial function in ofproto-dpif, especially since it makes less sense once multiple table support is implemented (which table should be searched?). --- ofproto/ofproto-dpif.c | 3 ++- ofproto/ofproto.c | 6 ------ ofproto/private.h | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 7779cf5b..3d919846 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -2427,7 +2427,8 @@ flow_push_stats(const struct rule_dpif *rule, static struct rule_dpif * rule_dpif_lookup(struct ofproto_dpif *ofproto, const struct flow *flow) { - return rule_dpif_cast(ofproto_rule_lookup(&ofproto->up, flow)); + return rule_dpif_cast(rule_from_cls_rule( + classifier_lookup(&ofproto->up.cls, flow))); } static struct rule * diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index a9f3704e..c58b4483 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1297,12 +1297,6 @@ rule_has_out_port(const struct rule *rule, ovs_be16 out_port) return false; } -struct rule * -ofproto_rule_lookup(struct ofproto *ofproto, const struct flow *flow) -{ - return rule_from_cls_rule(classifier_lookup(&ofproto->cls, flow)); -} - /* Executes the actions indicated by 'rule' on 'packet' and credits 'rule''s * statistics appropriately. 'packet' must have at least sizeof(struct * ofp_packet_in) bytes of headroom. diff --git a/ofproto/private.h b/ofproto/private.h index e74d4ad5..64897913 100644 --- a/ofproto/private.h +++ b/ofproto/private.h @@ -96,7 +96,6 @@ rule_from_cls_rule(const struct cls_rule *cls_rule) return cls_rule ? CONTAINER_OF(cls_rule, struct rule, cr) : NULL; } -struct rule *ofproto_rule_lookup(struct ofproto *, const struct flow *); void ofproto_rule_expire(struct rule *, uint8_t reason); void ofproto_rule_destroy(struct rule *); -- 2.30.2