def set_offload(interface, args): cmd, value = [a.lower() for a in args] if cmd == "tso": value = value == "on" and 1 or 0 try: ethtool.set_tso(interface, value) except: pass
def set_offload(devname, **kwargs): ''' Changes the offload parameters and other features of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.set_offload <devname> tcp_segmentation_offload=on ''' for param, value in kwargs.items(): if param == 'tcp_segmentation_offload': value = value == "on" and 1 or 0 try: ethtool.set_tso(devname, value) except IOError: return 'Not supported' return show_offload(devname)
def set_offload(devname, **kwargs): ''' Changes the offload parameters and other features of the specified network device CLI Example: .. code-block:: bash salt '*' ethtool.show_offload <devname> ''' for param, value in kwargs.items(): if param == 'tcp_segmentation_offload': value = value == "on" and 1 or 0 try: ethtool.set_tso(devname, value) except IOError: return 'Not supported' return show_offload(devname)