-
Notifications
You must be signed in to change notification settings - Fork 82
/
rrsched.hh
54 lines (46 loc) · 1.48 KB
/
rrsched.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// -*- c-basic-offset: 4 -*-
#ifndef CLICK_RRSCHED_HH
#define CLICK_RRSCHED_HH
#include <click/batchelement.hh>
#include <click/notifier.hh>
CLICK_DECLS
/*
* =c
* RoundRobinSched
* =s scheduling
* pulls from round-robin inputs
* =io
* one output, zero or more inputs
* =d
* Each time a pull comes in the output, pulls from its inputs
* in turn until one produces a packet. When the next pull
* comes in, it starts from the input after the one that
* last produced a packet. This amounts to a round robin
* scheduler.
*
* The inputs usually come from Queues or other pull schedulers.
* RoundRobinSched uses notification to avoid pulling from empty inputs.
*
* =a PrioSched, StrideSched, DRRSched, RoundRobinSwitch, SimpleRoundRobinSched
*/
class RRSched : public BatchElement {
public:
RRSched() CLICK_COLD;
const char *class_name() const override { return "RoundRobinSched"; }
const char *port_count() const override { return "-/1"; }
const char *processing() const override { return PULL; }
const char *flags() const { return "S0"; }
int configure(Vector<String> &conf, ErrorHandler *) CLICK_COLD;
int initialize(ErrorHandler *) CLICK_COLD;
void cleanup(CleanupStage) CLICK_COLD;
Packet *pull(int port);
#if HAVE_BATCH
PacketBatch *pull_batch(int port, unsigned max);
#endif
protected:
int _next;
NotifierSignal *_signals;
int _max;
};
CLICK_ENDDECLS
#endif