Print this page
4780 comstar iSCSI target shouldn't abuse ddi_get_time(9f)
Reviewed by: Eric Diven <eric.diven@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

@@ -19,11 +19,11 @@
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  *
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  */
 
 #include <sys/cpuvar.h>
 #include <sys/types.h>
 #include <sys/conf.h>

@@ -3123,11 +3123,11 @@
                  * the missing command is delivered to the SCSI layer.
                  * Irrespective of the order of insertion into the
                  * staging queue, the commands are processed out of the
                  * queue in cmdSN order only.
                  */
-                rx_pdu->isp_queue_time = ddi_get_time();
+                rx_pdu->isp_queue_time = gethrtime();
                 iscsit_add_pdu_to_queue(ist, rx_pdu);
                 mutex_exit(&ist->ist_sn_mutex);
                 return (ISCSIT_CMDSN_GT_EXPCMDSN);
         } else if (iscsit_sna_lt(ntohl(hdr->cmdsn), ist->ist_expcmdsn)) {
                 DTRACE_PROBE3(cmdsn__lt__expcmdsn, iscsit_sess_t *, ist,

@@ -3393,12 +3393,12 @@
                         /*
                          * If the PDU wait time has not exceeded threshold
                          * stop scanning the staging queue until the timer
                          * fires again
                          */
-                        if ((ddi_get_time() - next_pdu->isp_queue_time)
-                            < rxpdu_queue_threshold) {
+                        if ((gethrtime() - next_pdu->isp_queue_time)
+                            < (rxpdu_queue_threshold * NANOSEC)) {
                                 mutex_exit(&ist->ist_sn_mutex);
                                 return;
                         }
                         /*
                          * Remove the next PDU from the queue and post it