Lines Matching refs:sim

561         fail(dev["ifname"] != sim["ifname"],
562 "Ifname incorrect %s vs %s" % (dev["ifname"], sim["ifname"]))
592 def test_spurios_extack(sim, obj, skip_hw, needle): argument
593 res = sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_hw=skip_hw,
596 res = sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1,
599 res = sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf",
659 sim = NetdevSim() variable
660 sim.set_xdp(obj, "generic")
661 sim.remove()
664 sim = NetdevSim() variable
665 sim.tc_add_ingress()
668 ret, _ = sim.cls_bpf_add_filter(obj, skip_hw=True, fail=False)
672 ret, _ = sim.cls_bpf_add_filter(obj, fail=False)
674 sim.dfs_get_bound_progs(expected=0)
676 sim.tc_flush_filters()
679 ret, _, err = sim.cls_bpf_add_filter(obj, skip_sw=True,
683 sim.wait_for_flush()
685 sim.set_ethtool_tc_offloads(True)
686 sim.dfs["bpf_tc_non_bound_accept"] = "Y"
689 ret, _ = sim.cls_bpf_add_filter(obj, fail=False)
691 sim.dfs_get_bound_progs(expected=0)
692 ingress = sim.tc_show_ingress(expected=1)
696 sim.tc_flush_filters()
699 ret, _ = sim.cls_bpf_add_filter(bytecode, fail=False)
701 sim.dfs_get_bound_progs(expected=0)
702 ingress = sim.tc_show_ingress(expected=1)
706 sim.tc_flush_filters()
707 sim.dfs["bpf_tc_non_bound_accept"] = "N"
710 ret, _, err = sim.cls_bpf_add_filter(bytecode, skip_sw=True,
715 sim.wait_for_flush()
718 ret, _, err = sim.cls_bpf_add_filter(obj, chain=1, prio=1, handle=1,
723 sim.tc_flush_filters()
726 sim.cls_bpf_add_filter(obj, prio=1, handle=1)
727 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1)
728 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
730 sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_sw=True)
731 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1, skip_sw=True)
732 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
734 sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_hw=True)
735 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1, skip_hw=True)
736 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
741 ret, _ = sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1,
747 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
750 test_spurios_extack(sim, obj, False, "netdevsim")
751 test_spurios_extack(sim, obj, True, "netdevsim")
753 sim.set_ethtool_tc_offloads(False)
755 test_spurios_extack(sim, obj, False, "TC offload is disabled")
756 test_spurios_extack(sim, obj, True, "TC offload is disabled")
758 sim.set_ethtool_tc_offloads(True)
760 sim.tc_flush_filters()
763 ret, _, err = sim.cls_bpf_add_filter(obj, verbose=True, skip_sw=True,
769 dfs = sim.dfs_get_bound_progs(expected=1)
771 ingress = sim.tc_show_ingress(expected=1)
788 ret, _ = sim.set_ethtool_tc_offloads(False, fail=False)
792 sim.tc_flush_filters()
793 sim.tc_show_ingress(expected=0)
796 ret, _ = sim.set_ethtool_tc_offloads(False, fail=False)
800 sim.set_ethtool_tc_offloads(True)
803 sim.cls_bpf_add_filter(obj, skip_sw=True)
804 sim.remove()
807 sim = NetdevSim() variable
808 sim.set_ethtool_tc_offloads(True)
811 sim.set_xdp(obj, "offload")
812 sim.remove()
815 sim = NetdevSim() variable
816 sim.set_ethtool_tc_offloads(True)
819 sim.set_xdp(obj, "drv")
820 ipl = sim.ip_link_show(xdp=True)
826 ret, _ = sim.set_xdp(obj, "drv", fail=False)
828 sim.wait_for_flush(total=1)
831 ret, _ = sim.set_xdp(obj, "drv", force=True, fail=False)
834 ipl = sim.ip_link_show(xdp=True)
842 ret, _, err = sim.set_xdp(obj, "generic", force=True,
846 ret, _, err = sim.set_xdp(obj, "", force=True,
852 ret, _, err = sim.unset_xdp("", force=True,
858 ret, _ = sim.set_mtu(9000, fail=False)
861 sim.unset_xdp("drv")
863 sim.set_mtu(9000)
864 ret, _, err = sim.set_xdp(obj, "drv", fail=False, include_stderr=True)
867 sim.set_mtu(1500)
869 sim.wait_for_flush()
873 ret, _, err = sim.set_xdp(nooffload, "offload",
881 dev=sim['ifname'])
883 ret, _, err = sim.set_xdp(offload, "drv", fail=False, include_stderr=True)
887 sim.wait_for_flush()
890 _, _, err = sim.set_xdp(obj, "offload", verbose=True, include_stderr=True)
891 ipl = sim.ip_link_show(xdp=True)
899 dfs = sim.dfs_get_bound_progs(expected=1)
909 sim.unset_xdp("offload")
910 sim.unset_xdp("offload")
911 sim.unset_xdp("drv")
912 sim.unset_xdp("drv")
913 sim.unset_xdp("")
914 sim.unset_xdp("")
922 ret, _, err = sim.set_xdp(pinned, "offload",
927 ret, _, err = sim.set_xdp(pinned, "offload",
935 sim.set_xdp(obj, "offload")
936 xdp = sim.ip_link_show(xdp=True)["xdp"]
937 offloaded = sim.dfs_read("bpf_offloaded_id")
942 sim.set_xdp(obj, "")
943 two_xdps = sim.ip_link_show(xdp=True)["xdp"]
944 offloaded2 = sim.dfs_read("bpf_offloaded_id")
959 ret, _, err = sim.set_xdp(obj, "offload", fail=False, include_stderr=True)
963 ret, _, err = sim.unset_xdp("drv", force=True,
968 sim.unset_xdp("offload")
969 xdp = sim.ip_link_show(xdp=True)["xdp"]
970 offloaded = sim.dfs_read("bpf_offloaded_id")
982 sim.set_xdp(obj, "offload")
983 sim.remove()
985 sim = NetdevSim() variable
986 sim.set_ethtool_tc_offloads(True)
989 sim.tc_add_ingress()
990 sim.set_xdp(obj, "offload")
991 ret, _, err = sim.cls_bpf_add_filter(obj, skip_sw=True,
995 sim.unset_xdp("offload")
996 sim.wait_for_flush()
998 sim.cls_bpf_add_filter(obj, skip_sw=True)
999 ret, _, err = sim.set_xdp(obj, "offload", fail=False, include_stderr=True)
1005 sim.tc_flush_filters(bound=1, total=1)
1006 sim.cls_bpf_add_filter(pinned, da=True, skip_sw=True)
1007 sim.tc_flush_filters(bound=1, total=1)
1010 sim.set_xdp(obj, "offload")
1013 sim.set_xdp(pinned, "offload", force=True)
1014 sim.unset_xdp("offload")
1015 sim.set_xdp(pinned, "offload", force=True)
1016 sim.unset_xdp("offload")
1019 ret, _ = sim.cls_bpf_add_filter(pinned, da=True, skip_sw=True, fail=False)
1023 sim.cls_bpf_add_filter(obj, da=True, skip_sw=True)
1024 ret, _, err = sim.cls_bpf_add_filter(obj, da=True, skip_sw=True,
1029 sim.tc_flush_filters(bound=2, total=2)
1033 sim.dfs["bpf_bind_verifier_delay"] = delay_msec
1036 (sim['ifname'], obj)
1039 while sim.dfs_num_bound_progs() <= 2:
1041 sim.remove()
1056 sim = NetdevSim() variable
1059 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
1066 sim.set_ns(ns)
1073 sim.set_ns("")
1078 sim.remove()
1087 sim = NetdevSim() variable
1090 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
1166 sim.unset_xdp("offload")
1168 sim.remove()
1170 sim = NetdevSim() variable
1171 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
1172 sim.remove()
1176 sim = NetdevSim() variable
1177 sim.dfs["bpf_map_accept"] = "N"
1178 ret, _ = sim.set_xdp(map_obj, "offload", JSON=False, fail=False)
1182 sim.remove()