def bdev_ocf_set_cache_mode(client, name, mode):
    """Set cache mode of OCF block device

    Args:
        name: name of OCF bdev
        mode: OCF cache mode: {'wb', 'wt', 'pt', 'wa', 'wi', 'wo'}

    Returns:
        New cache mode name
    """
    params = {
        'name': name,
        'mode': mode,
    }

    return client.call('bdev_ocf_set_cache_mode', params)