def show_offload(devname):
 try:
  sg = ((ethtool.get_sg(devname) and 'on') or 'off')
 except IOError:
  sg = 'not supported'
 try:
  tso = ((ethtool.get_tso(devname) and 'on') or 'off')
 except IOError:
  tso = 'not supported'
 try:
  ufo = ((ethtool.get_ufo(devname) and 'on') or 'off')
 except IOError:
  ufo = 'not supported'
 try:
  gso = ((ethtool.get_gso(devname) and 'on') or 'off')
 except IOError:
  gso = 'not supported'
 offload = {'scatter_gather': sg, 'tcp_segmentation_offload': tso, 'udp_fragmentation_offload': ufo, 'generic_segmentation_offload': gso}
 return offload

def show_offload ( devname ) : try : sg = ( ( ethtool . get_sg ( devname ) and 'on' ) or 'off' ) except IOError : sg = 'not supported' try : tso = ( ( ethtool . get_tso ( devname ) and 'on' ) or 'off' ) except IOError : tso = 'not supported' try : ufo = ( ( ethtool . get_ufo ( devname ) and 'on' ) or 'off' ) except IOError : ufo = 'not supported' try : gso = ( ( ethtool . get_gso ( devname ) and 'on' ) or 'off' ) except IOError : gso = 'not supported' offload = { 'scatter_gather' : sg , 'tcp_segmentation_offload' : tso , 'udp_fragmentation_offload' : ufo , 'generic_segmentation_offload' : gso } return offload
queries the specified network device for the state of protocol offload and other features cli example: .