X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fpinsched.c;h=6d7eb1301ca7c5000bd2771571e6df72c758624e;hb=b5a36e3878937a489458f7a0ff42769e826ae88b;hp=dc835585b93b3e0186b664c00cb3302d84219701;hpb=531edfbb427fd7f3287d8e6412b115e2cf6dc558;p=openvswitch diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c index dc835585..6d7eb130 100644 --- a/ofproto/pinsched.c +++ b/ofproto/pinsched.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,13 +21,13 @@ #include #include #include +#include "hash.h" #include "hmap.h" #include "ofpbuf.h" #include "openflow/openflow.h" #include "poll-loop.h" #include "random.h" #include "rconn.h" -#include "status.h" #include "timeval.h" #include "vconn.h" @@ -64,9 +64,6 @@ struct pinsched { unsigned long long n_normal; /* # txed w/o rate limit queuing. */ unsigned long long n_limited; /* # queued for rate limiting. */ unsigned long long n_queue_dropped; /* # dropped due to queue overflow. */ - - /* Switch status. */ - struct status_category *ss_cat; }; static void @@ -123,7 +120,7 @@ static void drop_packet(struct pinsched *ps) { struct pinqueue *longest; /* Queue currently selected as longest. */ - int n_longest; /* # of queues of same length as 'longest'. */ + int n_longest = 0; /* # of queues of same length as 'longest'. */ struct pinqueue *q; ps->n_queue_dropped++; @@ -213,9 +210,9 @@ pinsched_send(struct pinsched *ps, uint16_t port_no, /* Otherwise queue it up for the periodic callback to drain out. */ struct pinqueue *q; - /* We are called with a buffer obtained from dpif_recv() that has much - * more allocated space than actual content most of the time. Since - * we're going to store the packet for some time, free up that + /* We might be called with a buffer obtained from dpif_recv() that has + * much more allocated space than actual content most of the time. + * Since we're going to store the packet for some time, free up that * otherwise wasted space. */ ofpbuf_trim(packet); @@ -230,16 +227,6 @@ pinsched_send(struct pinsched *ps, uint16_t port_no, } } -static void -pinsched_status_cb(struct status_reply *sr, void *ps_) -{ - struct pinsched *ps = ps_; - - status_reply_put(sr, "normal=%llu", ps->n_normal); - status_reply_put(sr, "limited=%llu", ps->n_limited); - status_reply_put(sr, "queue-dropped=%llu", ps->n_queue_dropped); -} - void pinsched_run(struct pinsched *ps, pinsched_tx_cb *cb, void *aux) { @@ -272,7 +259,7 @@ pinsched_wait(struct pinsched *ps) /* Creates and returns a scheduler for sending packet-in messages. */ struct pinsched * -pinsched_create(int rate_limit, int burst_limit, struct switch_status *ss) +pinsched_create(int rate_limit, int burst_limit) { struct pinsched *ps; @@ -288,11 +275,6 @@ pinsched_create(int rate_limit, int burst_limit, struct switch_status *ss) ps->n_queue_dropped = 0; pinsched_set_limits(ps, rate_limit, burst_limit); - if (ss) { - ps->ss_cat = switch_status_register(ss, "rate-limit", - pinsched_status_cb, ps); - } - return ps; } @@ -308,7 +290,6 @@ pinsched_destroy(struct pinsched *ps) free(q); } hmap_destroy(&ps->queues); - switch_status_unregister(ps->ss_cat); free(ps); } }