summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHamdy Khader <hamdyk@mellanox.com>2017-06-28 01:07:58 +0300
committerHamdy Khader <hamdyk@mellanox.com>2017-07-13 16:27:07 +0300
commitb488aaaf7a589d4fda10d91100cabfcd24bb2115 (patch)
tree786c56f9ba70386172e8b4f3bda3c8332c79f8c9
parent8a16909f400dd55014a04fe829e599de530923f1 (diff)
Add support for ConnectX-5 adaptersHEADmaster
- upgrade mlnx-ofed-fuel to version 4.0-2.0.0.1 - add maximum number of CX5 VFs to 96 Change-Id: Ie3612d5b9a488ade49dbfc65389be9e9f9442bb0
Notes
Notes (review): Code-Review+1: Rawan Herzallah <rherzallah@asaltech.com> Code-Review+2: Aviram Bar-Haim <aviramb@mellanox.com> Workflow+1: Aviram Bar-Haim <aviramb@mellanox.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 13 Jul 2017 16:57:42 +0000 Reviewed-on: https://review.openstack.org/478301 Project: openstack/fuel-plugin-mellanox Branch: refs/heads/master
-rwxr-xr-xdeployment_scripts/common1
-rwxr-xr-xdeployment_scripts/mellanox_settings.py24
-rw-r--r--deployment_scripts/puppet/manifests/controller.pp2
-rwxr-xr-xdeployment_scripts/sriov.sh18
-rwxr-xr-xpre_build_hook2
5 files changed, 30 insertions, 17 deletions
diff --git a/deployment_scripts/common b/deployment_scripts/common
index 994dbb9..d02f265 100755
--- a/deployment_scripts/common
+++ b/deployment_scripts/common
@@ -85,6 +85,7 @@ readonly SRIOV=`get_mlnx_param sriov`
85readonly USER_NUM_OF_VFS=`get_mlnx_param num_of_vfs` 85readonly USER_NUM_OF_VFS=`get_mlnx_param num_of_vfs`
86readonly ISER=`get_mlnx_param iser` 86readonly ISER=`get_mlnx_param iser`
87readonly MAX_VFS=62 87readonly MAX_VFS=62
88readonly MAX_VFS_CX5=96
88readonly MIN_VFS=1 89readonly MIN_VFS=1
89readonly CX=`get_mlnx_param cx_card` 90readonly CX=`get_mlnx_param cx_card`
90readonly NETWORK_TYPE=`get_mlnx_param network_type` 91readonly NETWORK_TYPE=`get_mlnx_param network_type`
diff --git a/deployment_scripts/mellanox_settings.py b/deployment_scripts/mellanox_settings.py
index 795e171..dd5b3ab 100755
--- a/deployment_scripts/mellanox_settings.py
+++ b/deployment_scripts/mellanox_settings.py
@@ -27,7 +27,8 @@ MLNX_SECTION = 'mellanox-plugin'
27SETTINGS_FILE = '/etc/astute.yaml' 27SETTINGS_FILE = '/etc/astute.yaml'
28PLUGIN_OVERRIDE_FILE = '/etc/hiera/override/plugins.yaml' 28PLUGIN_OVERRIDE_FILE = '/etc/hiera/override/plugins.yaml'
29MLNX_DRIVERS_LIST = { 'ConnectX-3': {'eth_driver' : 'mlx4_en', 'ib_driver' : 'eth_ipoib'}, 29MLNX_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'}}
31MLNX_DRIVERS = set([MLNX_DRIVERS_LIST[card][net] 32MLNX_DRIVERS = set([MLNX_DRIVERS_LIST[card][net]
32 for card in MLNX_DRIVERS_LIST 33 for card in MLNX_DRIVERS_LIST
33 for net in MLNX_DRIVERS_LIST[card]]) 34 for net in MLNX_DRIVERS_LIST[card]])
@@ -83,6 +84,17 @@ class MellanoxSettings(object):
83 return card 84 return card
84 85
85 @classmethod 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
97 @classmethod
86 def add_cx_card(cls): 98 def add_cx_card(cls):
87 mlnx_interfaces = cls.mlnx_interfaces_section 99 mlnx_interfaces = cls.mlnx_interfaces_section
88 drivers = list() 100 drivers = list()
@@ -90,7 +102,7 @@ class MellanoxSettings(object):
90 mlnx = cls.get_mlnx_section() 102 mlnx = cls.get_mlnx_section()
91 for network_type, ifc_dict in mlnx_interfaces.iteritems(): 103 for network_type, ifc_dict in mlnx_interfaces.iteritems():
92 if 'driver' in ifc_dict and network_type in ['private','management','storage']: 104 if 'driver' in ifc_dict and network_type in ['private','management','storage']:
93 105
94 # The bond interfaces extend the original list, 106 # The bond interfaces extend the original list,
95 # otherwise, the interface is appended to the list. 107 # otherwise, the interface is appended to the list.
96 if(type(ifc_dict['driver']) is list): 108 if(type(ifc_dict['driver']) is list):
@@ -115,7 +127,7 @@ class MellanoxSettings(object):
115 mellanox_interface = interfaces_set[0] 127 mellanox_interface = interfaces_set[0]
116 if current_driver in ETH_DRIVERS: 128 if current_driver in ETH_DRIVERS:
117 mlnx['network_type'] = 'ethernet' 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 elif current_driver in IB_DRIVERS: 131 elif current_driver in IB_DRIVERS:
120 mlnx['network_type'] = 'infiniband' 132 mlnx['network_type'] = 'infiniband'
121 ibdev = os.popen('ibdev2netdev').readlines() 133 ibdev = os.popen('ibdev2netdev').readlines()
@@ -125,11 +137,7 @@ class MellanoxSettings(object):
125 return 0 137 return 0
126 if ('bonds' in cls.data and mellanox_interface.startswith('bond')): 138 if ('bonds' in cls.data and mellanox_interface.startswith('bond')):
127 mellanox_interface = cls.data['bonds'][mellanox_interface]['interfaces'][0] 139 mellanox_interface = cls.data['bonds'][mellanox_interface]['interfaces'][0]
128 interface_line = [l for l in ibdev if mellanox_interface in l] 140 mlnx['cx_card'] = cls.get_card_type_by_interface_name(mellanox_interface)
129 if interface_line and 'mlx5' in interface_line.pop():
130 mlnx['cx_card'] = 'ConnectX-4'
131 else:
132 mlnx['cx_card'] = 'ConnectX-3'
133 141
134 network_info_msg = 'Detected Network Type is: {0} '.format(mlnx['network_type']) 142 network_info_msg = 'Detected Network Type is: {0} '.format(mlnx['network_type'])
135 card_info_msg = 'Detected Card Type is: {0} '.format(mlnx['cx_card']) 143 card_info_msg = 'Detected Card Type is: {0} '.format(mlnx['cx_card'])
diff --git a/deployment_scripts/puppet/manifests/controller.pp b/deployment_scripts/puppet/manifests/controller.pp
index 18e8d4f..d2ea68c 100644
--- a/deployment_scripts/puppet/manifests/controller.pp
+++ b/deployment_scripts/puppet/manifests/controller.pp
@@ -13,7 +13,7 @@ if ( $mlnx['driver'] == 'mlx4_en' and $mlnx['mlnx_qos'] ) {
13} 13}
14 14
15if ($mlnx['sriov']) { 15if ($mlnx['sriov']) {
16 $pci_vendor_devices = '15b3:1014,15b3:1016' 16 $pci_vendor_devices = '15b3:1014,15b3:1016,15b3:1018'
17 $agent_required = 'True' 17 $agent_required = 'True'
18 class { 'mellanox_openstack::controller_sriov' : 18 class { 'mellanox_openstack::controller_sriov' :
19 eswitch_vnic_type => $eswitch_vnic_type, 19 eswitch_vnic_type => $eswitch_vnic_type,
diff --git a/deployment_scripts/sriov.sh b/deployment_scripts/sriov.sh
index 8a62fdd..6c8c866 100755
--- a/deployment_scripts/sriov.sh
+++ b/deployment_scripts/sriov.sh
@@ -44,12 +44,16 @@ function get_num_probe_vfs () {
44} 44}
45 45
46function calculate_total_vfs () { 46function 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 if [ "${USER_NUM_OF_VFS}" -ne "${USER_NUM_OF_VFS}" ] 2>/dev/null || 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 [ "${USER_NUM_OF_VFS}" -lt ${MIN_VFS} ]; then 54 [ "${USER_NUM_OF_VFS}" -lt ${MIN_VFS} ]; then
51 logger_print error "Illegal number of VFs ${USER_NUM_OF_VFS}, value 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 return 1 57 return 1
54 fi 58 fi
55 num_of_vfs=0 59 num_of_vfs=0
@@ -177,7 +181,7 @@ function burn_vfs_in_fw () {
177 done 181 done
178 service mst stop &>/dev/null 182 service mst stop &>/dev/null
179 fi 183 fi
180 if [ $CX == 'ConnectX-4' ]; then 184 if [ $CX == 'ConnectX-4' ] || [ $CX == 'ConnectX-5' ]; then
181 # required for mlxconfig to discover mlnx devices 185 # required for mlxconfig to discover mlnx devices
182 service openibd start &>/dev/null 186 service openibd start &>/dev/null
183 service mst start &>/dev/null 187 service mst start &>/dev/null
@@ -218,9 +222,9 @@ function configure_sriov () {
218 logger_print info "Detected: ConnectX-3 card" 222 logger_print info "Detected: ConnectX-3 card"
219 fi 223 fi
220 224
221 if [ $CX == 'ConnectX-4' ]; then 225 if [ $CX == 'ConnectX-4' ] || [ $CX == 'ConnectX-5' ]; then
222 set_sriov $total_vfs && 226 set_sriov $total_vfs &&
223 logger_print info "Detected: ConnectX-4 card" 227 logger_print info "Detected: $CX card"
224 fi 228 fi
225 229
226 return $? 230 return $?
@@ -266,7 +270,7 @@ function validate_sriov () {
266 set_modprobe_file $FALLBACK_NUM_VFS 270 set_modprobe_file $FALLBACK_NUM_VFS
267 service openibd restart &> /dev/null 271 service openibd restart &> /dev/null
268 fi 272 fi
269 if [ $CX == 'ConnectX-4' ]; then 273 if [ $CX == 'ConnectX-4' ] || [ $CX == 'ConnectX-5' ]; then
270 set_sriov $FALLBACK_NUM_VFS 274 set_sriov $FALLBACK_NUM_VFS
271 fi 275 fi
272 276
diff --git a/pre_build_hook b/pre_build_hook
index c5eca12..3a8795f 100755
--- a/pre_build_hook
+++ b/pre_build_hook
@@ -62,7 +62,7 @@ old_debs="${PLUGIN_DIR}/repositories/ubuntu/*.deb"
62deb_files="cirros-testvm-mellanox_0.3.2-ubuntu3_amd64.deb 62deb_files="cirros-testvm-mellanox_0.3.2-ubuntu3_amd64.deb
63 cirros-testvm-mellanox-ib_0.3.2-9_amd64.deb 63 cirros-testvm-mellanox-ib_0.3.2-9_amd64.deb
64 eswitchd_1.0.0-18_amd64.deb 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 lldpd_0.9.1-0_amd64.deb 66 lldpd_0.9.1-0_amd64.deb
67 python-networking-mlnx_7.0.0-1_all.deb" 67 python-networking-mlnx_7.0.0-1_all.deb"
68get_packages "deb" "$old_debs" "$deb_files" 68get_packages "deb" "$old_debs" "$deb_files"