X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fpinsched.c;h=6af2bb6765e2edcc18f46284f32fdfea3b01b17c;hb=ce5a3e38dacd8042dd7c4de7be24aca9c2887103;hp=306d8516ecc565c5d30a3808e97b8dedf48d68ca;hpb=54e05b5f6f7d3504dc74a73dcf9707cbdb28d1d1;p=openvswitch diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c index 306d8516..6af2bb67 100644 --- a/ofproto/pinsched.c +++ b/ofproto/pinsched.c @@ -16,6 +16,8 @@ #include #include "pinsched.h" +#include +#include #include #include #include @@ -228,7 +230,7 @@ pinsched_create(int rate_limit, int burst_limit, struct switch_status *ss) { struct pinsched *ps; - ps = xcalloc(1, sizeof *ps); + ps = xzalloc(sizeof *ps); port_array_init(&ps->queues); ps->n_queued = 0; ps->last_tx_port = PORT_ARRAY_SIZE; @@ -265,6 +267,14 @@ pinsched_destroy(struct pinsched *ps) } } +void +pinsched_get_limits(const struct pinsched *ps, + int *rate_limit, int *burst_limit) +{ + *rate_limit = ps->rate_limit; + *burst_limit = ps->burst_limit; +} + void pinsched_set_limits(struct pinsched *ps, int rate_limit, int burst_limit) {