target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: michael.christie@oracle.com
To: John Garry <john.g.garry@oracle.com>,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org
Subject: Re: [PATCH 2/7] scsi: target: Add atomic se_device fields
Date: Wed, 23 Jul 2025 10:48:28 -0500	[thread overview]
Message-ID: <f6efa59c-680f-43a4-b477-0a3791f06f2e@oracle.com> (raw)
In-Reply-To: <481bcab0-7bc0-40f1-9384-7d3c20ccc22c@oracle.com>

On 7/23/25 10:10 AM, michael.christie@oracle.com wrote:
> On 7/23/25 6:28 AM, John Garry wrote:
>> On 20/07/2025 23:15, Mike Christie wrote:
>>> On 5/14/25 5:26 AM, John Garry wrote:
>>>> On 08/10/2024 03:03, Mike Christie wrote:
>>>>> This adds atomic fields to the se_device and exports them in configfs.
>>>>>
>>>>> Initially only target_core_iblock will be supported and we will inherit
>>>>> all the settings from the block layer except the alignment which
>>>>> userspace
>>>>> will set.
>>>>>
>>>>> Signed-off-by: Mike Christie <michael.christie@oracle.com>
>>>>> ---
>>>>>    drivers/target/target_core_configfs.c | 42 ++++++++++++++++++++++
>>>>> +++++
>>>>>    include/target/target_core_base.h     |  6 ++++
>>>>>    2 files changed, 48 insertions(+)
>>>>>
>>>>> diff --git a/drivers/target/target_core_configfs.c b/drivers/target/
>>>>> target_core_configfs.c
>>>>> index c40217f44b1b..f3c7da650f65 100644
>>>>> --- a/drivers/target/target_core_configfs.c
>>>>> +++ b/drivers/target/target_core_configfs.c
>>>>> @@ -578,6 +578,12 @@ DEF_CONFIGFS_ATTRIB_SHOW(unmap_zeroes_data);
>>>>>    DEF_CONFIGFS_ATTRIB_SHOW(max_write_same_len);
>>>>>    DEF_CONFIGFS_ATTRIB_SHOW(emulate_rsoc);
>>>>>    DEF_CONFIGFS_ATTRIB_SHOW(submit_type);
>>>>> +DEF_CONFIGFS_ATTRIB_SHOW(atomic_supported);
>>>>> +DEF_CONFIGFS_ATTRIB_SHOW(atomic_alignment);
>>>>> +DEF_CONFIGFS_ATTRIB_SHOW(atomic_max_len);
>>>>> +DEF_CONFIGFS_ATTRIB_SHOW(atomic_granularity);
>>>>> +DEF_CONFIGFS_ATTRIB_SHOW(atomic_max_with_boundary);
>>>>> +DEF_CONFIGFS_ATTRIB_SHOW(atomic_max_boundary);
>>>>>      #define DEF_CONFIGFS_ATTRIB_STORE_U32(_name)                \
>>>>>    static ssize_t _name##_store(struct config_item *item, const char
>>>>> *page,\
>>>>> @@ -1266,6 +1272,30 @@ static ssize_t submit_type_store(struct
>>>>> config_item *item, const char *page,
>>>>>        return count;
>>>>>    }
>>>>>    +static ssize_t atomic_alignment_store(struct config_item *item,
>>>>> +                      const char *page, size_t count)
>>>>
>>>> What is special about alignment that we need to be able to configure
>>>> this?
>>>>
>>>> Won't that be derived from the block device queue_limits (like
>>>> granularity)?
>>>
>>> What if you are not using a physical block device like using LIO's
>>> ramdisk mode
>>> to perform testing?
>>
>> But would this non-physical device still need to support atomics? I
>> would assume so.
> 
> It depends. For just a testing mode not necessarily. It can be relaxed
> so you can test different scenarios like you want to test when atomics
> are not supported correctly. For real support yes.
> 
> But just to be clear for either case, there won't always be a
> request_queue/block_device. For example, rd and tcmu don't use
> target_configure_write_atomic_from_bdev, so the atomic values can be
> whatever they want to support.

I think I misunderstood the last comment.

I'm trying to make sure I can support a broken device for testing so I
tried to make as flexible as possible.

With the code as is though I think your concern in the last comment is
that a user could set some valid settings, use rd/tcmu, and think they
were safe when they are not. If so, then I agree that can happen.

Or are you saying even for broken device simulation that we will never
need to set values like alignment above?

  reply	other threads:[~2025-07-23 15:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  2:03 [PATCH 0/7] scsi: target: Add WRITE_ATOMIC_16 support Mike Christie
2024-10-08  2:03 ` [PATCH 1/7] scsi: target: Rename target_configure_unmap_from_queue Mike Christie
2025-05-14 11:11   ` John Garry
2024-10-08  2:03 ` [PATCH 2/7] scsi: target: Add atomic se_device fields Mike Christie
2025-05-14 10:26   ` John Garry
2025-07-20 22:15     ` Mike Christie
2025-07-23 11:28       ` John Garry
2025-07-23 15:10         ` michael.christie
2025-07-23 15:48           ` michael.christie [this message]
2025-07-23 16:21             ` John Garry
2025-07-23 19:38               ` michael.christie
2024-10-08  2:03 ` [PATCH 3/7] scsi: target: Add helper to setup atomic values from block_device Mike Christie
2025-05-14 10:29   ` John Garry
2024-10-08  2:03 ` [PATCH 4/7] scsi: target: Add WRITE_ATOMIC_16 handler Mike Christie
2024-10-09  6:10   ` kernel test robot
2025-05-14 10:47   ` John Garry
2025-07-20 22:44     ` Mike Christie
2024-10-08  2:03 ` [PATCH 5/7] scsi: target: Report atomic values in INQUIRY Mike Christie
2025-05-14 10:56   ` John Garry
2025-07-20 22:42     ` Mike Christie
2024-10-08  2:03 ` [PATCH 6/7] scsi: target: Add WRITE_ATOMIC_16 support to RSOC Mike Christie
2024-10-08  2:03 ` [PATCH 7/7] scsi: target: Add atomic support to target_core_iblock Mike Christie
2025-05-14 11:01   ` John Garry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6efa59c-680f-43a4-b477-0a3791f06f2e@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=john.g.garry@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).