How to use the ethtool.get_tso function in ethtool

To help you get started, we’ve selected a few ethtool examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uyuni-project / uyuni / client / debian / packages-already-in-debian / python-ethtool / pethtool.py View on Github external
def show_offload(interface, args = None):
        try:
                sg = ethtool.get_sg(interface) and "on" or "off"
        except IOError:
                sg = "not supported"

        try:
                tso = ethtool.get_tso(interface) and "on" or "off"
        except IOError:
                tso = "not supported"

        try:
                ufo = ethtool.get_ufo(interface) and "on" or "off"
        except IOError:
                ufo = "not supported"

        try:
                gso = ethtool.get_gso(interface) and "on" or "off"
        except IOError:
                gso = "not supported"

        printtab("scatter-gather: %s" % sg)
        printtab("tcp segmentation offload: %s" % tso)
        printtab("udp fragmentation offload: %s" % ufo)