All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [SPDK] Starting SPDK RPC server and running the bdev example
@ 2019-05-28 14:03 Harris, James R
  0 siblings, 0 replies; 5+ messages in thread
From: Harris, James R @ 2019-05-28 14:03 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 14309 bytes --]

Hi Paul and Subash,

Seth Howell recently removed the default configuration file command line option:

https://github.com/spdk/spdk/commit/0a1103c41c2dd4b011b33d18b604b53f50ee16c3#diff-e568f3a27d5038b71d96e82ce4e3d3c1

The problem with using a default like this is that it only works if the user is running hello_world from the hello_world directory.  That's why Seth removed it.

Personally, I'd prefer to not add back the default config file.  Let users pass the config file via -c in all cases.  This makes it consistent with most (if not all) of the SPDK applications in the repository.

Thanks,

-Jim


On 5/28/19, 6:24 AM, "SPDK on behalf of subashr" <spdk-bounces(a)lists.01.org on behalf of subash.rajaa(a)iophysics.com> wrote:

    An alternative fix #2 seems to be more consistent.
    
    [root(a)iopxvm1 spdk]# git diff
    diff --git a/examples/bdev/hello_world/hello_bdev.c b/examples/bdev/hello_world/hello_bdev.c
    index 8e47a37..f7e4fc9 100644
    --- a/examples/bdev/hello_world/hello_bdev.c
    +++ b/examples/bdev/hello_world/hello_bdev.c
    @@ -274,6 +274,10 @@ main(int argc, char **argv)
                                          hello_bdev_usage)) != SPDK_APP_PARSE_ARGS_SUCCESS) {
                    exit(rc);
            }
    +       if (opts.config_file == NULL) {
    +               opts.config_file = "bdev.conf";
    +       }
    +       SPDK_NOTICELOG("Using config file %s\n", opts.config_file);
            hello_context.bdev_name = g_bdev_name;
    
    Testing Results:
    
    [root(a)iopxvm1 spdk]# examples/bdev/hello_world/hello_bdev -c ~/spdk/examples/bdev/hello_world/bdev.conf
    hello_bdev.c: 280:main: *NOTICE*: Using config file /root/spdk/examples/bdev/hello_world/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_pid24158 ]
    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
    
    
    [root(a)iopxvm1 spdk]# examples/bdev/hello_world/hello_bdev
    hello_bdev.c: 280:main: *NOTICE*: Using config file bdev.conf
    conf.c: 616:spdk_conf_read: *ERROR*: open error: bdev.conf
    app.c: 370:spdk_app_setup_conf: *ERROR*: Could not read config file bdev.conf
    hello_bdev.c: 291:main: *ERROR*: ERROR starting application
    [root(a)iopxvm1 spdk]# cd examples/bdev/hello_world/
    
    
    [root(a)iopxvm1 hello_world]# ./hello_bdev
    hello_bdev.c: 280:main: *NOTICE*: Using config file 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_pid24161 ]
    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
    Sent from Mail for Windows 10
    
    From: subashr
    Sent: 28 May 2019 18:34
    To: Storage Performance Development Kit
    Subject: Re: [SPDK] Starting SPDK RPC server and running the bdev example
    
    Thanks Paul ! Your suggestion works fine. The config file is needed. Also tested the fix as per your suggestion. I changed the fix slightly since as per the author, the code needs to use default if config file is not specified.
    
            /*
             * The user can provide the config file and bdev name at run time.
             * For example, to use Malloc0 in file bdev.conf run with params
             * ./hello_bdev -c bdev.conf -b Malloc0
             * To use passthru bdev PT0 run with params
             * ./hello_bdev -c bdev.conf -b PT0
             * If none of the parameters are provide the application will use the
             * default parameters(-c bdev.conf -b Malloc0).
    
    This is my patch:
    
    [root(a)iopxvm1 spdk]# git diff
    diff --git a/examples/bdev/hello_world/hello_bdev.c b/examples/bdev/hello_world/hello_bdev.c
    index 8e47a37..3cde161 100644
    --- a/examples/bdev/hello_world/hello_bdev.c
    +++ b/examples/bdev/hello_world/hello_bdev.c
    @@ -260,6 +260,8 @@ main(int argc, char **argv)
            /* Set default values in opts structure. */
            spdk_app_opts_init(&opts);
            opts.name = "hello_bdev";
    +       opts.config_file = "bdev.conf";
    +       SPDK_NOTICELOG("Using config file %s\n", opts.config_file);
    
            /*
             * The user can provide the config file and bdev name at run time.
    Testing with fix:
    [root(a)iopxvm1 hello_world]# ./hello_bdev
    hello_bdev.c: 264:main: *NOTICE*: Using config file 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_pid11135 ]
    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
    Sent from Mail for Windows 10
    
    From: Luse, Paul E
    Sent: 28 May 2019 00:21
    To: Storage Performance Development Kit
    Subject: Re: [SPDK] Starting SPDK RPC server and running the bdev example
    
    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
    _______________________________________________
    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
    


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [SPDK] Starting SPDK RPC server and running the bdev example
@ 2019-05-28 15:40 Harris, James R
  0 siblings, 0 replies; 5+ messages in thread
From: Harris, James R @ 2019-05-28 15:40 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 17012 bytes --]

Yes - that would be a good addition.

-Jim

On 5/28/19, 8:37 AM, "SPDK on behalf of subashr" <spdk-bounces(a)lists.01.org on behalf of subash.rajaa(a)iophysics.com> wrote:

    Sure. Can we then check the config file is specified as per Paul’s original suggestion ?
    
    [root(a)iopxvm1 spdk]# examples/bdev/hello_world/hello_bdev
    hello_bdev.c: 278:main: *ERROR*: configfile must be specified using -c <conffile> e.g. -c bdev.conf
    
    [root(a)iopxvm1 spdk]# git diff
    diff --git a/examples/bdev/hello_world/hello_bdev.c b/examples/bdev/hello_world/hello_bdev.c
    index 8e47a37..00d809f 100644
    --- a/examples/bdev/hello_world/hello_bdev.c
    +++ b/examples/bdev/hello_world/hello_bdev.c
    @@ -274,6 +274,10 @@ main(int argc, char **argv)
                                          hello_bdev_usage)) != SPDK_APP_PARSE_ARGS_SUCCESS) {
                    exit(rc);
            }
    +       if (opts.config_file == NULL) {
    +               SPDK_ERRLOG("configfile must be specified using -c <conffile> e.g. -c bdev.conf\n");
    +               return 1;
    +       }
    Sent from Mail for Windows 10
    
    From: Harris, James R
    Sent: 28 May 2019 19:34
    To: Storage Performance Development Kit
    Subject: Re: [SPDK] Starting SPDK RPC server and running the bdev example
    
    Hi Paul and Subash,
    
    Seth Howell recently removed the default configuration file command line option:
    
    https://github.com/spdk/spdk/commit/0a1103c41c2dd4b011b33d18b604b53f50ee16c3#diff-e568f3a27d5038b71d96e82ce4e3d3c1
    
    The problem with using a default like this is that it only works if the user is running hello_world from the hello_world directory.  That's why Seth removed it.
    
    Personally, I'd prefer to not add back the default config file.  Let users pass the config file via -c in all cases.  This makes it consistent with most (if not all) of the SPDK applications in the repository.
    
    Thanks,
    
    -Jim
    
    
    On 5/28/19, 6:24 AM, "SPDK on behalf of subashr" <spdk-bounces(a)lists.01.org on behalf of subash.rajaa(a)iophysics.com> wrote:
    
        An alternative fix #2 seems to be more consistent.
        
        [root(a)iopxvm1 spdk]# git diff
        diff --git a/examples/bdev/hello_world/hello_bdev.c b/examples/bdev/hello_world/hello_bdev.c
        index 8e47a37..f7e4fc9 100644
        --- a/examples/bdev/hello_world/hello_bdev.c
        +++ b/examples/bdev/hello_world/hello_bdev.c
        @@ -274,6 +274,10 @@ main(int argc, char **argv)
                                              hello_bdev_usage)) != SPDK_APP_PARSE_ARGS_SUCCESS) {
                        exit(rc);
                }
        +       if (opts.config_file == NULL) {
        +               opts.config_file = "bdev.conf";
        +       }
        +       SPDK_NOTICELOG("Using config file %s\n", opts.config_file);
                hello_context.bdev_name = g_bdev_name;
        
        Testing Results:
        
        [root(a)iopxvm1 spdk]# examples/bdev/hello_world/hello_bdev -c ~/spdk/examples/bdev/hello_world/bdev.conf
        hello_bdev.c: 280:main: *NOTICE*: Using config file /root/spdk/examples/bdev/hello_world/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_pid24158 ]
        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
        
        
        [root(a)iopxvm1 spdk]# examples/bdev/hello_world/hello_bdev
        hello_bdev.c: 280:main: *NOTICE*: Using config file bdev.conf
        conf.c: 616:spdk_conf_read: *ERROR*: open error: bdev.conf
        app.c: 370:spdk_app_setup_conf: *ERROR*: Could not read config file bdev.conf
        hello_bdev.c: 291:main: *ERROR*: ERROR starting application
        [root(a)iopxvm1 spdk]# cd examples/bdev/hello_world/
        
        
        [root(a)iopxvm1 hello_world]# ./hello_bdev
        hello_bdev.c: 280:main: *NOTICE*: Using config file 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_pid24161 ]
        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
        Sent from Mail for Windows 10
        
        From: subashr
        Sent: 28 May 2019 18:34
        To: Storage Performance Development Kit
        Subject: Re: [SPDK] Starting SPDK RPC server and running the bdev example
        
        Thanks Paul ! Your suggestion works fine. The config file is needed. Also tested the fix as per your suggestion. I changed the fix slightly since as per the author, the code needs to use default if config file is not specified.
        
                /*
                 * The user can provide the config file and bdev name at run time.
                 * For example, to use Malloc0 in file bdev.conf run with params
                 * ./hello_bdev -c bdev.conf -b Malloc0
                 * To use passthru bdev PT0 run with params
                 * ./hello_bdev -c bdev.conf -b PT0
                 * If none of the parameters are provide the application will use the
                 * default parameters(-c bdev.conf -b Malloc0).
        
        This is my patch:
        
        [root(a)iopxvm1 spdk]# git diff
        diff --git a/examples/bdev/hello_world/hello_bdev.c b/examples/bdev/hello_world/hello_bdev.c
        index 8e47a37..3cde161 100644
        --- a/examples/bdev/hello_world/hello_bdev.c
        +++ b/examples/bdev/hello_world/hello_bdev.c
        @@ -260,6 +260,8 @@ main(int argc, char **argv)
                /* Set default values in opts structure. */
                spdk_app_opts_init(&opts);
                opts.name = "hello_bdev";
        +       opts.config_file = "bdev.conf";
        +       SPDK_NOTICELOG("Using config file %s\n", opts.config_file);
        
                /*
                 * The user can provide the config file and bdev name at run time.
        Testing with fix:
        [root(a)iopxvm1 hello_world]# ./hello_bdev
        hello_bdev.c: 264:main: *NOTICE*: Using config file 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_pid11135 ]
        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
        Sent from Mail for Windows 10
        
        From: Luse, Paul E
        Sent: 28 May 2019 00:21
        To: Storage Performance Development Kit
        Subject: Re: [SPDK] Starting SPDK RPC server and running the bdev example
        
        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
        _______________________________________________
        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
        
    
    _______________________________________________
    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
    


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [SPDK] Starting SPDK RPC server and running the bdev example
@ 2019-05-28 13:23 Luse, Paul E
  0 siblings, 0 replies; 5+ messages in thread
From: Luse, Paul E @ 2019-05-28 13:23 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 9533 bytes --]

Great! Did you see on https://spdk.io/development/ how we submit patches? There's just a little bit of initial setup and after that it makes things much easier for everyone to review/comment/etc using GerritHub. If you can take it though that process that would be fantastic!  Looking forward to it....

-Paul


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

Thanks Paul ! Your suggestion works fine. The config file is needed. Also tested the fix as per your suggestion. I changed the fix slightly since as per the author, the code needs to use default if config file is not specified.

        /*
         * The user can provide the config file and bdev name at run time.
         * For example, to use Malloc0 in file bdev.conf run with params
         * ./hello_bdev -c bdev.conf -b Malloc0
         * To use passthru bdev PT0 run with params
         * ./hello_bdev -c bdev.conf -b PT0
         * If none of the parameters are provide the application will use the
         * default parameters(-c bdev.conf -b Malloc0).

This is my patch:

[root(a)iopxvm1 spdk]# git diff
diff --git a/examples/bdev/hello_world/hello_bdev.c b/examples/bdev/hello_world/hello_bdev.c
index 8e47a37..3cde161 100644
--- a/examples/bdev/hello_world/hello_bdev.c
+++ b/examples/bdev/hello_world/hello_bdev.c
@@ -260,6 +260,8 @@ main(int argc, char **argv)
        /* Set default values in opts structure. */
        spdk_app_opts_init(&opts);
        opts.name = "hello_bdev";
+       opts.config_file = "bdev.conf";
+       SPDK_NOTICELOG("Using config file %s\n", opts.config_file);

        /*
         * The user can provide the config file and bdev name at run time.
Testing with fix:
[root(a)iopxvm1 hello_world]# ./hello_bdev
hello_bdev.c: 264:main: *NOTICE*: Using config file 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_pid11135 ]
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 Sent from Mail for Windows 10

From: Luse, Paul E
Sent: 28 May 2019 00:21
To: Storage Performance Development Kit
Subject: Re: [SPDK] Starting SPDK RPC server and running the bdev example

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
_______________________________________________
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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [SPDK] Starting SPDK RPC server and running the bdev example
@ 2019-05-27 18:50 Luse, Paul E
  0 siblings, 0 replies; 5+ messages in thread
From: Luse, Paul E @ 2019-05-27 18:50 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 6091 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [SPDK] Starting SPDK RPC server and running the bdev example
@ 2019-05-27  7:20 Zawadzki, Tomasz
  0 siblings, 0 replies; 5+ messages in thread
From: Zawadzki, Tomasz @ 2019-05-27  7:20 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 3641 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-28 15:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28 14:03 [SPDK] Starting SPDK RPC server and running the bdev example Harris, James R
  -- strict thread matches above, loose matches on Subject: below --
2019-05-28 15:40 Harris, James R
2019-05-28 13:23 Luse, Paul E
2019-05-27 18:50 Luse, Paul E
2019-05-27  7:20 Zawadzki, Tomasz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.