projects
/
cascardo
/
ovs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
datapath-windows: set the nlBuf tail properly
[cascardo/ovs.git]
/
ofproto
/
pinsched.c
diff --git
a/ofproto/pinsched.c
b/ofproto/pinsched.c
index
5a59a50
..
d81c9b3
100644
(file)
--- a/
ofproto/pinsched.c
+++ b/
ofproto/pinsched.c
@@
-31,13
+31,13
@@
#include "rconn.h"
#include "sat-math.h"
#include "timeval.h"
#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. */
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'. */
};
int n; /* Number of packets in 'packets'. */
};
@@
-183,7
+183,7
@@
get_token(struct pinsched *ps)
void
pinsched_send(struct pinsched *ps, ofp_port_t port_no,
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) {
{
list_init(txq);
if (!ps) {
@@
-215,7
+215,7
@@
pinsched_send(struct pinsched *ps, ofp_port_t port_no,
}
void
}
void
-pinsched_run(struct pinsched *ps, struct list *txq)
+pinsched_run(struct pinsched *ps, struct
ovs_
list *txq)
{
list_init(txq);
if (ps) {
{
list_init(txq);
if (ps) {
@@
-295,10
+295,17
@@
pinsched_set_limits(struct pinsched *ps, int rate_limit, int burst_limit)
}
}
}
}
-/* Ret
urns 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 *p
s)
+/* Ret
rieves statistics for 'ps'. The statistics will be all zero if 'ps' is
+ * null. */
+void
+pinsched_
get_stats(const struct pinsched *ps, struct pinsched_stats *stat
s)
{
{
- 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);
+ }
}
}