#include "rconn.h"
#include "sat-math.h"
#include "timeval.h"
-#include "token-bucket.h"
-#include "vconn.h"
+#include "openvswitch/token-bucket.h"
+#include "openvswitch/vconn.h"
struct pinqueue {
struct hmap_node node; /* In struct pinsched's 'queues' hmap. */
- ofp_port_t port_no; /* Port number. */
- struct list packets; /* Contains "struct ofpbuf"s. */
+ ofp_port_t port_no; /* Port number. */
+ struct ovs_list packets; /* Contains "struct ofpbuf"s. */
int n; /* Number of packets in 'packets'. */
};
void
pinsched_send(struct pinsched *ps, ofp_port_t port_no,
- struct ofpbuf *packet, struct list *txq)
+ struct ofpbuf *packet, struct ovs_list *txq)
{
list_init(txq);
if (!ps) {
}
void
-pinsched_run(struct pinsched *ps, struct list *txq)
+pinsched_run(struct pinsched *ps, struct ovs_list *txq)
{
list_init(txq);
if (ps) {
}
}
-/* Returns the number of packets scheduled to be sent eventually by 'ps'.
- * Returns 0 if 'ps' is null. */
-unsigned int
-pinsched_count_txqlen(const struct pinsched *ps)
+/* Retrieves statistics for 'ps'. The statistics will be all zero if 'ps' is
+ * null. */
+void
+pinsched_get_stats(const struct pinsched *ps, struct pinsched_stats *stats)
{
- return ps ? ps->n_queued : 0;
+ if (ps) {
+ stats->n_queued = ps->n_queued;
+ stats->n_normal = ps->n_normal;
+ stats->n_limited = ps->n_limited;
+ stats->n_queue_dropped = ps->n_queue_dropped;
+ } else {
+ memset(stats, 0, sizeof *stats);
+ }
}