From f797957ad6fe772a95450d57fe1352709bb83ecd Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 11 May 2011 12:15:46 -0700 Subject: [PATCH] ofproto: Update some comments. --- ofproto/ofproto.c | 18 ++++++------------ ofproto/pinsched.c | 6 +++--- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 0745e127..d99e86d4 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -102,7 +102,7 @@ static const struct ofproto_class **ofproto_classes; static size_t n_ofproto_classes; static size_t allocated_ofproto_classes; -/* Map from dpif name to struct ofproto, for use by unixctl commands. */ +/* Map from datapath name to struct ofproto, for use by unixctl commands. */ static struct hmap all_ofprotos = HMAP_INITIALIZER(&all_ofprotos); static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); @@ -1278,8 +1278,7 @@ ofproto_rule_destroy__(struct rule *rule) rule->ofproto->ofproto_class->rule_dealloc(rule); } -/* Destroys 'rule' and iterates through all of its facets and revalidates them, - * destroying any that no longer has a rule (which is probably all of them). +/* Destroys 'rule' and removes it from the datapath. * * The caller must have already removed 'rule' from the classifier. */ void @@ -1317,8 +1316,8 @@ ofproto_rule_lookup(struct ofproto *ofproto, const struct flow *flow) } /* Executes the actions indicated by 'rule' on 'packet' and credits 'rule''s - * statistics (or the statistics for one of its facets) appropriately. - * 'packet' must have at least sizeof(struct ofp_packet_in) bytes of headroom. + * statistics appropriately. 'packet' must have at least sizeof(struct + * ofp_packet_in) bytes of headroom. * * 'packet' doesn't necessarily have to match 'rule'. 'rule' will be credited * with statistics for 'packet' either way. @@ -1335,13 +1334,8 @@ rule_execute(struct rule *rule, uint16_t in_port, struct ofpbuf *packet) return rule->ofproto->ofproto_class->rule_execute(rule, &flow, packet); } -/* Remove 'rule' from 'ofproto' and free up the associated memory: - * - * - Removes 'rule' from the classifier. - * - * - If 'rule' has facets, revalidates them (and possibly uninstalls and - * destroys them), via rule_destroy(). - */ +/* Removes 'rule' from 'ofproto' and frees up the associated memory. Removes + * 'rule' from the classifier. */ void ofproto_rule_remove(struct rule *rule) { diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c index 934140b2..695d9b46 100644 --- a/ofproto/pinsched.c +++ b/ofproto/pinsched.c @@ -209,9 +209,9 @@ pinsched_send(struct pinsched *ps, uint16_t port_no, /* Otherwise queue it up for the periodic callback to drain out. */ struct pinqueue *q; - /* We are called with a buffer obtained from dpif_recv() that has much - * more allocated space than actual content most of the time. Since - * we're going to store the packet for some time, free up that + /* We might be called with a buffer obtained from dpif_recv() that has + * much more allocated space than actual content most of the time. + * Since we're going to store the packet for some time, free up that * otherwise wasted space. */ ofpbuf_trim(packet); -- 2.30.2