'Set device rate: rate (max_tx_rate), min_tx_rate
@param pci_slot: Virtual Function address
@param rate_type: device rate name type. Could be \'rate\' and
\'min_tx_rate\'.
@param rate_kbps: device rate in kbps'

def set_device_rate(self, pci_slot, rate_type, rate_kbps):

    vf_index = self._get_vf_index(pci_slot)
    if ((rate_kbps > 0) and (rate_kbps < 1000)):
        rate_mbps = 1
    else:
        rate_mbps = helpers.round_val((rate_kbps / 1000.0))
    log_dict = {'rate_mbps': rate_mbps, 'rate_kbps': rate_kbps, 'vf_index': vf_index, 'rate_type': rate_type}
    if ((rate_kbps % 1000) != 0):
        LOG.debug("'%(rate_type)s'    for    SR-IOV    ports    is    counted    in    Mbps;    setting    %(rate_mbps)s    Mbps    limit    for    port    %(vf_index)s    instead    of    %(rate_kbps)s    kbps", log_dict)
    else:
        LOG.debug('Setting    %(rate_mbps)s    Mbps    limit    for    port    %(vf_index)s', log_dict)
    return self.pci_dev_wrapper.set_vf_rate(vf_index, rate_type, rate_mbps)
