예제 #1
0
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
예제 #2
0
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
예제 #3
0
파일: ethtool.py 프로젝트: scubahub/salt
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)
예제 #4
0
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)