Lines Matching refs:sim
576 fail(dev["ifname"] != sim["ifname"],
577 "Ifname incorrect %s vs %s" % (dev["ifname"], sim["ifname"]))
616 def test_spurios_extack(sim, obj, skip_hw, needle): argument
617 res = sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_hw=skip_hw,
620 res = sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1,
623 res = sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf",
627 def test_multi_prog(simdev, sim, obj, modename, modeid): argument
630 sim.set_xdp(obj, "offload")
631 xdp = sim.ip_link_show(xdp=True)["xdp"]
632 offloaded = sim.dfs_read("bpf_offloaded_id")
637 sim.set_xdp(obj, modename)
638 two_xdps = sim.ip_link_show(xdp=True)["xdp"]
644 offloaded2 = sim.dfs_read("bpf_offloaded_id")
649 ret, _, err = sim.set_xdp(obj, "offload", fail=False, include_stderr=True)
654 ret, _, err = sim.unset_xdp("", force=True,
659 sim.unset_xdp("offload")
660 xdp = sim.ip_link_show(xdp=True)["xdp"]
661 offloaded = sim.dfs_read("bpf_offloaded_id")
673 sim.set_xdp(obj, "offload")
674 two_xdps = sim.ip_link_show(xdp=True)["xdp"]
684 sim, = simdev.nsims
685 sim.set_ethtool_tc_offloads(True)
686 return [simdev, sim]
749 sim, = simdev.nsims variable
750 sim.set_xdp(obj, "generic")
755 sim, = simdev.nsims variable
756 sim.tc_add_ingress()
759 ret, _ = sim.cls_bpf_add_filter(obj, skip_hw=True, fail=False)
763 ret, _ = sim.cls_bpf_add_filter(obj, fail=False)
767 sim.tc_flush_filters()
770 ret, _, err = sim.cls_bpf_add_filter(obj, skip_sw=True,
774 sim.wait_for_flush()
776 sim.set_ethtool_tc_offloads(True)
777 sim.dfs["bpf_tc_non_bound_accept"] = "Y"
780 ret, _ = sim.cls_bpf_add_filter(obj, fail=False)
783 ingress = sim.tc_show_ingress(expected=1)
787 sim.tc_flush_filters()
790 ret, _ = sim.cls_bpf_add_filter(bytecode, fail=False)
793 ingress = sim.tc_show_ingress(expected=1)
797 sim.tc_flush_filters()
798 sim.dfs["bpf_tc_non_bound_accept"] = "N"
801 ret, _, err = sim.cls_bpf_add_filter(bytecode, skip_sw=True,
806 sim.wait_for_flush()
809 ret, _, err = sim.cls_bpf_add_filter(obj, chain=1, prio=1, handle=1,
814 sim.tc_flush_filters()
817 sim.cls_bpf_add_filter(obj, prio=1, handle=1)
818 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1)
819 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
821 sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_sw=True)
822 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1, skip_sw=True)
823 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
825 sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_hw=True)
826 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1, skip_hw=True)
827 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
832 ret, _ = sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1,
838 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
841 test_spurios_extack(sim, obj, False, "netdevsim")
842 test_spurios_extack(sim, obj, True, "netdevsim")
844 sim.set_ethtool_tc_offloads(False)
846 test_spurios_extack(sim, obj, False, "TC offload is disabled")
847 test_spurios_extack(sim, obj, True, "TC offload is disabled")
849 sim.set_ethtool_tc_offloads(True)
851 sim.tc_flush_filters()
854 sim.dfs["dev/bpf_bind_verifier_accept"] = 0
855 ret, _, err = sim.cls_bpf_add_filter(obj, verbose=True, skip_sw=True,
859 sim.dfs["dev/bpf_bind_verifier_accept"] = 1
862 ret, _, err = sim.cls_bpf_add_filter(obj, verbose=True, skip_sw=True,
869 ingress = sim.tc_show_ingress(expected=1)
886 ret, _ = sim.set_ethtool_tc_offloads(False, fail=False)
888 sim.set_ethtool_tc_offloads(True)
891 sim.tc_flush_filters()
892 sim.tc_show_ingress(expected=0)
895 ret, _ = sim.set_ethtool_tc_offloads(False, fail=False)
899 sim.set_ethtool_tc_offloads(True)
902 sim.cls_bpf_add_filter(obj, skip_sw=True)
907 sim, = simdev.nsims variable
908 sim.set_ethtool_tc_offloads(True)
911 sim.set_xdp(obj, "offload")
916 sim, = simdev.nsims variable
917 sim.set_ethtool_tc_offloads(True)
920 sim.set_xdp(obj, "drv")
921 ipl = sim.ip_link_show(xdp=True)
927 ret, _ = sim.set_xdp(obj, "drv", fail=False)
929 sim.wait_for_flush(total=1)
932 ret, _ = sim.set_xdp(obj, "drv", force=True, fail=False)
935 ipl = sim.ip_link_show(xdp=True)
943 ret, _, err = sim.set_xdp(obj, "generic", force=True,
951 ret, _ = sim.set_mtu(9000, fail=False)
954 sim.unset_xdp("drv")
956 sim.set_mtu(9000)
957 ret, _, err = sim.set_xdp(obj, "drv", fail=False, include_stderr=True)
960 sim.set_mtu(1500)
962 sim.wait_for_flush()
966 ret, _, err = sim.set_xdp(nooffload, "offload",
974 dev=sim['ifname'])
976 ret, _, err = sim.set_xdp(offload, "drv", fail=False, include_stderr=True)
980 sim.wait_for_flush()
983 sim.dfs["dev/bpf_bind_verifier_accept"] = 0
985 dev=sim['ifname'], fail=False, include_stderr=True)
988 sim.dfs["dev/bpf_bind_verifier_accept"] = 1
989 sim.wait_for_flush()
992 _, _, err = sim.set_xdp(obj, "offload", verbose=True, include_stderr=True)
993 ipl = sim.ip_link_show(xdp=True)
1010 sim.unset_xdp("offload")
1011 sim.unset_xdp("offload")
1012 sim.unset_xdp("drv")
1013 sim.unset_xdp("drv")
1014 sim.unset_xdp("")
1015 sim.unset_xdp("")
1024 ret, _, err = sim.set_xdp(pinned, "offload",
1029 ret, _, err = sim.set_xdp(pinned, "offload",
1036 simdev, sim = test_multi_prog(simdev, sim, obj, "", 1) variable
1037 simdev, sim = test_multi_prog(simdev, sim, obj, "drv", 1) variable
1038 simdev, sim = test_multi_prog(simdev, sim, obj, "generic", 2) variable
1041 sim.tc_add_ingress()
1042 sim.set_xdp(obj, "offload")
1043 ret, _, err = sim.cls_bpf_add_filter(obj, skip_sw=True,
1047 sim.unset_xdp("offload")
1048 sim.wait_for_flush()
1050 sim.cls_bpf_add_filter(obj, skip_sw=True)
1051 ret, _, err = sim.set_xdp(obj, "offload", fail=False, include_stderr=True)
1057 sim.tc_flush_filters(bound=1, total=1)
1058 sim.cls_bpf_add_filter(pinned, da=True, skip_sw=True)
1059 sim.tc_flush_filters(bound=1, total=1)
1062 sim.set_xdp(obj, "offload")
1065 sim.set_xdp(pinned, "offload", force=True)
1066 sim.unset_xdp("offload")
1067 sim.set_xdp(pinned, "offload", force=True)
1068 sim.unset_xdp("offload")
1071 ret, _ = sim.cls_bpf_add_filter(pinned, da=True, skip_sw=True, fail=False)
1075 sim.cls_bpf_add_filter(obj, da=True, skip_sw=True)
1076 ret, _, err = sim.cls_bpf_add_filter(obj, da=True, skip_sw=True,
1081 sim.tc_flush_filters(bound=2, total=2)
1085 sim.dfs["dev/bpf_bind_verifier_delay"] = delay_msec
1088 (sim['ifname'], obj)
1109 sim, = simdev.nsims variable
1112 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
1119 sim.set_ns(ns)
1126 sim.set_ns("")
1141 sim, = simdev.nsims variable
1144 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
1220 sim.unset_xdp("offload")
1225 sim, = simdev.nsims variable
1226 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
1232 sim, = simdev.nsims variable
1233 sim.dfs["bpf_map_accept"] = "N"
1234 ret, _ = sim.set_xdp(map_obj, "offload", JSON=False, fail=False)