summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Warren <ben@skyportsystems.com>2016-03-25 14:10:22 -0700
committerBen Pfaff <blp@ovn.org>2016-03-30 13:04:32 -0700
commit417e7e66e1217ab984ebb058fb3b469e77e216fc (patch)
tree664ef5b9af86bfdaa212dec9dd3162746a3df890 /lib
parentb19bab5b207da94c2f71b8df25fcfe47ee778a29 (diff)
downloadopenvswitch-417e7e66e1217ab984ebb058fb3b469e77e216fc.tar.gz
list: Rename all functions in list.h with ovs_ prefix.
This attempts to prevent namespace collisions with other list libraries Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/dpif-netdev.c6
-rw-r--r--lib/fat-rwlock.c8
-rw-r--r--lib/guarded-list.c10
-rw-r--r--lib/jsonrpc.c12
-rw-r--r--lib/lacp.c4
-rw-r--r--lib/lldp/lldp.c10
-rw-r--r--lib/lldp/lldpd-structs.c12
-rw-r--r--lib/lldp/lldpd.c22
-rw-r--r--lib/lldp/lldpd.h2
-rw-r--r--lib/mac-learning.c26
-rw-r--r--lib/mcast-snooping.c50
-rw-r--r--lib/netdev-dpdk.c10
-rw-r--r--lib/netdev-dummy.c36
-rw-r--r--lib/netdev.c8
-rw-r--r--lib/netlink-notifier.c10
-rw-r--r--lib/nx-match.c4
-rw-r--r--lib/ofp-msgs.c14
-rw-r--r--lib/ofp-parse.c12
-rw-r--r--lib/ofp-util.c50
-rw-r--r--lib/ofpbuf.c2
-rw-r--r--lib/ovs-atomic.h2
-rw-r--r--lib/ovs-lldp.c46
-rw-r--r--lib/ovs-numa.c12
-rw-r--r--lib/ovs-rcu.c8
-rw-r--r--lib/ovs-thread.c14
-rw-r--r--lib/ovsdb-idl.c50
-rw-r--r--lib/process.c6
-rw-r--r--lib/rconn.c24
-rw-r--r--lib/rstp.c4
-rw-r--r--lib/rtbsd.c6
-rw-r--r--lib/seq.c6
-rw-r--r--lib/seq.h6
-rw-r--r--lib/stp.c4
-rw-r--r--lib/tnl-ports.c12
-rw-r--r--lib/tun-metadata.c4
-rw-r--r--lib/unixctl.c6
-rw-r--r--lib/vlog.c2
37 files changed, 260 insertions, 260 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 85587321b..f25c32c57 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -2864,7 +2864,7 @@ dp_netdev_configure_pmd(struct dp_netdev_pmd_thread *pmd, struct dp_netdev *dp,
ovs_mutex_init(&pmd->poll_mutex);
dpcls_init(&pmd->cls);
cmap_init(&pmd->flow_table);
- list_init(&pmd->poll_list);
+ ovs_list_init(&pmd->poll_list);
/* init the 'flow_cache' since there is no
* actual thread created for NON_PMD_CORE_ID. */
if (core_id == NON_PMD_CORE_ID) {
@@ -3017,7 +3017,7 @@ dp_netdev_del_port_from_pmd(struct dp_netdev_port *port,
if (poll->port == port) {
found = true;
port_unref(poll->port);
- list_remove(&poll->node);
+ ovs_list_remove(&poll->node);
pmd->poll_cnt--;
free(poll);
}
@@ -3076,7 +3076,7 @@ dp_netdev_add_rxq_to_pmd(struct dp_netdev_pmd_thread *pmd,
poll->port = port;
poll->rx = rx;
- list_push_back(&pmd->poll_list, &poll->node);
+ ovs_list_push_back(&pmd->poll_list, &poll->node);
pmd->poll_cnt++;
}
diff --git a/lib/fat-rwlock.c b/lib/fat-rwlock.c
index b36cd4cb7..2f42b0563 100644
--- a/lib/fat-rwlock.c
+++ b/lib/fat-rwlock.c
@@ -66,7 +66,7 @@ free_slot(struct fat_rwlock_slot *slot)
abort();
}
- list_remove(&slot->list_node);
+ ovs_list_remove(&slot->list_node);
free_cacheline(slot);
}
@@ -88,7 +88,7 @@ fat_rwlock_init(struct fat_rwlock *rwlock)
ovsthread_key_create(&rwlock->key, slot_destructor);
ovs_mutex_init(&rwlock->mutex);
ovs_mutex_lock(&rwlock->mutex);
- list_init(&rwlock->threads);
+ ovs_list_init(&rwlock->threads);
ovs_mutex_unlock(&rwlock->mutex);
}
@@ -129,7 +129,7 @@ fat_rwlock_get_slot__(struct fat_rwlock *rwlock)
slot->depth = 0;
ovs_mutex_lock(&rwlock->mutex);
- list_push_back(&rwlock->threads, &slot->list_node);
+ ovs_list_push_back(&rwlock->threads, &slot->list_node);
ovs_mutex_unlock(&rwlock->mutex);
ovsthread_setspecific(rwlock->key, slot);
@@ -181,7 +181,7 @@ fat_rwlock_try_get_slot__(struct fat_rwlock *rwlock)
ovs_mutex_init(&slot->mutex);
slot->depth = 0;
- list_push_back(&rwlock->threads, &slot->list_node);
+ ovs_list_push_back(&rwlock->threads, &slot->list_node);
ovs_mutex_unlock(&rwlock->mutex);
ovsthread_setspecific(rwlock->key, slot);
}
diff --git a/lib/guarded-list.c b/lib/guarded-list.c
index da0a43ebf..2186d074e 100644
--- a/lib/guarded-list.c
+++ b/lib/guarded-list.c
@@ -22,7 +22,7 @@ void
guarded_list_init(struct guarded_list *list)
{
ovs_mutex_init(&list->mutex);
- list_init(&list->list);
+ ovs_list_init(&list->list);
list->n = 0;
}
@@ -57,7 +57,7 @@ guarded_list_push_back(struct guarded_list *list,
ovs_mutex_lock(&list->mutex);
if (list->n < max) {
- list_push_back(&list->list, node);
+ ovs_list_push_back(&list->list, node);
retval = ++list->n;
}
ovs_mutex_unlock(&list->mutex);
@@ -72,7 +72,7 @@ guarded_list_pop_front(struct guarded_list *list)
ovs_mutex_lock(&list->mutex);
if (list->n) {
- node = list_pop_front(&list->list);
+ node = ovs_list_pop_front(&list->list);
list->n--;
}
ovs_mutex_unlock(&list->mutex);
@@ -86,10 +86,10 @@ guarded_list_pop_all(struct guarded_list *list, struct ovs_list *elements)
size_t n;
ovs_mutex_lock(&list->mutex);
- list_move(elements, &list->list);
+ ovs_list_move(elements, &list->list);
n = list->n;
- list_init(&list->list);
+ ovs_list_init(&list->list);
list->n = 0;
ovs_mutex_unlock(&list->mutex);
diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index 33d23e1a0..c1e50adeb 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -87,7 +87,7 @@ jsonrpc_open(struct stream *stream)
rpc->name = xstrdup(stream_get_name(stream));
rpc->stream = stream;
byteq_init(&rpc->input, rpc->input_buffer, sizeof rpc->input_buffer);
- list_init(&rpc->output);
+ ovs_list_init(&rpc->output);
return rpc;
}
@@ -113,7 +113,7 @@ jsonrpc_run(struct jsonrpc *rpc)
}
stream_run(rpc->stream);
- while (!list_is_empty(&rpc->output)) {
+ while (!ovs_list_is_empty(&rpc->output)) {
struct ofpbuf *buf = ofpbuf_from_list(rpc->output.next);
int retval;
@@ -122,7 +122,7 @@ jsonrpc_run(struct jsonrpc *rpc)
rpc->backlog -= retval;
ofpbuf_pull(buf, retval);
if (!buf->size) {
- list_remove(&buf->list_node);
+ ovs_list_remove(&buf->list_node);
rpc->output_count--;
ofpbuf_delete(buf);
}
@@ -144,7 +144,7 @@ jsonrpc_wait(struct jsonrpc *rpc)
{
if (!rpc->status) {
stream_run_wait(rpc->stream);
- if (!list_is_empty(&rpc->output)) {
+ if (!ovs_list_is_empty(&rpc->output)) {
stream_send_wait(rpc->stream);
}
}
@@ -255,7 +255,7 @@ jsonrpc_send(struct jsonrpc *rpc, struct jsonrpc_msg *msg)
buf = xmalloc(sizeof *buf);
ofpbuf_use_ds(buf, &ds);
- list_push_back(&rpc->output, &buf->list_node);
+ ovs_list_push_back(&rpc->output, &buf->list_node);
rpc->output_count++;
rpc->backlog += length;
@@ -384,7 +384,7 @@ jsonrpc_send_block(struct jsonrpc *rpc, struct jsonrpc_msg *msg)
for (;;) {
jsonrpc_run(rpc);
- if (list_is_empty(&rpc->output) || rpc->status) {
+ if (ovs_list_is_empty(&rpc->output) || rpc->status) {
return rpc->status;
}
jsonrpc_wait(rpc);
diff --git a/lib/lacp.c b/lib/lacp.c
index 8ecef0693..a9d6e1e0e 100644
--- a/lib/lacp.c
+++ b/lib/lacp.c
@@ -236,7 +236,7 @@ lacp_create(void) OVS_EXCLUDED(mutex)
ovs_refcount_init(&lacp->ref_cnt);
lacp_lock();
- list_push_back(all_lacps, &lacp->node);
+ ovs_list_push_back(all_lacps, &lacp->node);
lacp_unlock();
return lacp;
}
@@ -264,7 +264,7 @@ lacp_unref(struct lacp *lacp) OVS_EXCLUDED(mutex)
}
hmap_destroy(&lacp->slaves);
- list_remove(&lacp->node);
+ ovs_list_remove(&lacp->node);
free(lacp->name);
free(lacp);
lacp_unlock();
diff --git a/lib/lldp/lldp.c b/lib/lldp/lldp.c
index 0340f676a..74f747fcd 100644
--- a/lib/lldp/lldp.c
+++ b/lib/lldp/lldp.c
@@ -295,7 +295,7 @@ lldp_send(struct lldpd *global OVS_UNUSED,
lldp_tlv_end(p, start);
}
- if (!list_is_empty(&port->p_isid_vlan_maps)) {
+ if (!ovs_list_is_empty(&port->p_isid_vlan_maps)) {
memset(msg_auth_digest, 0, sizeof msg_auth_digest);
@@ -372,10 +372,10 @@ lldp_decode(struct lldpd *cfg OVS_UNUSED, char *frame, int s,
VLOG_DBG("receive LLDP PDU on %s", hardware->h_ifname);
chassis = xzalloc(sizeof *chassis);
- list_init(&chassis->c_mgmt);
+ ovs_list_init(&chassis->c_mgmt);
port = xzalloc(sizeof *port);
- list_init(&port->p_isid_vlan_maps);
+ ovs_list_init(&port->p_isid_vlan_maps);
length = s;
pos = (u_int8_t*) frame;
@@ -501,7 +501,7 @@ lldp_decode(struct lldpd *cfg OVS_UNUSED, char *frame, int s,
VLOG_WARN("unable to allocate memory for management address");
goto malformed;
}
- list_push_back(&chassis->c_mgmt, &mgmt->m_entries);
+ ovs_list_push_back(&chassis->c_mgmt, &mgmt->m_entries);
break;
case LLDP_TLV_ORG:
@@ -599,7 +599,7 @@ lldp_decode(struct lldpd *cfg OVS_UNUSED, char *frame, int s,
PEEK_BYTES(isid, 3);
isid_vlan_map->isid_vlan_data.isid =
(isid[0] << 16) | (isid[1] << 8) | isid[2];
- list_push_back(&port->p_isid_vlan_maps,
+ ovs_list_push_back(&port->p_isid_vlan_maps,
&isid_vlan_map->m_entries);
isid_vlan_map = NULL;
}
diff --git a/lib/lldp/lldpd-structs.c b/lib/lldp/lldpd-structs.c
index 71c4f5e0b..499b44174 100644
--- a/lib/lldp/lldpd-structs.c
+++ b/lib/lldp/lldpd-structs.c
@@ -37,7 +37,7 @@ lldpd_chassis_mgmt_cleanup(struct lldpd_chassis *chassis)
free(mgmt);
}
- list_init(&chassis->c_mgmt);
+ ovs_list_init(&chassis->c_mgmt);
}
void
@@ -82,14 +82,14 @@ lldpd_remote_cleanup(struct lldpd_hardware *hw,
}
if (!all) {
- list_remove(&port->p_entries);
+ ovs_list_remove(&port->p_entries);
}
lldpd_port_cleanup(port, true);
free(port);
}
}
if (all) {
- list_init(&hw->h_rports);
+ ovs_list_init(&hw->h_rports);
}
}
@@ -101,16 +101,16 @@ lldpd_aa_maps_cleanup(struct lldpd_port *port)
struct lldpd_aa_isid_vlan_maps_tlv *isid_vlan_map = NULL;
struct lldpd_aa_isid_vlan_maps_tlv *isid_vlan_map_next = NULL;
- if (!list_is_empty(&port->p_isid_vlan_maps)) {
+ if (!ovs_list_is_empty(&port->p_isid_vlan_maps)) {
LIST_FOR_EACH_SAFE (isid_vlan_map, isid_vlan_map_next, m_entries,
&port->p_isid_vlan_maps) {
- list_remove(&isid_vlan_map->m_entries);
+ ovs_list_remove(&isid_vlan_map->m_entries);
free(isid_vlan_map);
}
- list_init(&port->p_isid_vlan_maps);
+ ovs_list_init(&port->p_isid_vlan_maps);
}
}
diff --git a/lib/lldp/lldpd.c b/lib/lldp/lldpd.c
index da8608309..60858b0d7 100644
--- a/lib/lldp/lldpd.c
+++ b/lib/lldp/lldpd.c
@@ -85,10 +85,10 @@ lldpd_alloc_hardware(struct lldpd *cfg, char *name, int index)
hw->h_cfg = cfg;
ovs_strlcpy(hw->h_ifname, name, sizeof hw->h_ifname);
hw->h_ifindex = index;
- hw->h_lport.p_chassis = CONTAINER_OF(list_front(&cfg->g_chassis),
+ hw->h_lport.p_chassis = CONTAINER_OF(ovs_list_front(&cfg->g_chassis),
struct lldpd_chassis, list);
hw->h_lport.p_chassis->c_refcount++;
- list_init(&hw->h_rports);
+ ovs_list_init(&hw->h_rports);
return hw;
}
@@ -139,7 +139,7 @@ lldpd_cleanup(struct lldpd *cfg)
LIST_FOR_EACH_SAFE (hw, hw_next, h_entries, &cfg->g_hardware) {
if (!hw->h_flags) {
- list_remove(&hw->h_entries);
+ ovs_list_remove(&hw->h_entries);
lldpd_remote_cleanup(hw, NULL, true);
lldpd_hardware_cleanup(cfg, hw);
} else {
@@ -151,7 +151,7 @@ lldpd_cleanup(struct lldpd *cfg)
LIST_FOR_EACH_SAFE (chassis, chassis_next, list, &cfg->g_chassis) {
if (chassis->c_refcount == 0) {
- list_remove(&chassis->list);
+ ovs_list_remove(&chassis->list);
lldpd_chassis_cleanup(chassis, 1);
}
}
@@ -179,11 +179,11 @@ lldpd_move_chassis(struct lldpd_chassis *ochassis,
* marshaling.
*/
memcpy(ochassis, chassis, sizeof *ochassis);
- list_init(&ochassis->c_mgmt);
+ ovs_list_init(&ochassis->c_mgmt);
/* Copy of management addresses */
LIST_FOR_EACH_POP (mgmt, m_entries, &chassis->c_mgmt) {
- list_insert(&ochassis->c_mgmt, &mgmt->m_entries);
+ ovs_list_insert(&ochassis->c_mgmt, &mgmt->m_entries);
}
/* Restore saved values */
@@ -360,7 +360,7 @@ lldpd_decode(struct lldpd *cfg, char *frame, int s,
if (oport) {
/* The port is known, remove it before adding it back */
- list_remove(&oport->p_entries);
+ ovs_list_remove(&oport->p_entries);
lldpd_port_cleanup(oport, 1);
free(oport);
}
@@ -373,8 +373,8 @@ lldpd_decode(struct lldpd *cfg, char *frame, int s,
VLOG_DBG("unknown chassis, add it to the list");
chassis->c_index = ++cfg->g_lastrid;
chassis->c_refcount = 0;
- list_push_back(&cfg->g_chassis, &chassis->list);
- listsize = list_size(&cfg->g_chassis);
+ ovs_list_push_back(&cfg->g_chassis, &chassis->list);
+ listsize = ovs_list_size(&cfg->g_chassis);
VLOG_DBG("%"PRIuSIZE " different systems are known", listsize);
}
@@ -383,7 +383,7 @@ lldpd_decode(struct lldpd *cfg, char *frame, int s,
port->p_lastframe = xmalloc(s + sizeof(struct lldpd_frame));
port->p_lastframe->size = s;
memcpy(port->p_lastframe->frame, frame, s);
- list_insert(&hw->h_rports, &port->p_entries);
+ ovs_list_insert(&hw->h_rports, &port->p_entries);
port->p_chassis = chassis;
port->p_chassis->c_refcount++;
@@ -400,7 +400,7 @@ lldpd_decode(struct lldpd *cfg, char *frame, int s,
* freed with lldpd_port_cleanup() and therefore, the refcount
* of the chassis that was attached to it is decreased.
*/
- i = list_size(&hw->h_rports);
+ i = ovs_list_size(&hw->h_rports);
VLOG_DBG("%"PRIuSIZE " neighbors for %s", i, hw->h_ifname);
if (!oport) {
diff --git a/lib/lldp/lldpd.h b/lib/lldp/lldpd.h
index fc2ae53c6..f77c6d523 100644
--- a/lib/lldp/lldpd.h
+++ b/lib/lldp/lldpd.h
@@ -71,7 +71,7 @@ struct lldpd {
static inline struct lldpd_hardware *
lldpd_first_hardware(struct lldpd *lldpd)
{
- return CONTAINER_OF(list_front(&lldpd->g_hardware),
+ return CONTAINER_OF(ovs_list_front(&lldpd->g_hardware),
struct lldpd_hardware, h_entries);
}
diff --git a/lib/mac-learning.c b/lib/mac-learning.c
index 6eda1faa7..5a2ccba15 100644
--- a/lib/mac-learning.c
+++ b/lib/mac-learning.c
@@ -101,9 +101,9 @@ mac_entry_set_port(struct mac_learning *ml, struct mac_entry *e, void *port)
if (e->mlport) {
struct mac_learning_port *mlport = e->mlport;
- list_remove(&e->port_lru_node);
+ ovs_list_remove(&e->port_lru_node);
- if (list_is_empty(&mlport->port_lrus)) {
+ if (ovs_list_is_empty(&mlport->port_lrus)) {
ovs_assert(mlport->heap_node.priority == 1);
hmap_remove(&ml->ports_by_ptr, &mlport->hmap_node);
heap_remove(&ml->ports_by_usage, &mlport->heap_node);
@@ -126,12 +126,12 @@ mac_entry_set_port(struct mac_learning *ml, struct mac_entry *e, void *port)
hash_pointer(port, ml->secret));
heap_insert(&ml->ports_by_usage, &mlport->heap_node, 1);
mlport->port = port;
- list_init(&mlport->port_lrus);
+ ovs_list_init(&mlport->port_lrus);
} else {
heap_change(&ml->ports_by_usage, &mlport->heap_node,
mlport->heap_node.priority + 1);
}
- list_push_back(&mlport->port_lrus, &e->port_lru_node);
+ ovs_list_push_back(&mlport->port_lrus, &e->port_lru_node);
e->mlport = mlport;
}
}
@@ -148,7 +148,7 @@ evict_mac_entry_fairly(struct mac_learning *ml)
mlport = CONTAINER_OF(heap_max(&ml->ports_by_usage),
struct mac_learning_port, heap_node);
- e = CONTAINER_OF(list_front(&mlport->port_lrus),
+ e = CONTAINER_OF(ovs_list_front(&mlport->port_lrus),
struct mac_entry, port_lru_node);
mac_learning_expire(ml, e);
}
@@ -160,7 +160,7 @@ static bool
get_lru(struct mac_learning *ml, struct mac_entry **e)
OVS_REQ_RDLOCK(ml->rwlock)
{
- if (!list_is_empty(&ml->lrus)) {
+ if (!ovs_list_is_empty(&ml->lrus)) {
*e = mac_entry_from_lru_node(ml->lrus.next);
return true;
} else {
@@ -186,7 +186,7 @@ mac_learning_create(unsigned int idle_time)
struct mac_learning *ml;
ml = xmalloc(sizeof *ml);
- list_init(&ml->lrus);
+ ovs_list_init(&ml->lrus);
hmap_init(&ml->table);
ml->secret = random_uint32();
ml->flood_vlans = NULL;
@@ -321,14 +321,14 @@ mac_learning_insert(struct mac_learning *ml,
e->mlport = NULL;
COVERAGE_INC(mac_learning_learned);
} else {
- list_remove(&e->lru_node);
+ ovs_list_remove(&e->lru_node);
}
/* Mark 'e' as recently used. */
- list_push_back(&ml->lrus, &e->lru_node);
+ ovs_list_push_back(&ml->lrus, &e->lru_node);
if (e->mlport) {
- list_remove(&e->port_lru_node);
- list_push_back(&e->mlport->port_lrus, &e->port_lru_node);
+ ovs_list_remove(&e->port_lru_node);
+ ovs_list_push_back(&e->mlport->port_lrus, &e->port_lru_node);
}
e->expires = time_now() + ml->idle_time;
@@ -364,7 +364,7 @@ mac_learning_expire(struct mac_learning *ml, struct mac_entry *e)
ml->need_revalidate = true;
mac_entry_set_port(ml, e, NULL);
hmap_remove(&ml->table, &e->hmap_node);
- list_remove(&e->lru_node);
+ ovs_list_remove(&e->lru_node);
free(e);
}
@@ -405,7 +405,7 @@ mac_learning_wait(struct mac_learning *ml)
if (hmap_count(&ml->table) > ml->max_entries
|| ml->need_revalidate) {
poll_immediate_wake();
- } else if (!list_is_empty(&ml->lrus)) {
+ } else if (!ovs_list_is_empty(&ml->lrus)) {
struct mac_entry *e = mac_entry_from_lru_node(ml->lrus.next);
poll_timer_wait_until(e->expires * 1000LL);
}
diff --git a/lib/mcast-snooping.c b/lib/mcast-snooping.c
index 356006950..7fd0b9a6a 100644
--- a/lib/mcast-snooping.c
+++ b/lib/mcast-snooping.c
@@ -141,7 +141,7 @@ static bool
group_get_lru(const struct mcast_snooping *ms, struct mcast_group **grp)
OVS_REQ_RDLOCK(ms->rwlock)
{
- if (!list_is_empty(&ms->group_lru)) {
+ if (!ovs_list_is_empty(&ms->group_lru)) {
*grp = mcast_group_from_lru_node(ms->group_lru.next);
return true;
} else {
@@ -168,10 +168,10 @@ mcast_snooping_create(void)
ms = xmalloc(sizeof *ms);
hmap_init(&ms->table);
- list_init(&ms->group_lru);
- list_init(&ms->mrouter_lru);
- list_init(&ms->fport_list);
- list_init(&ms->rport_list);
+ ovs_list_init(&ms->group_lru);
+ ovs_list_init(&ms->mrouter_lru);
+ ovs_list_init(&ms->fport_list);
+ ovs_list_init(&ms->rport_list);
ms->secret = random_uint32();
ms->idle_time = MCAST_ENTRY_DEFAULT_IDLE_TIME;
ms->max_entries = MCAST_DEFAULT_MAX_ENTRIES;
@@ -281,15 +281,15 @@ mcast_group_insert_bundle(struct mcast_snooping *ms OVS_UNUSED,
b = mcast_group_bundle_lookup(ms, grp, port);
if (b) {
- list_remove(&b->bundle_node);
+ ovs_list_remove(&b->bundle_node);
} else {
b = xmalloc(sizeof *b);
- list_init(&b->bundle_node);
+ ovs_list_init(&b->bundle_node);
b->port = port;
}
b->expires = time_now() + idle_time;
- list_push_back(&grp->bundle_lru, &b->bundle_node);
+ ovs_list_push_back(&grp->bundle_lru, &b->bundle_node);
return b;
}
@@ -298,7 +298,7 @@ mcast_group_insert_bundle(struct mcast_snooping *ms OVS_UNUSED,
static bool
mcast_group_has_bundles(struct mcast_group *grp)
{
- return !list_is_empty(&grp->bundle_lru);
+ return !ovs_list_is_empty(&grp->bundle_lru);
}
/* Delete 'grp' from the 'ms' hash table.
@@ -307,9 +307,9 @@ static void
mcast_snooping_flush_group__(struct mcast_snooping *ms,
struct mcast_group *grp)
{
- ovs_assert(list_is_empty(&grp->bundle_lru));
+ ovs_assert(ovs_list_is_empty(&grp->bundle_lru));
hmap_remove(&ms->table, &grp->hmap_node);
- list_remove(&grp->group_node);
+ ovs_list_remove(&grp->group_node);
free(grp);
}
@@ -339,7 +339,7 @@ mcast_group_delete_bundle(struct mcast_snooping *ms OVS_UNUSED,
LIST_FOR_EACH (b, bundle_node, &grp->bundle_lru) {
if (b->port == port) {
- list_remove(&b->bundle_node);
+ ovs_list_remove(&b->bundle_node);
free(b);
return true;
}
@@ -364,7 +364,7 @@ mcast_snooping_prune_expired(struct mcast_snooping *ms,
if (b->expires > timenow) {
break;
}
- list_remove(&b->bundle_node);
+ ovs_list_remove(&b->bundle_node);
free(b);
expired++;
}
@@ -414,17 +414,17 @@ mcast_snooping_add_group(struct mcast_snooping *ms,
hmap_insert(&ms->table, &grp->hmap_node, hash);
grp->addr = *addr;
grp->vlan = vlan;
- list_init(&grp->bundle_lru);
+ ovs_list_init(&grp->bundle_lru);
learned = true;
ms->need_revalidate = true;
COVERAGE_INC(mcast_snooping_learned);
} else {
- list_remove(&grp->group_node);
+ ovs_list_remove(&grp->group_node);
}
mcast_group_insert_bundle(ms, grp, port, ms->idle_time);
/* Mark 'grp' as recently used. */
- list_push_back(&ms->group_lru, &grp->group_node);
+ ovs_list_push_back(&ms->group_lru, &grp->group_node);
return learned;
}
@@ -617,7 +617,7 @@ mrouter_get_lru(const struct mcast_snooping *ms,
struct mcast_mrouter_bundle **m)
OVS_REQ_RDLOCK(ms->rwlock)
{
- if (!list_is_empty(&ms->mrouter_lru)) {
+ if (!ovs_list_is_empty(&ms->mrouter_lru)) {
*m = mcast_mrouter_from_lru_node(ms->mrouter_lru.next);
return true;
} else {
@@ -655,7 +655,7 @@ mcast_snooping_add_mrouter(struct mcast_snooping *ms, uint16_t vlan,
mrouter = mcast_snooping_mrouter_lookup(ms, vlan, port);
if (mrouter) {
- list_remove(&mrouter->mrouter_node);
+ ovs_list_remove(&mrouter->mrouter_node);
} else {
mrouter = xmalloc(sizeof *mrouter);
mrouter->vlan = vlan;
@@ -665,14 +665,14 @@ mcast_snooping_add_mrouter(struct mcast_snooping *ms, uint16_t vlan,
}
mrouter->expires = time_now() + MCAST_MROUTER_PORT_IDLE_TIME;
- list_push_back(&ms->mrouter_lru, &mrouter->mrouter_node);
+ ovs_list_push_back(&ms->mrouter_lru, &mrouter->mrouter_node);
return ms->need_revalidate;
}
static void
mcast_snooping_flush_mrouter(struct mcast_mrouter_bundle *mrouter)
{
- list_remove(&mrouter->mrouter_node);
+ ovs_list_remove(&mrouter->mrouter_node);
free(mrouter);
}
@@ -690,7 +690,7 @@ static bool
mcast_snooping_port_get(const struct ovs_list *list,
struct mcast_port_bundle **f)
{
- if (!list_is_empty(list)) {
+ if (!ovs_list_is_empty(list)) {
*f = mcast_port_from_list_node(list->next);
return true;
} else {
@@ -719,13 +719,13 @@ mcast_snooping_add_port(struct ovs_list *list, void *port)
pbundle = xmalloc(sizeof *pbundle);
pbundle->port = port;
- list_insert(list, &pbundle->node);
+ ovs_list_insert(list, &pbundle->node);
}
static void
mcast_snooping_flush_port(struct mcast_port_bundle *pbundle)
{
- list_remove(&pbundle->node);
+ ovs_list_remove(&pbundle->node);
free(pbundle);
}
@@ -912,13 +912,13 @@ mcast_snooping_wait__(struct mcast_snooping *ms)
long long int mrouter_msec;
long long int msec = 0;
- if (!list_is_empty(&ms->group_lru)) {
+ if (!ovs_list_is_empty(&ms->group_lru)) {
grp = mcast_group_from_lru_node(ms->group_lru.next);
bundle = mcast_group_bundle_from_lru_node(grp->bundle_lru.next);
msec = bundle->expires * 1000LL;
}
- if (!list_is_empty(&ms->mrouter_lru)) {
+ if (!ovs_list_is_empty(&ms->mrouter_lru)) {
mrouter = mcast_mrouter_from_lru_node(ms->mrouter_lru.next);
mrouter_msec = mrouter->expires * 1000LL;
msec = msec ? MIN(msec, mrouter_msec) : mrouter_msec;
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index aa3632952..e09b47136 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -458,7 +458,7 @@ dpdk_mp_get(int socket_id, int mtu) OVS_REQUIRES(dpdk_mutex)
VLOG_DBG("Allocated \"%s\" mempool with %u mbufs", mp_name, mp_size );
}
- list_push_back(&dpdk_mp_list, &dmp->list_node);
+ ovs_list_push_back(&dpdk_mp_list, &dmp->list_node);
return dmp;
}
@@ -736,7 +736,7 @@ netdev_dpdk_init(struct netdev *netdev_, unsigned int port_no,
netdev_dpdk_alloc_txq(netdev, OVS_VHOST_MAX_QUEUE_NUM);
}
- list_push_back(&dpdk_list, &netdev->list_node);
+ ovs_list_push_back(&dpdk_list, &netdev->list_node);
unlock:
if (err) {
@@ -862,7 +862,7 @@ netdev_dpdk_destruct(struct netdev *netdev_)
ovs_mutex_lock(&dpdk_mutex);
rte_free(dev->tx_q);
- list_remove(&dev->list_node);
+ ovs_list_remove(&dev->list_node);
dpdk_mp_put(dev->dpdk_mp);
ovs_mutex_unlock(&dpdk_mutex);
}
@@ -889,7 +889,7 @@ netdev_dpdk_vhost_destruct(struct netdev *netdev_)
ovs_mutex_lock(&dpdk_mutex);
rte_free(dev->tx_q);
- list_remove(&dev->list_node);
+ ovs_list_remove(&dev->list_node);
dpdk_mp_put(dev->dpdk_mp);
ovs_mutex_unlock(&dpdk_mutex);
}
@@ -2337,7 +2337,7 @@ dpdk_ring_create(const char dev_name[], unsigned int port_no,
ivshmem->user_port_id = port_no;
ivshmem->eth_port_id = rte_eth_dev_count() - 1;
- list_push_back(&dpdk_ring_list, &ivshmem->list_node);
+ ovs_list_push_back(&dpdk_ring_list, &ivshmem->list_node);
*eth_port_id = ivshmem->eth_port_id;
return 0;
diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 933ecc861..7758943f8 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -127,7 +127,7 @@ struct netdev_rxq_dummy {
struct netdev_rxq up;
struct ovs_list node; /* In netdev_dummy's "rxes" list. */
struct ovs_list recv_queue;
- int recv_queue_len; /* list_size(&recv_queue). */
+ int recv_queue_len; /* ovs_list_size(&recv_queue). */
struct seq *seq; /* Reports newly queued packets. */
};
@@ -165,7 +165,7 @@ dummy_packet_stream_init(struct dummy_packet_stream *s, struct stream *stream)
int rxbuf_size = stream ? 2048 : 0;
s->stream = stream;
dp_packet_init(&s->rxbuf, rxbuf_size);
- list_init(&s->txq);
+ ovs_list_init(&s->txq);
}
static struct dummy_packet_stream *
@@ -183,7 +183,7 @@ static void
dummy_packet_stream_wait(struct dummy_packet_stream *s)
{
stream_run_wait(s->stream);
- if (!list_is_empty(&s->txq)) {
+ if (!ovs_list_is_empty(&s->txq)) {
stream_send_wait(s->stream);
}
stream_recv_wait(s->stream);
@@ -192,7 +192,7 @@ dummy_packet_stream_wait(struct dummy_packet_stream *s)
static void
dummy_packet_stream_send(struct dummy_packet_stream *s, const void *buffer, size_t size)
{
- if (list_size(&s->txq) < NETDEV_DUMMY_MAX_QUEUE) {
+ if (ovs_list_size(&s->txq) < NETDEV_DUMMY_MAX_QUEUE) {
struct dp_packet *b;
struct pkt_list_node *node;
@@ -201,7 +201,7 @@ dummy_packet_stream_send(struct dummy_packet_stream *s, const void *buffer, size
node = xmalloc(sizeof *node);
node->pkt = b;
- list_push_back(&s->txq, &node->list_node);
+ ovs_list_push_back(&s->txq, &node->list_node);
}
}
@@ -213,19 +213,19 @@ dummy_packet_stream_run(struct netdev_dummy *dev, struct dummy_packet_stream *s)
stream_run(s->stream);
- if (!list_is_empty(&s->txq)) {
+ if (!ovs_list_is_empty(&s->txq)) {
struct pkt_list_node *txbuf_node;
struct dp_packet *txbuf;
int retval;
- ASSIGN_CONTAINER(txbuf_node, list_front(&s->txq), list_node);
+ ASSIGN_CONTAINER(txbuf_node, ovs_list_front(&s->txq), list_node);
txbuf = txbuf_node->pkt;
retval = stream_send(s->stream, dp_packet_data(txbuf), dp_packet_size(txbuf));
if (retval > 0) {
dp_packet_pull(txbuf, retval);
if (!dp_packet_size(txbuf)) {
- list_remove(&txbuf_node->list_node);
+ ovs_list_remove(&txbuf_node->list_node);
free(txbuf_node);
dp_packet_delete(txbuf);
}
@@ -664,11 +664,11 @@ netdev_dummy_construct(struct netdev *netdev_)
dummy_packet_conn_init(&netdev->conn);
- list_init(&netdev->rxes);
+ ovs_list_init(&netdev->rxes);
ovs_mutex_unlock(&netdev->mutex);
ovs_mutex_lock(&dummy_list_mutex);
- list_push_back(&dummy_list, &netdev->list_node);
+ ovs_list_push_back(&dummy_list, &netdev->list_node);
ovs_mutex_unlock(&dummy_list_mutex);
return 0;
@@ -680,7 +680,7 @@ netdev_dummy_destruct(struct netdev *netdev_)
struct netdev_dummy *netdev = netdev_dummy_cast(netdev_);
ovs_mutex_lock(&dummy_list_mutex);
- list_remove(&netdev->list_node);
+ ovs_list_remove(&netdev->list_node);
ovs_mutex_unlock(&dummy_list_mutex);
ovs_mutex_lock(&netdev->mutex);
@@ -845,8 +845,8 @@ netdev_dummy_rxq_construct(struct netdev_rxq *rxq_)
struct netdev_dummy *netdev = netdev_dummy_cast(rx->up.netdev);
ovs_mutex_lock(&netdev->mutex);
- list_push_back(&netdev->rxes, &rx->node);
- list_init(&rx->recv_queue);
+ ovs_list_push_back(&netdev->rxes, &rx->node);
+ ovs_list_init(&rx->recv_queue);
rx->recv_queue_len = 0;
rx->seq = seq_create();
ovs_mutex_unlock(&netdev->mutex);
@@ -861,7 +861,7 @@ netdev_dummy_rxq_destruct(struct netdev_rxq *rxq_)
struct netdev_dummy *netdev = netdev_dummy_cast(rx->up.netdev);
ovs_mutex_lock(&netdev->mutex);
- list_remove(&rx->node);
+ ovs_list_remove(&rx->node);
pkt_list_delete(&rx->recv_queue);
ovs_mutex_unlock(&netdev->mutex);
seq_destroy(rx->seq);
@@ -884,10 +884,10 @@ netdev_dummy_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **arr,
struct dp_packet *packet;
ovs_mutex_lock(&netdev->mutex);
- if (!list_is_empty(&rx->recv_queue)) {
+ if (!ovs_list_is_empty(&rx->recv_queue)) {
struct pkt_list_node *pkt_node;
- ASSIGN_CONTAINER(pkt_node, list_pop_front(&rx->recv_queue), list_node);
+ ASSIGN_CONTAINER(pkt_node, ovs_list_pop_front(&rx->recv_queue), list_node);
packet = pkt_node->pkt;
free(pkt_node);
rx->recv_queue_len--;
@@ -920,7 +920,7 @@ netdev_dummy_rxq_wait(struct netdev_rxq *rxq_)
uint64_t seq = seq_read(rx->seq);
ovs_mutex_lock(&netdev->mutex);
- if (!list_is_empty(&rx->recv_queue)) {
+ if (!ovs_list_is_empty(&rx->recv_queue)) {
poll_immediate_wake();
} else {
seq_wait(rx->seq, seq);
@@ -1343,7 +1343,7 @@ netdev_dummy_queue_packet__(struct netdev_rxq_dummy *rx, struct dp_packet *packe
struct pkt_list_node *pkt_node = xmalloc(sizeof *pkt_node);
pkt_node->pkt = packet;
- list_push_back(&rx->recv_queue, &pkt_node->list_node);
+ ovs_list_push_back(&rx->recv_queue, &pkt_node->list_node);
rx->recv_queue_len++;
seq_change(rx->seq);
}
diff --git a/lib/netdev.c b/lib/netdev.c
index 47d6a8dbe..31998b39d 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -389,7 +389,7 @@ netdev_open(const char *name, const char *type, struct netdev **netdevp)
netdev->n_rxq = netdev->netdev_class->rxq_alloc ? 1 : 0;
netdev->requested_n_rxq = netdev->n_rxq;
- list_init(&netdev->saved_flags_list);
+ ovs_list_init(&netdev->saved_flags_list);
error = rc->class->construct(netdev);
if (!error) {
@@ -397,7 +397,7 @@ netdev_open(const char *name, const char *type, struct netdev **netdevp)
netdev_change_seq_changed(netdev);
} else {
free(netdev->name);
- ovs_assert(list_is_empty(&netdev->saved_flags_list));
+ ovs_assert(ovs_list_is_empty(&netdev->saved_flags_list));
shash_delete(&netdev_shash, netdev->node);
rc->class->dealloc(netdev);
}
@@ -1171,7 +1171,7 @@ do_update_flags(struct netdev *netdev, enum netdev_flags off,
ovs_mutex_lock(&netdev_mutex);
*sfp = sf = xmalloc(sizeof *sf);
sf->netdev = netdev;
- list_push_front(&netdev->saved_flags_list, &sf->node);
+ ovs_list_push_front(&netdev->saved_flags_list, &sf->node);
sf->saved_flags = changed_flags;
sf->saved_values = changed_flags & new_flags;
@@ -1252,7 +1252,7 @@ netdev_restore_flags(struct netdev_saved_flags *sf)
&old_flags);
ovs_mutex_lock(&netdev_mutex);
- list_remove(&sf->node);
+ ovs_list_remove(&sf->node);
free(sf);
netdev_unref(netdev);
}
diff --git a/lib/netlink-notifier.c b/lib/netlink-notifier.c
index 45c9188af..4db5e3ccf 100644
--- a/lib/netlink-notifier.c
+++ b/lib/netlink-notifier.c
@@ -73,7 +73,7 @@ nln_create(int protocol, int multicast_group, nln_parse_func *parse,
nln->change = change;
nln->has_run = false;
- list_init(&nln->all_notifiers);
+ ovs_list_init(&nln->all_notifiers);
return nln;
}
@@ -86,7 +86,7 @@ void
nln_destroy(struct nln *nln)
{
if (nln) {
- ovs_assert(list_is_empty(&nln->all_notifiers));
+ ovs_assert(ovs_list_is_empty(&nln->all_notifiers));
nl_sock_destroy(nln->notify_sock);
free(nln);
}
@@ -127,7 +127,7 @@ nln_notifier_create(struct nln *nln, nln_notify_func *cb, void *aux)
}
notifier = xmalloc(sizeof *notifier);
- list_push_back(&nln->all_notifiers, &notifier->node);
+ ovs_list_push_back(&nln->all_notifiers, &notifier->node);
notifier->cb = cb;
notifier->aux = aux;
notifier->nln = nln;
@@ -142,8 +142,8 @@ nln_notifier_destroy(struct nln_notifier *notifier)
if (notifier) {
struct nln *nln = notifier->nln;
- list_remove(&notifier->node);
- if (list_is_empty(&nln->all_notifiers)) {
+ ovs_list_remove(&notifier->node);
+ if (ovs_list_is_empty(&nln->all_notifiers)) {
nl_sock_destroy(nln->notify_sock);
nln->notify_sock = NULL;
}
diff --git a/lib/nx-match.c b/lib/nx-match.c
index edac68bcf..fcd2e5704 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -2009,7 +2009,7 @@ nxm_init(void)
hmap_init(&nxm_header_map);
hmap_init(&nxm_name_map);
for (int i = 0; i < MFF_N_IDS; i++) {
- list_init(&nxm_mf_map[i]);
+ ovs_list_init(&nxm_mf_map[i]);
}
for (struct nxm_field_index *nfi = all_nxm_fields;
nfi < &all_nxm_fields[ARRAY_SIZE(all_nxm_fields)]; nfi++) {
@@ -2017,7 +2017,7 @@ nxm_init(void)
hash_uint64(nxm_no_len(nfi->nf.header)));
hmap_insert(&nxm_name_map, &nfi->name_node,
hash_string(nfi->nf.name, 0));
- list_push_back(&nxm_mf_map[nfi->nf.id], &nfi->mf_node);
+ ovs_list_push_back(&nxm_mf_map[nfi->nf.id], &nfi->mf_node);
}
ovsthread_once_done(&once);
}
diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c
index 9d35df6e4..9f623c0fa 100644
--- a/lib/ofp-msgs.c
+++ b/lib/ofp-msgs.c
@@ -921,10 +921,10 @@ ofpmp_init(struct ovs_list *replies, const struct ofp_header *request)
{
struct ofpbuf *msg;
- list_init(replies);
+ ovs_list_init(replies);
msg = ofpraw_alloc_stats_reply(request, 1000);
- list_push_back(replies, &msg->list_node);
+ ovs_list_push_back(replies, &msg->list_node);
}
/* Prepares to append up to 'len' bytes to the series of statistics replies in
@@ -937,7 +937,7 @@ ofpmp_init(struct ovs_list *replies, const struct ofp_header *request)
struct ofpbuf *
ofpmp_reserve(struct ovs_list *replies, size_t len)
{
- struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *msg = ofpbuf_from_list(ovs_list_back(replies));
if (msg->size + len <= UINT16_MAX) {
ofpbuf_prealloc_tailroom(msg, len);
@@ -954,7 +954,7 @@ ofpmp_reserve(struct ovs_list *replies, size_t len)
ofpbuf_put(next, msg->data, hdrs_len);
next->header = next->data;
next->msg = ofpbuf_tail(next);
- list_push_back(replies, &next->list_node);
+ ovs_list_push_back(replies, &next->list_node);
*ofpmp_flags__(msg->data) |= htons(OFPSF_REPLY_MORE);
@@ -983,7 +983,7 @@ ofpmp_append(struct ovs_list *replies, size_t len)
void
ofpmp_postappend(struct ovs_list *replies, size_t start_ofs)
{
- struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *msg = ofpbuf_from_list(ovs_list_back(replies));
ovs_assert(start_ofs <= UINT16_MAX);
if (msg->size > UINT16_MAX) {
@@ -999,7 +999,7 @@ ofpmp_postappend(struct ovs_list *replies, size_t start_ofs)
enum ofp_version
ofpmp_version(struct ovs_list *replies)
{
- struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *msg = ofpbuf_from_list(ovs_list_back(replies));
const struct ofp_header *oh = msg->data;
return oh->version;
@@ -1010,7 +1010,7 @@ ofpmp_version(struct ovs_list *replies)
enum ofpraw
ofpmp_decode_raw(struct ovs_list *replies)
{
- struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *msg = ofpbuf_from_list(ovs_list_back(replies));
enum ofperr error;
enum ofpraw raw;
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 438270ab0..9b6db3a32 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -1399,7 +1399,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command,
gm->command = command;
gm->group_id = OFPG_ANY;
gm->command_bucket_id = OFPG15_BUCKET_ALL;
- list_init(&gm->buckets);
+ ovs_list_init(&gm->buckets);
if (command == OFPGC11_DELETE && string[0] == '\0') {
gm->group_id = OFPG_ALL;
return NULL;
@@ -1569,7 +1569,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command,
free(bucket);
goto out;
}
- list_push_back(&gm->buckets, &bucket->list_node);
+ ovs_list_push_back(&gm->buckets, &bucket->list_node);
if (gm->type != OFPGT11_SELECT && bucket->weight) {
error = xstrdup("Only select groups can have bucket weights.");
@@ -1578,7 +1578,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command,
bkt_str = next_bkt_str;
}
- if (gm->type == OFPGT11_INDIRECT && !list_is_short(&gm->buckets)) {
+ if (gm->type == OFPGT11_INDIRECT && !ovs_list_is_short(&gm->buckets)) {
error = xstrdup("Indirect groups can have at most one bucket.");
goto out;
}
@@ -1638,7 +1638,7 @@ parse_ofp_group_mod_file(const char *file_name, uint16_t command,
new_gms = x2nrealloc(*gms, &allocated_gms, sizeof **gms);
for (i = 0; i < *n_gms; i++) {
- list_moved(&new_gms[i].buckets, &(*gms)[i].buckets);
+ ovs_list_moved(&new_gms[i].buckets, &(*gms)[i].buckets);
}
*gms = new_gms;
}
@@ -1680,7 +1680,7 @@ parse_ofp_tlv_table_mod_str(struct ofputil_tlv_table_mod *ttm,
*usable_protocols = OFPUTIL_P_NXM_OXM_ANY;
ttm->command = command;
- list_init(&ttm->mappings);
+ ovs_list_init(&ttm->mappings);
while (*s) {
struct ofputil_tlv_map *map = xmalloc(sizeof *map);
@@ -1690,7 +1690,7 @@ parse_ofp_tlv_table_mod_str(struct ofputil_tlv_table_mod *ttm,
s++;
}
- list_push_back(&ttm->mappings, &map->list_node);
+ ovs_list_push_back(&ttm->mappings, &map->list_node);
if (!ovs_scan(s, "{class=%"SCNi16",type=%"SCNi8",len=%"SCNi8"}->tun_metadata%"SCNi16"%n",
&map->option_class, &map->option_type, &map->option_len,
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 97e46086e..772913810 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -1879,7 +1879,7 @@ void
ofputil_append_meter_config(struct ovs_list *replies,
const struct ofputil_meter_config *mc)
{
- struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *msg = ofpbuf_from_list(ovs_list_back(replies));
size_t start_ofs = msg->size;
struct ofp13_meter_config *reply;
@@ -2418,8 +2418,8 @@ ofputil_start_queue_get_config_reply(const struct ofp_header *request,
OVS_NOT_REACHED();
}
- list_init(replies);
- list_push_back(replies, &reply->list_node);
+ ovs_list_init(replies);
+ ovs_list_push_back(replies, &reply->list_node);
}
static void
@@ -2450,7 +2450,7 @@ ofputil_append_queue_get_config_reply(const struct ofputil_queue_config *qc,
struct ovs_list *replies)
{
enum ofp_version ofp_version = ofpmp_version(replies);
- struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies));
size_t start_ofs = reply->size;
size_t len_ofs;
ovs_be16 *len;
@@ -2995,7 +2995,7 @@ void
ofputil_append_flow_stats_reply(const struct ofputil_flow_stats *fs,
struct ovs_list *replies)
{
- struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies));
size_t start_ofs = reply->size;
enum ofp_version version = ofpmp_version(replies);
enum ofpraw raw = ofpmp_decode_raw(replies);
@@ -4535,7 +4535,7 @@ void
ofputil_append_port_desc_stats_reply(const struct ofputil_phy_port *pp,
struct ovs_list *replies)
{
- struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies));
size_t start_ofs = reply->size;
ofputil_put_phy_port(ofpmp_version(replies), pp, reply);
@@ -5403,7 +5403,7 @@ void
ofputil_append_table_features_reply(const struct ofputil_table_features *tf,
struct ovs_list *replies)
{
- struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies));
enum ofp_version version = ofpmp_version(replies);
size_t start_ofs = reply->size;
struct ofp13_table_features *otf;
@@ -5549,7 +5549,7 @@ ofputil_append_table_desc_reply(const struct ofputil_table_desc *td,
struct ovs_list *replies,
enum ofp_version version)
{
- struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies));
size_t start_otd;
struct ofp14_table_desc *otd;
@@ -6744,8 +6744,8 @@ ofputil_start_flow_update(struct ovs_list *replies)
msg = ofpraw_alloc_xid(OFPRAW_NXST_FLOW_MONITOR_REPLY, OFP10_VERSION,
htonl(0), 1024);
- list_init(replies);
- list_push_back(replies, &msg->list_node);
+ ovs_list_init(replies);
+ ovs_list_push_back(replies, &msg->list_node);
}
void
@@ -6757,7 +6757,7 @@ ofputil_append_flow_update(const struct ofputil_flow_update *update,
struct ofpbuf *msg;
size_t start_ofs;
- msg = ofpbuf_from_list(list_back(replies));
+ msg = ofpbuf_from_list(ovs_list_back(replies));
start_ofs = msg->size;
if (update->event == NXFME_ABBREV) {
@@ -7828,7 +7828,7 @@ ofputil_bucket_clone_list(struct ovs_list *dest, const struct ovs_list *src,
}
new_bucket = ofputil_bucket_clone_data(bucket);
- list_push_back(dest, &new_bucket->list_node);
+ ovs_list_push_back(dest, &new_bucket->list_node);
}
}
@@ -7880,7 +7880,7 @@ ofputil_bucket_list_front(const struct ovs_list *buckets)
{
static struct ofputil_bucket *bucket;
- ASSIGN_CONTAINER(bucket, list_front(buckets), list_node);
+ ASSIGN_CONTAINER(bucket, ovs_list_front(buckets), list_node);
return bucket;
}
@@ -7892,7 +7892,7 @@ ofputil_bucket_list_back(const struct ovs_list *buckets)
{
static struct ofputil_bucket *bucket;
- ASSIGN_CONTAINER(bucket, list_back(buckets), list_node);
+ ASSIGN_CONTAINER(bucket, ovs_list_back(buckets), list_node);
return bucket;
}
@@ -8318,7 +8318,7 @@ ofputil_append_ofp11_group_desc_reply(const struct ofputil_group_desc *gds,
struct ovs_list *replies,
enum ofp_version version)
{
- struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies));
struct ofp11_group_desc_stats *ogds;
struct ofputil_bucket *bucket;
size_t start_ogds;
@@ -8342,7 +8342,7 @@ ofputil_append_ofp15_group_desc_reply(const struct ofputil_group_desc *gds,
struct ovs_list *replies,
enum ofp_version version)
{
- struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
+ struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies));
struct ofp15_group_desc_stats *ogds;
struct ofputil_bucket *bucket;
size_t start_ogds, start_buckets;
@@ -8406,7 +8406,7 @@ ofputil_pull_ofp11_buckets(struct ofpbuf *msg, size_t buckets_length,
struct ofp11_bucket *ob;
uint32_t bucket_id = 0;
- list_init(buckets);
+ ovs_list_init(buckets);
while (buckets_length > 0) {
struct ofputil_bucket *bucket;
struct ofpbuf ofpacts;
@@ -8457,7 +8457,7 @@ ofputil_pull_ofp11_buckets(struct ofpbuf *msg, size_t buckets_length,
bucket->ofpacts = ofpbuf_steal_data(&ofpacts);
bucket->ofpacts_len = ofpacts.size;
- list_push_back(buckets, &bucket->list_node);
+ ovs_list_push_back(buckets, &bucket->list_node);
}
return 0;
@@ -8470,7 +8470,7 @@ ofputil_pull_ofp15_buckets(struct ofpbuf *msg, size_t buckets_length,
{
struct ofp15_bucket *ob;
- list_init(buckets);
+ ovs_list_init(buckets);
while (buckets_length > 0) {
struct ofputil_bucket *bucket = NULL;
struct ofpbuf ofpacts;
@@ -8570,7 +8570,7 @@ ofputil_pull_ofp15_buckets(struct ofpbuf *msg, size_t buckets_length,
bucket->ofpacts = ofpbuf_steal_data(&ofpacts);
bucket->ofpacts_len = ofpacts.size;
- list_push_back(buckets, &bucket->list_node);
+ ovs_list_push_back(buckets, &bucket->list_node);
continue;
@@ -9042,7 +9042,7 @@ ofputil_pull_ofp11_group_mod(struct ofpbuf *msg, enum ofp_version ofp_version,
if (!error
&& ofp_version >= OFP13_VERSION
&& gm->command == OFPGC11_DELETE
- && !list_is_empty(&gm->buckets)) {
+ && !ovs_list_is_empty(&gm->buckets)) {
error = OFPERR_OFPGMFC_INVALID_GROUP;
}
@@ -9140,7 +9140,7 @@ ofputil_decode_group_mod(const struct ofp_header *oh,
switch (gm->type) {
case OFPGT11_INDIRECT:
- if (!list_is_singleton(&gm->buckets)) {
+ if (!ovs_list_is_singleton(&gm->buckets)) {
return OFPERR_OFPGMFC_INVALID_GROUP;
}
break;
@@ -9159,7 +9159,7 @@ ofputil_decode_group_mod(const struct ofp_header *oh,
case OFPGC15_INSERT_BUCKET:
break;
case OFPGC15_REMOVE_BUCKET:
- if (!list_is_empty(&gm->buckets)) {
+ if (!ovs_list_is_empty(&gm->buckets)) {
return OFPERR_OFPGMFC_BAD_BUCKET;
}
break;
@@ -9764,7 +9764,7 @@ static enum ofperr
decode_tlv_table_mappings(struct ofpbuf *msg, unsigned int max_fields,
struct ovs_list *mappings)
{
- list_init(mappings);
+ ovs_list_init(mappings);
while (msg->size) {
struct nx_tlv_map *nx_map;
@@ -9772,7 +9772,7 @@ decode_tlv_table_mappings(struct ofpbuf *msg, unsigned int max_fields,
nx_map = ofpbuf_pull(msg, sizeof *nx_map);
map = xmalloc(sizeof *map);
- list_push_back(mappings, &map->list_node);
+ ovs_list_push_back(mappings, &map->list_node);
map->option_class = ntohs(nx_map->option_class);
map->option_type = nx_map->option_type;
diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c
index cd83b57d0..22ebce6e4 100644
--- a/lib/ofpbuf.c
+++ b/lib/ofpbuf.c
@@ -29,7 +29,7 @@ ofpbuf_init__(struct ofpbuf *b, size_t allocated, enum ofpbuf_source source)
b->source = source;
b->header = NULL;
b->msg = NULL;
- list_poison(&b->list_node);
+ ovs_list_poison(&b->list_node);
}
static void
diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h
index b38c9ef4d..c8e616cb4 100644
--- a/lib/ovs-atomic.h
+++ b/lib/ovs-atomic.h
@@ -596,7 +596,7 @@ ovs_refcount_try_ref_rcu(struct ovs_refcount *refcount)
*
* if (stp && ovs_refcount_unref_relaxed(&stp->ref_cnt) == 1) {
* ovs_mutex_lock(&mutex);
- * list_remove(&stp->node);
+ * ovs_list_remove(&stp->node);
* ovs_mutex_unlock(&mutex);
* free(stp->name);
* free(stp);
diff --git a/lib/ovs-lldp.c b/lib/ovs-lldp.c
index b78967774..55fc23203 100644
--- a/lib/ovs-lldp.c
+++ b/lib/ovs-lldp.c
@@ -257,7 +257,7 @@ aa_print_isid_status_port_isid(struct lldp *lldp, struct lldpd_port *port)
{
struct lldpd_aa_isid_vlan_maps_tlv *mapping;
- if (list_is_empty(&port->p_isid_vlan_maps)) {
+ if (ovs_list_is_empty(&port->p_isid_vlan_maps)) {
return;
}
@@ -396,7 +396,7 @@ update_mapping_on_lldp(struct lldp *lldp, struct lldpd_hardware *hardware,
lm->isid_vlan_data.isid = m->isid;
lm->isid_vlan_data.vlan = m->vlan;
- list_push_back(&hardware->h_lport.p_isid_vlan_maps, &lm->m_entries);
+ ovs_list_push_back(&hardware->h_lport.p_isid_vlan_maps, &lm->m_entries);
/* TODO Should be done in the Auto Attach state machine when a mapping goes
* from "pending" to "active".
@@ -407,7 +407,7 @@ update_mapping_on_lldp(struct lldp *lldp, struct lldpd_hardware *hardware,
node->vlan = m->vlan;
node->oper = BRIDGE_AA_VLAN_OPER_ADD;
- list_push_back(&lldp->active_mapping_queue, &node->list_node);
+ ovs_list_push_back(&lldp->active_mapping_queue, &node->list_node);
}
/* Bridge will poll the list of VLAN that needs to be auto configure based on
@@ -431,7 +431,7 @@ aa_get_vlan_queued(struct ovs_list *list)
copy->vlan = node->vlan;
copy->oper = node->oper;
- list_push_back(list, &copy->list_node);
+ ovs_list_push_back(list, &copy->list_node);
/* Cleanup */
free(node->port_name);
@@ -455,7 +455,7 @@ aa_get_vlan_queue_size(void)
ovs_mutex_lock(&mutex);
HMAP_FOR_EACH (lldp, hmap_node, all_lldps) {
- size += list_size(&lldp->active_mapping_queue);
+ size += ovs_list_size(&lldp->active_mapping_queue);
}
ovs_mutex_unlock(&mutex);
@@ -570,7 +570,7 @@ aa_mapping_unregister_mapping(struct lldp *lldp,
isid,
lm->isid_vlan_data.vlan);
- list_remove(&lm->m_entries);
+ ovs_list_remove(&lm->m_entries);
/* TODO Should be done in the AA SM when a mapping goes
* from "pending" to "active".
@@ -581,7 +581,7 @@ aa_mapping_unregister_mapping(struct lldp *lldp,
node->vlan = m->vlan;
node->oper = BRIDGE_AA_VLAN_OPER_REMOVE;
- list_push_back(&lldp->active_mapping_queue, &node->list_node);
+ ovs_list_push_back(&lldp->active_mapping_queue, &node->list_node);
break;
}
@@ -784,7 +784,7 @@ lldp_create(const struct netdev *netdev,
hmap_init(&lldp->mappings_by_isid);
hmap_init(&lldp->mappings_by_aux);
- list_init(&lldp->active_mapping_queue);
+ ovs_list_init(&lldp->active_mapping_queue);
lchassis = xzalloc(sizeof *lchassis);
lchassis->c_cap_available = LLDP_CAP_BRIDGE;
@@ -796,13 +796,13 @@ lldp_create(const struct netdev *netdev,
netdev_get_etheraddr(netdev, mac);
lchassis->c_id = &mac->ea[0];
- list_init(&lchassis->c_mgmt);
+ ovs_list_init(&lchassis->c_mgmt);
lchassis->c_ttl = lldp->lldpd->g_config.c_tx_interval *
lldp->lldpd->g_config.c_tx_hold;
lchassis->c_ttl = LLDP_CHASSIS_TTL;
lldpd_assign_cfg_to_protocols(lldp->lldpd);
- list_init(&lldp->lldpd->g_chassis);
- list_push_back(&lldp->lldpd->g_chassis, &lchassis->list);
+ ovs_list_init(&lldp->lldpd->g_chassis);
+ ovs_list_push_back(&lldp->lldpd->g_chassis, &lchassis->list);
if ((hw = lldpd_alloc_hardware(lldp->lldpd,
(char *) netdev_get_name(netdev),
@@ -834,9 +834,9 @@ lldp_create(const struct netdev *netdev,
hw->h_lport.p_element.system_id.rsvd2[0] = 0;
hw->h_lport.p_element.system_id.rsvd2[1] = 0;
- list_init(&hw->h_lport.p_isid_vlan_maps);
- list_init(&lldp->lldpd->g_hardware);
- list_push_back(&lldp->lldpd->g_hardware, &hw->h_entries);
+ ovs_list_init(&hw->h_lport.p_isid_vlan_maps);
+ ovs_list_init(&lldp->lldpd->g_hardware);
+ ovs_list_push_back(&lldp->lldpd->g_hardware, &hw->h_entries);
ovs_mutex_lock(&mutex);
@@ -880,7 +880,7 @@ lldp_create_dummy(void)
hmap_init(&lldp->mappings_by_isid);
hmap_init(&lldp->mappings_by_aux);
- list_init(&lldp->active_mapping_queue);
+ ovs_list_init(&lldp->active_mapping_queue);
lchassis = xzalloc(sizeof *lchassis);
lchassis->c_cap_available = LLDP_CAP_BRIDGE;
@@ -888,11 +888,11 @@ lldp_create_dummy(void)
lchassis->c_id_subtype = LLDP_CHASSISID_SUBTYPE_LLADDR;
lchassis->c_id_len = ETH_ADDR_LEN;
- list_init(&lchassis->c_mgmt);
+ ovs_list_init(&lchassis->c_mgmt);
lchassis->c_ttl = LLDP_CHASSIS_TTL;
lldpd_assign_cfg_to_protocols(lldp->lldpd);
- list_init(&lldp->lldpd->g_chassis);
- list_push_back(&lldp->lldpd->g_chassis, &lchassis->list);
+ ovs_list_init(&lldp->lldpd->g_chassis);
+ ovs_list_push_back(&lldp->lldpd->g_chassis, &lchassis->list);
hw = lldpd_alloc_hardware(lldp->lldpd, "dummy-hw", 0);
@@ -916,9 +916,9 @@ lldp_create_dummy(void)
hw->h_lport.p_element.system_id.rsvd2[0] = 0;
hw->h_lport.p_element.system_id.rsvd2[1] = 0;
- list_init(&hw->h_lport.p_isid_vlan_maps);
- list_init(&lldp->lldpd->g_hardware);
- list_push_back(&lldp->lldpd->g_hardware, &hw->h_entries);
+ ovs_list_init(&hw->h_lport.p_isid_vlan_maps);
+ ovs_list_init(&lldp->lldpd->g_hardware);
+ ovs_list_push_back(&lldp->lldpd->g_hardware, &hw->h_entries);
return lldp;
}
@@ -973,13 +973,13 @@ lldp_destroy_dummy(struct lldp *lldp)
cfg = lldp->lldpd;
LIST_FOR_EACH_SAFE (hw, hw_next, h_entries, &cfg->g_hardware) {
- list_remove(&hw->h_entries);
+ ovs_list_remove(&hw->h_entries);
free(hw->h_lport.p_lastframe);
free(hw);
}
LIST_FOR_EACH_SAFE (chassis, chassis_next, list, &cfg->g_chassis) {
- list_remove(&chassis->list);
+ ovs_list_remove(&chassis->list);
free(chassis);
}
diff --git a/lib/ovs-numa.c b/lib/ovs-numa.c
index b92522d93..747648a30 100644
--- a/lib/ovs-numa.c
+++ b/lib/ovs-numa.c
@@ -127,7 +127,7 @@ discover_numa_and_core(void)
struct dirent *subdir;
hmap_insert(&all_numa_nodes, &n->hmap_node, hash_int(i, 0));
- list_init(&n->cores);
+ ovs_list_init(&n->cores);
n->numa_id = i;
while ((subdir = readdir(dir)) != NULL) {
@@ -139,7 +139,7 @@ discover_numa_and_core(void)
core_id = strtoul(subdir->d_name + 3, NULL, 10);
hmap_insert(&all_cpu_cores, &c->hmap_node,
hash_int(core_id, 0));
- list_insert(&n->cores, &c->list_node);
+ ovs_list_insert(&n->cores, &c->list_node);
c->core_id = core_id;
c->numa = n;
c->available = true;
@@ -147,7 +147,7 @@ discover_numa_and_core(void)
}
}
VLOG_INFO("Discovered %"PRIuSIZE" CPU cores on NUMA node %d",
- list_size(&n->cores), n->numa_id);
+ ovs_list_size(&n->cores), n->numa_id);
closedir(dir);
} else if (errno != ENOENT) {
VLOG_WARN("opendir(%s) failed (%s)", path,
@@ -272,7 +272,7 @@ ovs_numa_get_n_cores_on_numa(int numa_id)
struct numa_node *numa = get_numa_by_numa_id(numa_id);
if (numa) {
- return list_size(&numa->cores);
+ return ovs_list_size(&numa->cores);
}
return OVS_CORE_UNSPEC;
@@ -380,13 +380,13 @@ ovs_numa_dump_cores_on_numa(int numa_id)
struct cpu_core *core;
dump = xmalloc(sizeof *dump);
- list_init(&dump->dump);
+ ovs_list_init(&dump->dump);
LIST_FOR_EACH(core, list_node, &numa->cores) {
struct ovs_numa_info *info = xmalloc(sizeof *info);
info->numa_id = numa->numa_id;
info->core_id = core->core_id;
- list_insert(&dump->dump, &info->list_node);
+ ovs_list_insert(&dump->dump, &info->list_node);
}
}
diff --git a/lib/ovs-rcu.c b/lib/ovs-rcu.c
index b71b075fe..0ff508efd 100644
--- a/lib/ovs-rcu.c
+++ b/lib/ovs-rcu.c
@@ -81,7 +81,7 @@ ovsrcu_perthread_get(void)
sizeof perthread->name);
ovs_mutex_lock(&ovsrcu_threads_mutex);
- list_push_back(&ovsrcu_threads, &perthread->list_node);
+ ovs_list_push_back(&ovsrcu_threads, &perthread->list_node);
ovs_mutex_unlock(&ovsrcu_threads_mutex);
pthread_setspecific(perthread_key, perthread);
@@ -257,7 +257,7 @@ ovsrcu_call_postponed(void)
struct ovs_list cbsets;
guarded_list_pop_all(&flushed_cbsets, &cbsets);
- if (list_is_empty(&cbsets)) {
+ if (ovs_list_is_empty(&cbsets)) {
return false;
}
@@ -312,7 +312,7 @@ ovsrcu_unregister__(struct ovsrcu_perthread *perthread)
}
ovs_mutex_lock(&ovsrcu_threads_mutex);
- list_remove(&perthread->list_node);
+ ovs_list_remove(&perthread->list_node);
ovs_mutex_unlock(&ovsrcu_threads_mutex);
ovs_mutex_destroy(&perthread->mutex);
@@ -347,7 +347,7 @@ ovsrcu_init_module(void)
global_seqno = seq_create();
xpthread_key_create(&perthread_key, ovsrcu_thread_exit_cb);
fatal_signal_add_hook(ovsrcu_cancel_thread_exit_cb, NULL, NULL, true);
- list_init(&ovsrcu_threads);
+ ovs_list_init(&ovsrcu_threads);
ovs_mutex_init(&ovsrcu_threads_mutex);
guarded_list_init(&flushed_cbsets);
diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
index dd95ab72c..3c065cf15 100644
--- a/lib/ovs-thread.c
+++ b/lib/ovs-thread.c
@@ -708,7 +708,7 @@ ovsthread_key_destruct__(void *slots_)
int i;
ovs_mutex_lock(&key_mutex);
- list_remove(&slots->list_node);
+ ovs_list_remove(&slots->list_node);
LIST_FOR_EACH (key, list_node, &inuse_keys) {
void *value = clear_slot(slots, key->index);
if (value && key->destructor) {
@@ -758,17 +758,17 @@ ovsthread_key_create(ovsthread_key_t *keyp, void (*destructor)(void *))
}
ovs_mutex_lock(&key_mutex);
- if (list_is_empty(&free_keys)) {
+ if (ovs_list_is_empty(&free_keys)) {
key = xmalloc(sizeof *key);
key->index = n_keys++;
if (key->index >= MAX_KEYS) {
abort();
}
} else {
- key = CONTAINER_OF(list_pop_back(&free_keys),
+ key = CONTAINER_OF(ovs_list_pop_back(&free_keys),
struct ovsthread_key, list_node);
}
- list_push_back(&inuse_keys, &key->list_node);
+ ovs_list_push_back(&inuse_keys, &key->list_node);
key->destructor = destructor;
ovs_mutex_unlock(&key_mutex);
@@ -787,8 +787,8 @@ ovsthread_key_delete(ovsthread_key_t key)
ovs_mutex_lock(&key_mutex);
/* Move 'key' from 'inuse_keys' to 'free_keys'. */
- list_remove(&key->list_node);
- list_push_back(&free_keys, &key->list_node);
+ ovs_list_remove(&key->list_node);
+ ovs_list_push_back(&free_keys, &key->list_node);
/* Clear this slot in all threads. */
LIST_FOR_EACH (slots, list_node, &slots_list) {
@@ -810,7 +810,7 @@ ovsthread_key_lookup__(const struct ovsthread_key *key)
ovs_mutex_lock(&key_mutex);
pthread_setspecific(tsd_key, slots);
- list_push_back(&slots_list, &slots->list_node);
+ ovs_list_push_back(&slots_list, &slots->list_node);
ovs_mutex_unlock(&key_mutex);
}
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index bfc133be5..b059660a7 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -256,7 +256,7 @@ ovsdb_idl_create(const char *remote, const struct ovsdb_idl_class *class,
shash_add_assert(&table->columns, column->name, column);
}
hmap_init(&table->rows);
- list_init(&table->track_list);
+ ovs_list_init(&table->track_list);
table->change_seqno[OVSDB_IDL_CHANGE_INSERT]
= table->change_seqno[OVSDB_IDL_CHANGE_MODIFY]
= table->change_seqno[OVSDB_IDL_CHANGE_DELETE] = 0;
@@ -327,8 +327,8 @@ ovsdb_idl_clear(struct ovsdb_idl *idl)
/* No need to do anything with dst_arcs: some node has those arcs
* as forward arcs and will destroy them itself. */
- if (!list_is_empty(&row->track_node)) {
- list_remove(&row->track_node);
+ if (!ovs_list_is_empty(&row->track_node)) {
+ ovs_list_remove(&row->track_node);
}
ovsdb_idl_row_destroy(row);
@@ -782,8 +782,8 @@ ovsdb_idl_track_get_first(const struct ovsdb_idl *idl,
struct ovsdb_idl_table *table
= ovsdb_idl_table_from_class(idl, table_class);
- if (!list_is_empty(&table->track_list)) {
- return CONTAINER_OF(list_front(&table->track_list), struct ovsdb_idl_row, track_node);
+ if (!ovs_list_is_empty(&table->track_list)) {
+ return CONTAINER_OF(ovs_list_front(&table->track_list), struct ovsdb_idl_row, track_node);
}
return NULL;
}
@@ -836,7 +836,7 @@ ovsdb_idl_track_clear(const struct ovsdb_idl *idl)
for (i = 0; i < idl->class->n_tables; i++) {
struct ovsdb_idl_table *table = &idl->tables[i];
- if (!list_is_empty(&table->track_list)) {
+ if (!ovs_list_is_empty(&table->track_list)) {
struct ovsdb_idl_row *row, *next;
LIST_FOR_EACH_SAFE(row, next, track_node, &table->track_list) {
@@ -844,8 +844,8 @@ ovsdb_idl_track_clear(const struct ovsdb_idl *idl)
free(row->updated);
row->updated = NULL;
}
- list_remove(&row->track_node);
- list_init(&row->track_node);
+ ovs_list_remove(&row->track_node);
+ ovs_list_init(&row->track_node);
if (ovsdb_idl_row_is_orphan(row)) {
ovsdb_idl_row_clear_old(row);
free(row);
@@ -1367,10 +1367,10 @@ ovsdb_idl_row_change__(struct ovsdb_idl_row *row, const struct json *row_json,
= row->table->change_seqno[change]
= row->table->idl->change_seqno + 1;
if (table->modes[column_idx] & OVSDB_IDL_TRACK) {
- if (!list_is_empty(&row->track_node)) {
- list_remove(&row->track_node);
+ if (!ovs_list_is_empty(&row->track_node)) {
+ ovs_list_remove(&row->track_node);
}
- list_push_back(&row->table->track_list,
+ ovs_list_push_back(&row->table->track_list,
&row->track_node);
if (!row->updated) {
row->updated = bitmap_allocate(class->n_columns);
@@ -1520,15 +1520,15 @@ ovsdb_idl_row_clear_arcs(struct ovsdb_idl_row *row, bool destroy_dsts)
* freed.
*/
LIST_FOR_EACH_SAFE (arc, next, src_node, &row->src_arcs) {
- list_remove(&arc->dst_node);
+ ovs_list_remove(&arc->dst_node);
if (destroy_dsts
&& ovsdb_idl_row_is_orphan(arc->dst)
- && list_is_empty(&arc->dst->dst_arcs)) {
+ && ovs_list_is_empty(&arc->dst->dst_arcs)) {
ovsdb_idl_row_destroy(arc->dst);
}
free(arc);
}
- list_init(&row->src_arcs);
+ ovs_list_init(&row->src_arcs);
}
/* Force nodes that reference 'row' to reparse. */
@@ -1561,10 +1561,10 @@ ovsdb_idl_row_create__(const struct ovsdb_idl_table_class *class)
{
struct ovsdb_idl_row *row = xzalloc(class->allocation_size);
class->row_init(row);
- list_init(&row->src_arcs);
- list_init(&row->dst_arcs);
+ ovs_list_init(&row->src_arcs);
+ ovs_list_init(&row->dst_arcs);
hmap_node_nullify(&row->txn_node);
- list_init(&row->track_node);
+ ovs_list_init(&row->track_node);
return row;
}
@@ -1589,8 +1589,8 @@ ovsdb_idl_row_destroy(struct ovsdb_idl_row *row)
= row->table->change_seqno[OVSDB_IDL_CHANGE_DELETE]
= row->table->idl->change_seqno + 1;
}
- if (list_is_empty(&row->track_node)) {
- list_push_back(&row->table->track_list, &row->track_node);
+ if (ovs_list_is_empty(&row->track_node)) {
+ ovs_list_push_back(&row->table->track_list, &row->track_node);
}
}
}
@@ -1603,12 +1603,12 @@ ovsdb_idl_row_destroy_postprocess(struct ovsdb_idl *idl)
for (i = 0; i < idl->class->n_tables; i++) {
struct ovsdb_idl_table *table = &idl->tables[i];
- if (!list_is_empty(&table->track_list)) {
+ if (!ovs_list_is_empty(&table->track_list)) {
struct ovsdb_idl_row *row, *next;
LIST_FOR_EACH_SAFE(row, next, track_node, &table->track_list) {
if (!ovsdb_idl_track_is_set(row->table)) {
- list_remove(&row->track_node);
+ ovs_list_remove(&row->track_node);
free(row);
}
}
@@ -1639,7 +1639,7 @@ ovsdb_idl_delete_row(struct ovsdb_idl_row *row)
ovsdb_idl_row_unparse(row);
ovsdb_idl_row_clear_arcs(row, true);
ovsdb_idl_row_clear_old(row);
- if (list_is_empty(&row->dst_arcs)) {
+ if (ovs_list_is_empty(&row->dst_arcs)) {
ovsdb_idl_row_destroy(row);
} else {
ovsdb_idl_row_reparse_backrefs(row);
@@ -1692,7 +1692,7 @@ may_add_arc(const struct ovsdb_idl_row *src, const struct ovsdb_idl_row *dst)
* at 'src', since we add all of the arcs from a given source in a clump
* (in a single call to ovsdb_idl_row_parse()) and new arcs are always
* added at the front of the dst_arcs list. */
- if (list_is_empty(&dst->dst_arcs)) {
+ if (ovs_list_is_empty(&dst->dst_arcs)) {
return true;
}
arc = CONTAINER_OF(dst->dst_arcs.next, struct ovsdb_idl_arc, dst_node);
@@ -1741,8 +1741,8 @@ ovsdb_idl_get_row_arc(struct ovsdb_idl_row *src,
/* The arc *must* be added at the front of the dst_arcs list. See
* ovsdb_idl_row_reparse_backrefs() for details. */
arc = xmalloc(sizeof *arc);
- list_push_front(&src->src_arcs, &arc->src_node);
- list_push_front(&dst->dst_arcs, &arc->dst_node);
+ ovs_list_push_front(&src->src_arcs, &arc->src_node);
+ ovs_list_push_front(&dst->dst_arcs, &arc->dst_node);
arc->src = src;
arc->dst = dst;
}
diff --git a/lib/process.c b/lib/process.c
index 5c257ed7e..e9d0ba967 100644
--- a/lib/process.c
+++ b/lib/process.c
@@ -161,7 +161,7 @@ process_register(const char *name, pid_t pid)
p->name = xstrdup(slash ? slash + 1 : name);
p->exited = false;
- list_push_back(&all_processes, &p->node);
+ ovs_list_push_back(&all_processes, &p->node);
return p;
}
@@ -275,7 +275,7 @@ void
process_destroy(struct process *p)
{
if (p) {
- list_remove(&p->node);
+ ovs_list_remove(&p->node);
free(p->name);
free(p);
}
@@ -367,7 +367,7 @@ process_run(void)
#ifndef _WIN32
char buf[_POSIX_PIPE_BUF];
- if (!list_is_empty(&all_processes) && read(fds[0], buf, sizeof buf) > 0) {
+ if (!ovs_list_is_empty(&all_processes) && read(fds[0], buf, sizeof buf) > 0) {
struct process *p;
LIST_FOR_EACH (p, node, &all_processes) {
diff --git a/lib/rconn.c b/lib/rconn.c
index 5706c3f2d..bfed74508 100644
--- a/lib/rconn.c
+++ b/lib/rconn.c
@@ -251,7 +251,7 @@ rconn_create(int probe_interval, int max_backoff, uint8_t dscp,
rc->target = xstrdup("void");
rc->reliable = false;
- list_init(&rc->txq);
+ ovs_list_init(&rc->txq);
rc->backoff = 0;
rc->max_backoff = max_backoff ? max_backoff : 8;
@@ -521,17 +521,17 @@ static void
do_tx_work(struct rconn *rc)
OVS_REQUIRES(rc->mutex)
{
- if (list_is_empty(&rc->txq)) {
+ if (ovs_list_is_empty(&rc->txq)) {
return;
}
- while (!list_is_empty(&rc->txq)) {
+ while (!ovs_list_is_empty(&rc->txq)) {
int error = try_send(rc);
if (error) {
break;
}
rc->last_activity = time_now();
}
- if (list_is_empty(&rc->txq)) {
+ if (ovs_list_is_empty(&rc->txq)) {
poll_immediate_wake();
}
}
@@ -672,7 +672,7 @@ rconn_run_wait(struct rconn *rc)
ovs_mutex_lock(&rc->mutex);
if (rc->vconn) {
vconn_run_wait(rc->vconn);
- if ((rc->state & (S_ACTIVE | S_IDLE)) && !list_is_empty(&rc->txq)) {
+ if ((rc->state & (S_ACTIVE | S_IDLE)) && !ovs_list_is_empty(&rc->txq)) {
vconn_wait(rc->vconn, WAIT_SEND);
}
}
@@ -751,7 +751,7 @@ rconn_send__(struct rconn *rc, struct ofpbuf *b,
/* Reuse 'frame' as a private pointer while 'b' is in txq. */
b->header = counter;
- list_push_back(&rc->txq, &b->list_node);
+ ovs_list_push_back(&rc->txq, &b->list_node);
/* If the queue was empty before we added 'b', try to send some
* packets. (But if the queue had packets in it, it's because the
@@ -1005,7 +1005,7 @@ rconn_count_txqlen(const struct rconn *rc)
unsigned int len;
ovs_mutex_lock(&rc->mutex);
- len = list_size(&rc->txq);
+ len = ovs_list_size(&rc->txq);
ovs_mutex_unlock(&rc->mutex);
return len;
@@ -1120,13 +1120,13 @@ try_send(struct rconn *rc)
/* Eagerly remove 'msg' from the txq. We can't remove it from the list
* after sending, if sending is successful, because it is then owned by the
* vconn, which might have freed it already. */
- list_remove(&msg->list_node);
+ ovs_list_remove(&msg->list_node);
msg->header = NULL;
retval = vconn_send(rc->vconn, msg);
if (retval) {
msg->header = counter;
- list_push_front(&rc->txq, &msg->list_node);
+ ovs_list_push_front(&rc->txq, &msg->list_node);
if (retval != EAGAIN) {
report_error(rc, retval);
disconnect(rc, retval);
@@ -1221,11 +1221,11 @@ static void
flush_queue(struct rconn *rc)
OVS_REQUIRES(rc->mutex)
{
- if (list_is_empty(&rc->txq)) {
+ if (ovs_list_is_empty(&rc->txq)) {
return;
}
- while (!list_is_empty(&rc->txq)) {
- struct ofpbuf *b = ofpbuf_from_list(list_pop_front(&rc->txq));
+ while (!ovs_list_is_empty(&rc->txq)) {
+ struct ofpbuf *b = ofpbuf_from_list(ovs_list_pop_front(&rc->txq));
struct rconn_packet_counter *counter = b->header;
if (counter) {
rconn_packet_counter_dec(counter, b->size);
diff --git a/lib/rstp.c b/lib/rstp.c
index f24ca0143..280bc6caf 100644
--- a/lib/rstp.c
+++ b/lib/rstp.c
@@ -184,7 +184,7 @@ rstp_unref(struct rstp *rstp)
* means that there should be not ports at this time. */
ovs_assert(hmap_is_empty(&rstp->ports));
- list_remove(&rstp->node);
+ ovs_list_remove(&rstp->node);
ovs_mutex_unlock(&rstp_mutex);
hmap_destroy(&rstp->ports);
free(rstp->name);
@@ -287,7 +287,7 @@ rstp_create(const char *name, rstp_identifier bridge_address,
ovs_refcount_init(&rstp->ref_cnt);
- list_push_back(all_rstps, &rstp->node);
+ ovs_list_push_back(all_rstps, &rstp->node);
ovs_mutex_unlock(&rstp_mutex);
VLOG_DBG("RSTP instance creation done");
diff --git a/lib/rtbsd.c b/lib/rtbsd.c
index df708c599..aa9cc9b5a 100644
--- a/lib/rtbsd.c
+++ b/lib/rtbsd.c
@@ -74,7 +74,7 @@ rtbsd_notifier_register(struct rtbsd_notifier *notifier,
}
}
- list_push_back(&all_notifiers, &notifier->node);
+ ovs_list_push_back(&all_notifiers, &notifier->node);
notifier->cb = cb;
notifier->aux = aux;
@@ -90,8 +90,8 @@ rtbsd_notifier_unregister(struct rtbsd_notifier *notifier)
OVS_EXCLUDED(rtbsd_mutex)
{
ovs_mutex_lock(&rtbsd_mutex);
- list_remove(&notifier->node);
- if (list_is_empty(&all_notifiers)) {
+ ovs_list_remove(&notifier->node);
+ if (ovs_list_is_empty(&all_notifiers)) {
close(notify_sock);
notify_sock = -1;
}
diff --git a/lib/seq.c b/lib/seq.c
index 704340591..57e077582 100644
--- a/lib/seq.c
+++ b/lib/seq.c
@@ -159,7 +159,7 @@ seq_wait__(struct seq *seq, uint64_t value, const char *where)
waiter->ovsthread_id = id;
waiter->value = value;
waiter->thread = seq_thread_get();
- list_push_back(&waiter->thread->waiters, &waiter->list_node);
+ ovs_list_push_back(&waiter->thread->waiters, &waiter->list_node);
if (!waiter->thread->waiting) {
latch_wait_at(&waiter->thread->latch, where);
@@ -230,7 +230,7 @@ seq_thread_get(void)
struct seq_thread *thread = pthread_getspecific(seq_thread_key);
if (!thread) {
thread = xmalloc(sizeof *thread);
- list_init(&thread->waiters);
+ ovs_list_init(&thread->waiters);
latch_init(&thread->latch);
thread->waiting = false;
@@ -270,7 +270,7 @@ seq_waiter_destroy(struct seq_waiter *waiter)
OVS_REQUIRES(seq_mutex)
{
hmap_remove(&waiter->seq->waiters, &waiter->hmap_node);
- list_remove(&waiter->list_node);
+ ovs_list_remove(&waiter->list_node);
free(waiter);
}
diff --git a/lib/seq.h b/lib/seq.h
index b0ec6bf0e..f3f4b5364 100644
--- a/lib/seq.h
+++ b/lib/seq.h
@@ -82,8 +82,8 @@
* To add an element to the queue:
*
* ovs_mutex_lock(&mutex);
- * list_push_back(&queue, ...element...);
- * if (list_is_singleton(&queue)) { // The 'if' test here is optional.
+ * ovs_list_push_back(&queue, ...element...);
+ * if (ovs_list_is_singleton(&queue)) { // The 'if' test here is optional.
* seq_change(&nonempty_seq);
* }
* ovs_mutex_unlock(&mutex);
@@ -91,7 +91,7 @@
* To wait for the queue to become nonempty:
*
* ovs_mutex_lock(&mutex);
- * if (list_is_empty(&queue)) {
+ * if (ovs_list_is_empty(&queue)) {
* seq_wait(&nonempty_seq, seq_read(&nonempty_seq));
* } else {
* poll_immediate_wake();
diff --git a/lib/stp.c b/lib/stp.c
index 467b0ba32..ba09965cc 100644
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -313,7 +313,7 @@ stp_create(const char *name, stp_identifier bridge_id,
}
ovs_refcount_init(&stp->ref_cnt);
- list_push_back(all_stps, &stp->node);
+ ovs_list_push_back(all_stps, &stp->node);
ovs_mutex_unlock(&mutex);
return stp;
}
@@ -336,7 +336,7 @@ stp_unref(struct stp *stp)
size_t i;
ovs_mutex_lock(&mutex);
- list_remove(&stp->node);
+ ovs_list_remove(&stp->node);
ovs_mutex_unlock(&mutex);
free(stp->name);
diff --git a/lib/tnl-ports.c b/lib/tnl-ports.c
index 0e329ecaa..12e03db0a 100644
--- a/lib/tnl-ports.c
+++ b/lib/tnl-ports.c
@@ -182,7 +182,7 @@ tnl_port_map_insert(odp_port_t port,
p->port = port;
p->udp_port = udp_port;
ovs_strlcpy(p->dev_name, dev_name, sizeof p->dev_name);
- list_insert(&port_list, &p->node);
+ ovs_list_insert(&port_list, &p->node);
LIST_FOR_EACH(ip_dev, node, &addr_list) {
map_insert_ipdev__(ip_dev, p->dev_name, p->port, p->udp_port);
@@ -238,7 +238,7 @@ tnl_port_map_delete(ovs_be16 udp_port)
ovs_mutex_lock(&mutex);
LIST_FOR_EACH_SAFE(p, next, node, &port_list) {
if (p->udp_port == udp_port) {
- list_remove(&p->node);
+ ovs_list_remove(&p->node);
found = true;
break;
}
@@ -370,7 +370,7 @@ insert_ipdev__(struct netdev *dev,
ip_dev->addr = addr;
ip_dev->n_addr = n_addr;
ovs_strlcpy(ip_dev->dev_name, netdev_get_name(dev), sizeof ip_dev->dev_name);
- list_insert(&addr_list, &ip_dev->node);
+ ovs_list_insert(&addr_list, &ip_dev->node);
map_insert_ipdev(ip_dev);
return;
@@ -412,7 +412,7 @@ delete_ipdev(struct ip_device *ip_dev)
ipdev_map_delete(ip_dev, p->udp_port);
}
- list_remove(&ip_dev->node);
+ ovs_list_remove(&ip_dev->node);
netdev_close(ip_dev->dev);
free(ip_dev->addr);
free(ip_dev);
@@ -479,7 +479,7 @@ void
tnl_port_map_init(void)
{
classifier_init(&cls, flow_segment_u64s);
- list_init(&addr_list);
- list_init(&port_list);
+ ovs_list_init(&addr_list);
+ ovs_list_init(&port_list);
unixctl_command_register("tnl/ports/show", "-v", 0, 1, tnl_port_show, NULL);
}
diff --git a/lib/tun-metadata.c b/lib/tun-metadata.c
index ececee5f3..1e6ef4684 100644
--- a/lib/tun-metadata.c
+++ b/lib/tun-metadata.c
@@ -208,7 +208,7 @@ tun_metadata_table_request(struct ofputil_tlv_table_reply *ttr)
ttr->max_option_space = TUN_METADATA_TOT_OPT_SIZE;
ttr->max_fields = TUN_METADATA_NUM_OPTS;
- list_init(&ttr->mappings);
+ ovs_list_init(&ttr->mappings);
for (i = 0; i < TUN_METADATA_NUM_OPTS; i++) {
struct tun_meta_entry *entry = &map->entries[i];
@@ -224,7 +224,7 @@ tun_metadata_table_request(struct ofputil_tlv_table_reply *ttr)
map->option_len = entry->loc.len;
map->index = i;
- list_push_back(&ttr->mappings, &map->list_node);
+ ovs_list_push_back(&ttr->mappings, &map->list_node);
}
}
diff --git a/lib/unixctl.c b/lib/unixctl.c
index c91dd0a9d..935c1450c 100644
--- a/lib/unixctl.c
+++ b/lib/unixctl.c
@@ -256,7 +256,7 @@ unixctl_server_create(const char *path, struct unixctl_server **serverp)
server = xmalloc(sizeof *server);
server->listener = listener;
- list_init(&server->conns);
+ ovs_list_init(&server->conns);
*serverp = server;
exit:
@@ -362,7 +362,7 @@ run_connection(struct unixctl_conn *conn)
static void
kill_connection(struct unixctl_conn *conn)
{
- list_remove(&conn->node);
+ ovs_list_remove(&conn->node);
jsonrpc_close(conn->rpc);
json_destroy(conn->request_id);
free(conn);
@@ -385,7 +385,7 @@ unixctl_server_run(struct unixctl_server *server)
error = pstream_accept(server->listener, &stream);
if (!error) {
struct unixctl_conn *conn = xzalloc(sizeof *conn);
- list_push_back(&server->conns, &conn->node);
+ ovs_list_push_back(&server->conns, &conn->node);
conn->rpc = jsonrpc_open(stream);
} else if (error == EAGAIN) {
break;
diff --git a/lib/vlog.c b/lib/vlog.c
index 4c36f1b78..6babdca0e 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -215,7 +215,7 @@ void
vlog_insert_module(struct ovs_list *vlog)
{
ovs_mutex_lock(&log_file_mutex);
- list_insert(&vlog_modules, vlog);
+ ovs_list_insert(&vlog_modules, vlog);
ovs_mutex_unlock(&log_file_mutex);
}