summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/bundles.c5
-rw-r--r--ofproto/connmgr.c16
-rw-r--r--ofproto/ofproto-dpif-rid.c5
-rw-r--r--ofproto/ofproto-dpif-xlate.c5
-rw-r--r--ofproto/ofproto-dpif.c15
-rw-r--r--ofproto/ofproto.c5
6 files changed, 20 insertions, 31 deletions
diff --git a/ofproto/bundles.c b/ofproto/bundles.c
index 4d9deacf9..c40909150 100644
--- a/ofproto/bundles.c
+++ b/ofproto/bundles.c
@@ -100,11 +100,10 @@ ofp_bundle_create(uint32_t id, uint16_t flags)
static void
ofp_bundle_remove(struct ofconn *ofconn, struct ofp_bundle *item)
{
- struct bundle_message *msg, *next;
+ struct bundle_message *msg;
struct hmap *bundles;
- LIST_FOR_EACH_SAFE (msg, next, node, &item->msg_list) {
- list_remove(&msg->node);
+ LIST_FOR_EACH_POP (msg, node, &item->msg_list) {
free(msg->msg);
free(msg);
}
diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
index f34652bfa..707385f00 100644
--- a/ofproto/connmgr.c
+++ b/ofproto/connmgr.c
@@ -1093,10 +1093,9 @@ ofconn_send_reply(const struct ofconn *ofconn, struct ofpbuf *msg)
void
ofconn_send_replies(const struct ofconn *ofconn, struct ovs_list *replies)
{
- struct ofpbuf *reply, *next;
+ struct ofpbuf *reply;
- LIST_FOR_EACH_SAFE (reply, next, list_node, replies) {
- list_remove(&reply->list_node);
+ LIST_FOR_EACH_POP (reply, list_node, replies) {
ofconn_send_reply(ofconn, reply);
}
}
@@ -1724,11 +1723,9 @@ connmgr_send_packet_in(struct connmgr *mgr,
static void
do_send_packet_ins(struct ofconn *ofconn, struct ovs_list *txq)
{
- struct ofpbuf *pin, *next_pin;
-
- LIST_FOR_EACH_SAFE (pin, next_pin, list_node, txq) {
- list_remove(&pin->list_node);
+ struct ofpbuf *pin;
+ LIST_FOR_EACH_POP (pin, list_node, txq) {
if (rconn_send_with_limit(ofconn->rconn, pin,
ofconn->packet_in_counter, 100) == EAGAIN) {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5);
@@ -2255,12 +2252,11 @@ ofmonitor_flush(struct connmgr *mgr)
struct ofconn *ofconn;
LIST_FOR_EACH (ofconn, node, &mgr->all_conns) {
- struct ofpbuf *msg, *next;
+ struct ofpbuf *msg;
- LIST_FOR_EACH_SAFE (msg, next, list_node, &ofconn->updates) {
+ LIST_FOR_EACH_POP (msg, list_node, &ofconn->updates) {
unsigned int n_bytes;
- list_remove(&msg->list_node);
ofconn_send(ofconn, msg, ofconn->monitor_counter);
n_bytes = rconn_packet_counter_n_bytes(ofconn->monitor_counter);
if (!ofconn->monitor_paused && n_bytes > 128 * 1024) {
diff --git a/ofproto/ofproto-dpif-rid.c b/ofproto/ofproto-dpif-rid.c
index 17bcede62..f1b3bdcf8 100644
--- a/ofproto/ofproto-dpif-rid.c
+++ b/ofproto/ofproto-dpif-rid.c
@@ -67,7 +67,7 @@ recirc_run(void)
/* Do maintenance at most 4 times / sec. */
ovs_mutex_lock(&mutex);
if (now - last > 250) {
- struct recirc_id_node *node, *next;
+ struct recirc_id_node *node;
last = now;
@@ -86,8 +86,7 @@ recirc_run(void)
/* Delete the expired. These have been lingering for at least 250 ms,
* which should be enough for any ongoing recirculations to be
* finished. */
- LIST_FOR_EACH_SAFE (node, next, exp_node, &expired) {
- list_remove(&node->exp_node);
+ LIST_FOR_EACH_POP (node, exp_node, &expired) {
cmap_remove(&id_map, &node->id_node, node->id);
ovsrcu_postpone(free, node);
}
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 4f82238be..55ae6831a 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -949,14 +949,13 @@ xlate_bundle_set(struct ofproto_dpif *ofproto, struct ofbundle *ofbundle,
static void
xlate_xbundle_remove(struct xlate_cfg *xcfg, struct xbundle *xbundle)
{
- struct xport *xport, *next;
+ struct xport *xport;
if (!xbundle) {
return;
}
- LIST_FOR_EACH_SAFE (xport, next, bundle_node, &xbundle->xports) {
- list_remove(&xport->bundle_node);
+ LIST_FOR_EACH_POP (xport, bundle_node, &xbundle->xports) {
xport->xbundle = NULL;
}
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 837ae0bd3..01d99c54a 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -886,7 +886,7 @@ open_dpif_backer(const char *type, struct dpif_backer **backerp)
struct dpif_port port;
struct shash_node *node;
struct ovs_list garbage_list;
- struct odp_garbage *garbage, *next;
+ struct odp_garbage *garbage;
struct sset names;
char *backer_name;
@@ -964,9 +964,8 @@ open_dpif_backer(const char *type, struct dpif_backer **backerp)
}
dpif_port_dump_done(&port_dump);
- LIST_FOR_EACH_SAFE (garbage, next, list_node, &garbage_list) {
+ LIST_FOR_EACH_POP (garbage, list_node, &garbage_list) {
dpif_port_del(backer->dpif, garbage->odp_port);
- list_remove(&garbage->list_node);
free(garbage);
}
@@ -1377,7 +1376,7 @@ static void
destruct(struct ofproto *ofproto_)
{
struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
- struct ofproto_packet_in *pin, *next_pin;
+ struct ofproto_packet_in *pin;
struct rule_dpif *rule;
struct oftable *table;
struct ovs_list pins;
@@ -1400,8 +1399,7 @@ destruct(struct ofproto *ofproto_)
}
guarded_list_pop_all(&ofproto->pins, &pins);
- LIST_FOR_EACH_SAFE (pin, next_pin, list_node, &pins) {
- list_remove(&pin->list_node);
+ LIST_FOR_EACH_POP (pin, list_node, &pins) {
free(CONST_CAST(void *, pin->up.packet));
free(pin);
}
@@ -1456,13 +1454,12 @@ run(struct ofproto *ofproto_)
/* Do not perform any periodic activity required by 'ofproto' while
* waiting for flow restore to complete. */
if (!ofproto_get_flow_restore_wait()) {
- struct ofproto_packet_in *pin, *next_pin;
+ struct ofproto_packet_in *pin;
struct ovs_list pins;
guarded_list_pop_all(&ofproto->pins, &pins);
- LIST_FOR_EACH_SAFE (pin, next_pin, list_node, &pins) {
+ LIST_FOR_EACH_POP (pin, list_node, &pins) {
connmgr_send_packet_in(ofproto->up.connmgr, pin);
- list_remove(&pin->list_node);
free(CONST_CAST(void *, pin->up.packet));
free(pin);
}
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index a36a1f8cc..927521bb2 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -2961,9 +2961,9 @@ static void
learned_cookies_flush(struct ofproto *ofproto, struct ovs_list *dead_cookies)
OVS_REQUIRES(ofproto_mutex)
{
- struct learned_cookie *c, *next;
+ struct learned_cookie *c;
- LIST_FOR_EACH_SAFE (c, next, u.list_node, dead_cookies) {
+ LIST_FOR_EACH_POP (c, u.list_node, dead_cookies) {
struct rule_criteria criteria;
struct rule_collection rules;
struct match match;
@@ -2977,7 +2977,6 @@ learned_cookies_flush(struct ofproto *ofproto, struct ovs_list *dead_cookies)
rule_criteria_destroy(&criteria);
rule_collection_destroy(&rules);
- list_remove(&c->u.list_node);
free(c);
}
}