Lines Matching refs:cfg

13 def get_shapers(cfg, nl_shaper) -> None:  argument
15 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
24 def get_caps(cfg, nl_shaper) -> None: argument
26 caps = nl_shaper.cap_get({'ifindex': cfg.ifindex}, dump=True)
36 def set_qshapers(cfg, nl_shaper) -> None: argument
38 caps = nl_shaper.cap_get({'ifindex': cfg.ifindex,
47 cfg.queues = True;
49 channels = netnl.channels_get({'header': {'dev-index': cfg.ifindex}})
51 cfg.rx_type = 'rx'
52 cfg.nr_queues = channels['rx-count']
54 cfg.rx_type = 'combined'
55 cfg.nr_queues = channels['combined-count']
56 if cfg.nr_queues < 3:
59 nl_shaper.set({'ifindex': cfg.ifindex,
63 nl_shaper.set({'ifindex': cfg.ifindex,
71 shaper_q0 = nl_shaper.get({'ifindex': cfg.ifindex,
77 shaper_q1 = nl_shaper.get({'ifindex': cfg.ifindex,
79 ksft_eq(shaper_q1, {'ifindex': cfg.ifindex,
85 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
86 ksft_eq(shapers, [{'ifindex': cfg.ifindex,
91 {'ifindex': cfg.ifindex,
97 def del_qshapers(cfg, nl_shaper) -> None: argument
98 if not cfg.queues:
101 nl_shaper.delete({'ifindex': cfg.ifindex,
103 nl_shaper.delete({'ifindex': cfg.ifindex,
105 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
108 def set_nshapers(cfg, nl_shaper) -> None: argument
111 caps = nl_shaper.cap_get({'ifindex': cfg.ifindex,
120 cfg.netdev = True;
121 nl_shaper.set({'ifindex': cfg.ifindex,
125 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
126 ksft_eq(shapers, [{'ifindex': cfg.ifindex,
131 def del_nshapers(cfg, nl_shaper) -> None: argument
132 if not cfg.netdev:
135 nl_shaper.delete({'ifindex': cfg.ifindex,
137 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
140 def basic_groups(cfg, nl_shaper) -> None: argument
141 if not cfg.netdev:
143 if cfg.nr_queues < 3:
147 caps = nl_shaper.cap_get({'ifindex': cfg.ifindex,
157 'ifindex': cfg.ifindex,
165 ksft_eq(node_handle, {'ifindex': cfg.ifindex,
168 shaper = nl_shaper.get({'ifindex': cfg.ifindex,
170 ksft_eq(shaper, {'ifindex': cfg.ifindex,
175 nl_shaper.delete({'ifindex': cfg.ifindex,
177 nl_shaper.delete({'ifindex': cfg.ifindex,
182 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
185 nl_shaper.delete({'ifindex': cfg.ifindex,
188 def qgroups(cfg, nl_shaper) -> None: argument
189 if cfg.nr_queues < 4:
192 caps = nl_shaper.cap_get({'ifindex': cfg.ifindex,
201 caps = nl_shaper.cap_get({'ifindex': cfg.ifindex,
210 cfg.groups = True;
212 'ifindex': cfg.ifindex,
222 shaper = nl_shaper.get({'ifindex': cfg.ifindex,
224 ksft_eq(shaper, {'ifindex': cfg.ifindex,
228 shaper = nl_shaper.get({'ifindex': cfg.ifindex,
230 ksft_eq(shaper, {'ifindex': cfg.ifindex,
240 'ifindex': cfg.ifindex,
253 'ifindex': cfg.ifindex,
257 ksft_eq(node_handle, {'ifindex': cfg.ifindex,
260 shaper = nl_shaper.get({'ifindex': cfg.ifindex,
262 ksft_eq(shaper, {'ifindex': cfg.ifindex,
267 nl_shaper.delete({'ifindex': cfg.ifindex,
269 nl_shaper.delete({'ifindex': cfg.ifindex,
273 nl_shaper.delete({'ifindex': cfg.ifindex,
275 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
276 ksft_eq(shapers, [{'ifindex': cfg.ifindex,
282 nl_shaper.delete({'ifindex': cfg.ifindex,
284 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
287 def delegation(cfg, nl_shaper) -> None: argument
288 if not cfg.groups:
291 caps = nl_shaper.cap_get({'ifindex': cfg.ifindex,
301 'ifindex': cfg.ifindex,
315 'ifindex': cfg.ifindex,
325 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
326 ksft_eq(shapers, [{'ifindex': cfg.ifindex,
330 {'ifindex': cfg.ifindex,
334 {'ifindex': cfg.ifindex,
338 {'ifindex': cfg.ifindex,
343 {'ifindex': cfg.ifindex,
350 nl_shaper.delete({'ifindex': cfg.ifindex,
352 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
353 ksft_eq(shapers, [{'ifindex': cfg.ifindex,
357 {'ifindex': cfg.ifindex,
361 {'ifindex': cfg.ifindex,
365 {'ifindex': cfg.ifindex,
373 nl_shaper.delete({'ifindex': cfg.ifindex,
375 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
378 def queue_update(cfg, nl_shaper) -> None: argument
379 if cfg.nr_queues < 4:
381 if not cfg.queues:
385 nl_shaper.set({'ifindex': cfg.ifindex,
392 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
393 ksft_eq(shapers, [{'ifindex': cfg.ifindex,
398 {'ifindex': cfg.ifindex,
403 {'ifindex': cfg.ifindex,
413 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
414 ksft_eq(shapers, [{'ifindex': cfg.ifindex,
419 {'ifindex': cfg.ifindex,
427 shapers = nl_shaper.get({'ifindex': cfg.ifindex}, dump=True)
428 ksft_eq(shapers, [{'ifindex': cfg.ifindex,
433 {'ifindex': cfg.ifindex,
441 nl_shaper.delete({'ifindex': cfg.ifindex,
444 def dup_leaves(cfg, nl_shaper) -> None: argument
446 if not cfg.groups:
451 'ifindex': cfg.ifindex,
460 with NetDrvEnv(__file__, queue_count=4) as cfg:
461 cfg.queues = False
462 cfg.netdev = False
463 cfg.groups = False
464 cfg.nr_queues = 0
476 args=(cfg, NetshaperFamily()))