]> git.openfabrics.org - ~tnikolova/compat-rdma/.git/commitdiff
iwpmd: Enable the port mapper service for iWarp providers. vofed-4.8-rc3
authorTatyana Nikolova <tatyana.e.nikolova@intel.com>
Thu, 18 May 2017 14:23:10 +0000 (09:23 -0500)
committerTatyana Nikolova <tatyana.e.nikolova@intel.com>
Thu, 18 May 2017 16:29:07 +0000 (09:29 -0700)
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
ofed_scripts/openibd

index 91ff444c54363b4c81c943535564ba29582ad713..e63facc9420375b1ca31b4af6779d8d37178f143 100644 (file)
@@ -299,6 +299,18 @@ get_mlx4_en_interfaces()
     done
 }
 
+enable_iwpmd()
+{
+       if command -v "systemctl" > /dev/null 2>&1 ; then
+               if [ "systemctl is-enabled iwpmd" != "enabled" ]; then
+                       systemctl enable iwpmd
+               fi
+               if [ "systemctl is-active iwpmd" != "active" ]; then
+                       systemctl start iwpmd
+               fi
+       fi
+}
+
 # If module $1 is loaded return - 0 else - 1
 is_module()
 {
@@ -818,6 +830,7 @@ start()
         fi
     fi
 
+    local need_iwpmd=0
     # Load Mellanox HCA driver
     if [ "X${MTHCA_LOAD}" == "Xyes" ]; then
         load_module ib_mthca
@@ -927,6 +940,8 @@ start()
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading cxgb4 driver: "
+       else
+               need_iwpmd=1
         fi
         RC=$[ $RC + $my_rc ]
     fi
@@ -938,6 +953,8 @@ start()
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading nes driver: "
+       else
+               need_iwpmd=1
         fi
         RC=$[ $RC + $my_rc ]
     fi
@@ -949,6 +966,8 @@ start()
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading i40iw driver: "
+       else
+               need_iwpmd=1
         fi
         RC=$[ $RC + $my_rc ]
     fi
@@ -987,6 +1006,10 @@ start()
         RC=$[ $RC + $? ]
     fi
 
+    if [ $need_iwpmd -eq 1 ]; then
+       enable_iwpmd
+    fi
+
     if [ $RC -eq 0 ]; then
         echo_success $"Loading HCA driver and Access Layer: "
     else