Lines Matching refs:sim
640 fail(dev["ifname"] != sim["ifname"],
641 "Ifname incorrect %s vs %s" % (dev["ifname"], sim["ifname"]))
680 def test_spurios_extack(sim, obj, skip_hw, needle): argument
681 res = sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_hw=skip_hw,
684 res = sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1,
687 res = sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf",
691 def test_multi_prog(simdev, sim, obj, modename, modeid): argument
694 sim.set_xdp(obj, "offload")
695 xdp = sim.ip_link_show(xdp=True)["xdp"]
696 offloaded = sim.dfs_read("bpf_offloaded_id")
701 sim.set_xdp(obj, modename)
702 two_xdps = sim.ip_link_show(xdp=True)["xdp"]
708 offloaded2 = sim.dfs_read("bpf_offloaded_id")
713 ret, _, err = sim.set_xdp(obj, "offload", fail=False, include_stderr=True)
718 ret, _, err = sim.unset_xdp("", force=True,
723 sim.unset_xdp("offload")
724 xdp = sim.ip_link_show(xdp=True)["xdp"]
725 offloaded = sim.dfs_read("bpf_offloaded_id")
737 sim.set_xdp(obj, "offload")
738 two_xdps = sim.ip_link_show(xdp=True)["xdp"]
748 sim, = simdev.nsims
749 sim.set_ethtool_tc_offloads(True)
750 return [simdev, sim]
813 sim, = simdev.nsims variable
814 sim.set_xdp(obj, "generic")
819 sim, = simdev.nsims variable
820 sim.tc_add_ingress()
823 ret, _ = sim.cls_bpf_add_filter(obj, skip_hw=True, fail=False)
827 ret, _ = sim.cls_bpf_add_filter(obj, fail=False)
831 sim.tc_flush_filters()
834 ret, _, err = sim.cls_bpf_add_filter(obj, skip_sw=True,
838 sim.wait_for_flush()
840 sim.set_ethtool_tc_offloads(True)
841 sim.dfs["bpf_tc_non_bound_accept"] = "Y"
844 ret, _ = sim.cls_bpf_add_filter(obj, fail=False)
847 ingress = sim.tc_show_ingress(expected=1)
851 sim.tc_flush_filters()
854 ret, _ = sim.cls_bpf_add_filter(bytecode, fail=False)
857 ingress = sim.tc_show_ingress(expected=1)
861 sim.tc_flush_filters()
862 sim.dfs["bpf_tc_non_bound_accept"] = "N"
865 ret, _, err = sim.cls_bpf_add_filter(bytecode, skip_sw=True,
870 sim.wait_for_flush()
873 ret, _, err = sim.cls_bpf_add_filter(obj, chain=1, prio=1, handle=1,
878 sim.tc_flush_filters()
881 sim.cls_bpf_add_filter(obj, prio=1, handle=1)
882 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1)
883 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
885 sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_sw=True)
886 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1, skip_sw=True)
887 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
889 sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_hw=True)
890 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1, skip_hw=True)
891 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
896 ret, _ = sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1,
902 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
905 test_spurios_extack(sim, obj, False, "netdevsim")
906 test_spurios_extack(sim, obj, True, "netdevsim")
908 sim.set_ethtool_tc_offloads(False)
910 test_spurios_extack(sim, obj, False, "TC offload is disabled")
911 test_spurios_extack(sim, obj, True, "TC offload is disabled")
913 sim.set_ethtool_tc_offloads(True)
915 sim.tc_flush_filters()
918 sim.dfs["dev/bpf_bind_verifier_accept"] = 0
919 ret, _, err = sim.cls_bpf_add_filter(obj, verbose=True, skip_sw=True,
923 sim.dfs["dev/bpf_bind_verifier_accept"] = 1
926 ret, _, err = sim.cls_bpf_add_filter(obj, verbose=True, skip_sw=True,
933 ingress = sim.tc_show_ingress(expected=1)
950 ret, _ = sim.set_ethtool_tc_offloads(False, fail=False)
952 sim.set_ethtool_tc_offloads(True)
955 sim.tc_flush_filters()
956 sim.tc_show_ingress(expected=0)
959 ret, _ = sim.set_ethtool_tc_offloads(False, fail=False)
963 sim.set_ethtool_tc_offloads(True)
966 sim.cls_bpf_add_filter(obj, skip_sw=True)
971 sim, = simdev.nsims variable
972 sim.set_ethtool_tc_offloads(True)
975 sim.set_xdp(obj, "offload")
980 sim, = simdev.nsims variable
981 sim.set_ethtool_tc_offloads(True)
984 sim.set_xdp(obj, "drv")
985 ipl = sim.ip_link_show(xdp=True)
991 ret, _ = sim.set_xdp(obj, "drv", fail=False)
993 sim.wait_for_flush(total=1)
996 ret, _ = sim.set_xdp(obj, "drv", force=True, fail=False)
999 ipl = sim.ip_link_show(xdp=True)
1007 ret, _, err = sim.set_xdp(obj, "generic", force=True,
1015 ret, _ = sim.set_mtu(9000, fail=False)
1018 sim.unset_xdp("drv")
1020 sim.set_mtu(9000)
1021 ret, _, err = sim.set_xdp(obj, "drv", fail=False, include_stderr=True)
1024 sim.set_mtu(1500)
1026 sim.wait_for_flush()
1030 ret, _, err = sim.set_xdp(nooffload, "offload",
1038 dev=sim['ifname'])
1040 ret, _, err = sim.set_xdp(offload, "drv", fail=False, include_stderr=True)
1044 sim.wait_for_flush()
1047 sim.dfs["dev/bpf_bind_verifier_accept"] = 0
1049 dev=sim['ifname'], fail=False, include_stderr=True)
1052 sim.dfs["dev/bpf_bind_verifier_accept"] = 1
1053 sim.wait_for_flush()
1056 _, _, err = sim.set_xdp(obj, "offload", verbose=True, include_stderr=True)
1057 ipl = sim.ip_link_show(xdp=True)
1074 sim.unset_xdp("offload")
1075 sim.unset_xdp("offload")
1076 sim.unset_xdp("drv")
1077 sim.unset_xdp("drv")
1078 sim.unset_xdp("")
1079 sim.unset_xdp("")
1088 ret, _, err = sim.set_xdp(pinned, "offload",
1093 ret, _, err = sim.set_xdp(pinned, "offload",
1100 simdev, sim = test_multi_prog(simdev, sim, obj, "", 1) variable
1101 simdev, sim = test_multi_prog(simdev, sim, obj, "drv", 1) variable
1102 simdev, sim = test_multi_prog(simdev, sim, obj, "generic", 2) variable
1105 sim.tc_add_ingress()
1106 sim.set_xdp(obj, "offload")
1107 ret, _, err = sim.cls_bpf_add_filter(obj, skip_sw=True,
1111 sim.unset_xdp("offload")
1112 sim.wait_for_flush()
1114 sim.cls_bpf_add_filter(obj, skip_sw=True)
1115 ret, _, err = sim.set_xdp(obj, "offload", fail=False, include_stderr=True)
1121 sim.tc_flush_filters(bound=1, total=1)
1122 sim.cls_bpf_add_filter(pinned, da=True, skip_sw=True)
1123 sim.tc_flush_filters(bound=1, total=1)
1126 sim.set_xdp(obj, "offload")
1129 sim.set_xdp(pinned, "offload", force=True)
1130 sim.unset_xdp("offload")
1131 sim.set_xdp(pinned, "offload", force=True)
1132 sim.unset_xdp("offload")
1135 ret, _ = sim.cls_bpf_add_filter(pinned, da=True, skip_sw=True, fail=False)
1139 sim.cls_bpf_add_filter(obj, da=True, skip_sw=True)
1140 ret, _, err = sim.cls_bpf_add_filter(obj, da=True, skip_sw=True,
1145 sim.tc_flush_filters(bound=2, total=2)
1149 sim.dfs["dev/bpf_bind_verifier_delay"] = delay_msec
1152 (sim['ifname'], obj)
1173 sim, = simdev.nsims variable
1176 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
1183 sim.set_ns(ns)
1190 sim.set_ns("")
1205 sim, = simdev.nsims variable
1208 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
1284 sim.unset_xdp("offload")
1289 sim, = simdev.nsims variable
1290 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
1296 sim, = simdev.nsims variable
1297 sim.dfs["bpf_map_accept"] = "N"
1298 ret, _ = sim.set_xdp(map_obj, "offload", JSON=False, fail=False)