Commit 2799103
netdevsim: implement peer queue flow control
Add flow control mechanism between paired netdevsim devices to stop the
TX queue during high traffic scenarios. When a receive queue becomes
congested (approaching NSIM_RING_SIZE limit), the corresponding transmit
queue on the peer device is stopped using netif_subqueue_try_stop().
Once the receive queue has sufficient capacity again, the peer's
transmit queue is resumed with netif_tx_wake_queue().
Key changes:
* Add nsim_stop_peer_tx_queue() to pause peer TX when RX queue is full
* Add nsim_start_peer_tx_queue() to resume peer TX when RX queue drains
* Implement queue mapping validation to ensure TX/RX queue count match
* Wake all queues during device unlinking to prevent stuck queues
* Use RCU protection when accessing peer device references
* wake the queues when changing the queue numbers
* Remove IFF_NO_QUEUE given it will enqueue packets now
The flow control only activates when devices have matching TX/RX queue
counts to ensure proper queue mapping.
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: NipaLocal <nipa@local>1 parent 0fb5ea0 commit 2799103
3 files changed
+85
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
387 | 390 | | |
388 | 391 | | |
389 | 392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
104 | 120 | | |
105 | 121 | | |
106 | 122 | | |
| |||
113 | 129 | | |
114 | 130 | | |
115 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
116 | 137 | | |
117 | 138 | | |
118 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
41 | 87 | | |
42 | 88 | | |
43 | 89 | | |
44 | 90 | | |
45 | 91 | | |
46 | 92 | | |
47 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
48 | 100 | | |
49 | 101 | | |
50 | 102 | | |
51 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
52 | 106 | | |
53 | 107 | | |
54 | | - | |
| 108 | + | |
| 109 | + | |
55 | 110 | | |
56 | 111 | | |
57 | 112 | | |
| |||
86 | 141 | | |
87 | 142 | | |
88 | 143 | | |
89 | | - | |
| 144 | + | |
90 | 145 | | |
91 | 146 | | |
92 | 147 | | |
| |||
351 | 406 | | |
352 | 407 | | |
353 | 408 | | |
| 409 | + | |
354 | 410 | | |
355 | 411 | | |
356 | 412 | | |
| |||
864 | 920 | | |
865 | 921 | | |
866 | 922 | | |
867 | | - | |
868 | 923 | | |
869 | | - | |
870 | | - | |
| 924 | + | |
871 | 925 | | |
872 | 926 | | |
873 | 927 | | |
| |||
0 commit comments