Commit Graph

474 Commits

Author SHA1 Message Date
rafalste
4d91b4ef01 bdev/ocf: add cache line size
Define cache line size when creating cache device.

Signed-off-by: rafalste <rafal.stefanowski@intel.com>
Change-Id: Ica536a9bda35c355b4dd4e406a241defc1453f53
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3449
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-08-12 10:39:56 +00:00
Seth Howell
8bff48f63c module/bdev_rpc: modify detach_ctrlr rpc to accept trid.
This will allow us to use this RPC to detach only specific
paths from controllers.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ib52e38aa7d4ea096418a6dc0328481c2e8db6c54
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3070
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-08-11 08:29:14 +00:00
Shuhei Matsumoto
4ea197883c lib/iscsi: Add iscsi_target_node_set_redirect RPC
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I090f55debe4ecdc47459bcfe0571a937f064313b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3439
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-08-11 08:27:43 +00:00
Shuhei Matsumoto
10d6218444 lib/iscsi: Create portal group as public or private portal group
In SPDK iSCSI target, portal group works almost as identifier of
portal.

To support iSCSI login redirection, we need to have two types of
portal groups, public and private portal groups.

We need portals of public portal groups to redirect to a portal in
a private portal groups at login via temporary login redirection
funciton, and we need to make SendTargets return only portals in
public portal groups.

To do these simply, we mark primary or secondary portal group expicitly
at its creation by this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iccf87a4b9dd1f4a8fbb857a399b8f2dbc7c0b3ab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3491
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-08-11 08:27:43 +00:00
Shuhei Matsumoto
61cd9d308e lib/sock: Add option to enable or disable quick ACK
TCP delayed ACK can be disabled or enabled by enabling or disabling
quick ACK, respectively.

The recently added spdk_sock_impl_opts is helpful for sock library
to control quick ACK.

Hence this patch adds and uses an option enable_quickack. The option
is effective only for the POSIX sock module.

We have spdk_sock_opts now too but spdk_sock_impl_opts will be better
for this case.

This option is not supported on FreeBSD. FreeBSD users can set the
option globally via sysctl if desired.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic89620267acce5872dc8ecaf7a99bb70ae97e993
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3603
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-08-10 11:29:20 +00:00
paul luse
62b3b171cb module/compress: add new parm to RPC for create compress vol
To specify the desired logical block size. Must be 4K or 512.
If no block size is provided a default of 0 means to use the
underlying bdev block size. For cases where something other
than 4K or 512 is desired, format the underlying device
accordingly and don't specify a logical block size on creation
of the compress vol.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I58b71e210cfa77b3237c0c454585c734e2e22aea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3177
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-27 22:39:29 +00:00
Evgeniy Kochetov
29f31a90e1 sock: Add sock_impl option to disable zero copy on send
Zero copy send can cause performance degradation with small
payloads. This patch adds an option to disable it if required. By
default zero copy is enabled.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: I14f2b21ad375e770cb08f850360898bac675b351
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3344
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-24 00:30:45 +00:00
Evgeniy Kochetov
63c5e51ebc sock: Add sock_impl option to disable receive pipe
Receive pipe reduces number of system calls and gives significant
performance improvement with kernel TCP stack and relatively small IO
sizes. With user space TCP/IP implementations there are no system
calls and double buffering introduced by pipe has negative impact on
performance. Receive pipe remains enabled by default.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: Ic5ddee42293df2c233ba7ffbe6662de7917ac586
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3343
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-24 00:30:45 +00:00
Shuhei Matsumoto
26e0ef9a36 lib/nvmf: Make abort execution timeout value optional
Make the abort execution timeout value as optional.

Zero is acceptable and means immediate timeout.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia4b03c65b8bd15899f48be9476ee657446147581
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3104
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-16 07:29:46 +00:00
Seth Howell
3b830202ca lib/nvmf: add an acceptor_backlog transport opt.
This allows users to configure the number of
connection requests outstanding to an rdma port
at once.

RPC included.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I8a2bb86b2fb7565cb10288088d39af763b778703
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3097
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-08 07:57:04 +00:00
Evgeniy Kochetov
b1074c4905 sock/rpc: Add sock_impl_get/set_options RPC methods
Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: If1193ef647c85b045d7f14a03a9942783583f553
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/612
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-07 07:32:32 +00:00
Ben Walker
c37cf9fbd8 nvmf: Make transport-chosen the only valid qpair scheduler
The transport always knows best.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: If66f539033fe11c50dc42e12ec990468588d5739
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2812
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-06-16 07:44:49 +00:00
Darek Stojaczyk
00b52bf5dd scripts/rpc.py: add new parameter to retry connecting
This can potentially replace waitforlisten() in our test scripts.

$ ./scripts/rpc.py -h
  -r CONN_RETRIES       Retry connecting to the RPC server N times with
                        0.2s interval. Default: 0
[...]

$ ./scripts/rpc.py -r 10 spdk_get_version
<SNIP the usual python exception>
rpc.client.JSONRPCException: Error while connecting to
/var/tmp/spdk.sock
Error details: [Errno -2] Name or service not known

real    0m2.452s
user    0m0.242s
sys     0m0.020s

Change-Id: I204da366360647fcce8f8de0eb25b0f576aabc5b
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2751
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-06-08 09:35:16 +00:00
Alexey Marchuk
1551197db5 rpc: Deprecate max_qpairs_per_ctrlr parameter
This parameter describes the number of admin and IO
qpairs while admin qpair always exists and should not
be configured explicitly.
Introduce a new parameter `max_io_qpairs_per_ctrlr`
which configures the number of IO qpairs.
Internal structure of NVMF transport is not changed,
both RPC parameters configure the same nvmf transport parameter.

Deprecate max_qpairs_per_ctrlr in spdkcli as well

Side change: update dif_insert_or_strip description -
it can be used by TCP and RDMA transports

Config files parsing is not changed since it is deprecated

Fixes #1378

Change-Id: I8403ee6fcf090bb5e86a32e4868fea5924daed23
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2279
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI
2020-06-04 07:20:45 +00:00
yupeng
240b243af5 bdev: add doc for bdev_auto_examine
Explain the bdev_auto_examine parameter of the bdev_set_options rpc.
Add bdev_auto_examine parameter for the bdev_set_options
in the python rpc client.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: I268cd5c01129180467967c2ebfffa7c3ba7e5b1a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2580
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-05-29 14:58:16 +00:00
Maciej Szwed
b0bac20ad6 rpc: Add possibility to load module with additional RPC commands
This patch adds '--plugin <module_name>' parameter
to rpc.py script which is used to provide module
name with additional RPC commands that should be
included in rpc.py script. User must export path
to rpc module with PYTHONPATH before calling rpc.py
with this new parameter.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I971429a33cf4ea943d2b7f3abd5a6cb82398d2a4

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2263
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-05-13 07:46:17 +00:00
Michal Berger
871214e2c1 rpc.py: Allow loading json config from different sources
This is relevant in context of rpc_cmd() which was introduced with the
following commit:

     "scripts/rpc.py: add daemon mode" 8b98cdb64a

When rpc.py runs in a server mode, its stdin is already attached to a
pipe connected to its parent Bash process. In such a setup, it's not
possible to use some of the rpc methods, e.g. load_config().

To make use of said methods possible, allow them to load the config
from different sources - a regular file or a string.

Change-Id: I6fa7d13fa1957b6449ce5d5c5a810bd58d0a5703
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2106
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-05-13 07:46:04 +00:00
paul luse
3044bd27d0 lib/accel: remove RPC for setting the module
This was added before the usage of having a SW engine and 2 HW
engines was fully thought out. The current rules are:

* if no HW engine specific enable RPC is sent, use SW
* if a HW engine specific enable RPC is sent, use it
* If a 2nd HW engine specific enable RPC is sent, ignore

In this scheme there's no need for an RPC that lets the user
choose which engine to use because they already do so when
they enable an engine.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I006ffb3b417f1e93bb061b29535d157ba66f03b4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2033
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-07 10:41:44 +00:00
Tomasz Zawadzki
519d720902 scripts/rpc: do not list positional arguments for the subparser
Main subparser for rpc lists all positional arguments. Like so:
positional arguments:
  {framework_start_init,start_subsystem_init,framework_wait_init,....

This again is duplicated with better help message.

This patch just removes this list, leaving the most detailed one.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5e6b9d0dd6ccf68bfe1cd5959ed509032738c037
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2126
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2020-05-07 08:26:54 +00:00
Tomasz Zawadzki
0d105d4f1f scripts/rpc: do not list commands for the main parser
The main parser will show usaged like so:
usage: rpc.py [-h] [-s SERVER_ADDR] [-p PORT] [-t TIMEOUT] [-v]
              [--verbose {DEBUG,INFO,ERROR}] [--dry_run] [--server]
              {framework_start_init,start_subsystem_init,............

The above contains very long list of all RPCs.
This is duplicates help from the subparsers, which contain
more descriptive help message.

This patch replaces the usage with:
usage: rpc.py [options]

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ibf400987103f5571f79c57d8a9588d97f463d773
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2125
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2020-05-07 08:26:54 +00:00
Tomasz Zawadzki
17c2f4ee8f script/rpc: do not send rpc when no arguments provided
Any time script is called an RPC is called and socket
connection is attempted.

This should not be required when no arguments were provided,
such as calling help to explore possible options.

Example of the error:

[tzawadzk@PowerEdgeFour spdk]$ sudo ./scripts/rpc.py
Traceback (most recent call last):
  File "/home/tzawadzk/spdk/scripts/rpc/client.py", line 40, in __init__
    self.sock.connect(addr)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./scripts/rpc.py", line 2438, in <module>
    args.client = rpc.client.JSONRPCClient(args.server_addr, args.port, args.timeout, log_level=getattr(logging, args.verbose.upper()))
  File "/home/tzawadzk/spdk/scripts/rpc/client.py", line 56, in __init__
    "Error details: %s" % (addr, ex))
rpc.client.JSONRPCException: Error while connecting to /var/tmp/spdk.sock
Error details: [Errno 111] Connection refused

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3734e1603fa7151fd53b99b8af4ea79bf82fe0f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2124
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-05-07 08:26:54 +00:00
Ziye Yang
94345a0a1a nvme: Add the priority field in struct spdk_nvme_transport_id
Purpose: To set the priority of the NVMe-oF connection especially
for TCP connection.

For example, the previous example can be:

trtype:TCP adrfam:IPv4 traddr:10.67.110.181 trsvcid:4420

With the change, it could be:

trtype:TCP adrfam:IPv4 traddr:10.67.110.181 trsvcid:4420 priority:2

The priority is optional. We try to change
spdk_nvme_transport_id but not in spdk_nvme_ctrlr_opts since
the opts in spdk_nvme_ctrlr_opts will reflect in every nvme ctrlr,
this is short of flexibility.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Signed-off-by: Sudheer Mogilappagari <sudheer.mogilappagari@intel.com>
Change-Id: I1ba364c714a95f2dbeab2b3fcc832b0222b48a15
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1875
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-24 15:53:34 +00:00
paul luse
42eb233e48 scripts/rpc: addd RPC support to enable idxd
The new RPC also includes and option for which
idxd config is to be used. Config options will be
explained in detail in a later patch.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I1322bab4d6ca9cc45ec3a56d7267dc7dc09dbea3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1726
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-23 15:48:32 +00:00
Liang Yan
6a29c6a906 bdev/rbd: add ceph rbd resize function.
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Change-Id: Id7f24f1f5e0789ee6d4c07ae7f59cc2d98983e98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1766
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-23 07:28:10 +00:00
Jin Yu
2eabc71518 vhost: add packed ring support
Update vhost blk contruct rpc, make it enable to
support packed ring feature.

Change-Id: Ia1f75e72e8441e8d82fad89073e4875f89e5b9cd
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1567
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-15 03:55:59 +00:00
Darek Stojaczyk
8b98cdb64a scripts/rpc.py: add daemon mode
Add rpc_cmd() bash command that sends rpc command to an
rpc.py instance permanently running in background.
This makes sending RPC commands even 17 times faster.

We make use of bash coprocesses - a builtin bash feature
that allow starting background processes with stdin and
stdout connected to pipes. rpc.py will block trying to
read stdin, effectively being always "ready" to read
an RPC command.

The background rpc.py is started with a new --server flag
that's described as:

> Start listening on stdin, parse each line as a regular
> rpc.py execution and create a separate connection for each command.
> Each command's output ends with either **STATUS=0 if the
> command succeeded or **STATUS=1 if it failed.
> --server is meant to be used in conjunction with bash
> coproc, where stdin and stdout are named pipes and can be
> used as a faster way to send RPC commands.

As a part of this patch I'm attaching a sample test
that runs the following rpc commands first with the regular
rpc.py, then the new rpc_cmd() function.

```
time {
        bdevs=$($rpc bdev_get_bdevs)
        [ "$(jq length <<< "$bdevs")" == "0" ]

        malloc=$($rpc bdev_malloc_create 8 512)
        bdevs=$($rpc bdev_get_bdevs)
        [ "$(jq length <<< "$bdevs")" == "1" ]

        $rpc bdev_passthru_create -b "$malloc" -p Passthru0
        bdevs=$($rpc bdev_get_bdevs)
        [ "$(jq length <<< "$bdevs")" == "2" ]

        $rpc bdev_passthru_delete Passthru0
        $rpc bdev_malloc_delete $malloc
        bdevs=$($rpc bdev_get_bdevs)
        [ "$(jq length <<< "$bdevs")" == "0" ]
}
```

Regular rpc.py:
```
real    0m1.477s
user    0m1.289s
sys     0m0.139s
```

rpc_cmd():
```
real    0m0.085s
user    0m0.025s
sys     0m0.006s
```

autotest_common.sh will now spawn an rpc.py daemon if
it's not running yet, and it will offer rpc_cmd() function
to quickly send RPC commands. If the command is invalid or
SPDK returns with error, the bash function will return
a non-zero code and may trigger ERR trap just like a regular
rpc.py instance.

Pipes have major advantage over e.g. unix domain sockets - the pipes
will be automatically closed once the owner process exits.
This means we can create a named pipe in autotest_common.sh,
open it, then start rpc.py in background and never worry
about it again - it will be closed automatically once the
test exits. It doesn't even matter if the test is executed
manually in isolation, or as a part of the entire autotest.

(check_so_deps.sh needs to be modified not to wait for *all*
background processes to finish, but just the ones it started)

Change-Id: If0ded961b7fef3af3837b44532300dee8b5b4663
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/621
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-11 11:35:03 +00:00
Shuhei Matsumoto
49cffc1e68 rpc: Add thread_get_io_channels RPC
Add an new JSON RPC thread_get_io_channels to retrieve IO channels
of the threads. IO channel don't have its own name and so get the
name of the corresponding IO device instead.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id8fbb328ffba09e1eace35994cdbf36b24832b82
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/887
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-03-10 09:13:02 +00:00
Shuhei Matsumoto
0b0f0c5415 rpc: Add thread_get_pollers RPC
Add an new JSON RPC thread_get_pollers to retrieve pollers of all
the threads. By adding a helper function spdk_poller_state_str(),
output poller state as string to improve readability. Most of the
code of thread_get_stats and thread_get_pollers are common and so
unify these two RPCs as possible as we can.

Sample output of thread_get_stats RPC in doc/jsonrpc.md was wrong
because thread_get_stats doesn't output ticks. Fix this together.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I003ffe569d3c0651ae65c5858eff8287f7e9031d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/604
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-06 10:29:56 +00:00
Maciej Szczepaniak
12642633bf bdev/ftl: Add ftl_path parameter to rpc parsing
Signed-off-by: Maciej Szczepaniak <maciej.szczepaniak@intel.com>
Change-Id: I51cc68536f162b0d920d135ba491b1657e699618
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/880
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-06 10:28:21 +00:00
Shuhei Matsumoto
95b35daa5f rpc: Add thread_set_cpumask RPC
Add an new JSON RPC thread_set_cpumask to control CPU affinity of
the thread dynamically from outside of SPDK application.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6b6b794405f612200a2c3cb27dc4fc1ad2e88bec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/501
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-04 10:03:30 +00:00
paul luse
f070b78cd1 module/crypto: add RPC and plumbing to support QAT AES_XTS cipher
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Iadd03f8da305e97e3f1d57ef4aeaece400e8d959
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/441
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-02-18 08:05:42 +00:00
paul luse
e753402aa1 lib/accel: add RPC to select which accel module should be used
Startup RPC only to avoid issues trying to switch while in use.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I7f1801905de0927f3610c4065182dd8fa88cdfdd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/660
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-02-18 08:05:34 +00:00
paul luse
aa7a13afc7 global: rename copy to accel
The copy engine library, modules and public APIs have been renamed.
Use of the word `copy` has been replaced with the word `accel`
short for accelerator in preparation for adding new capabilities
in the future. Additionally, APIs for what was previously called
the `memcpy` engine have been renamed to identify the engine as a
software accelerator.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ia607aa718416146fbba1e6792b8de0f66bd8a5de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/576
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-02-18 08:05:34 +00:00
Tomasz Kulasek
8e3b0c159b rpc: fix allow to use bdev_nvme_apply_firmware in rpc.py
Change-Id: I53c5c69b7b954a491e29a72305bfc1b6c57aabb1
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/532
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-06 09:46:17 +00:00
Wojciech Malikowski
dcd3fc1fd1 bdev/ftl: "use_append" parameter for bdev_ftl_create RPC
Allow for using appends instead of writes.

Change-Id: I2f0d3bcdbb0eee034f7b0b6349de854ddbf7273d
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/481839
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2020-02-04 18:10:01 +00:00
paul luse
e914958951 module/compress: rename set_compress_pmd RPC to match convention
set_compress_pmd -> compress_set_pmd

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Icb1ecc7adfe10485c44f98ab9e31eaa6857596e7
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/482597
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
2020-01-31 12:37:31 +00:00
Michael Haeuptle
c9874b91a7 lib/nvmf: custom admin handler config
This commit disables the custom identify handler by default.
The user has to explictly enable this handler via the set_nvmf_config
RPC or conf file.

Change-Id: I767816ba7639ebe78683993408ce6db02c7620fe
Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479603
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-01-20 09:56:35 +00:00
Wojciech Malikowski
f2c8083ef3 lib/ftl: Functional tests
This patch adjust functional tests to
new FTL stack.

Change-Id: I0b8ff08c61793d7f1685942031aecf9cc88d1f24
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468738
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2020-01-15 12:24:44 +00:00
Wojciech Malikowski
52a9661d94 bdev/ftl: Remove punit parameter from ftl bdev configuration
FTL library is consuming whole OCSSD device
so punit parameter is not needed for bdev ftl
configuration.

Change-Id: I56f62ea6d09b3157b70c02ccfffcd3cb07ba4597
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467950
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2020-01-10 08:42:51 +00:00
Shuhei Matsumoto
876fdf2a59 event/rpc: Add framework_get_reactors RPC
Add an new RPC `framework_get_reactors` to retrieve list of all
reactors.  Running threads on each reactor are included
in the output.  Update jsonrpc.md and CHANGELOG accordingly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I985d087dd41afe3033b7678af141ec8e5a2a822e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478027
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
2020-01-03 08:33:25 +00:00
Konrad Sztyber
64fe514efa bdev/ocssd: parallel unit ranges
This patch adds the ability to create bdevs on specified parallel unit
ranges on one OCSSD controller.  It allows the user to create multiple
isolated bdevs, each operating on a separate set of parallel units.

To create a bdev on a specified range, a new parameter -r|--range was
added. For example:
 rpc.py bdev_ocssd_create -c nvme0 -b nvme0n1 -r 0-4

will create a bdev on parallel units 0 through 4 (inclusive).  If the
parameter is ommited, the bdev will span across all available units.

Change-Id: Icd94cf1e22fcc72806ef1ce1efd2d7031010009f
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469898
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-12-20 10:02:15 +00:00
Seth Howell
de467ec91d env_dpdk/rpc: add rpc to get memory stats.
This will enable us to create a helper applciation to print memory
statistics for a given SPDK application.

Change-Id: I0ad5a8163166a5d67d9a5533303ec0858297ba6b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477511
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-13 11:05:57 +00:00
Evgeniy Kochetov
542be8790b nvme/rpc: Make 'delay_cmd_submit' configurable via RPC
Optional parameter 'delay_cmd_submit' has been added to
'bdev_nvme_set_options' RPC method.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ia09c57bbac8078ee6ab1e8f0bd279ffeb9e08cb8
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462584
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-12-10 17:32:10 +00:00
Tomasz Kulasek
b7b45bc7bc lib/nvme: remove device name parameter from nvme cuse
This patch removes posibility to set cuse device path. Instead
"/dev/spdk/nvme*" path is used.


Change-Id: I7c3087772a3661eebe03fce21356c35cc8204b49
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474598
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-12-09 17:40:35 +00:00
Konrad Sztyber
6bda87b324 bdev/ocssd: create / delete calls
Added a way to create and delete OCSSD bdevs on top of OC NVMe
controller.  The controller can be created using the regular NVMe bdev
RPC call.  For instance, the following (assuming 0000:00:04.0 is an
OC device):

 rpc.py bdev_nvme_attach_controller -b nvme0 -a 0000:00:04.0 -t pcie
 rpc.py bdev_ocssd_create -c nvme0 -b nvme0n1

creates Open Channel controller nvme0 and OCSSD bdev nvme0n1 on top of
it.  The bdevs can be deleted either by the bdev_ocssd_delete call or by
deleting whole NVMe controller, in which case all bdevs are destroyed.

Change-Id: I9f2f02103fc5570a53bd26479c8690be206829c3
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468984
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-12-06 14:45:05 +00:00
Jim Harris
5bd76a1098 rpc.py: expliclty print the exception's message
This worked fine as-is with Python 3.  But when
trying to run rpc.py with Python 2, it was noted
that simply doing print(ex) didn't print the message,
it needs to be print(ex.message).

Note that the similar code for printing the exception
message when running an RPC script was already doing
print(ex.message), so this change also makes the
code more consistent.

We aren't supporting or testing rpc.py with Python 2,
and there are some fairly significant mods required
to get it to work, but this small change at least
reduces that effort for those needing to implement
it and maintain it themselves.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0a6c94889dc631ef33835433f20f35ddc738aafb

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476633
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-12-05 12:23:30 +00:00
Mateusz Kozlowski
195be29e9b bdev/zone: Rpc functions for zoned block bdev
Added rpc handling for creation and deletion of zoned block bdev

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: Ib7b6f3928511aa840cbe098472682c951e92e5ed
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468031
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-15 20:27:14 +00:00
Yao Liu
ec2ba7aade bdev/uring: add an argument to specify block size
The block size of non-disk files can't be automatically detected,
so add an argument to specify it.

Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: Ia11ab177b78c66ede4a09a997bba28827d83ec25
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473607
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-13 15:06:30 +00:00
Xiaodong Liu
138e6daec3 rpc/blobfs: add cache size setting rpc
This RPC method can be used to set cache size of
blobfs, in case a smaller or larger memory scale
is requred by cache pool.

Change-Id: I8046c7caeaa15c67825f86d14ae0b79395d51daf
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471870
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-07 00:33:25 +00:00
Yao Liu
ff93f0f9d6 bdev/uring: make uring rpc interface unified with aio
Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: I338c63f1acf17c3b2a8612dd71952617076ec8f9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472676
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-06 14:43:57 +00:00