X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=resources%2Flibraries%2Fpython%2FInterfaceUtil.py;h=2368ee336207a4999a0c6414d91ee672d4fdc60e;hb=1fbfcbcb15bc51b7b689df44ae338a1c7db6269c;hp=03e0e69d42a84f7f8380918d8bedb71f066822b3;hpb=afd47c02032712b98e876f0fe2d7e8725b93d516;p=csit.git diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py index 03e0e69d42..2368ee3362 100644 --- a/resources/libraries/python/InterfaceUtil.py +++ b/resources/libraries/python/InterfaceUtil.py @@ -294,6 +294,21 @@ class InterfaceUtil: cmd = f"ethtool --set-channels {pf_eth} {channel} {num_queues}" exec_cmd_no_error(node, cmd, sudo=True) + @staticmethod + def set_interface_xdp_off(node, pf_pcis): + """Detaches any currently attached XDP/BPF program from the specified + interfaces. + + :param node: Topology node. + :param pf_pcis: List of node's interfaces PCI addresses. + :type nodes: dict + :type pf_pcis: list + """ + for pf_pci in pf_pcis: + pf_eth = InterfaceUtil.pci_to_eth(node, pf_pci) + cmd = f"ip link set dev {pf_eth} xdp off" + exec_cmd_no_error(node, cmd, sudo=True) + @staticmethod def set_interface_flow_control(node, pf_pcis, rxf=u"off", txf=u"off"): """Set Ethernet flow control for specified interfaces.