36
36
from common import OpTestInstallUtil
37
37
from common .OpTestUtil import OpTestUtil
38
38
from common .OpTestSystem import OpSystemState
39
+ from common .OpTestEBMC import EBMCHostManagement
39
40
40
41
log = OpTestLogger .optest_logger_glob .get_logger (__name__ )
41
42
@@ -98,6 +99,7 @@ def callConfig(self, key):
98
99
if key == "cec" :
99
100
lmb_size = None
100
101
num_hugepages = None
102
+ ioenlargecapacity = None
101
103
setup = 0
102
104
if not self .cv_HMC .lpar_vios :
103
105
self .skipTest ("Please pass lpar_vios in config file." )
@@ -113,8 +115,12 @@ def callConfig(self, key):
113
115
setup = 1
114
116
num_hugepages = re .findall (
115
117
'hugepages=[0-9]+' , str (self .machine_config ))[0 ].split ('=' )[1 ]
118
+ if "iocapacity" in config_value :
119
+ setup = 1
120
+ ioenlargecapacity = re .findall (
121
+ 'iocapacity=[0-9]+' , str (self .machine_config ))[0 ].split ('=' )[1 ]
116
122
117
- status = CecConfig (self .cv_HMC ,self .system_name ,self .lpar_name ,self .lpar_prof ,lmb = lmb_size ,hugepages = num_hugepages ).CecSetup ()
123
+ status = CecConfig (self .cv_HMC ,self .system_name ,self .lpar_name ,self .lpar_prof ,lmb = lmb_size ,hugepages = num_hugepages , iocapacity = ioenlargecapacity ).CecSetup ()
118
124
if status :
119
125
self .fail (status )
120
126
if not setup :
@@ -356,16 +362,17 @@ class CecConfig():
356
362
Ex: machine_config={"cec":"hugepages=4"}
357
363
'''
358
364
def __init__ (self , cv_HMC = None , system_name = None ,
359
- lpar_name = None , lpar_prof = None , lmb = None , hugepages = None ):
365
+ lpar_name = None , lpar_prof = None , lmb = None , hugepages = None , iocapacity = None ):
360
366
361
367
self .cv_HMC = cv_HMC
362
368
self .system_name = system_name
363
369
self .lpar_name = lpar_name
364
370
self .lpar_prof = lpar_prof
365
371
self .lmb_size = lmb
366
372
self .num_hugepages = hugepages
373
+ self .ioenlargecapacity = iocapacity
367
374
self .setup = 0
368
- self .cec_dict = {'lmb_cec' : None , 'hugepages' : None }
375
+ self .cec_dict = {'lmb_cec' : None , 'hugepages' : None , 'iocapcity' : None }
369
376
370
377
def CecSetup (self ):
371
378
@@ -376,6 +383,8 @@ def CecSetup(self):
376
383
self .lmb_setup ()
377
384
if self .cec_dict ['hugepages' ] is not None :
378
385
self .hugepage_16gb_setup ()
386
+ if self .cec_dict ['iocapacity' ] is not None :
387
+ self .io_enlarge_cpacity ()
379
388
if self .setup :
380
389
self .cv_HMC .poweron_system ()
381
390
self .ValidateCEC_Setup ()
@@ -400,6 +409,8 @@ def ValidateCEC_Setup(self):
400
409
self .setting_16gb_hugepage_profile ()
401
410
else :
402
411
self .cec_dict ['hugepages' ] = self .num_hugepages
412
+ if self .ioenlargecapacity :
413
+ self .io_enlarge_capacity ()
403
414
404
415
def lmb_setup (self ):
405
416
#Configure the lmb as per user request
@@ -417,6 +428,30 @@ def setting_16gb_hugepage_profile(self):
417
428
int (self .current_hgpg [0 ]))
418
429
self .cv_HMC .set_lpar_cfg (attrs )
419
430
431
+ def io_enlarge_capacity (self ):
432
+ cur_iocapacity = self .get_current_ioadapter_enlarged_capacity ()
433
+ if cur_iocapacity != self .ioenlargecapacity :
434
+ self .set_ioenlarge_capacity ()
435
+
436
+ def get_current_ioadapter_enlarged_capacity (self ):
437
+ """
438
+ Get ioadapter enlarged capcity value
439
+ """
440
+ log .debug ("=====Get current IOAdapter Enlarge Capacity=====" )
441
+ return EBMCHostManagement .get_bios_attribute_value (
442
+ bios_attribute = "hb_ioadapter_enlarged_capacity_current"
443
+ )
444
+
445
+ def set_ioenlarge_capacity (self ):
446
+ """
447
+ Set ioadapter enlarged capcity value
448
+ """
449
+ log .debug ("=====Set IOAdapter Enlarge Capacity=====" )
450
+ EBMCHostManagement .set_bios_attribute (
451
+ bios_attribute = "hb_ioadapter_enlarged_capacity" ,
452
+ bios_attribute_val = self .ioenlargecapacity
453
+ )
454
+
420
455
class OsConfig ():
421
456
'''
422
457
This Class assign huge page in the system based on MMU either Radix or hash and validate
0 commit comments