'Configure the port and set its properties.
bw: bandwidth in b/s (e.g. \'10m\')
delay: transmit delay (e.g. \'1ms\' )
jitter: jitter (e.g. \'1ms\')
loss: loss (e.g. \'1%\' )
gro: enable GRO (False)
txo: enable transmit checksum offload (True)
rxo: enable receive checksum offload (True)
speedup: experimental switch-side bw option
use_hfsc: use HFSC scheduling
use_tbf: use TBF scheduling
latency_ms: TBF latency parameter
enable_ecn: enable ECN (False)
enable_red: enable RED (False)
max_queue_size: queue limit parameter for netem'

def config(self, bw=None, delay=None, jitter=None, loss=None, gro=False, txo=True, rxo=True, speedup=0, use_hfsc=False, use_tbf=False, latency_ms=None, enable_ecn=False, enable_red=False, max_queue_size=None, **params):

    gro = (not params.pop('disable_gro', (not gro)))
    result = Intf.config(self, **params)
    def on(isOn):
        "Helper    method:    bool    ->    'on'/'off'"
        return ('on' if isOn else 'off')
    self.cmd('ethtool    -K', self, 'gro', on(gro), 'tx', on(txo), 'rx', on(rxo))
    if ((bw is None) and (not delay) and (not loss) and (max_queue_size is None)):
        return
    tcoutput = self.tc('%s    qdisc    show    dev    %s')
    if (('priomap' not in tcoutput) and ('noqueue' not in tcoutput)):
        cmds = ['%s    qdisc    del    dev    %s    root']
    else:
        cmds = []
    (bwcmds, parent) = self.bwCmds(bw=bw, speedup=speedup, use_hfsc=use_hfsc, use_tbf=use_tbf, latency_ms=latency_ms, enable_ecn=enable_ecn, enable_red=enable_red)
    cmds += bwcmds
    (delaycmds, parent) = self.delayCmds(delay=delay, jitter=jitter, loss=loss, max_queue_size=max_queue_size, parent=parent)
    cmds += delaycmds
    stuff = ((((([('%.2fMbit' % bw)] if (bw is not None) else []) + ([('%s    delay' % delay)] if (delay is not None) else [])) + ([('%s    jitter' % jitter)] if (jitter is not None) else [])) + ([('%.5f%%    loss' % loss)] if (loss is not None) else [])) + (['ECN'] if enable_ecn else (['RED'] if enable_red else [])))
    info((('(' + '    '.join(stuff)) + ')    '))
    debug(('at    map    stage    w/cmds:    %s\n' % cmds))
    tcoutputs = [self.tc(cmd) for cmd in cmds]
    for output in tcoutputs:
        if (output != ''):
            error(('***    Error:    %s' % output))
    debug('cmds:', cmds, '\n')
    debug('outputs:', tcoutputs, '\n')
    result['tcoutputs'] = tcoutputs
    result['parent'] = parent
    return result
