diff options
author | Thomas Graf <tgraf@noironetworks.com> | 2014-12-15 14:10:38 +0100 |
---|---|---|
committer | Thomas Graf <tgraf@noironetworks.com> | 2014-12-15 14:15:12 +0100 |
commit | ca6ba70092b1528e12d3140d70232175a13c335d (patch) | |
tree | 49c4bab3a1745a6d618582096e27b9ffaf8d8ffa /lib | |
parent | 8c7be52d10a1e9a4745249a4a94540df13d847a3 (diff) | |
download | openvswitch-ca6ba70092b1528e12d3140d70232175a13c335d.tar.gz |
list: Rename struct list to struct ovs_list
struct list is a common name and can't be used in public headers.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib')
44 files changed, 207 insertions, 205 deletions
diff --git a/lib/fat-rwlock.c b/lib/fat-rwlock.c index be53b567c..89cff1d29 100644 --- a/lib/fat-rwlock.c +++ b/lib/fat-rwlock.c @@ -30,7 +30,7 @@ struct fat_rwlock_slot { * * fat_rwlock_destroy() sets 'rwlock' to NULL to indicate that this * slot may be destroyed. */ - struct list list_node; /* In struct rwlock's 'threads' list. */ + struct ovs_list list_node; /* In struct rwlock's 'threads' list. */ struct fat_rwlock *rwlock; /* Owner. */ /* Mutex. diff --git a/lib/fat-rwlock.h b/lib/fat-rwlock.h index 27e3c2288..257cd563d 100644 --- a/lib/fat-rwlock.h +++ b/lib/fat-rwlock.h @@ -33,7 +33,7 @@ struct OVS_LOCKABLE fat_rwlock { /* Contains "struct fat_rwlock_slot"s, one for each thread that has taken * this lock. Guarded by 'mutex'. */ - struct list threads OVS_GUARDED; + struct ovs_list threads OVS_GUARDED; struct ovs_mutex mutex; }; diff --git a/lib/guarded-list.c b/lib/guarded-list.c index cbb203021..da0a43ebf 100644 --- a/lib/guarded-list.c +++ b/lib/guarded-list.c @@ -51,7 +51,7 @@ guarded_list_is_empty(const struct guarded_list *list) * the list. */ size_t guarded_list_push_back(struct guarded_list *list, - struct list *node, size_t max) + struct ovs_list *node, size_t max) { size_t retval = 0; @@ -65,10 +65,10 @@ guarded_list_push_back(struct guarded_list *list, return retval; } -struct list * +struct ovs_list * guarded_list_pop_front(struct guarded_list *list) { - struct list *node = NULL; + struct ovs_list *node = NULL; ovs_mutex_lock(&list->mutex); if (list->n) { @@ -81,7 +81,7 @@ guarded_list_pop_front(struct guarded_list *list) } size_t -guarded_list_pop_all(struct guarded_list *list, struct list *elements) +guarded_list_pop_all(struct guarded_list *list, struct ovs_list *elements) { size_t n; diff --git a/lib/guarded-list.h b/lib/guarded-list.h index df17cbc74..c19f64ee9 100644 --- a/lib/guarded-list.h +++ b/lib/guarded-list.h @@ -24,7 +24,7 @@ struct guarded_list { struct ovs_mutex mutex; - struct list list; + struct ovs_list list; size_t n; }; @@ -38,9 +38,9 @@ void guarded_list_destroy(struct guarded_list *); bool guarded_list_is_empty(const struct guarded_list *); -size_t guarded_list_push_back(struct guarded_list *, struct list *, +size_t guarded_list_push_back(struct guarded_list *, struct ovs_list *, size_t max); -struct list *guarded_list_pop_front(struct guarded_list *); -size_t guarded_list_pop_all(struct guarded_list *, struct list *); +struct ovs_list *guarded_list_pop_front(struct guarded_list *); +size_t guarded_list_pop_all(struct guarded_list *, struct ovs_list *); #endif /* guarded-list.h */ diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c index a9f6a2a55..d571656eb 100644 --- a/lib/jsonrpc.c +++ b/lib/jsonrpc.c @@ -46,7 +46,7 @@ struct jsonrpc { struct json_parser *parser; /* Output. */ - struct list output; /* Contains "struct ofpbuf"s. */ + struct ovs_list output; /* Contains "struct ofpbuf"s. */ size_t output_count; /* Number of elements in "output". */ size_t backlog; }; diff --git a/lib/lacp.c b/lib/lacp.c index ce5343b76..46d5bfb17 100644 --- a/lib/lacp.c +++ b/lib/lacp.c @@ -92,7 +92,7 @@ enum slave_status { }; struct lacp { - struct list node; /* Node in all_lacps list. */ + struct ovs_list node; /* Node in all_lacps list. */ char *name; /* Name of this lacp object. */ uint8_t sys_id[ETH_ADDR_LEN]; /* System ID. */ uint16_t sys_priority; /* System Priority. */ @@ -132,8 +132,8 @@ struct slave { }; static struct ovs_mutex mutex; -static struct list all_lacps__ = LIST_INITIALIZER(&all_lacps__); -static struct list *const all_lacps OVS_GUARDED_BY(mutex) = &all_lacps__; +static struct ovs_list all_lacps__ = LIST_INITIALIZER(&all_lacps__); +static struct ovs_list *const all_lacps OVS_GUARDED_BY(mutex) = &all_lacps__; static void lacp_update_attached(struct lacp *) OVS_REQUIRES(mutex); diff --git a/lib/list.h b/lib/list.h index 53582ee16..f2aa3350f 100644 --- a/lib/list.h +++ b/lib/list.h @@ -23,40 +23,40 @@ #include "util.h" /* Doubly linked list head or element. */ -struct list { - struct list *prev; /* Previous list element. */ - struct list *next; /* Next list element. */ +struct ovs_list { + struct ovs_list *prev; /* Previous list element. */ + struct ovs_list *next; /* Next list element. */ }; #define LIST_INITIALIZER(LIST) { LIST, LIST } -static inline void list_init(struct list *); -static inline void list_poison(struct list *); +static inline void list_init(struct ovs_list *); +static inline void list_poison(struct ovs_list *); /* List insertion. */ -static inline void list_insert(struct list *, struct list *); -static inline void list_splice(struct list *before, struct list *first, - struct list *last); -static inline void list_push_front(struct list *, struct list *); -static inline void list_push_back(struct list *, struct list *); -static inline void list_replace(struct list *, const struct list *); -static inline void list_moved(struct list *); -static inline void list_move(struct list *dst, struct list *src); +static inline void list_insert(struct ovs_list *, struct ovs_list *); +static inline void list_splice(struct ovs_list *before, struct ovs_list *first, + struct ovs_list *last); +static inline void list_push_front(struct ovs_list *, struct ovs_list *); +static inline void list_push_back(struct ovs_list *, struct ovs_list *); +static inline void list_replace(struct ovs_list *, const struct ovs_list *); +static inline void list_moved(struct ovs_list *); +static inline void list_move(struct ovs_list *dst, struct ovs_list *src); /* List removal. */ -static inline struct list *list_remove(struct list *); -static inline struct list *list_pop_front(struct list *); -static inline struct list *list_pop_back(struct list *); +static inline struct ovs_list *list_remove(struct ovs_list *); +static inline struct ovs_list *list_pop_front(struct ovs_list *); +static inline struct ovs_list *list_pop_back(struct ovs_list *); /* List elements. */ -static inline struct list *list_front(const struct list *); -static inline struct list *list_back(const struct list *); +static inline struct ovs_list *list_front(const struct ovs_list *); +static inline struct ovs_list *list_back(const struct ovs_list *); /* List properties. */ -static inline size_t list_size(const struct list *); -static inline bool list_is_empty(const struct list *); -static inline bool list_is_singleton(const struct list *); -static inline bool list_is_short(const struct list *); +static inline size_t list_size(const struct ovs_list *); +static inline bool list_is_empty(const struct ovs_list *); +static inline bool list_is_singleton(const struct ovs_list *); +static inline bool list_is_short(const struct ovs_list *); #define LIST_FOR_EACH(ITER, MEMBER, LIST) \ for (INIT_CONTAINER(ITER, (LIST)->next, MEMBER); \ @@ -85,7 +85,7 @@ static inline bool list_is_short(const struct list *); /* Initializes 'list' as an empty list. */ static inline void -list_init(struct list *list) +list_init(struct ovs_list *list) { list->next = list->prev = list; } @@ -93,14 +93,14 @@ list_init(struct list *list) /* Initializes 'list' with pointers that will (probably) cause segfaults if * dereferenced and, better yet, show up clearly in a debugger. */ static inline void -list_poison(struct list *list) +list_poison(struct ovs_list *list) { memset(list, 0xcc, sizeof *list); } /* Inserts 'elem' just before 'before'. */ static inline void -list_insert(struct list *before, struct list *elem) +list_insert(struct ovs_list *before, struct ovs_list *elem) { elem->prev = before->prev; elem->next = before; @@ -111,7 +111,7 @@ list_insert(struct list *before, struct list *elem) /* Removes elements 'first' though 'last' (exclusive) from their current list, then inserts them just before 'before'. */ static inline void -list_splice(struct list *before, struct list *first, struct list *last) +list_splice(struct ovs_list *before, struct ovs_list *first, struct ovs_list *last) { if (first == last) { return; @@ -132,7 +132,7 @@ list_splice(struct list *before, struct list *first, struct list *last) /* Inserts 'elem' at the beginning of 'list', so that it becomes the front in 'list'. */ static inline void -list_push_front(struct list *list, struct list *elem) +list_push_front(struct ovs_list *list, struct ovs_list *elem) { list_insert(list->next, elem); } @@ -140,7 +140,7 @@ list_push_front(struct list *list, struct list *elem) /* Inserts 'elem' at the end of 'list', so that it becomes the back in * 'list'. */ static inline void -list_push_back(struct list *list, struct list *elem) +list_push_back(struct ovs_list *list, struct ovs_list *elem) { list_insert(list, elem); } @@ -148,7 +148,7 @@ list_push_back(struct list *list, struct list *elem) /* Puts 'elem' in the position currently occupied by 'position'. * Afterward, 'position' is not part of a list. */ static inline void -list_replace(struct list *element, const struct list *position) +list_replace(struct ovs_list *element, const struct ovs_list *position) { element->next = position->next; element->next->prev = element; @@ -163,7 +163,7 @@ list_replace(struct list *element, const struct list *position) * of a non-empty list. It fails badly, however, if 'list' is the head of an * empty list; just use list_init() in that case. */ static inline void -list_moved(struct list *list) +list_moved(struct ovs_list *list) { list->prev->next = list->next->prev = list; } @@ -172,7 +172,7 @@ list_moved(struct list *list) * around in memory. The effect is that, if 'src' was the head of a list, now * 'dst' is the head of a list containing the same elements. */ static inline void -list_move(struct list *dst, struct list *src) +list_move(struct ovs_list *dst, struct ovs_list *src) { if (!list_is_empty(src)) { *dst = *src; @@ -184,8 +184,8 @@ list_move(struct list *dst, struct list *src) /* Removes 'elem' from its list and returns the element that followed it. Undefined behavior if 'elem' is not in a list. */ -static inline struct list * -list_remove(struct list *elem) +static inline struct ovs_list * +list_remove(struct ovs_list *elem) { elem->prev->next = elem->next; elem->next->prev = elem->prev; @@ -194,10 +194,10 @@ list_remove(struct list *elem) /* Removes the front element from 'list' and returns it. Undefined behavior if 'list' is empty before removal. */ -static inline struct list * -list_pop_front(struct list *list) +static inline struct ovs_list * +list_pop_front(struct ovs_list *list) { - struct list *front = list->next; + struct ovs_list *front = list->next; list_remove(front); return front; @@ -205,10 +205,10 @@ list_pop_front(struct list *list) /* Removes the back element from 'list' and returns it. Undefined behavior if 'list' is empty before removal. */ -static inline struct list * -list_pop_back(struct list *list) +static inline struct ovs_list * +list_pop_back(struct ovs_list *list) { - struct list *back = list->prev; + struct ovs_list *back = list->prev; list_remove(back); return back; @@ -216,10 +216,10 @@ list_pop_back(struct list *list) /* Returns the front element in 'list_'. Undefined behavior if 'list_' is empty. */ -static inline struct list * -list_front(const struct list *list_) +static inline struct ovs_list * +list_front(const struct ovs_list *list_) { - struct list *list = CONST_CAST(struct list *, list_); + struct ovs_list *list = CONST_CAST(struct ovs_list *, list_); ovs_assert(!list_is_empty(list)); @@ -228,10 +228,10 @@ list_front(const struct list *list_) /* Returns the back element in 'list_'. Undefined behavior if 'list_' is empty. */ -static inline struct list * -list_back(const struct list *list_) +static inline struct ovs_list * +list_back(const struct ovs_list *list_) { - struct list *list = CONST_CAST(struct list *, list_); + struct ovs_list *list = CONST_CAST(struct ovs_list *, list_); ovs_assert(!list_is_empty(list)); @@ -241,9 +241,9 @@ list_back(const struct list *list_) /* Returns the number of elements in 'list'. Runs in O(n) in the number of elements. */ static inline size_t -list_size(const struct list *list) +list_size(const struct ovs_list *list) { - const struct list *e; + const struct ovs_list *e; size_t cnt = 0; for (e = list->next; e != list; e = e->next) { @@ -254,21 +254,21 @@ list_size(const struct list *list) /* Returns true if 'list' is empty, false otherwise. */ static inline bool -list_is_empty(const struct list *list) +list_is_empty(const struct ovs_list *list) { return list->next == list; } /* Returns true if 'list' has exactly 1 element, false otherwise. */ static inline bool -list_is_singleton(const struct list *list) +list_is_singleton(const struct ovs_list *list) { return list_is_short(list) && !list_is_empty(list); } /* Returns true if 'list' has 0 or 1 elements, false otherwise. */ static inline bool -list_is_short(const struct list *list) +list_is_short(const struct ovs_list *list) { return list->next == list->prev; } diff --git a/lib/mac-learning.c b/lib/mac-learning.c index 7dcce4154..dbb457bab 100644 --- a/lib/mac-learning.c +++ b/lib/mac-learning.c @@ -49,7 +49,7 @@ mac_table_hash(const struct mac_learning *ml, const uint8_t mac[ETH_ADDR_LEN], } static struct mac_entry * -mac_entry_from_lru_node(struct list *list) +mac_entry_from_lru_node(struct ovs_list *list) { return CONTAINER_OF(list, struct mac_entry, lru_node); } diff --git a/lib/mac-learning.h b/lib/mac-learning.h index 34dc12c47..7f38339d5 100644 --- a/lib/mac-learning.h +++ b/lib/mac-learning.h @@ -48,7 +48,7 @@ struct mac_entry { /* The following are marked guarded to prevent users from iterating over or * accessing a mac_entry without hodling the parent mac_learning rwlock. */ - struct list lru_node OVS_GUARDED; /* Element in 'lrus' list. */ + struct ovs_list lru_node OVS_GUARDED; /* Element in 'lrus' list. */ /* Learned port. */ union { @@ -74,7 +74,7 @@ static inline bool mac_entry_is_grat_arp_locked(const struct mac_entry *mac) /* MAC learning table. */ struct mac_learning { struct hmap table; /* Learning table. */ - struct list lrus OVS_GUARDED; /* In-use entries, least recently used at the + struct ovs_list lrus OVS_GUARDED; /* In-use entries, least recently used at the front, most recently used at the back. */ uint32_t secret; /* Secret for randomizing hash table. */ unsigned long *flood_vlans; /* Bitmap of learning disabled VLANs. */ diff --git a/lib/mcast-snooping.c b/lib/mcast-snooping.c index 865144599..d99f01c13 100644 --- a/lib/mcast-snooping.c +++ b/lib/mcast-snooping.c @@ -91,13 +91,13 @@ mcast_table_hash(const struct mcast_snooping *ms, ovs_be32 grp_ip4, } static struct mcast_group_bundle * -mcast_group_bundle_from_lru_node(struct list *list) +mcast_group_bundle_from_lru_node(struct ovs_list *list) { return CONTAINER_OF(list, struct mcast_group_bundle, bundle_node); } static struct mcast_group * -mcast_group_from_lru_node(struct list *list) +mcast_group_from_lru_node(struct ovs_list *list) { return CONTAINER_OF(list, struct mcast_group, group_node); } @@ -443,7 +443,7 @@ mcast_mrouter_age(const struct mcast_snooping *ms OVS_UNUSED, } static struct mcast_mrouter_bundle * -mcast_mrouter_from_lru_node(struct list *list) +mcast_mrouter_from_lru_node(struct ovs_list *list) { return CONTAINER_OF(list, struct mcast_mrouter_bundle, mrouter_node); } @@ -518,7 +518,7 @@ mcast_snooping_flush_mrouter(struct mcast_mrouter_bundle *mrouter) /* Flood ports. */ static struct mcast_fport_bundle * -mcast_fport_from_list_node(struct list *list) +mcast_fport_from_list_node(struct ovs_list *list) { return CONTAINER_OF(list, struct mcast_fport_bundle, fport_node); } diff --git a/lib/mcast-snooping.h b/lib/mcast-snooping.h index f15e9736e..d65148c5f 100644 --- a/lib/mcast-snooping.h +++ b/lib/mcast-snooping.h @@ -51,18 +51,18 @@ struct mcast_group { uint16_t vlan; /* Node in parent struct mcast_snooping group_lru. */ - struct list group_node OVS_GUARDED; + struct ovs_list group_node OVS_GUARDED; /* Contains struct mcast_group_bundle (ports), least recently used * at the front, most recently used at the back. */ - struct list bundle_lru OVS_GUARDED; + struct ovs_list bundle_lru OVS_GUARDED; }; /* The bundle associated to the multicast group. * Guarded by owning 'mcast_snooping''s rwlock. */ struct mcast_group_bundle { /* Node in parent struct mcast_group bundle_lru list. */ - struct list bundle_node OVS_GUARDED; + struct ovs_list bundle_node OVS_GUARDED; /* When this node expires. */ time_t expires; @@ -75,7 +75,7 @@ struct mcast_group_bundle { * Guarded by owning 'mcast_snooping''s rwlock. */ struct mcast_mrouter_bundle { /* Node in parent struct mcast_group mrouter_lru list. */ - struct list mrouter_node OVS_GUARDED; + struct ovs_list mrouter_node OVS_GUARDED; /* When this node expires. */ time_t expires; @@ -91,7 +91,7 @@ struct mcast_mrouter_bundle { * Guarded by owning 'mcast_snooping''s rwlock */ struct mcast_fport_bundle { /* Node in parent struct mcast_snooping fport_list. */ - struct list fport_node; + struct ovs_list fport_node; /* VLAN tag. */ uint16_t vlan; @@ -107,15 +107,15 @@ struct mcast_snooping { /* Contains struct mcast_group, least recently used at the front, * most recently used at the back. */ - struct list group_lru OVS_GUARDED; + struct ovs_list group_lru OVS_GUARDED; /* Contains struct mcast_mrouter_bundle, least recently used at the * front, most recently used at the back. */ - struct list mrouter_lru OVS_GUARDED; + struct ovs_list mrouter_lru OVS_GUARDED; /* Contains struct mcast_fport_bundle to be flooded with multicast * packets in no special order. */ - struct list fport_list OVS_GUARDED; + struct ovs_list fport_list OVS_GUARDED; /* Secret for randomizing hash table. */ uint32_t secret; diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 9ac49c8fc..53fdb8e32 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -134,10 +134,10 @@ static int rte_eal_init_ret = ENODEV; static struct ovs_mutex dpdk_mutex = OVS_MUTEX_INITIALIZER; /* Contains all 'struct dpdk_dev's. */ -static struct list dpdk_list OVS_GUARDED_BY(dpdk_mutex) +static struct ovs_list dpdk_list OVS_GUARDED_BY(dpdk_mutex) = LIST_INITIALIZER(&dpdk_list); -static struct list dpdk_mp_list OVS_GUARDED_BY(dpdk_mutex) +static struct ovs_list dpdk_mp_list OVS_GUARDED_BY(dpdk_mutex) = LIST_INITIALIZER(&dpdk_mp_list); /* This mutex must be used by non pmd threads when allocating or freeing @@ -150,7 +150,7 @@ struct dpdk_mp { int mtu; int socket_id; int refcount; - struct list list_node OVS_GUARDED_BY(dpdk_mutex); + struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex); }; /* There should be one 'struct dpdk_tx_queue' created for @@ -167,7 +167,7 @@ struct dpdk_tx_queue { so we have to keep them around once they've been created */ -static struct list dpdk_ring_list OVS_GUARDED_BY(dpdk_mutex) +static struct ovs_list dpdk_ring_list OVS_GUARDED_BY(dpdk_mutex) = LIST_INITIALIZER(&dpdk_ring_list); struct dpdk_ring { @@ -176,7 +176,7 @@ struct dpdk_ring { struct rte_ring *cring_rx; int user_port_id; /* User given port no, parsed from port name */ int eth_port_id; /* ethernet device port id */ - struct list list_node OVS_GUARDED_BY(dpdk_mutex); + struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex); }; struct netdev_dpdk { @@ -201,7 +201,7 @@ struct netdev_dpdk { int link_reset_cnt; /* In dpdk_list. */ - struct list list_node OVS_GUARDED_BY(dpdk_mutex); + struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex); rte_spinlock_t dpdkr_tx_lock; }; diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c index f6d50709b..b794b107c 100644 --- a/lib/netdev-dummy.c +++ b/lib/netdev-dummy.c @@ -49,7 +49,7 @@ struct reconnect; struct dummy_packet_stream { struct stream *stream; struct ofpbuf rxbuf; - struct list txq; + struct ovs_list txq; }; enum dummy_packet_conn_type { @@ -87,14 +87,14 @@ struct dummy_packet_conn { static struct ovs_mutex dummy_list_mutex = OVS_MUTEX_INITIALIZER; /* Contains all 'struct dummy_dev's. */ -static struct list dummy_list OVS_GUARDED_BY(dummy_list_mutex) +static struct ovs_list dummy_list OVS_GUARDED_BY(dummy_list_mutex) = LIST_INITIALIZER(&dummy_list); struct netdev_dummy { struct netdev up; /* In dummy_list. */ - struct list list_node OVS_GUARDED_BY(dummy_list_mutex); + struct ovs_list list_node OVS_GUARDED_BY(dummy_list_mutex); /* Protects all members below. */ struct ovs_mutex mutex OVS_ACQ_AFTER(dummy_list_mutex); @@ -110,7 +110,7 @@ struct netdev_dummy { FILE *tx_pcap, *rxq_pcap OVS_GUARDED; struct in_addr address, netmask; - struct list rxes OVS_GUARDED; /* List of child "netdev_rxq_dummy"s. */ + struct ovs_list rxes OVS_GUARDED; /* List of child "netdev_rxq_dummy"s. */ }; /* Max 'recv_queue_len' in struct netdev_dummy. */ @@ -118,8 +118,8 @@ struct netdev_dummy { struct netdev_rxq_dummy { struct netdev_rxq up; - struct list node; /* In netdev_dummy's "rxes" list. */ - struct list recv_queue; + struct ovs_list node; /* In netdev_dummy's "rxes" list. */ + struct ovs_list recv_queue; int recv_queue_len; /* list_size(&recv_queue). */ struct seq *seq; /* Reports newly queued packets. */ }; diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index 0bc9f35be..3fdc7325c 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -57,7 +57,7 @@ struct netdev { int n_rxq; int ref_cnt; /* Times this devices was opened. */ struct shash_node *node; /* Pointer to element in global map. */ - struct list saved_flags_list; /* Contains "struct netdev_saved_flags". */ + struct ovs_list saved_flags_list; /* Contains "struct netdev_saved_flags". */ }; static void diff --git a/lib/netdev.c b/lib/netdev.c index a6ab141c6..4a9c0f516 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -53,7 +53,7 @@ COVERAGE_DEFINE(netdev_get_stats); struct netdev_saved_flags { struct netdev *netdev; - struct list node; /* In struct netdev's saved_flags_list. */ + struct ovs_list node; /* In struct netdev's saved_flags_list. */ enum netdev_flags saved_flags; enum netdev_flags saved_values; }; diff --git a/lib/netlink-notifier.c b/lib/netlink-notifier.c index 0be851838..713082db4 100644 --- a/lib/netlink-notifier.c +++ b/lib/netlink-notifier.c @@ -36,7 +36,7 @@ static void nln_report(struct nln *nln, void *change); struct nln { struct nl_sock *notify_sock; /* Netlink socket. */ - struct list all_notifiers; /* All nln notifiers. */ + struct ovs_list all_notifiers; /* All nln notifiers. */ bool has_run; /* Guard for run and wait functions. */ /* Passed in by nln_create(). */ @@ -49,7 +49,7 @@ struct nln { struct nln_notifier { struct nln *nln; /* Parent nln. */ - struct list node; + struct ovs_list node; nln_notify_func *cb; void *aux; }; diff --git a/lib/nx-match.c b/lib/nx-match.c index 9e9aeb482..72fa29bb6 100644 --- a/lib/nx-match.c +++ b/lib/nx-match.c @@ -1736,7 +1736,7 @@ oxm_maskable_fields(void) struct nxm_field_index { struct hmap_node header_node; /* In nxm_header_map. */ struct hmap_node name_node; /* In nxm_name_map. */ - struct list mf_node; /* In mf_mf_map[nf.id]. */ + struct ovs_list mf_node; /* In mf_mf_map[nf.id]. */ const struct nxm_field nf; }; @@ -1744,7 +1744,7 @@ struct nxm_field_index { static struct hmap nxm_header_map; static struct hmap nxm_name_map; -static struct list nxm_mf_map[MFF_N_IDS]; +static struct ovs_list nxm_mf_map[MFF_N_IDS]; static void nxm_init(void) diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c index 904aba6e0..4dfc65764 100644 --- a/lib/ofp-msgs.c +++ b/lib/ofp-msgs.c @@ -860,7 +860,7 @@ static ovs_be16 *ofpmp_flags__(const struct ofp_header *); * use calls to the other ofpmp_*() functions to add to the body and split the * message into multiple parts, if necessary. */ void -ofpmp_init(struct list *replies, const struct ofp_header *request) +ofpmp_init(struct ovs_list *replies, const struct ofp_header *request) { struct ofpbuf *msg; @@ -878,7 +878,7 @@ ofpmp_init(struct list *replies, const struct ofp_header *request) * have not actually been allocated, so the caller must do so with * e.g. ofpbuf_put_uninit(). */ struct ofpbuf * -ofpmp_reserve(struct list *replies, size_t len) +ofpmp_reserve(struct ovs_list *replies, size_t len) { struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); @@ -908,7 +908,7 @@ ofpmp_reserve(struct list *replies, size_t len) /* Appends 'len' bytes to the series of statistics replies in 'replies', and * returns the first byte. */ void * -ofpmp_append(struct list *replies, size_t len) +ofpmp_append(struct ovs_list *replies, size_t len) { return ofpbuf_put_uninit(ofpmp_reserve(replies, len), len); } @@ -924,7 +924,7 @@ ofpmp_append(struct list *replies, size_t len) * the first 'start_ofs' bytes, the second one containing the bytes from that * offset onward. */ void -ofpmp_postappend(struct list *replies, size_t start_ofs) +ofpmp_postappend(struct ovs_list *replies, size_t start_ofs) { struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); @@ -940,7 +940,7 @@ ofpmp_postappend(struct list *replies, size_t start_ofs) /* Returns the OpenFlow version of the replies being constructed in 'replies', * which should have been initialized by ofpmp_init(). */ enum ofp_version -ofpmp_version(struct list *replies) +ofpmp_version(struct ovs_list *replies) { struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); const struct ofp_header *oh = ofpbuf_data(msg); @@ -951,7 +951,7 @@ ofpmp_version(struct list *replies) /* Determines the OFPRAW_* type of the OpenFlow messages in 'replies', which * should have been initialized by ofpmp_init(). */ enum ofpraw -ofpmp_decode_raw(struct list *replies) +ofpmp_decode_raw(struct ovs_list *replies) { struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); enum ofperr error; diff --git a/lib/ofp-msgs.h b/lib/ofp-msgs.h index ad6dc6f92..23c334a30 100644 --- a/lib/ofp-msgs.h +++ b/lib/ofp-msgs.h @@ -42,7 +42,7 @@ #include "ofp-errors.h" #include "util.h" -struct list; +struct ovs_list; /* Raw identifiers for OpenFlow messages. * @@ -661,15 +661,15 @@ bool ofpmsg_is_stat_request(const struct ofp_header *); * within 64 kB doesn't need any special treatment, so you might as well use * the ofpraw_alloc_*() functions. * - * These functions work with a "struct list" of "struct ofpbuf"s, each of + * These functions work with a "struct ovs_list" of "struct ofpbuf"s, each of * which represents one part of a multipart message. */ -void ofpmp_init(struct list *, const struct ofp_header *request); -struct ofpbuf *ofpmp_reserve(struct list *, size_t len); -void *ofpmp_append(struct list *, size_t len); -void ofpmp_postappend(struct list *, size_t start_ofs); +void ofpmp_init(struct ovs_list *, const struct ofp_header *request); +struct ofpbuf *ofpmp_reserve(struct ovs_list *, size_t len); +void *ofpmp_append(struct ovs_list *, size_t len); +void ofpmp_postappend(struct ovs_list *, size_t start_ofs); -enum ofp_version ofpmp_version(struct list *); -enum ofpraw ofpmp_decode_raw(struct list *); +enum ofp_version ofpmp_version(struct ovs_list *); +enum ofpraw ofpmp_decode_raw(struct ovs_list *); /* Decoding multipart replies. */ uint16_t ofpmp_flags(const struct ofp_header *); diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 732771e65..d15a385db 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -2139,7 +2139,7 @@ ofp_print_bucket_id(struct ds *s, const char *label, uint32_t bucket_id, static void ofp_print_group(struct ds *s, uint32_t group_id, uint8_t type, - struct list *p_buckets, enum ofp_version ofp_version, + struct ovs_list *p_buckets, enum ofp_version ofp_version, bool suppress_type) { struct ofputil_bucket *bucket; diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 8ba6408a2..b32234a97 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1969,7 +1969,7 @@ ofputil_put_bands(uint16_t n_bands, const struct ofputil_meter_band *mb, /* Encode a meter stat for 'mc' and append it to 'replies'. */ void -ofputil_append_meter_config(struct list *replies, +ofputil_append_meter_config(struct ovs_list *replies, const struct ofputil_meter_config *mc) { struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); @@ -1987,7 +1987,7 @@ ofputil_append_meter_config(struct list *replies, /* Encode a meter stat for 'ms' and append it to 'replies'. */ void -ofputil_append_meter_stats(struct list *replies, +ofputil_append_meter_stats(struct ovs_list *replies, const struct ofputil_meter_stats *ms) { struct ofp13_meter_stats *reply; @@ -2973,7 +2973,7 @@ unknown_to_zero(uint64_t count) * have been initialized with ofpmp_init(). */ void ofputil_append_flow_stats_reply(const struct ofputil_flow_stats *fs, - struct list *replies) + struct ovs_list *replies) { struct ofpbuf *reply = ofpbuf_from_list(list_back(replies)); size_t start_ofs = ofpbuf_size(reply); @@ -4054,7 +4054,7 @@ ofputil_encode_port_desc_stats_request(enum ofp_version ofp_version, void ofputil_append_port_desc_stats_reply(const struct ofputil_phy_port *pp, - struct list *replies) + struct ovs_list *replies) { struct ofpbuf *reply = ofpbuf_from_list(list_back(replies)); size_t start_ofs = ofpbuf_size(reply); @@ -4875,7 +4875,7 @@ put_table_instruction_features( void ofputil_append_table_features_reply(const struct ofputil_table_features *tf, - struct list *replies) + struct ovs_list *replies) { struct ofpbuf *reply = ofpbuf_from_list(list_back(replies)); enum ofp_version version = ofpmp_version(replies); @@ -5809,7 +5809,7 @@ ofputil_encode_flow_monitor_cancel(uint32_t id) } void -ofputil_start_flow_update(struct list *replies) +ofputil_start_flow_update(struct ovs_list *replies) { struct ofpbuf *msg; @@ -5822,7 +5822,7 @@ ofputil_start_flow_update(struct list *replies) void ofputil_append_flow_update(const struct ofputil_flow_update *update, - struct list *replies) + struct ovs_list *replies) { enum ofp_version version = ofpmp_version(replies); struct nx_flow_update_header *nfuh; @@ -6540,7 +6540,7 @@ ofputil_port_stats_to_ofp13(const struct ofputil_port_stats *ops, static void ofputil_append_ofp14_port_stats(const struct ofputil_port_stats *ops, - struct list *replies) + struct ovs_list *replies) { struct ofp14_port_stats_prop_ethernet *eth; struct ofp14_port_stats *ps14; @@ -6575,7 +6575,7 @@ ofputil_append_ofp14_port_stats(const struct ofputil_port_stats *ops, /* Encode a ports stat for 'ops' and append it to 'replies'. */ void -ofputil_append_port_stat(struct list *replies, +ofputil_append_port_stat(struct ovs_list *replies, const struct ofputil_port_stats *ops) { switch (ofpmp_version(replies)) { @@ -6869,7 +6869,7 @@ ofputil_decode_port_stats_request(const struct ofp_header *request, /* Frees all of the "struct ofputil_bucket"s in the 'buckets' list. */ void -ofputil_bucket_list_destroy(struct list *buckets) +ofputil_bucket_list_destroy(struct ovs_list *buckets) { struct ofputil_bucket *bucket, *next_bucket; @@ -6899,7 +6899,7 @@ ofputil_bucket_clone_data(const struct ofputil_bucket *bucket) * This allows all of 'src' or 'all of 'src' except 'skip' to * be cloned and appended to 'dest'. */ void -ofputil_bucket_clone_list(struct list *dest, const struct list *src, +ofputil_bucket_clone_list(struct ovs_list *dest, const struct ovs_list *src, const struct ofputil_bucket *skip) { struct ofputil_bucket *bucket; @@ -6919,7 +6919,7 @@ ofputil_bucket_clone_list(struct list *dest, const struct list *src, /* Find a bucket in the list 'buckets' whose bucket id is 'bucket_id' * Returns the first bucket found or NULL if no buckets are found. */ struct ofputil_bucket * -ofputil_bucket_find(const struct list *buckets, uint32_t bucket_id) +ofputil_bucket_find(const struct ovs_list *buckets, uint32_t bucket_id) { struct ofputil_bucket *bucket; @@ -6939,7 +6939,7 @@ ofputil_bucket_find(const struct list *buckets, uint32_t bucket_id) /* Returns true if more than one bucket in the list 'buckets' * have the same bucket id. Returns false otherwise. */ bool -ofputil_bucket_check_duplicate_id(const struct list *buckets) +ofputil_bucket_check_duplicate_id(const struct ovs_list *buckets) { struct ofputil_bucket *i, *j; @@ -6960,7 +6960,7 @@ ofputil_bucket_check_duplicate_id(const struct list *buckets) /* Returns the bucket at the front of the list 'buckets'. * Undefined if 'buckets is empty. */ struct ofputil_bucket * -ofputil_bucket_list_front(const struct list *buckets) +ofputil_bucket_list_front(const struct ovs_list *buckets) { static struct ofputil_bucket *bucket; @@ -6972,7 +6972,7 @@ ofputil_bucket_list_front(const struct list *buckets) /* Returns the bucket at the back of the list 'buckets'. * Undefined if 'buckets is empty. */ struct ofputil_bucket * -ofputil_bucket_list_back(const struct list *buckets) +ofputil_bucket_list_back(const struct ovs_list *buckets) { static struct ofputil_bucket *bucket; @@ -7114,7 +7114,7 @@ ofputil_group_stats_to_ofp13(const struct ofputil_group_stats *gs, * replies already begun in 'replies' and appends it to the list. 'replies' * must have originally been initialized with ofpmp_init(). */ void -ofputil_append_group_stats(struct list *replies, +ofputil_append_group_stats(struct ovs_list *replies, const struct ofputil_group_stats *gs) { size_t bucket_counter_size; @@ -7408,8 +7408,8 @@ ofputil_put_ofp15_bucket(const struct ofputil_bucket *bucket, static void ofputil_append_ofp11_group_desc_reply(const struct ofputil_group_desc *gds, - struct list *buckets, - struct list *replies, + struct ovs_list *buckets, + struct ovs_list *replies, enum ofp_version version) { struct ofpbuf *reply = ofpbuf_from_list(list_back(replies)); @@ -7432,8 +7432,8 @@ ofputil_append_ofp11_group_desc_reply(const struct ofputil_group_desc *gds, static void ofputil_append_ofp15_group_desc_reply(const struct ofputil_group_desc *gds, - struct list *buckets, - struct list *replies, + struct ovs_list *buckets, + struct ovs_list *replies, enum ofp_version version) { struct ofpbuf *reply = ofpbuf_from_list(list_back(replies)); @@ -7462,8 +7462,8 @@ ofputil_append_ofp15_group_desc_reply(const struct ofputil_group_desc *gds, * initialized with ofpmp_init(). */ void ofputil_append_group_desc_reply(const struct ofputil_group_desc *gds, - struct list *buckets, - struct list *replies) + struct ovs_list *buckets, + struct ovs_list *replies) { enum ofp_version version = ofpmp_version(replies); @@ -7488,7 +7488,7 @@ ofputil_append_group_desc_reply(const struct ofputil_group_desc *gds, static enum ofperr ofputil_pull_ofp11_buckets(struct ofpbuf *msg, size_t buckets_length, - enum ofp_version version, struct list *buckets) + enum ofp_version version, struct ovs_list *buckets) { struct ofp11_bucket *ob; uint32_t bucket_id = 0; @@ -7586,7 +7586,7 @@ parse_ofp15_group_bucket_prop_watch(const struct ofpbuf *payload, static enum ofperr ofputil_pull_ofp15_buckets(struct ofpbuf *msg, size_t buckets_length, - enum ofp_version version, struct list *buckets) + enum ofp_version version, struct ovs_list *buckets) { struct ofp15_bucket *ob; @@ -8415,7 +8415,7 @@ ofputil_queue_stats_to_ofp14(const struct ofputil_queue_stats *oqs, /* Encode a queue stat for 'oqs' and append it to 'replies'. */ void -ofputil_append_queue_stat(struct list *replies, +ofputil_append_queue_stat(struct ovs_list *replies, const struct ofputil_queue_stats *oqs) { switch (ofpmp_version(replies)) { diff --git a/lib/ofp-util.h b/lib/ofp-util.h index 6fe28839d..d7cf5ca57 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -268,7 +268,7 @@ enum ofputil_flow_mod_flags { * The handling of cookies across multiple versions of OpenFlow is a bit * confusing. See DESIGN for the details. */ struct ofputil_flow_mod { - struct list list_node; /* For queuing flow_mods. */ + struct ovs_list list_node; /* For queuing flow_mods. */ struct match match; int priority; @@ -364,7 +364,7 @@ int ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *, bool flow_age_extension, struct ofpbuf *ofpacts); void ofputil_append_flow_stats_reply(const struct ofputil_flow_stats *, - struct list *replies); + struct ovs_list *replies); /* Aggregate stats reply, independent of protocol. */ struct ofputil_aggregate_stats { @@ -684,7 +684,7 @@ int ofputil_decode_table_features(struct ofpbuf *, struct ofpbuf *ofputil_encode_table_features_request(enum ofp_version); void ofputil_append_table_features_reply( - const struct ofputil_table_features *tf, struct list *replies); + const struct ofputil_table_features *tf, struct ovs_list *replies); /* Meter band configuration for all supported band types. */ struct ofputil_meter_band { @@ -746,10 +746,10 @@ struct ofpbuf *ofputil_encode_meter_features_reply(const struct void ofputil_decode_meter_request(const struct ofp_header *, uint32_t *meter_id); -void ofputil_append_meter_config(struct list *replies, +void ofputil_append_meter_config(struct ovs_list *replies, const struct ofputil_meter_config *); -void ofputil_append_meter_stats(struct list *replies, +void ofputil_append_meter_stats(struct ovs_list *replies, const struct ofputil_meter_stats *); enum ofputil_meter_request_type { @@ -883,9 +883,9 @@ struct ofputil_flow_update { int ofputil_decode_flow_update(struct ofputil_flow_update *, struct ofpbuf *msg, struct ofpbuf *ofpacts); -void ofputil_start_flow_update(struct list *replies); +void ofputil_start_flow_update(struct ovs_list *replies); void ofputil_append_flow_update(const struct ofputil_flow_update *, - struct list *replies); + struct ovs_list *replies); /* Abstract nx_flow_monitor_cancel. */ uint32_t ofputil_decode_flow_monitor_cancel(const struct ofp_header *); @@ -898,7 +898,7 @@ struct ofpbuf *ofputil_encode_port_desc_stats_request( enum ofp_version ofp_version, ofp_port_t); void ofputil_append_port_desc_stats_reply(const struct ofputil_phy_port *pp, - struct list *replies); + struct ovs_list *replies); /* Encoding simple OpenFlow messages. */ struct ofpbuf *make_echo_request(enum ofp_version); @@ -933,7 +933,7 @@ struct ofputil_port_stats { struct ofpbuf *ofputil_encode_dump_ports_request(enum ofp_version ofp_version, ofp_port_t port); -void ofputil_append_port_stat(struct list *replies, +void ofputil_append_port_stat(struct ovs_list *replies, const struct ofputil_port_stats *ops); size_t ofputil_count_port_stats(const struct ofp_header *); int ofputil_decode_port_stats(struct ofputil_port_stats *, struct ofpbuf *msg); @@ -968,7 +968,7 @@ struct ofputil_queue_stats { size_t ofputil_count_queue_stats(const struct ofp_header *); int ofputil_decode_queue_stats(struct ofputil_queue_stats *qs, struct ofpbuf *msg); -void ofputil_append_queue_stat(struct list *replies, +void ofputil_append_queue_stat(struct ovs_list *replies, const struct ofputil_queue_stats *oqs); struct bucket_counter { @@ -978,7 +978,7 @@ struct bucket_counter { /* Bucket for use in groups. */ struct ofputil_bucket { - struct list list_node; + struct ovs_list list_node; uint16_t weight; /* Relative weight, for "select" groups. */ ofp_port_t watch_port; /* Port whose state affects whether this bucket * is live. Only required for fast failover @@ -1002,7 +1002,7 @@ struct ofputil_group_mod { * OFPGC15_INSERT_BUCKET and * OFPGC15_REMOVE_BUCKET commands * execution.*/ - struct list buckets; /* Contains "struct ofputil_bucket"s. */ + struct ovs_list buckets; /* Contains "struct ofputil_bucket"s. */ }; /* Group stats reply, independent of protocol. */ @@ -1031,17 +1031,18 @@ struct ofputil_group_features { struct ofputil_group_desc { uint8_t type; /* One of OFPGT_*. */ uint32_t group_id; /* Group identifier. */ - struct list buckets; /* Contains "struct ofputil_bucket"s. */ + struct ovs_list buckets; /* Contains "struct ofputil_bucket"s. */ }; -void ofputil_bucket_list_destroy(struct list *buckets); -void ofputil_bucket_clone_list(struct list *dest, const struct list *src, +void ofputil_bucket_list_destroy(struct ovs_list *buckets); +void ofputil_bucket_clone_list(struct ovs_list *dest, + const struct ovs_list *src, const struct ofputil_bucket *); -struct ofputil_bucket *ofputil_bucket_find(const struct list *, +struct ofputil_bucket *ofputil_bucket_find(const struct ovs_list *, uint32_t bucket_id); -bool ofputil_bucket_check_duplicate_id(const struct list *); -struct ofputil_bucket *ofputil_bucket_list_front(const struct list *); -struct ofputil_bucket *ofputil_bucket_list_back(const struct list *); +bool ofputil_bucket_check_duplicate_id(const struct ovs_list *); +struct ofputil_bucket *ofputil_bucket_list_front(const struct ovs_list *); +struct ofputil_bucket *ofputil_bucket_list_back(const struct ovs_list *); static inline bool ofputil_bucket_has_liveness(const struct ofputil_bucket *bucket) @@ -1054,7 +1055,7 @@ struct ofpbuf *ofputil_encode_group_stats_request(enum ofp_version, uint32_t group_id); enum ofperr ofputil_decode_group_stats_request( const struct ofp_header *request, uint32_t *group_id); -void ofputil_append_group_stats(struct list *replies, +void ofputil_append_group_stats(struct ovs_list *replies, const struct ofputil_group_stats *); struct ofpbuf *ofputil_encode_group_features_request(enum ofp_version); struct ofpbuf *ofputil_encode_group_features_reply( @@ -1078,8 +1079,8 @@ int ofputil_decode_group_desc_reply(struct ofputil_group_desc *, struct ofpbuf *, enum ofp_version); void ofputil_append_group_desc_reply(const struct ofputil_group_desc *, - struct list *buckets, - struct list *replies); + struct ovs_list *buckets, + struct ovs_list *replies); struct ofputil_bundle_ctrl_msg { uint32_t bundle_id; diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c index 1d3cd0330..4946e6fc8 100644 --- a/lib/ofpbuf.c +++ b/lib/ofpbuf.c @@ -517,7 +517,7 @@ ofpbuf_to_string(const struct ofpbuf *b, size_t maxbytes) /* Removes each of the "struct ofpbuf"s on 'list' from the list and frees * them. */ void -ofpbuf_list_delete(struct list *list) +ofpbuf_list_delete(struct ovs_list *list) { struct ofpbuf *b, *next; diff --git a/lib/ofpbuf.h b/lib/ofpbuf.h index ea03c9da9..4c0f7eaa4 100644 --- a/lib/ofpbuf.h +++ b/lib/ofpbuf.h @@ -76,7 +76,7 @@ struct ofpbuf { or UINT16_MAX. */ uint16_t l4_ofs; /* Transport-level header offset from 'frame', or UINT16_MAX. */ - struct list list_node; /* Private list element for use by owner. */ + struct ovs_list list_node; /* Private list element for use by owner. */ }; static inline void * ofpbuf_data(const struct ofpbuf *); @@ -160,8 +160,8 @@ static inline void *ofpbuf_try_pull(struct ofpbuf *, size_t); void *ofpbuf_steal_data(struct ofpbuf *); char *ofpbuf_to_string(const struct ofpbuf *, size_t maxbytes); -static inline struct ofpbuf *ofpbuf_from_list(const struct list *); -void ofpbuf_list_delete(struct list *); +static inline struct ofpbuf *ofpbuf_from_list(const struct ovs_list *); +void ofpbuf_list_delete(struct ovs_list *); static inline bool ofpbuf_equal(const struct ofpbuf *, const struct ofpbuf *); @@ -263,7 +263,7 @@ static inline void *ofpbuf_try_pull(struct ofpbuf *b, size_t size) ? ofpbuf_pull(b, size) : NULL; } -static inline struct ofpbuf *ofpbuf_from_list(const struct list *list) +static inline struct ofpbuf *ofpbuf_from_list(const struct ovs_list *list) { return CONTAINER_OF(list, struct ofpbuf, list_node); } diff --git a/lib/ovs-numa.c b/lib/ovs-numa.c index 26ab3cf21..07cbc7b2d 100644 --- a/lib/ovs-numa.c +++ b/lib/ovs-numa.c @@ -59,14 +59,14 @@ VLOG_DEFINE_THIS_MODULE(ovs_numa); /* numa node. */ struct numa_node { struct hmap_node hmap_node; /* In the 'all_numa_nodes'. */ - struct list cores; /* List of cpu cores on the numa node. */ + struct ovs_list cores; /* List of cpu cores on the numa node. */ int numa_id; /* numa node id. */ }; /* Cpu core on a numa node. */ struct cpu_core { struct hmap_node hmap_node;/* In the 'all_cpu_cores'. */ - struct list list_node; /* In 'numa_node->cores' list. */ + struct ovs_list list_node; /* In 'numa_node->cores' list. */ struct numa_node *numa; /* numa node containing the core. */ int core_id; /* Core id. */ bool available; /* If the core can be pinned. */ diff --git a/lib/ovs-rcu.c b/lib/ovs-rcu.c index 11c67c929..1cf69aebb 100644 --- a/lib/ovs-rcu.c +++ b/lib/ovs-rcu.c @@ -32,13 +32,13 @@ struct ovsrcu_cb { }; struct ovsrcu_cbset { - struct list list_node; + struct ovs_list list_node; struct ovsrcu_cb cbs[16]; int n_cbs; }; struct ovsrcu_perthread { - struct list list_node; /* In global list. */ + struct ovs_list list_node; /* In global list. */ struct ovs_mutex mutex; uint64_t seqno; @@ -49,7 +49,7 @@ struct ovsrcu_perthread { static struct seq *global_seqno; static pthread_key_t perthread_key; -static struct list ovsrcu_threads; +static struct ovs_list ovsrcu_threads; static struct ovs_mutex ovsrcu_threads_mutex; static struct guarded_list flushed_cbsets; @@ -240,7 +240,7 @@ static bool ovsrcu_call_postponed(void) { struct ovsrcu_cbset *cbset, *next_cbset; - struct list cbsets; + struct ovs_list cbsets; guarded_list_pop_all(&flushed_cbsets, &cbsets); if (list_is_empty(&cbsets)) { diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c index e2c3971e5..1f346b930 100644 --- a/lib/ovs-thread.c +++ b/lib/ovs-thread.c @@ -591,7 +591,7 @@ count_cpu_cores(void) /* A piece of thread-specific data. */ struct ovsthread_key { - struct list list_node; /* In 'inuse_keys' or 'free_keys'. */ + struct ovs_list list_node; /* In 'inuse_keys' or 'free_keys'. */ void (*destructor)(void *); /* Called at thread exit. */ /* Indexes into the per-thread array in struct ovsthread_key_slots. @@ -601,7 +601,7 @@ struct ovsthread_key { /* Per-thread data structure. */ struct ovsthread_key_slots { - struct list list_node; /* In 'slots_list'. */ + struct ovs_list list_node; /* In 'slots_list'. */ void **p1[L1_SIZE]; }; @@ -620,14 +620,14 @@ static struct ovs_mutex key_mutex = OVS_MUTEX_INITIALIZER; * * Together, 'inuse_keys' and 'free_keys' hold an ovsthread_key for every index * from 0 to n_keys - 1, inclusive. */ -static struct list inuse_keys OVS_GUARDED_BY(key_mutex) +static struct ovs_list inuse_keys OVS_GUARDED_BY(key_mutex) = LIST_INITIALIZER(&inuse_keys); -static struct list free_keys OVS_GUARDED_BY(key_mutex) +static struct ovs_list free_keys OVS_GUARDED_BY(key_mutex) = LIST_INITIALIZER(&free_keys); static unsigned int n_keys OVS_GUARDED_BY(key_mutex); /* All existing struct ovsthread_key_slots. */ -static struct list slots_list OVS_GUARDED_BY(key_mutex) +static struct ovs_list slots_list OVS_GUARDED_BY(key_mutex) = LIST_INITIALIZER(&slots_list); static void * diff --git a/lib/ovsdb-idl-provider.h b/lib/ovsdb-idl-provider.h index 7ea5ce690..2ed78a76e 100644 --- a/lib/ovsdb-idl-provider.h +++ b/lib/ovsdb-idl-provider.h @@ -26,8 +26,8 @@ struct ovsdb_idl_row { struct hmap_node hmap_node; /* In struct ovsdb_idl_table's 'rows'. */ struct uuid uuid; /* Row "_uuid" field. */ - struct list src_arcs; /* Forward arcs (ovsdb_idl_arc.src_node). */ - struct list dst_arcs; /* Backward arcs (ovsdb_idl_arc.dst_node). */ + struct ovs_list src_arcs; /* Forward arcs (ovsdb_idl_arc.src_node). */ + struct ovs_list dst_arcs; /* Backward arcs (ovsdb_idl_arc.dst_node). */ struct ovsdb_idl_table *table; /* Containing table. */ struct ovsdb_datum *old; /* Committed data (null if orphaned). */ diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 4f6a2ed18..e1857b6d3 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -65,8 +65,8 @@ COVERAGE_DEFINE(txn_error); * tables. */ struct ovsdb_idl_arc { - struct list src_node; /* In src->src_arcs list. */ - struct list dst_node; /* In dst->dst_arcs list. */ + struct ovs_list src_node; /* In src->src_arcs list. */ + struct ovs_list dst_node; /* In dst->dst_arcs list. */ struct ovsdb_idl_row *src; /* Source row. */ struct ovsdb_idl_row *dst; /* Destination row. */ }; diff --git a/lib/process.c b/lib/process.c index 7946d802d..93a99ab16 100644 --- a/lib/process.c +++ b/lib/process.c @@ -41,7 +41,7 @@ VLOG_DEFINE_THIS_MODULE(process); COVERAGE_DEFINE(process_start); struct process { - struct list node; + struct ovs_list node; char *name; pid_t pid; @@ -54,7 +54,7 @@ struct process { static int fds[2]; /* All processes. */ -static struct list all_processes = LIST_INITIALIZER(&all_processes); +static struct ovs_list all_processes = LIST_INITIALIZER(&all_processes); static void sigchld_handler(int signr OVS_UNUSED); diff --git a/lib/rconn.c b/lib/rconn.c index 5c2880698..9d8c46f3e 100644 --- a/lib/rconn.c +++ b/lib/rconn.c @@ -95,7 +95,7 @@ struct rconn { char *target; /* vconn name, passed to vconn_open(). */ bool reliable; - struct list txq; /* Contains "struct ofpbuf"s. */ + struct ovs_list txq; /* Contains "struct ofpbuf"s. */ int backoff; int max_backoff; diff --git a/lib/rculist.h b/lib/rculist.h index f597d84d1..3a5795613 100644 --- a/lib/rculist.h +++ b/lib/rculist.h @@ -26,7 +26,8 @@ * To be RCU-friendly, the struct rculist instances must be freed via * ovsrcu_postpone(). * - * The API is almost the same as for struct list, with the following exeptions: + * The API is almost the same as for struct ovs_list, with the following + * exeptions: * * - The 'prev' pointer may not be accessed by the user. * - The 'next' pointer should be accessed via rculist_next() by readers, and @@ -42,7 +43,7 @@ * write operation to the list element, hopefully crashing the program if * the list node was freed or re-used too early. * - * The following functions are variations of the struct list functions with + * The following functions are variations of the struct ovs_list functions with * similar names, but are now restricted to the writer use: * * - rculist_back_protected() @@ -57,7 +58,7 @@ /* A non-existing mutex to make it more difficult for an user to accidentally * keep using the 'prev' pointer. This may be helpful when porting code from - * struct list to rculist. */ + * struct ovs_list to rculist. */ extern struct ovs_mutex rculist_fake_mutex; /* Doubly linked list head or element. */ diff --git a/lib/rstp-common.h b/lib/rstp-common.h index 271db2a52..452417e66 100644 --- a/lib/rstp-common.h +++ b/lib/rstp-common.h @@ -705,7 +705,7 @@ struct rstp_port { }; struct rstp { - struct list node OVS_GUARDED_BY(rstp_mutex); /* In rstp instances list */ + struct ovs_list node OVS_GUARDED_BY(rstp_mutex); /* In rstp instances list */ char *name; /* Bridge name. */ /* Changes in last SM execution. */ diff --git a/lib/rstp.c b/lib/rstp.c index 9573fe49a..022fc3cfb 100644 --- a/lib/rstp.c +++ b/lib/rstp.c @@ -50,8 +50,8 @@ VLOG_DEFINE_THIS_MODULE(rstp); struct ovs_mutex rstp_mutex = OVS_MUTEX_INITIALIZER; -static struct list all_rstps__ = LIST_INITIALIZER(&all_rstps__); -static struct list *const all_rstps OVS_GUARDED_BY(rstp_mutex) = &all_rstps__; +static struct ovs_list all_rstps__ = LIST_INITIALIZER(&all_rstps__); +static struct ovs_list *const all_rstps OVS_GUARDED_BY(rstp_mutex) = &all_rstps__; /* Internal use only. */ static void rstp_set_bridge_address__(struct rstp *, rstp_identifier) diff --git a/lib/rtbsd.c b/lib/rtbsd.c index ffffbb736..46a0632cc 100644 --- a/lib/rtbsd.c +++ b/lib/rtbsd.c @@ -38,7 +38,7 @@ static struct ovs_mutex rtbsd_mutex = OVS_MUTEX_INITIALIZER; static int notify_sock = -1; /* All registered notifiers. */ -static struct list all_notifiers = LIST_INITIALIZER(&all_notifiers); +static struct ovs_list all_notifiers = LIST_INITIALIZER(&all_notifiers); static void rtbsd_report_change(const struct if_msghdr *) OVS_REQUIRES(rtbsd_mutex); diff --git a/lib/rtbsd.h b/lib/rtbsd.h index 60bfae985..5dfbaffcc 100644 --- a/lib/rtbsd.h +++ b/lib/rtbsd.h @@ -44,7 +44,7 @@ struct rtbsd_change { typedef void rtbsd_notify_func(const struct rtbsd_change *, void *aux); struct rtbsd_notifier { - struct list node; + struct ovs_list node; rtbsd_notify_func *cb; void *aux; }; @@ -39,15 +39,15 @@ struct seq_waiter { struct hmap_node hmap_node OVS_GUARDED; /* In 'seq->waiters'. */ unsigned int ovsthread_id OVS_GUARDED; /* Key in 'waiters' hmap. */ - struct seq_thread *thread OVS_GUARDED; /* Thread preparing to wait. */ - struct list list_node OVS_GUARDED; /* In 'thread->waiters'. */ + struct seq_thread *thread OVS_GUARDED; /* Thread preparing to wait. */ + struct ovs_list list_node OVS_GUARDED; /* In 'thread->waiters'. */ uint64_t value OVS_GUARDED; /* seq->value we're waiting to change. */ }; /* A thread that might be waiting on one or more seqs. */ struct seq_thread { - struct list waiters OVS_GUARDED; /* Contains 'struct seq_waiter's. */ + struct ovs_list waiters OVS_GUARDED; /* Contains 'struct seq_waiter's. */ struct latch latch OVS_GUARDED; /* Wakeup latch for this thread. */ bool waiting OVS_GUARDED; /* True if latch_wait() already called. */ }; @@ -76,7 +76,7 @@ * e.g.: * * struct ovs_mutex mutex; - * struct list queue OVS_GUARDED_BY(mutex); + * struct ovs_list queue OVS_GUARDED_BY(mutex); * struct seq nonempty_seq; * * To add an element to the queue: @@ -109,7 +109,7 @@ struct stp_port { }; struct stp { - struct list node; /* Node in all_stps list. */ + struct ovs_list node; /* Node in all_stps list. */ /* Static bridge data. */ char *name; /* Human-readable name for log messages. */ @@ -150,8 +150,8 @@ struct stp { }; static struct ovs_mutex mutex; -static struct list all_stps__ = LIST_INITIALIZER(&all_stps__); -static struct list *const all_stps OVS_GUARDED_BY(mutex) = &all_stps__; +static struct ovs_list all_stps__ = LIST_INITIALIZER(&all_stps__); +static struct ovs_list *const all_stps OVS_GUARDED_BY(mutex) = &all_stps__; #define FOR_EACH_ENABLED_PORT(PORT, STP) \ for ((PORT) = stp_next_enabled_port((STP), (STP)->ports); \ diff --git a/lib/unixctl.c b/lib/unixctl.c index 5749293ba..9fb2e85b6 100644 --- a/lib/unixctl.c +++ b/lib/unixctl.c @@ -44,7 +44,7 @@ struct unixctl_command { }; struct unixctl_conn { - struct list node; + struct ovs_list node; struct jsonrpc *rpc; /* Only one request can be in progress at a time. While the request is @@ -55,7 +55,7 @@ struct unixctl_conn { /* Server for control connection. */ struct unixctl_server { struct pstream *listener; - struct list conns; + struct ovs_list conns; }; static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5); diff --git a/lib/vconn.c b/lib/vconn.c index c24e87d26..97e8dd262 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -878,7 +878,7 @@ vconn_transact_noreply(struct vconn *vconn, struct ofpbuf *request, * All of the requests on 'requests' are always destroyed, regardless of the * return value. */ int -vconn_transact_multiple_noreply(struct vconn *vconn, struct list *requests, +vconn_transact_multiple_noreply(struct vconn *vconn, struct ovs_list *requests, struct ofpbuf **replyp) { struct ofpbuf *request, *next; diff --git a/lib/vconn.h b/lib/vconn.h index f6ba95531..258568cc3 100644 --- a/lib/vconn.h +++ b/lib/vconn.h @@ -25,7 +25,7 @@ extern "C" { #endif -struct list; +struct ovs_list; struct ofpbuf; struct pvconn; struct vconn; @@ -51,7 +51,7 @@ int vconn_send(struct vconn *, struct ofpbuf *); int vconn_recv_xid(struct vconn *, ovs_be32 xid, struct ofpbuf **); int vconn_transact(struct vconn *, struct ofpbuf *, struct ofpbuf **); int vconn_transact_noreply(struct vconn *, struct ofpbuf *, struct ofpbuf **); -int vconn_transact_multiple_noreply(struct vconn *, struct list *requests, +int vconn_transact_multiple_noreply(struct vconn *, struct ovs_list *requests, struct ofpbuf **replyp); void vconn_run(struct vconn *); diff --git a/lib/vlog.c b/lib/vlog.c index a2255ebf7..639dc9127 100644 --- a/lib/vlog.c +++ b/lib/vlog.c @@ -75,7 +75,7 @@ VLOG_LEVELS BUILD_ASSERT_DECL(LOG_LOCAL0 == (16 << 3)); /* The log modules. */ -struct list vlog_modules = LIST_INITIALIZER(&vlog_modules); +struct ovs_list vlog_modules = LIST_INITIALIZER(&vlog_modules); /* Protects the 'pattern' in all "struct facility"s, so that a race between * changing and reading the pattern does not cause an access to freed diff --git a/lib/vlog.h b/lib/vlog.h index 8190a44b7..41b0adcab 100644 --- a/lib/vlog.h +++ b/lib/vlog.h @@ -79,7 +79,7 @@ enum vlog_facility vlog_get_facility_val(const char *name); /* A log module. */ struct vlog_module { - struct list list; + struct ovs_list list; const char *name; /* User-visible name. */ int levels[VLF_N_FACILITIES]; /* Minimum log level for each facility. */ int min_level; /* Minimum log level for any facility. */ @@ -87,7 +87,7 @@ struct vlog_module { }; /* Global list of all logging modules */ -extern struct list vlog_modules; +extern struct ovs_list vlog_modules; /* Creates and initializes a global instance of a module named MODULE. */ #define VLOG_DEFINE_MODULE(MODULE) \ |