mpxyd: let TX thread sleep if no open devices are referenced
authorAmir Hanania <amir.hanania@intel.com>
Mon, 19 Sep 2016 23:44:25 +0000 (16:44 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Mon, 19 Sep 2016 23:44:25 +0000 (16:44 -0700)
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
Signed-off-by: Amir Hanania <amir.hanania@intel.com>
dapl/svc/mpxyd.c
doc/mpxyd.conf

index 3df50e8..9f2d01d 100644 (file)
@@ -504,6 +504,11 @@ static int init_smd_send_op_mmap(mcm_scif_dev_t *smd)
        smd->mm_s_place_holder = NULL;
        smd->mm_r_head = 0;
        smd->mm_r_last = DAT_MIX_MMAP_WR_MAX;
+       smd->mm_r_addr = NULL;
+
+       /* Activate send OP via mmap only when polling mode is set */
+       if (!mcm_op_poll)
+               return -1;
 
        len = ALIGN_PAGE(DAT_MIX_MMAP_WR_MAX * (sizeof(dat_mix_mmap_wr_t)));
        smd->mm_r_len = len;
@@ -1046,9 +1051,6 @@ void mpxy_tx_thread(void *mic_client)
                mc->tx_busy = data;
                time_ms = (data) ? 0:-1;
 
-               if (time_ms && mcm_op_poll)
-                       time_ms = 0;
-
                mpxy_unlock(&mc->txlock);
                if (time_ms == -1) mlog(0x10," sleep\n");
                mcm_select(set, time_ms);
@@ -1137,9 +1139,6 @@ void mpxy_op_thread(void *mic_client)
                /* data-path, loop if busy or device open & single core */
                if ((mc->tx_busy || mc->rx_busy) || (smd_cnt && mcm_op_poll))
                        time_ms = 0;
-               else {
-                       time_ms = 0;
-               }
 
                mcm_select(set, time_ms); /* Another sched yield */
                if (time_ms == -1) mlog(0x10," OP wake\n");
@@ -1305,9 +1304,6 @@ void mpxy_rx_thread(void *mic_client)
                mc->rx_busy = data;
                time_ms = data ? 0:-1;
 
-               if (time_ms && mcm_op_poll)
-                       time_ms = 0;
-
                mpxy_unlock(&mc->rxlock);
                if (time_ms == -1) mlog(0x10," RX sleep\n");
                mcm_select(set, time_ms);
index 349a1c0..b16f1f2 100644 (file)
@@ -59,6 +59,14 @@ scif_listen_qlen 240
 # The default is 1 
 
 mcm_affinity 1
+
+# mcm_op_poll:
+# For the OP thread. Use FD wake or use pollong for next OP
+# If 0, FD wake up will be used.
+# If 1, use polling for the next OP.
+#
+# The default is 1
+
 mcm_op_poll 1
 
 # mcm_affinity_base_mic: