From: John Garry <john.g.garry@oracle.com>
To: martin.petersen@oracle.com
Cc: target-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org, michael.christie@oracle.com,
John Garry <john.g.garry@oracle.com>
Subject: [PATCH v2 2/7] scsi: target: Add atomic se_device fields
Date: Fri, 10 Oct 2025 14:15:03 +0000 [thread overview]
Message-ID: <20251010141508.3695908-3-john.g.garry@oracle.com> (raw)
In-Reply-To: <20251010141508.3695908-1-john.g.garry@oracle.com>
From: Mike Christie <michael.christie@oracle.com>
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.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
jpg: Stop being allowed to configure atomic write alignment,
remove atomic_supported member
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
drivers/target/target_core_configfs.c | 15 +++++++++++++++
include/target/target_core_base.h | 5 +++++
2 files changed, 20 insertions(+)
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index 0904ecae253a8..31d1b28933e96 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -578,6 +578,11 @@ 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_max_len);
+DEF_CONFIGFS_ATTRIB_SHOW(atomic_alignment);
+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,\
@@ -1300,6 +1305,11 @@ CONFIGFS_ATTR(, max_write_same_len);
CONFIGFS_ATTR(, alua_support);
CONFIGFS_ATTR(, pgr_support);
CONFIGFS_ATTR(, submit_type);
+CONFIGFS_ATTR_RO(, atomic_max_len);
+CONFIGFS_ATTR_RO(, atomic_alignment);
+CONFIGFS_ATTR_RO(, atomic_granularity);
+CONFIGFS_ATTR_RO(, atomic_max_with_boundary);
+CONFIGFS_ATTR_RO(, atomic_max_boundary);
/*
* dev_attrib attributes for devices using the target core SBC/SPC
@@ -1343,6 +1353,11 @@ struct configfs_attribute *sbc_attrib_attrs[] = {
&attr_pgr_support,
&attr_emulate_rsoc,
&attr_submit_type,
+ &attr_atomic_alignment,
+ &attr_atomic_max_len,
+ &attr_atomic_granularity,
+ &attr_atomic_max_with_boundary,
+ &attr_atomic_max_boundary,
NULL,
};
EXPORT_SYMBOL(sbc_attrib_attrs);
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index c4d9116904aa0..70ece58d30780 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -731,6 +731,11 @@ struct se_dev_attrib {
u32 unmap_granularity;
u32 unmap_granularity_alignment;
u32 max_write_same_len;
+ u32 atomic_max_len;
+ u32 atomic_alignment;
+ u32 atomic_granularity;
+ u32 atomic_max_with_boundary;
+ u32 atomic_max_boundary;
u8 submit_type;
struct se_device *da_dev;
struct config_group da_group;
--
2.43.5
next prev parent reply other threads:[~2025-10-10 14:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 14:15 [PATCH v2 0/7] scsi: target: Add WRITE_ATOMIC_16 support John Garry
2025-10-10 14:15 ` [PATCH v2 1/7] scsi: target: Rename target_configure_unmap_from_queue John Garry
2025-10-10 14:15 ` John Garry [this message]
2025-10-10 14:15 ` [PATCH v2 3/7] scsi: target: Add helper to setup atomic values from block_device John Garry
2025-10-10 14:15 ` [PATCH v2 4/7] scsi: target: Add WRITE_ATOMIC_16 handler John Garry
2025-10-12 1:38 ` kernel test robot
2025-10-10 14:15 ` [PATCH v2 5/7] scsi: target: Report atomic values in INQUIRY John Garry
2025-10-10 14:15 ` [PATCH v2 6/7] scsi: target: Add WRITE_ATOMIC_16 support to RSOC John Garry
2025-10-10 14:15 ` [PATCH v2 7/7] scsi: target: Add atomic support to target_core_iblock 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=20251010141508.3695908-3-john.g.garry@oracle.com \
--to=john.g.garry@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@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