[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-head
Subject:    target/user: Update example code for new ABI requirements
From:       "Linux Kernel Mailing List" <linux-kernel () vger ! kernel ! org>
Date:       2015-05-31 19:06:11
Message-ID: 20150531190611.63E2F660DEE () gitolite ! kernel ! org
[Download RAW message or body]

Gitweb:     http://git.kernel.org/linus/;a=commit;h=cf87edc6022d1fe7efa6b8ce1a99f2ef6a1b27f9
Commit:     cf87edc6022d1fe7efa6b8ce1a99f2ef6a1b27f9
Parent:     5a7125c64def3b21f8147eca8b54949a60963942
Refname:    refs/heads/master
Author:     Andy Grover <agrover@redhat.com>
AuthorDate: Tue May 19 14:44:38 2015 -0700
Committer:  Nicholas Bellinger <nab@linux-iscsi.org>
CommitDate: Sat May 30 19:57:33 2015 -0700

    target/user: Update example code for new ABI requirements
    
    We now require that the userspace handler set a bit if the command is not
    handled.
    
    Update calls to tcmu_hdr_get_op for v2.
    
    Signed-off-by: Andy Grover <agrover@redhat.com>
    Reviewed-by: Ilias Tsitsimpis <iliastsi@arrikto.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
---
 Documentation/target/tcmu-design.txt | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/target/tcmu-design.txt b/Documentation/target/tcmu-design.txt
index c80bf1e..b495108 100644
--- a/Documentation/target/tcmu-design.txt
+++ b/Documentation/target/tcmu-design.txt
@@ -324,7 +324,7 @@ int handle_device_events(int fd, void *map)
   /* Process events from cmd ring until we catch up with cmd_head */
   while (ent != (void *)mb + mb->cmdr_off + mb->cmd_head) {
 
-    if (tcmu_hdr_get_op(&ent->hdr) == TCMU_OP_CMD) {
+    if (tcmu_hdr_get_op(ent->hdr.len_op) == TCMU_OP_CMD) {
       uint8_t *cdb = (void *)mb + ent->req.cdb_off;
       bool success = true;
 
@@ -339,8 +339,12 @@ int handle_device_events(int fd, void *map)
         ent->rsp.scsi_status = SCSI_CHECK_CONDITION;
       }
     }
+    else if (tcmu_hdr_get_op(ent->hdr.len_op) != TCMU_OP_PAD) {
+      /* Tell the kernel we didn't handle unknown opcodes */
+      ent->hdr.uflags |= TCMU_UFLAG_UNKNOWN_OP;
+    }
     else {
-      /* Do nothing for PAD entries */
+      /* Do nothing for PAD entries except update cmd_tail */
     }
 
     /* update cmd_tail */
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic