Thread (39 messages) 39 messages, 5 authors, 2021-02-10

Re: [PATCH 03/13] target: add workqueue based cmd submission

From: Mike Christie <michael.christie@oracle.com>
Date: 2021-02-10 00:15:55
Also in: target-devel

On 2/9/21 12:43 PM, Mike Christie wrote:
On 2/9/21 9:48 AM, Bodo Stroesser wrote:
quoted
On 09.02.21 13:38, Mike Christie wrote:
quoted
  +void target_queued_submit_work(struct work_struct *work)
+{
+    struct se_cmd_queue *sq = container_of(work, struct se_cmd_queue, work);
+    struct se_cmd *se_cmd, *next_cmd;
+    struct llist_node *cmd_list;
+    unsigned char *cdb;
+
+    cmd_list = llist_del_all(&sq->cmd_list);
+    if (!cmd_list)
+        /* Previous call took what we were queued to submit */
+        return;
+
+    cmd_list = llist_reverse_order(cmd_list);
+    llist_for_each_entry_safe(se_cmd, next_cmd, cmd_list, se_cmd_list) {
+        cdb = se_cmd->se_tfo->get_cdb(se_cmd);
If I got it right, get_cdb is a new, optional callback.
So, should we check, whether it is set?
I think a check is not really useful. The caller has to implement it
if they call target_queue_cmd_submit. It would be a BUG() and so
either way you would get a crash when you are developing a patch.
I'll actually add the BUG. It looks like it's preferred in the lio code.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help