All of lore.kernel.org
 help / color / mirror / Atom feed
* [SPDK] Re: Some questions about SPDK bdev module
@ 2022-02-10 13:33 Luse, Paul E
  0 siblings, 0 replies; 9+ messages in thread
From: Luse, Paul E @ 2022-02-10 13:33 UTC (permalink / raw)
  To: spdk

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

Hi,

The example that Gang provided looked pretty good, you just need to use that format and change the keys/values.  Can you provide the exact json file that you’ve tried (mentioned below) that isn’t working?

Thx
Paul

From: liushengchao02(a)meituan.com <liushengchao02(a)meituan.com>
Date: Thursday, February 10, 2022 at 12:22 AM
To: spdk(a)lists.01.org <spdk(a)lists.01.org>
Subject: [SPDK] Re: Some questions about SPDK bdev module
Thank you for the reply.

I have tested many ways in a "json config file" but still can not work as executing 'rpc.py log_set_flag nvme' when starting the SPDK app with '-c' option and specify the json config file.

That's why I'm here asking for an example of "json config file".

Does anybody know the answers? Or currently SPDK does not support "log_set_flag" in a json config file?

Thanks
_______________________________________________
SPDK mailing list -- spdk(a)lists.01.org
To unsubscribe send an email to spdk-leave(a)lists.01.org

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

* [SPDK] Re: Some questions about SPDK bdev module
@ 2022-02-11 12:37 Luse, Paul E
  0 siblings, 0 replies; 9+ messages in thread
From: Luse, Paul E @ 2022-02-11 12:37 UTC (permalink / raw)
  To: spdk

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

Great!

-from my iPhone 

> On Feb 11, 2022, at 5:31 AM, liushengchao02(a)meituan.com wrote:
> 
> Thanks, Paul. Jim has provided the correct json format and it worked!
> 
> I remember that I tested similar format. Maybe I made some mistakes at that time.
> 
> Thanks!
> _______________________________________________
> SPDK mailing list -- spdk(a)lists.01.org
> To unsubscribe send an email to spdk-leave(a)lists.01.org

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

* [SPDK] Re: Some questions about SPDK bdev module
@ 2022-02-11 12:36 liushengchao02
  0 siblings, 0 replies; 9+ messages in thread
From: liushengchao02 @ 2022-02-11 12:36 UTC (permalink / raw)
  To: spdk

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

Thanks Jim.

The json you provde works! I remember that I have tested similar formats. Maybe I've made some mistakes at that time.

My final question is whether SPDK framework would handle inflight spdk_bdev_io data when a bdev is deleted?

Or the 'destruct' of 'spdk_bdev_fn_table' would not be called until all inflight spdk_bdev_io data are completed? If so, is it OK that I change the 'module_link' of 'spdk_bdev_io' in my own bdev module?

Thanks!

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

* [SPDK] Re: Some questions about SPDK bdev module
@ 2022-02-11 12:30 liushengchao02
  0 siblings, 0 replies; 9+ messages in thread
From: liushengchao02 @ 2022-02-11 12:30 UTC (permalink / raw)
  To: spdk

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

Thanks, Paul. Jim has provided the correct json format and it worked!

I remember that I tested similar format. Maybe I made some mistakes at that time.

Thanks!

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

* [SPDK] Re: Some questions about SPDK bdev module
@ 2022-02-10 15:14 Harris, James R
  0 siblings, 0 replies; 9+ messages in thread
From: Harris, James R @ 2022-02-10 15:14 UTC (permalink / raw)
  To: spdk

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

Hi,

Please try the following:

{
  "subsystems": [
    {
      "subsystem": "log",
      "config": [
        {
          "method": "log_set_flag",
          "params": { "flag": "nvme" }
        }
      ]
    }
  ]
}

This JSON file will work if you only want to set the nvme log flag.  Or if you have an existing JSON file, you can just add the "subsystem" entry to the "subsystems" array in that file.

Regards,

Jim


On 2/10/22, 6:34 AM, "Luse, Paul E" <paul.e.luse(a)intel.com> wrote:

    Hi,

    The example that Gang provided looked pretty good, you just need to use that format and change the keys/values.  Can you provide the exact json file that you’ve tried (mentioned below) that isn’t working?

    Thx
    Paul

    From: liushengchao02(a)meituan.com <liushengchao02(a)meituan.com>
    Date: Thursday, February 10, 2022 at 12:22 AM
    To: spdk(a)lists.01.org <spdk(a)lists.01.org>
    Subject: [SPDK] Re: Some questions about SPDK bdev module
    Thank you for the reply.

    I have tested many ways in a "json config file" but still can not work as executing 'rpc.py log_set_flag nvme' when starting the SPDK app with '-c' option and specify the json config file.

    That's why I'm here asking for an example of "json config file".

    Does anybody know the answers? Or currently SPDK does not support "log_set_flag" in a json config file?

    Thanks
    _______________________________________________
    SPDK mailing list -- spdk(a)lists.01.org
    To unsubscribe send an email to spdk-leave(a)lists.01.org
    _______________________________________________
    SPDK mailing list -- spdk(a)lists.01.org
    To unsubscribe send an email to spdk-leave(a)lists.01.org


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

* [SPDK] Re: Some questions about SPDK bdev module
@ 2022-02-10  7:21 liushengchao02
  0 siblings, 0 replies; 9+ messages in thread
From: liushengchao02 @ 2022-02-10  7:21 UTC (permalink / raw)
  To: spdk

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

Thank you for the reply.

I have tested many ways in a "json config file" but still can not work as executing 'rpc.py log_set_flag nvme' when starting the SPDK app with '-c' option and specify the json config file.

That's why I'm here asking for an example of "json config file".

Does anybody know the answers? Or currently SPDK does not support "log_set_flag" in a json config file?

Thanks

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

* [SPDK] Re: Some questions about SPDK bdev module
@ 2022-02-10  6:58 Cao, Gang
  0 siblings, 0 replies; 9+ messages in thread
From: Cao, Gang @ 2022-02-10  6:58 UTC (permalink / raw)
  To: spdk

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

https://github.com/spdk/spdk/blob/master/examples/bdev/fio_plugin/bdev.json is one example of JSON file which is to call the bdev_malloc_create() RPC method.

Basically it is to convert the RPC command to json format. You may refer this to change the log_set_flag RPC method to JSON content.

-----Original Message-----
From: liushengchao02(a)meituan.com <liushengchao02(a)meituan.com> 
Sent: Thursday, February 10, 2022 12:50
To: spdk(a)lists.01.org
Subject: [SPDK] Re: Some questions about SPDK bdev module

Thank you for the reply.

For the 1st question, is it certain that the SPDK framework will handle remaining uncompleted spdk_bdev_io?

For the 2nd question, what I want is an example of 'json config file' that would do the same thing as calling 'rpc.py log_set_flag nvme' when I start the SPDK app with '-c' option and specify the json config file.

Thanks!
_______________________________________________
SPDK mailing list -- spdk(a)lists.01.org
To unsubscribe send an email to spdk-leave(a)lists.01.org

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

* [SPDK] Re: Some questions about SPDK bdev module
@ 2022-02-10  4:49 liushengchao02
  0 siblings, 0 replies; 9+ messages in thread
From: liushengchao02 @ 2022-02-10  4:49 UTC (permalink / raw)
  To: spdk

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

Thank you for the reply.

For the 1st question, is it certain that the SPDK framework will handle remaining uncompleted spdk_bdev_io?

For the 2nd question, what I want is an example of 'json config file' that would do the same thing as calling 'rpc.py log_set_flag nvme' when I start the SPDK app with '-c' option and specify the json config file.

Thanks!

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

* [SPDK] Re: Some questions about SPDK bdev module
@ 2022-02-10  4:26 Cao, Gang
  0 siblings, 0 replies; 9+ messages in thread
From: Cao, Gang @ 2022-02-10  4:26 UTC (permalink / raw)
  To: spdk

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

For 1st question, the bdev close/destruct is usually in the aysnc mode if there are ongoing IOs. The SPDK bdev framework will handle that from my understanding.

For 2nd question, take nvme bdev as example, there is a config_json function pointer for the json related configuration.

And for the specific log related, you could take a look at SPDK_LOG_REGISTER_COMPONENT macro first.

static struct spdk_bdev_module nvme_if = {
	.name = "nvme",
	.async_fini = true,
	.module_init = bdev_nvme_library_init,
	.module_fini = bdev_nvme_library_fini,
	.config_json = bdev_nvme_config_json,
	.get_ctx_size = bdev_nvme_get_ctx_size,

};
SPDK_BDEV_MODULE_REGISTER(nvme, &nvme_if)

-----Original Message-----
From: liushengchao02(a)meituan.com <liushengchao02(a)meituan.com> 
Sent: Thursday, February 10, 2022 11:18
To: spdk(a)lists.01.org
Subject: [SPDK] Some questions about SPDK bdev module

I have read the source code of SPDK and implemented my own bdev module by referencing official bdev modules like null, malloc and aio. But I still have some questions and hope someone can explain.

1.When a bdev is deleted, the 'destruct' function pointer of spdk_bdev_fn_table is called and the block device is closed. I find that ongoing spdk_bdev_io is not explicitly completed by calling spdk_bdev_io_complete(). Are these spdk_bdev_io cleaned automatically by SPDK framework?

2.How to write the json config that corresponds to the rpc call of 'log_set_flag'? I have tried many ways but still can not work and I have to implement my own version of rpc call in my own bdev module to enable json config.

Thanks!
_______________________________________________
SPDK mailing list -- spdk(a)lists.01.org
To unsubscribe send an email to spdk-leave(a)lists.01.org

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

end of thread, other threads:[~2022-02-11 12:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 13:33 [SPDK] Re: Some questions about SPDK bdev module Luse, Paul E
  -- strict thread matches above, loose matches on Subject: below --
2022-02-11 12:37 Luse, Paul E
2022-02-11 12:36 liushengchao02
2022-02-11 12:30 liushengchao02
2022-02-10 15:14 Harris, James R
2022-02-10  7:21 liushengchao02
2022-02-10  6:58 Cao, Gang
2022-02-10  4:49 liushengchao02
2022-02-10  4:26 Cao, Gang

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.