On 30/11/17 02:42 PM, Serge Semin wrote:
+function find_pidx()
+{
+       PORT=$1
+       PPATH=$2
+
+       for ((i = 0; i < 64; i++)); do
+               PEER_DIR="$PPATH/peer$i"
+
+               check_file ${PEER_DIR} || break
+
+               PEER_PORT=$(read_file "${PEER_DIR}/port")
+               if [[ ${PORT} -eq $PEER_PORT ]]; then
+                       echo $i
+                       return 0
+               fi
+       done
+
+       return 1
+}

Actually, per my earlier comments on other messages. I think it would be best if each of the patches in this series also included the relevant changes to ntb_tool. Then just ditch the ntb_tool patch. For example, this patch would include adding the "port" file to ntb_tool and the relevant test to ntb_test.

Otherwise, when the ntb_tool patch is committed, the ntb_test breaks and then is fixed in subsequent patches. In an ideal world, this would be avoided in case we ever want to do a bisect involving ntb_test.

Logan

Reply via email to