Lines Matching +full:in +full:- +full:ports

2 # SPDX-License-Identifier: GPL-2.0
19 - random size
22 - random pool number
23 - random threshold
26 - random threshold
30 for pool in pools:
37 # For threshold of 16, this works out to be about 12MB on Spectrum-1,
38 # and about 17MB on Spectrum-2.
58 for pool in self._pools:
67 return arr[random.randint(0, len(arr) - 1)]
71 if objid["pool"] in [4, 8, 9, 10]:
105 for item in objlist:
109 if isinstance(objid, Pool) and objid["pool"] in [4, 8, 9, 10]:
115 for rec in self._recs:
135 print("TEST: %-80s [FAIL]" % test_name)
137 print("TEST: %-80s [ OK ]" % test_name)
146 for key in self.varitems:
151 for key in self:
152 if key in self.varitems:
161 for item in self:
167 for item in self:
186 d = run_json_cmd("devlink sb pool show -j")
188 for pooldict in d["pool"][dlname]:
195 for pool in pools:
249 def get_tcbinds(ports, verify_existence=False): argument
250 d = run_json_cmd("devlink sb tc bind show -j -n")
252 for port in ports:
254 if port.name not in d["tc_bind"] or len(d["tc_bind"][port.name]) == 0:
257 for tcbinddict in d["tc_bind"][port.name]:
264 def do_check_tcbind(ports, tcbinds, vp): argument
265 for tcbind in tcbinds:
266 pre_tcbinds = get_tcbinds(ports)
272 post_tcbinds = get_tcbinds(ports)
285 log_test("tc bind {}-{} of sb {} set verification".format(tcbind["dlportname"],
290 def check_tcbind(dlname, ports, pools): argument
291 tcbinds = get_tcbinds(ports, verify_existence=True)
298 do_check_tcbind(ports, tcbinds, RandomValuePicker(pools))
301 do_check_tcbind(ports, tcbinds, record_vp)
321 def get_portpools(ports, verify_existence=False): argument
322 d = run_json_cmd("devlink sb port pool -j -n")
324 for port in ports:
326 if port.name not in d["port_pool"] or len(d["port_pool"][port.name]) == 0:
329 for portpooldict in d["port_pool"][port.name]:
336 def do_check_portpool(ports, portpools, vp): argument
337 for portpool in portpools:
338 pre_portpools = get_portpools(ports)
341 post_portpools = get_portpools(ports)
352 log_test("port pool {}-{} of sb {} set verification".format(portpool["dlportname"],
357 def check_portpool(dlname, ports, pools): argument
358 portpools = get_portpools(ports, verify_existence=True)
364 do_check_portpool(ports, portpools, RandomValuePicker(pools))
367 do_check_portpool(ports, portpools, record_vp)
380 d = run_json_cmd("devlink port show -j")
381 ports = PortList()
382 for name in d["port"]:
384 ports.append(Port(name))
385 return ports
389 devices_info = run_json_cmd("devlink -j dev info")["info"]
390 for d in devices_info:
391 if "mlxsw_spectrum" in devices_info[d]["driver"]:
408 ports = get_ports(dlname)
412 check_tcbind(dlname, ports, pools)
413 check_portpool(dlname, ports, pools)