Commit 2ad8345
committed
queueing: let DynamicClassifier accept a packet before it has any branch
canPushSomePacket() is inherited as "one of the existing branches can take a
packet", which is false for a classifier that has not built any branch yet. An
active source in front of such a classifier stops, waits for the notification
that would tell it packets can be pushed again, and never gets it, because
nothing else creates the first branch. Answer true instead: a packet of a class
that has not been seen yet is taken by the branch created for it, and the range
of the classifier function is not known here, so there may always be such a
class.
canPushPacket() is worse than useless in its inherited form here: it classifies
the packet, and for this classifier classifying creates the branch of a new
class, so a query that is supposed to be a query builds submodules, grows gate
vectors, wires connections and initializes the new modules. Look the class up
instead, and only delegate to the branch that already exists. (The pull side
classifies in canPullPacket() too, and is left alone: there the query is what
drives branch creation, and this classifier has no pull user.)
Classification for the map is taken directly from the classifier function
rather than through PacketClassifier::classifyPacket(), whose reverseOrder
mapping is relative to the current number of output gates -- which grows with
each branch, so the same class would be looked up under a different key later
and get a second branch.
The module test no longer needs the BackPressureBarrier that hid the missing
back pressure answer, so it now covers this as well: without the fix the
producer never produces and no branch is built.1 parent 643a5dd commit 2ad8345
3 files changed
Lines changed: 42 additions & 10 deletions
File tree
- src/inet/queueing/classifier
- tests/queueing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
35 | 45 | | |
36 | 46 | | |
37 | | - | |
| 47 | + | |
38 | 48 | | |
39 | 49 | | |
40 | 50 | | |
| |||
43 | 53 | | |
44 | 54 | | |
45 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
46 | 75 | | |
47 | 76 | | |
48 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 74 | | |
76 | | - | |
| 75 | + | |
77 | 76 | | |
78 | 77 | | |
79 | | - | |
| 78 | + | |
80 | 79 | | |
81 | 80 | | |
82 | | - | |
83 | | - | |
| 81 | + | |
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
| |||
0 commit comments