Skip to contentSkip to conversation

target: clean up kernel-doc and add driver-api document

PATCH New Randy Dunlap 2 participants 6 messages Apr 14, 2018 – Apr 20, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

From: Randy Dunlap <[email protected]>

This patch series fixes kernel-doc warnings in drivers/target/ and its header files, then adds a Documentation driver-api chapter for target driver interfaces.

[PATCH v3 1/4] target: target_core_transport.c: fix kernel-doc warnings [PATCH v3 2/4] target: target_core_transport.c: enable+fix kernel-doc [PATCH v3 3/4] target: target_core_user.[ch]: convert comments into DOC:
[PATCH v3 4/4] target: add driver-api document

 Documentation/driver-api/index.rst     |    1 
 Documentation/driver-api/scsi.rst      |    2 
 Documentation/driver-api/target.rst    |   64 +++++++++++++++++++++++
 drivers/target/target_core_transport.c |   19 +++---
 drivers/target/target_core_user.c      |    8 ++
 include/uapi/linux/target_core_user.h  |   11 ++-
 6 files changed, 89 insertions(+), 16 deletions(-)
#1 lore raw

PATCH v3 1/4 target: target_core_transport.c: fix kernel-doc warnings

From: Randy Dunlap <[email protected]>

Correct a function parameter's name to eliminate kernel-doc warnings in drivers/target/target_core_transport.c.

Fixes these kernel-doc warnings: (tested by adding these files to a new target.rst documentation file)

../drivers/target/target_core_transport.c:1671: warning: No description found for parameter 'fabric_tmr_ptr' ../drivers/target/target_core_transport.c:1671: warning: Excess function parameter 'fabric_context' description in 'target_submit_tmr'

To: "Nicholas A. Bellinger" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Jonathan Corbet <[email protected]>

---
 drivers/target/target_core_transport.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/target_core_transport.c +1 -1
@@ -1654,7 +1654,7 @@ static bool target_lookup_lun_from_tag(s
  * @se_sess: associated se_sess for endpoint
  * @sense: pointer to SCSI sense buffer
  * @unpacked_lun: unpacked LUN to reference for struct se_lun
- * @fabric_context: fabric context for TMR req
+ * @fabric_tmr_ptr: fabric context for TMR req
  * @tm_type: Type of TM request
  * @gfp: gfp type for caller
  * @tag: referenced task tag for TMR_ABORT_TASK
#2 lore raw

PATCH v3 2/4 target: target_core_transport.c: enable+fix kernel-doc

In reply to Randy Dunlap

From: Randy Dunlap <[email protected]>

For exported functions that already have near-kernel-doc notation, fix them to begin with "/**" and make a few corrections so that they don't have any kernel-doc warnings.

To: "Nicholas A. Bellinger" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Jonathan Corbet <[email protected]>

---
 drivers/target/target_core_transport.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/target/target_core_transport.c +10 -7
@@ -1431,7 +1431,7 @@ transport_generic_map_mem_to_cmd(struct
 	return 0;
 }
 
-/*
+/**
  * target_submit_cmd_map_sgls - lookup unpacked lun and submit uninitialized
  * 			 se_cmd + use pre-allocated SGL memory.
  *
@@ -1441,7 +1441,7 @@ transport_generic_map_mem_to_cmd(struct
  * @sense: pointer to SCSI sense buffer
  * @unpacked_lun: unpacked LUN to reference for struct se_lun
  * @data_length: fabric expected data transfer length
- * @task_addr: SAM task attribute
+ * @task_attr: SAM task attribute
  * @data_dir: DMA data direction
  * @flags: flags for command submission from target_sc_flags_tables
  * @sgl: struct scatterlist memory for unidirectional mapping
@@ -1578,7 +1578,7 @@ int target_submit_cmd_map_sgls(struct se
 }
 EXPORT_SYMBOL(target_submit_cmd_map_sgls);
 
-/*
+/**
  * target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd
  *
  * @se_cmd: command descriptor to submit
@@ -1587,7 +1587,7 @@ EXPORT_SYMBOL(target_submit_cmd_map_sgls
  * @sense: pointer to SCSI sense buffer
  * @unpacked_lun: unpacked LUN to reference for struct se_lun
  * @data_length: fabric expected data transfer length
- * @task_addr: SAM task attribute
+ * @task_attr: SAM task attribute
  * @data_dir: DMA data direction
  * @flags: flags for command submission from target_sc_flags_tables
  *
@@ -2606,7 +2606,8 @@ int transport_generic_free_cmd(struct se
 }
 EXPORT_SYMBOL(transport_generic_free_cmd);
 
-/* target_get_sess_cmd - Add command to active ->sess_cmd_list
+/**
+ * target_get_sess_cmd - Add command to active ->sess_cmd_list
  * @se_cmd:	command descriptor to add
  * @ack_kref:	Signal that fabric will perform an ack target_put_sess_cmd()
  */
@@ -2800,7 +2801,8 @@ void target_show_cmd(const char *pfx, st
 }
 EXPORT_SYMBOL(target_show_cmd);
 
-/* target_sess_cmd_list_set_waiting - Flag all commands in
+/**
+ * target_sess_cmd_list_set_waiting - Flag all commands in
  *         sess_cmd_list to complete cmd_wait_comp.  Set
  *         sess_tearing_down so no more commands are queued.
  * @se_sess:	session to flag
@@ -2835,7 +2837,8 @@ void target_sess_cmd_list_set_waiting(st
 }
 EXPORT_SYMBOL(target_sess_cmd_list_set_waiting);
 
-/* target_wait_for_sess_cmds - Wait for outstanding descriptors
+/**
+ * target_wait_for_sess_cmds - Wait for outstanding descriptors
  * @se_sess:    session to wait for active I/O
  */
 void target_wait_for_sess_cmds(struct se_session *se_sess)
#3 lore raw

PATCH v3 3/4 target: target_core_user.[ch]: convert comments into DOC:

In reply to Randy Dunlap

From: Randy Dunlap <[email protected]>

Make documentation on target-supported userspace-I/O design be usable by kernel-doc by using "DOC:". This is used in the driver-api Documentation chapter.

To: "Nicholas A. Bellinger" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Jonathan Corbet <[email protected]>

---
 drivers/target/target_core_user.c     |    8 ++++++--
 include/uapi/linux/target_core_user.h |   11 ++++++-----
 2 files changed, 12 insertions(+), 7 deletions(-)
drivers/target/target_core_user.c +6 -2
@@ -42,7 +42,11 @@
 
 #include <linux/target_core_user.h>
 
-/*
+/**
+ * DOC: Userspace I/O
+ * Userspace I/O
+ * -------------
+ *
  * Define a shared-memory interface for LIO to pass SCSI commands and
  * data to userspace for processing. This is to allow backends that
  * are too complex for in-kernel support to be possible.
@@ -53,7 +57,7 @@
  * See the .h file for how the ring is laid out. Note that while the
  * command ring is defined, the particulars of the data area are
  * not. Offset values in the command entry point to other locations
- * internal to the mmap()ed area. There is separate space outside the
+ * internal to the mmap-ed area. There is separate space outside the
  * command ring for data buffers. This leaves maximum flexibility for
  * moving buffer allocations, or even page flipping or other
  * allocation techniques, without altering the command ring layout.
include/uapi/linux/target_core_user.h +6 -5
@@ -9,21 +9,22 @@
 
 #define TCMU_VERSION "2.0"
 
-/*
+/**
+ * DOC: Ring Design
  * Ring Design
  * -----------
  *
  * The mmaped area is divided into three parts:
- * 1) The mailbox (struct tcmu_mailbox, below)
- * 2) The command ring
- * 3) Everything beyond the command ring (data)
+ * 1) The mailbox (struct tcmu_mailbox, below);
+ * 2) The command ring;
+ * 3) Everything beyond the command ring (data).
  *
  * The mailbox tells userspace the offset of the command ring from the
  * start of the shared memory region, and how big the command ring is.
  *
  * The kernel passes SCSI commands to userspace by putting a struct
  * tcmu_cmd_entry in the ring, updating mailbox->cmd_head, and poking
- * userspace via uio's interrupt mechanism.
+ * userspace via UIO's interrupt mechanism.
  *
  * tcmu_cmd_entry contains a header. If the header type is PAD,
  * userspace should skip hdr->length bytes (mod cmdr_size) to find the
#4 lore raw

PATCH v3 4/4 target: add driver-api document

In reply to Randy Dunlap

From: Randy Dunlap <[email protected]>

Add a driver-api document for target/iSCSI interfaces.

To: "Nicholas A. Bellinger" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Jonathan Corbet <[email protected]>

---
 Documentation/driver-api/index.rst  |    1 
 Documentation/driver-api/scsi.rst   |    2 
 Documentation/driver-api/target.rst |   64 ++++++++++++++++++++++++++
 3 files changed, 66 insertions(+), 1 deletion(-)
Documentation/driver-api/index.rst +1 -0
@@ -34,6 +34,7 @@ available subsections can be seen below.
    edac
    scsi
    libata
+   target
    mtdnand
    miscellaneous
    w1
Documentation/driver-api/scsi.rst +1 -1
@@ -334,5 +334,5 @@ todo
 ~~~~
 
 Parallel (fast/wide/ultra) SCSI, USB, SATA, SAS, Fibre Channel,
-FireWire, ATAPI devices, Infiniband, I2O, iSCSI, Parallel ports,
+FireWire, ATAPI devices, Infiniband, I2O, Parallel ports,
 netlink...
Documentation/driver-api/target.rst new file +59 -0

59 lines not on this page · raw message

#5 lore raw
In reply to Randy Dunlap

Randy,

Quoted 3 lines

This patch series fixes kernel-doc warnings in drivers/target/ and its header files, then adds a Documentation driver-api chapter for target driver interfaces.

Applied to 4.18/scsi-queue. Thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering