Commit 7c0720d1 authored by Boris Glimcher's avatar Boris Glimcher Committed by Tomasz Zawadzki
Browse files

python/rpc: remove deprecated python modules



Commit f4cdd081 deprecated those in previous release.
So it's time to remove them now.

Users are encouraged to use client object directly.

Change-Id: I8f042d787b9fba25d3a33db4277a75e424865e23
Signed-off-by: default avatarBoris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26624


Reviewed-by: default avatarKonrad Sztyber <ksztyber@nvidia.com>
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
parent 886fdf7f
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -19,18 +19,6 @@ The tags can be matched with the level 4 headers below.

## Deprecation Notices

### python

#### `rpc`

Deprecated all modules under python/spdk/rpc providing wrappers around RPC methods.

Will be removed in the 26.01 release.

Individual rpc modules provides very simple wrappers around existing client functions.
There is no translations or useful abstractions happen inside those RPC modules.
This can be easily replaced by setattr based dynamic functions on the JSONRPCClient.

### util/net

#### `spdk_net_getaddr`
+2 −77
Original line number Diff line number Diff line
@@ -8,82 +8,7 @@ import sys

from io import IOBase as io

from . import accel
from . import app
from . import bdev
from . import compressdev
from . import fsdev
from . import env_dpdk
from . import dsa
from . import iaa
from . import ioat
from . import iscsi
from . import keyring
from . import log
from . import lvol
from . import nbd
from . import ublk
from . import notify
from . import nvme
from . import nvmf
from . import subsystem
from . import trace
from . import vhost
from . import vmd
from . import sock
from . import vfio_user
from . import iobuf
from . import dpdk_cryptodev
from . import mlx5
from . import client as rpc_client
from .helpers import deprecated_method


@deprecated_method
def framework_start_init(client):
    """Start initialization of subsystems"""
    return client.call('framework_start_init')


@deprecated_method
def framework_wait_init(client):
    """Block until subsystems have been initialized"""
    return client.call('framework_wait_init')


@deprecated_method
def framework_disable_cpumask_locks(client):
    """ Disable CPU core lock files."""
    return client.call('framework_disable_cpumask_locks')


@deprecated_method
def framework_enable_cpumask_locks(client):
    """ Enable CPU core lock files."""
    return client.call('framework_enable_cpumask_locks')


@deprecated_method
def rpc_get_methods(client, current=None, include_aliases=None):
    """Get list of supported RPC methods.
    Args:
        current: Get list of RPC methods only callable in the current state.
        include_aliases: Include aliases in the list with RPC methods.
    """
    params = {}

    if current:
        params['current'] = current
    if include_aliases:
        params['include_aliases'] = include_aliases

    return client.call('rpc_get_methods', params)


@deprecated_method
def spdk_get_version(client):
    """Get SPDK version"""
    return client.call('spdk_get_version')


def _json_dump(config, fd, indent):
@@ -165,7 +90,7 @@ def load_config(client, fd, include_aliases=False):
    # check if methods in the config file are known
    allowed_methods = client.call('rpc_get_methods', {'include_aliases': include_aliases})
    if not subsystems and 'framework_start_init' in allowed_methods:
        framework_start_init(client)
        client.framework_start_init()
        return

    for subsystem in list(subsystems):
@@ -193,7 +118,7 @@ def load_config(client, fd, include_aliases=False):
                subsystems.remove(subsystem)

        if 'framework_start_init' in allowed_methods:
            framework_start_init(client)
            client.framework_start_init()
            allowed_found = True

        if not allowed_found:

python/spdk/rpc/accel.py

deleted100644 → 0
+0 −141
Original line number Diff line number Diff line
#  SPDX-License-Identifier: BSD-3-Clause
#  Copyright (C) 2022 Intel Corporation.
#  All rights reserved.
#

from spdk.rpc.helpers import deprecated_method


@deprecated_method
def accel_get_opc_assignments(client):
    """Get list of opcode name to module assignments.
    """
    return client.call('accel_get_opc_assignments')


@deprecated_method
def accel_get_module_info(client):
    """Get list of valid module names and their operations.
    """
    return client.call('accel_get_module_info')


@deprecated_method
def accel_assign_opc(client, opname, module):
    """Manually assign an operation to a module.

    Args:
        opname: name of operation
        module: name of module
    """
    params = {
        'opname': opname,
        'module': module,
    }

    return client.call('accel_assign_opc', params)


@deprecated_method
def accel_crypto_key_create(client, cipher, key, key2, tweak_mode, name):
    """Create Data Encryption Key Identifier.

    Args:
        cipher: cipher
        key: key
        key2: key2
        tweak_mode: tweak mode
        name: key name
    """
    params = {
        'cipher': cipher,
        'key': key,
        'name': name,
    }
    if key2 is not None:
        params['key2'] = key2
    if tweak_mode is not None:
        params['tweak_mode'] = tweak_mode

    return client.call('accel_crypto_key_create', params)


@deprecated_method
def accel_crypto_key_destroy(client, key_name):
    """Destroy Data Encryption Key.

    Args:
        key_name: key name
    """
    params = {
        'key_name': key_name
    }

    return client.call('accel_crypto_key_destroy', params)


@deprecated_method
def accel_crypto_keys_get(client, key_name):
    """Get a list of the crypto keys.

    Args:
        key_name: Get information about a specific key
    """
    params = {}

    if key_name is not None:
        params['key_name'] = key_name

    return client.call('accel_crypto_keys_get', params)


@deprecated_method
def accel_set_driver(client, name):
    """Select accel platform driver to execute operation chains.

    Args:
        name: name of the driver
    """
    return client.call('accel_set_driver', {'name': name})


@deprecated_method
def accel_set_options(client, small_cache_size, large_cache_size,
                      task_count, sequence_count, buf_count):
    """Set accel framework's options."""
    params = {}

    if small_cache_size is not None:
        params['small_cache_size'] = small_cache_size
    if large_cache_size is not None:
        params['large_cache_size'] = large_cache_size
    if task_count is not None:
        params['task_count'] = task_count
    if sequence_count is not None:
        params['sequence_count'] = sequence_count
    if buf_count is not None:
        params['buf_count'] = buf_count

    return client.call('accel_set_options', params)


@deprecated_method
def accel_get_stats(client):
    """Get accel framework's statistics"""

    return client.call('accel_get_stats')


@deprecated_method
def accel_error_inject_error(client, opcode, type, count=None, interval=None, errcode=None):
    """Inject an error to processing accel operation"""
    params = {}
    if count is not None:
        params['count'] = count
    if interval is not None:
        params['interval'] = interval
    if errcode is not None:
        params['errcode'] = errcode

    return client.call('accel_error_inject_error',
                       {'opcode': opcode, 'type': type, **params})

python/spdk/rpc/app.py

deleted100644 → 0
+0 −156
Original line number Diff line number Diff line
#  SPDX-License-Identifier: BSD-3-Clause
#  Copyright (C) 2017 Intel Corporation.
#  All rights reserved.

from spdk.rpc.helpers import deprecated_method


@deprecated_method
def spdk_kill_instance(client, sig_name):
    """Send a signal to the SPDK process.

    Args:
        sig_name: signal to send ("SIGINT", "SIGTERM", "SIGQUIT", "SIGHUP", or "SIGKILL")
    """
    params = {'sig_name': sig_name}
    return client.call('spdk_kill_instance', params)


@deprecated_method
def framework_monitor_context_switch(client, enabled=None):
    """Query or set state of context switch monitoring.

    Args:
        enabled: True to enable monitoring; False to disable monitoring; None to query (optional)

    Returns:
        Current context switch monitoring state (after applying enabled flag).
    """
    params = {}
    if enabled is not None:
        params['enabled'] = enabled
    return client.call('framework_monitor_context_switch', params)


@deprecated_method
def framework_get_reactors(client):
    """Query list of all reactors.

    Returns:
        List of all reactors.
    """
    return client.call('framework_get_reactors')


@deprecated_method
def framework_set_scheduler(client, name, period=None, load_limit=None, core_limit=None,
                            core_busy=None, mappings=None):
    """Select threads scheduler that will be activated and its period.

    Args:
        name: Name of a scheduler
        period: Scheduler period in microseconds
    Returns:
        True or False
    """
    params = {'name': name}
    if period is not None:
        params['period'] = period
    if load_limit is not None:
        params['load_limit'] = load_limit
    if core_limit is not None:
        params['core_limit'] = core_limit
    if core_busy is not None:
        params['core_busy'] = core_busy
    if mappings is not None:
        params['mappings'] = mappings
    return client.call('framework_set_scheduler', params)


@deprecated_method
def framework_get_scheduler(client):
    """Query currently set scheduler.

    Returns:
        Name, period (in microseconds) of currently set scheduler and name of currently set governor.
    """
    return client.call('framework_get_scheduler')


@deprecated_method
def framework_get_governor(client):
    """Query current governor data.

    Returns:
        Name of currently set governor, available frequencies and currently set frequency of the CPU cores.
    """
    return client.call('framework_get_governor')


@deprecated_method
def scheduler_set_options(client, scheduling_core=None, isolated_core_mask=None):
    params = {}
    if isolated_core_mask is not None:
        params['isolated_core_mask'] = isolated_core_mask
    if scheduling_core is not None:
        params['scheduling_core'] = scheduling_core
    return client.call('scheduler_set_options', params)


@deprecated_method
def thread_get_stats(client):
    """Query threads statistics.

    Returns:
        Current threads statistics.
    """
    return client.call('thread_get_stats')


@deprecated_method
def thread_set_cpumask(client, id, cpumask):
    """Set the cpumask of the thread whose ID matches to the specified value.

    Args:
        id: thread ID
        cpumask: cpumask for this thread

    Returns:
        True or False
    """
    params = {'id': id, 'cpumask': cpumask}
    return client.call('thread_set_cpumask', params)


@deprecated_method
def log_enable_timestamps(client, enabled):
    """Enable or disable timestamps.

    Args:
        value: on or off

    Returns:
        None
    """
    params = {'enabled': enabled}
    return client.call('log_enable_timestamps', params)


@deprecated_method
def thread_get_pollers(client):
    """Query current pollers.

    Returns:
        Current pollers.
    """
    return client.call('thread_get_pollers')


@deprecated_method
def thread_get_io_channels(client):
    """Query current IO channels.

    Returns:
        Current IO channels.
    """
    return client.call('thread_get_io_channels')

python/spdk/rpc/bdev.py

deleted100644 → 0
+0 −1799

File deleted.

Preview size limit exceeded, changes collapsed.

Loading