Browse Source

Add support for ConnectX-5 adapters

  - upgrade mlnx-ofed-fuel to version 4.0-2.0.0.1
  - add maximum number of CX5 VFs to 96

Change-Id: Ie3612d5b9a488ade49dbfc65389be9e9f9442bb0
changes/01/478301/7
Hamdy Khader 1 year ago
parent
commit
b488aaaf7a

+ 1
- 0
deployment_scripts/common View File

@@ -85,6 +85,7 @@ readonly SRIOV=`get_mlnx_param sriov`
85 85
 readonly USER_NUM_OF_VFS=`get_mlnx_param num_of_vfs`
86 86
 readonly ISER=`get_mlnx_param iser`
87 87
 readonly MAX_VFS=62
88
+readonly MAX_VFS_CX5=96
88 89
 readonly MIN_VFS=1
89 90
 readonly CX=`get_mlnx_param cx_card`
90 91
 readonly NETWORK_TYPE=`get_mlnx_param network_type`

+ 16
- 8
deployment_scripts/mellanox_settings.py View File

@@ -27,7 +27,8 @@ MLNX_SECTION = 'mellanox-plugin'
27 27
 SETTINGS_FILE = '/etc/astute.yaml'
28 28
 PLUGIN_OVERRIDE_FILE = '/etc/hiera/override/plugins.yaml'
29 29
 MLNX_DRIVERS_LIST = { 'ConnectX-3': {'eth_driver' : 'mlx4_en', 'ib_driver' : 'eth_ipoib'},
30
-                      'ConnectX-4': {'eth_driver' : 'mlx5_core', 'ib_driver' : 'eth_ipoib'}}
30
+                      'ConnectX-4': {'eth_driver' : 'mlx5_core', 'ib_driver' : 'eth_ipoib'},
31
+                      'ConnectX-5': {'eth_driver' : 'mlx5_core', 'ib_driver' : 'eth_ipoib'}}
31 32
 MLNX_DRIVERS = set([MLNX_DRIVERS_LIST[card][net]
32 33
                     for card in MLNX_DRIVERS_LIST
33 34
                     for net in MLNX_DRIVERS_LIST[card]])
@@ -82,6 +83,17 @@ class MellanoxSettings(object):
82 83
                                             .index(driver)]
83 84
             return card
84 85
 
86
+    @classmethod
87
+    def get_card_type_by_interface_name(cls, ifc_name):
88
+        card_type = os.popen('mst status -v | grep {0} | grep -o ConnectX[0-9]*'
89
+                             .format(ifc_name)).readlines()
90
+        if len(card_type) == 1:
91
+            card_type = card_type[0].replace('ConnectX', 'ConnectX-').strip()
92
+            return card_type
93
+        else:
94
+            logging.error('No driver found for interface {0}'.format(ifc_name))
95
+            exit(1)
96
+
85 97
     @classmethod
86 98
     def add_cx_card(cls):
87 99
         mlnx_interfaces = cls.mlnx_interfaces_section
@@ -90,7 +102,7 @@ class MellanoxSettings(object):
90 102
         mlnx = cls.get_mlnx_section()
91 103
         for network_type, ifc_dict in mlnx_interfaces.iteritems():
92 104
             if 'driver' in ifc_dict and network_type in ['private','management','storage']:
93
-              
105
+
94 106
               # The bond interfaces extend the original list,
95 107
               # otherwise, the interface is appended to the list.
96 108
               if(type(ifc_dict['driver']) is list):
@@ -115,7 +127,7 @@ class MellanoxSettings(object):
115 127
           mellanox_interface = interfaces_set[0]
116 128
           if current_driver in ETH_DRIVERS:
117 129
               mlnx['network_type'] = 'ethernet'
118
-              mlnx['cx_card'] = cls.get_card_type(current_driver)
130
+              mlnx['cx_card'] = cls.get_card_type_by_interface_name(mellanox_interface)
119 131
           elif current_driver in IB_DRIVERS:
120 132
               mlnx['network_type'] = 'infiniband'
121 133
               ibdev = os.popen('ibdev2netdev').readlines()
@@ -125,11 +137,7 @@ class MellanoxSettings(object):
125 137
                 return 0
126 138
               if ('bonds' in cls.data and mellanox_interface.startswith('bond')):
127 139
                   mellanox_interface = cls.data['bonds'][mellanox_interface]['interfaces'][0]
128
-              interface_line = [l for l in ibdev if mellanox_interface in l]
129
-              if interface_line and 'mlx5' in interface_line.pop():
130
-                  mlnx['cx_card'] = 'ConnectX-4'
131
-              else:
132
-                  mlnx['cx_card'] = 'ConnectX-3'
140
+              mlnx['cx_card'] = cls.get_card_type_by_interface_name(mellanox_interface)
133 141
 
134 142
           network_info_msg = 'Detected Network Type is: {0} '.format(mlnx['network_type'])
135 143
           card_info_msg = 'Detected Card Type is: {0} '.format(mlnx['cx_card'])

+ 1
- 1
deployment_scripts/puppet/manifests/controller.pp View File

@@ -13,7 +13,7 @@ if ( $mlnx['driver'] == 'mlx4_en' and $mlnx['mlnx_qos'] ) {
13 13
 }
14 14
 
15 15
 if ($mlnx['sriov']) {
16
-  $pci_vendor_devices = '15b3:1014,15b3:1016'
16
+  $pci_vendor_devices = '15b3:1014,15b3:1016,15b3:1018'
17 17
   $agent_required = 'True'
18 18
   class { 'mellanox_openstack::controller_sriov' :
19 19
     eswitch_vnic_type           => $eswitch_vnic_type,

+ 11
- 7
deployment_scripts/sriov.sh View File

@@ -44,12 +44,16 @@ function get_num_probe_vfs () {
44 44
 }
45 45
 
46 46
 function calculate_total_vfs () {
47
-  # validate num of vfs is an integer, 0 <= num <= 64
47
+  max_card_vfs=$MAX_VFS
48
+  if [ $CX == "ConnectX-5" ]; then
49
+    max_card_vfs=$MAX_VFS_CX5
50
+  fi
51
+  # validate num of vfs is an integer, 0 <= num <= 96
48 52
   if [ "${USER_NUM_OF_VFS}" -ne "${USER_NUM_OF_VFS}" ] 2>/dev/null ||
49
-      [ "${USER_NUM_OF_VFS}" -gt ${MAX_VFS} ] ||
53
+      [ "${USER_NUM_OF_VFS}" -gt ${max_card_vfs} ] ||
50 54
       [ "${USER_NUM_OF_VFS}" -lt ${MIN_VFS} ]; then
51 55
     logger_print error "Illegal number of VFs ${USER_NUM_OF_VFS}, value
52
-                        should be an integer between ${MIN_VFS},${MAX_VFS}"
56
+                        should be an integer between ${MIN_VFS},${max_card_vfs}"
53 57
     return 1
54 58
   fi
55 59
   num_of_vfs=0
@@ -177,7 +181,7 @@ function burn_vfs_in_fw () {
177 181
     done
178 182
     service mst stop &>/dev/null
179 183
   fi
180
-  if [ $CX == 'ConnectX-4' ]; then
184
+  if [ $CX == 'ConnectX-4' ] || [ $CX == 'ConnectX-5' ]; then
181 185
     # required for mlxconfig to discover mlnx devices
182 186
     service openibd start &>/dev/null
183 187
     service mst start &>/dev/null
@@ -218,9 +222,9 @@ function configure_sriov () {
218 222
       logger_print info "Detected: ConnectX-3 card"
219 223
     fi
220 224
 
221
-    if [ $CX == 'ConnectX-4' ]; then
225
+    if [ $CX == 'ConnectX-4' ] || [ $CX == 'ConnectX-5' ]; then
222 226
       set_sriov $total_vfs &&
223
-      logger_print info "Detected: ConnectX-4 card"
227
+      logger_print info "Detected: $CX card"
224 228
     fi
225 229
 
226 230
     return $?
@@ -266,7 +270,7 @@ function validate_sriov () {
266 270
     set_modprobe_file $FALLBACK_NUM_VFS
267 271
     service openibd restart &> /dev/null
268 272
   fi
269
-  if [ $CX == 'ConnectX-4' ]; then
273
+  if [ $CX == 'ConnectX-4' ] || [ $CX == 'ConnectX-5' ]; then
270 274
     set_sriov $FALLBACK_NUM_VFS
271 275
   fi
272 276
 

+ 1
- 1
pre_build_hook View File

@@ -62,7 +62,7 @@ old_debs="${PLUGIN_DIR}/repositories/ubuntu/*.deb"
62 62
 deb_files="cirros-testvm-mellanox_0.3.2-ubuntu3_amd64.deb
63 63
            cirros-testvm-mellanox-ib_0.3.2-9_amd64.deb
64 64
            eswitchd_1.0.0-18_amd64.deb
65
-           mlnx-ofed-fuel_3.4-1.0.0.0_amd64.deb
65
+           mlnx-ofed-fuel_4.0-2.0.0.1_amd64.deb
66 66
            lldpd_0.9.1-0_amd64.deb
67 67
            python-networking-mlnx_7.0.0-1_all.deb"
68 68
 get_packages "deb" "$old_debs" "$deb_files"

Loading…
Cancel
Save