Skip to contentSkip to conversation

Starting SPDK RPC server and running the bdev example

SPDK Luse 1 participant 1 message May 27, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Luse

#1 lore raw

Or if you're just looking to walk through the example, the config file is supplied in the same dir so would look like what I pasted below Or if you want to get your feet wet making a small change to the app and submitting a patch it would be *great* to have the app spit out an error if no config file is supplied. What you experienced is not very user friendly :)

Let me know if you'd like to give that a shot and/or if you need any help (anyone here can help), if not I'll probably knock it later...

Thx
Paul

[peluse(a)localhost hello_world]$ sudo ./hello_bdev -c bdev.conf
Starting SPDK v19.07-pre / DPDK 19.02.0 initialization...
[ DPDK EAL parameters: hello_bdev --no-shconf -c 0x1 --log-level=lib.eal:6 --log-level=lib.cryptodev:5 --log-level=user1:6 --base-virtaddr=0x200000000000 --match-allocations --file-prefix=spdk_pid38550 ]
EAL: No free hugepages reported in hugepages-1048576kB
app.c: 628:spdk_app_start: *NOTICE*: Total cores available: 1
reactor.c: 251:_spdk_reactor_run: *NOTICE*: Reactor started on core 0
hello_bdev.c: 199:hello_start: *NOTICE*: Successfully started the application
hello_bdev.c: 217:hello_start: *NOTICE*: Opening the bdev Malloc0
hello_bdev.c: 225:hello_start: *NOTICE*: Opening io channel
hello_bdev.c: 167:hello_write: *NOTICE*: Writing to the bdev
hello_bdev.c: 144:write_complete: *NOTICE*: bdev io write completed successfully
hello_bdev.c: 111:hello_read: *NOTICE*: Reading io
hello_bdev.c: 91:read_complete: *NOTICE*: Read string from bdev : Hello World!

hello_bdev.c: 100:read_complete: *NOTICE*: Stopping app

-----Original Message-----
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of subashr
Sent: Monday, May 27, 2019 9:23 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: Re: [SPDK] Starting SPDK RPC server and running the bdev example

Thanks Tomek for the neat explanation. I will look at the options you mentioned and hopefully be able to go further.

Sent from Mail for Windows 10

From: Zawadzki, Tomasz
Sent: 27 May 2019 12:51
To: Storage Performance Development Kit
Subject: Re: [SPDK] Starting SPDK RPC server and running the bdev example

Hello Subash,

What you are seeing is by design for the hello_bdev example. It was written to showcase how to interact with bdevs, instead of being full-fledged application.
It starts with hello_start and goes through stages of writing to and reading from selected bdev. The bdev should be available at startup time, since the example immediately performs whole flow. You can supply config via -c parameter, please see test/bdev/blockdev.sh for example.

On the other hand if your goal was to change the hello_bdev example to accept RPC, it already does since spdk_app_opts_init() sets socket to the default value and spdk_app_start() is supplied with it. It is just that the flow of the example does not anticipate it, the hello_start() would need to be modified to wait until selected bdev is available.

Thanks,
Tomek

-----Original Message-----
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of subashr
Sent: Sunday, May 26, 2019 3:27 PM
To: spdk(a)lists.01.org
Subject: [SPDK] Starting SPDK RPC server and running the bdev example

All,

I have a CentOS VM and it has latest spdk installed. I am using virtual box and a virtual NVME controller. The hello world app runs fine. Question is how to start the RPC server and run the bdev example ?
[root(a)iopxvm1 nvme]# hello_world/hello_world Starting SPDK v19.07-pre / DPDK 19.02.0 initialization...
[ DPDK EAL parameters: hello_world -c 0x1 --log-level=lib.eal:6 --log-level=lib.cryptodev:5 --log-level=user1:6 --base-virtaddr=0x200000000000 --match-allocations --file-prefix=spdk0 --proc-type=auto ] Initializing NVMe Controllers Attaching to 0000:00:0e.0 Attached to 0000:00:0e.0
Using controller ORCL-VBOX-NVME-VER12 (VB1234-56789 ) with 1 namespaces.
Namespace ID: 1 size: 8GB
Initialization complete.
INFO: using host memory buffer for IO
Hello world!

Running the bdev example gives the following:
root(a)iopxvm1 hello_world]# ./hello_bdev
Starting SPDK v19.07-pre / DPDK 19.02.0 initialization...
[ DPDK EAL parameters: hello_bdev --no-shconf -c 0x1 --log-level=lib.eal:6 --log-level=lib.cryptodev:5 --log-level=user1:6 --base-virtaddr=0x200000000000 --match-allocations --file-prefix=spdk_pid10649 ] app.c: 628:spdk_app_start: *NOTICE*: Total cores available: 1
reactor.c: 251:_spdk_reactor_run: *NOTICE*: Reactor started on core 0
hello_bdev.c: 199:hello_start: *NOTICE*: Successfully started the application
hello_bdev.c: 208:hello_start: *ERROR*: Could not find the bdev: Malloc0
app.c: 723:spdk_app_stop: *WARNING*: spdk_app_stop'd on non-zero
hello_bdev.c: 287:main: *ERROR*: ERROR starting application

[root(a)iopxvm1 scripts]# ./rpc.py get_rpc_methods Traceback (most recent call last):
File "/root/spdk/scripts/rpc/client.py", line 46, in __init__
self.sock.connect((addr, port))
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./rpc.py", line 1794, in <module>
args.client = rpc.client.JSONRPCClient(args.server_addr, args.port, args.timeout, log_level=getattr(logging, args.verbose.upper()))
File "/root/spdk/scripts/rpc/client.py", line 49, in __init__

    "Error details: %s" % (addr, ex))

rpc.client.JSONRPCException: Error while connecting to /var/tmp/spdk.sock Error details: [Errno -2] Name or service not known Sent from Mail for Windows 10

Looks like UDS socket is not working ?

Any suggestions?

Thanks,
Subash

_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk

_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk