{
struct netdev_dev_linux *netdev_dev =
netdev_dev_linux_cast(netdev_get_dev(netdev));
- struct tc_queue *queue;
+ struct tc_queue *queue, *next_queue;
struct shash details;
int last_error;
int error;
last_error = 0;
shash_init(&details);
- HMAP_FOR_EACH (queue, hmap_node, &netdev_dev->tc->queues) {
+ HMAP_FOR_EACH_SAFE (queue, next_queue, hmap_node,
+ &netdev_dev->tc->queues) {
shash_clear(&details);
error = netdev_dev->tc->ops->class_get(netdev, queue, &details);
/*
- * Copyright (c) 2009, 2010, 2011 Nicira Networks.
+ * Copyright (c) 2009, 2010, 2011, 2012 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* of iteration is unspecified, but (when successful) each queue is visited
* exactly once.
*
- * 'cb' will not modify or free the 'details' argument passed in. */
+ * 'cb' will not modify or free the 'details' argument passed in. It may
+ * delete or modify the queue passed in as its 'queue_id' argument. It may
+ * modify but will not delete any other queue within 'netdev'. If 'cb'
+ * adds new queues, then ->dump_queues is allowed to visit some queues
+ * twice or not at all.
+ */
int (*dump_queues)(const struct netdev *netdev,
void (*cb)(unsigned int queue_id,
const struct shash *details,
* Calling this function may be more efficient than calling netdev_get_queue()
* for every queue.
*
- * 'cb' must not modify or free the 'details' argument passed in.
+ * 'cb' must not modify or free the 'details' argument passed in. It may
+ * delete or modify the queue passed in as its 'queue_id' argument. It may
+ * modify but must not delete any other queue within 'netdev'. 'cb' should not
+ * add new queues because this may cause some queues to be visited twice or not
+ * at all.
*
* Returns 0 if successful, otherwise a positive errno value. On error, some
* configured queues may not have been included in the iteration. */