def Show(self): logger.info("Collector : %s" % self.GID()) logger.info("- Encap : %s" % self.vlan) logger.info("- Destination : %s" % self.dest_ip) logger.info("- Source : %s" % self.source_ip) logger.info("- Protocol : %s" % self.protocol) logger.info("- Port : %s" % self.dport) logger.info("- Format : %s" % self.format) logger.info("- Template ID : %s" % self.template_id) logger.info("- Export Intvl : %s" % self.export_interval) return
def TestCaseTrigger(tc): logger.info("RDMA TestCaseTrigger() Implementation.") return
def TestCaseVerify(tc): if (GlobalOptions.dryrun): return True logger.info("RDMA TestCaseVerify() Implementation.") return True
def __init__(self, session): logger.info("creating proxycb object for session %s" % (session.GID())) super().__init__() self.Clone(Store.templates.Get("PROXYCB")) self.session = session return
def PrepareHALRequestSpec(self, req_spec): logger.info("Configuring proxy for the flow with label: " + self.session.iflow.label) if self.session.iflow.label == 'TCP-PROXY' or self.session.iflow.label == 'TCP-PROXY-E2E' or \ self.session.iflow.label == 'PROXY-REDIR' or self.session.iflow.label == 'NVME-PROXY': req_spec.spec.vrf_key_handle.vrf_id = self.session.initiator.ep.tenant.id req_spec.spec.key_or_handle.proxy_id = 0 req_spec.spec.proxy_type = 1 if req_spec.__class__.__name__ == 'ProxyFlowConfigRequest': req_spec.proxy_en = True req_spec.alloc_qid = True if hasattr(self, 'tls_sess_profile'): self.PrepareHalTlsProxyFlowConfigSpec( req_spec.tls_proxy_config) self.session.iflow.PrepareHALRequestSpec(req_spec) elif self.session.iflow.label == 'RAW-REDIR' or self.session.iflow.label == 'RAW-REDIR-FLOW-MISS' or \ self.session.iflow.label == 'RAW-REDIR-KNOWN-APPID': req_spec.spec.vrf_key_handle.vrf_id = self.session.initiator.ep.tenant.id req_spec.spec.key_or_handle.proxy_id = 4 req_spec.spec.proxy_type = 7 if req_spec.__class__.__name__ == 'ProxyFlowConfigRequest': req_spec.proxy_en = True req_spec.alloc_qid = True self.session.iflow.PrepareHALRequestSpec(req_spec) elif self.session.iflow.label == 'RAW-REDIR-SPAN' or self.session.iflow.label == 'RAW-REDIR-SPAN-FLOW-MISS': req_spec.spec.vrf_key_handle.vrf_id = self.session.initiator.ep.tenant.id req_spec.spec.key_or_handle.proxy_id = 7 req_spec.spec.proxy_type = 10 if req_spec.__class__.__name__ == 'ProxyFlowConfigRequest': req_spec.proxy_en = True req_spec.alloc_qid = False self.session.iflow.PrepareHALRequestSpec(req_spec) elif self.session.iflow.label == 'PROXY-REDIR-E2E': req_spec.spec.vrf_key_handle.vrf_id = self.session.initiator.ep.tenant.id req_spec.spec.key_or_handle.proxy_id = 6 req_spec.spec.proxy_type = 9 if req_spec.__class__.__name__ == 'ProxyFlowConfigRequest': req_spec.proxy_en = True req_spec.alloc_qid = True self.session.iflow.PrepareHALRequestSpec(req_spec) elif self.session.iflow.label == 'PROXY-REDIR-SPAN-E2E': req_spec.spec.vrf_key_handle.vrf_id = self.session.initiator.ep.tenant.id req_spec.spec.key_or_handle.proxy_id = 8 req_spec.spec.proxy_type = 11 if req_spec.__class__.__name__ == 'ProxyFlowConfigRequest': req_spec.proxy_en = True req_spec.alloc_qid = True self.session.iflow.PrepareHALRequestSpec(req_spec) elif self.session.iflow.label == 'ESP-PROXY': logger.info( "Configuring esp ipsec proxy for the flow with label: " + self.session.iflow.label) req_spec.spec.vrf_key_handle.vrf_id = self.session.initiator.ep.tenant.id req_spec.spec.key_or_handle.proxy_id = 0 req_spec.spec.proxy_type = 3 if req_spec.__class__.__name__ == 'ProxyFlowConfigRequest': req_spec.proxy_en = True req_spec.alloc_qid = False req_spec.ipsec_config.encrypt = False self.session.iflow.PrepareHALRequestSpec(req_spec) elif self.session.iflow.label == 'IPSEC-PROXY': logger.info( "Configuring host ipsec proxy for the flow with label: " + self.session.iflow.label) req_spec.spec.vrf_key_handle.vrf_id = self.session.initiator.ep.tenant.id req_spec.spec.key_or_handle.proxy_id = 0 req_spec.spec.proxy_type = 3 if req_spec.__class__.__name__ == 'ProxyFlowConfigRequest': req_spec.proxy_en = True req_spec.alloc_qid = True req_spec.ipsec_config.encrypt = True self.session.iflow.PrepareHALRequestSpec(req_spec) return
def Init(self, tenant, spec, namespace=None): if namespace: self.id = namespace.get() else: self.id = resmgr.LifIdAllocator.get() self.GID("Lif%d" % self.id) self.status = haldefs.interface.IF_STATUS_UP self.hw_lif_id = -1 self.qstate_base = {} self.promiscuous = False self.allmulticast = False self.pds = [] self.c_lib_name = getattr(spec, 'c_lib', None) if self.c_lib_name: self.c_lib = clibs.LoadCLib(self.c_lib_name) if self.c_lib: self.c_lib_config = self.c_lib[self.c_lib_name + '_config'] self.c_lib_config.argtypes = [ctypes.POINTER(QInfoStruct)] self.c_lib_config.restype = None else: self.c_lib = None if hasattr(spec, 'rdma') and spec.rdma.enable: self.enable_rdma = spec.rdma.enable self.rdma_max_pt_entries = spec.rdma.max_pt_entries self.rdma_max_keys = spec.rdma.max_keys self.rdma_max_ahs = spec.rdma.max_ahs self.hostmem_pg_size = spec.rdma.hostmem_pg_size self.hbm_barmap_entries = (int(spec.rdma.hbm_barmap_size / spec.rdma.hostmem_pg_size)) self.rdma_tbl_pos = BitArray(length=self.rdma_max_pt_entries) self.hbm_tbl_pos = BitArray(length=self.hbm_barmap_entries) self.rdma_async_eq_id = 0 self.rdma_admin_aq_id = 1 self.rdma_admin_cq_id = 0 else: self.enable_rdma = False self.rdma_max_pt_entries = 0 self.rdma_max_keys = 0 self.rdma_max_ahs = 0 self.hbm_barmap_entries = 0 self.hostmem_pg_size = 0 self.rdma_pt_base_addr = 0 self.rdma_kt_base_addr = 0 self.rdma_dcqcn_profile_base_addr = 0 self.rdma_at_base_addr = 0 if hasattr(spec, 'nvme') and spec.nvme.enable: self.enable_nvme = spec.nvme.enable self.nvme_lif = nvme_lif.NvmeLifObject(self, spec.nvme) else: self.enable_nvme = False self.vlan_strip_en = False self.vlan_insert_en = False self.queue_types = objects.ObjectDatabase() self.obj_helper_q = queue_type.QueueTypeObjectHelper() self.obj_helper_q.Generate(self, spec) self.queue_types.SetAll(self.obj_helper_q.queue_types) self.queue_types_list = self.obj_helper_q.queue_types self.queue_list = [] for q_type in self.queue_types_list: for queue in q_type.queues.GetAll(): self.queue_list.append(queue) # RDMA per LIF allocators if self.enable_rdma: # QP 0, 1 are special QPs self.qpid_allocator = objects.TemplateFieldObject( "range/2/" + str(spec.rdma.max_qp)) # AQ ID 0 is owned by ETH self.aqid_allocator = objects.TemplateFieldObject( "range/1/" + str(spec.rdma.max_aq)) # Reserve CQ 0, 1 for special QPs, AQ self.cqid_allocator = objects.TemplateFieldObject( "range/2/" + str(spec.rdma.max_cq)) self.eqid_allocator = objects.TemplateFieldObject( "range/0/" + str(spec.rdma.max_eq)) self.pd_allocator = objects.TemplateFieldObject( "range/0/" + str(spec.rdma.max_pd)) self.mr_key_allocator = objects.TemplateFieldObject( "range/1/" + str(spec.rdma.max_mr)) self.slab_allocator = objects.TemplateFieldObject("range/0/2048") self.kslab_allocator = objects.TemplateFieldObject("range/0/2048") # Generate RDMA LIF owned resources self.slabs = objects.ObjectDatabase() # Generate KernelSlab of 4KB and 10 MB for FRPMR self.kslab_4KB = slab.SlabObject(self, 4096, True) self.obj_helper_slab = slab.SlabObjectHelper() #slab_spec = spec.rdma.slab.Get(Store) #self.obj_helper_slab.Generate(self, slab_spec) #self.slabs.SetAll(self.obj_helper_slab.slabs) # Create EQs for RDMA LIF self.eqs = objects.ObjectDatabase() self.obj_helper_eq = eq.EqObjectHelper() self.obj_helper_eq.Generate(self, spec.rdma.max_eq, spec.rdma.max_eqe) if len(self.obj_helper_eq.eqs): self.eqs.SetAll(self.obj_helper_eq.eqs) # Create CQ 0 for adminQ logger.info("Creating 1 Cqs. for LIF:%s" % (self.GID())) # Hardcode CQ 0 for AQ # Page size is calculated as max_cqe * cqe_size by the CQ for privileged resources cq_id = 0 self.cq = cqs.CqObject(None, cq_id, spec.rdma.max_cqe, 0, True, self) # Create AdminQ logger.info("Creating 1 Aqs. for LIF:%s" % (self.GID())) aq_id = self.GetAqid() self.aq = aqs.AqObject(self, aq_id, spec.rdma.max_aqe, spec.rdma.hostmem_pg_size) self.dcqcn_config_spec = spec.rdma.dcqcn_config.Get(Store) if hasattr(spec, 'rss'): self.rss_type = ( haldefs.interface.LifRssType.Value("RSS_TYPE_IPV4") | haldefs.interface.LifRssType.Value("RSS_TYPE_IPV4_TCP") | haldefs.interface.LifRssType.Value("RSS_TYPE_IPV4_UDP") | haldefs.interface.LifRssType.Value("RSS_TYPE_IPV6") | haldefs.interface.LifRssType.Value("RSS_TYPE_IPV6_TCP") | haldefs.interface.LifRssType.Value("RSS_TYPE_IPV6_UDP")) self.rss_key = array.array('B', toeplitz.toeplitz_msft_key) self.rss_indir = array.array('B', [0] * 128) else: self.rss_type = haldefs.interface.LifRssType.Value("RSS_TYPE_NONE") self.rss_key = array.array('B', toeplitz.toeplitz_msft_key) self.rss_indir = array.array('B', [0] * 128) self.tenant = tenant self.spec = spec self.tx_qos_class = None self.rx_qos_class = None if self.tenant.IsQosEnabled(): self.tx_qos_class = getattr(spec, 'tx_qos_class', None) self.rx_qos_class = getattr(spec, 'rx_qos_class', None) if self.tx_qos_class: self.tx_qos_class = Store.objects.Get(self.tx_qos_class) if self.rx_qos_class: self.rx_qos_class = Store.objects.Get(self.rx_qos_class) self.Show()
def RegisterPd(self, pd): if self.enable_rdma: logger.info("Registering PD: %s LIF %s" % (pd.GID(), self.GID())) self.pds.append(pd)
def TestCaseSetup(tc): logger.info("RDMA TestCaseSetup() Implementation.") PopulatePreQStates(tc) return
def TestCaseTeardown(tc): logger.info("RDMA TestCaseTeardown() Implementation.") if (GlobalOptions.dryrun): return return
def TestCaseStepVerify(tc, step): if (GlobalOptions.dryrun): return True logger.info("RDMA TestCaseVerify() Implementation.") PopulatePostQStates(tc) rs = tc.config.rdmasession ring0_mask = (rs.lqp.num_rq_wqes - 1) if step.step_id == 0: ############ RQ VALIDATIONS ################# # verify that e_psn is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'e_psn', 1): return False # verify that msn is NOT incremented if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'msn', 0): return False # verify that proxy_cindex is NOT incremented if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'proxy_cindex', ring0_mask, 0): return False # verify that token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'token_id', 1): return False # verify that nxt_to_go_token_id is NOT incremented if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'nxt_to_go_token_id', 0): return False # verify that state is now moved to ERR (2) if not VerifyErrQState(tc): return False ############ STATS VALIDATIONS ################# # verify that error disable stats are updated if not VerifyErrStatistics(tc): return False #verify that insuff_sge_err is set to 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'qp_err_dis_insuff_sge_err', 1): return False # last bth opcode should be 0 (send_first) if not VerifyFieldAbsolute(tc, tc.pvtdata.rq_post_qstate, 'last_bth_opcode', 0): return False elif step.step_id == 1: if not ValidatePostSyncCQChecks(tc): return False return True
def TestCaseStepVerify(tc, step): if (GlobalOptions.dryrun): return True logger.info("RDMA TestCaseVerify() Implementation.") rs = tc.config.rdmasession rs.lqp.rq.qstate.Read() ring0_mask = (rs.lqp.num_rq_wqes - 1) tc.pvtdata.rq_post_qstate = rs.lqp.rq.qstate.data if step.step_id == 0: ############ RQ VALIDATIONS ################# # verify that e_psn is incremented by 3 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'e_psn', 3): return False # verify that proxy_cindex is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'proxy_cindex', ring0_mask, 1): return False # verify that token_id is incremented by 3 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'token_id', 3): return False # verify that nxt_to_go_token_id is incremented by 3 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'nxt_to_go_token_id', 3): return False ############ RQ STATS VALIDATIONS ################# # verify that num_pkts is incremented by 3 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'num_pkts', 3): return False # verify that num_bytes is incremented by pvtdata.num_total_bytes if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'num_bytes', tc.pvtdata.num_total_bytes): return False # verify that num_send_msgs is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'num_send_msgs', 1): return False # verify that num_pkts_in_cur_msg is 3 if not VerifyFieldAbsolute(tc, tc.pvtdata.rq_post_qstate, 'num_pkts_in_cur_msg', 3): return False # verify that max_pkts_in_any_msg is 3 if not VerifyFieldAbsolute( tc, tc.pvtdata.rq_post_qstate, 'max_pkts_in_any_msg', max([3, tc.pvtdata.rq_pre_qstate.max_pkts_in_any_msg])): return False ############ CQ VALIDATIONS ################# if not ValidateRespRxCQChecks(tc): return False elif step.step_id == 1: if not ValidatePostSyncCQChecks(tc): return False return True
def TestCaseStepVerify(tc, step): if (GlobalOptions.dryrun): return True logger.info("RDMA TestCaseVerify() Implementation.") PopulatePostQStates(tc) rs = tc.config.rdmasession rs.lqp.sq.qstate.Read() ring0_mask = (rs.lqp.num_sq_wqes - 1) ring4_mask = (rs.lqp.num_rrq_wqes - 1) if step.step_id == 0: # verify that tx_psn is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'tx_psn', 1): return False # verify that p_index is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'p_index0', ring0_mask, 1): return False # verify that c_index is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'c_index0', ring0_mask, 1): return False # verify that ssn is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'ssn', 1): return False # verify that lsn is incremented by 1 for write if tc.pvtdata.sq_pre_qstate.disable_credits != 1: if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'lsn', 1): return False # verify that busy is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'busy', 0): return False # verify that in_progress is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'in_progress', 0): return False # verify that p_index of rrq is not incremented if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'p_index4', ring4_mask, 1): return False elif step.step_id == 1: msn = tc.pvtdata.sq_pre_qstate.ssn - 1 # verify that msn is not modified if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'msn', msn): return False # verify rexmit_psn is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'rexmit_psn', 1): return False # verify that c_index of rrq is not incremented if not VerifyFieldsEqual(tc, tc.pvtdata.sq_pre_qstate, 'c_index4', tc.pvtdata.sq_post_qstate, 'c_index4'): return False # verify that busy is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'busy', 0): return False # verify that in_progress is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'in_progress', 0): return False # verify that tx_psn is not incremented if not VerifyFieldsEqual(tc, tc.pvtdata.sq_pre_qstate, 'tx_psn', tc.pvtdata.sq_post_qstate, 'tx_psn'): return False # verify that token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'token_id', 1): return False # verify that nxt_to_go_token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'nxt_to_go_token_id', 1): return False # verify qp_err_disable is set if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'rx_qp_err_disabled', 1): return False # verify qp_err_dis_rrqwqe_remote_acc_err_rcvd is set if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'qp_err_dis_rrqwqe_remote_acc_err_rcvd', 1): return False if not ValidateCQCompletions(tc, 1, 1): return False ############ SKIP EQ VALIDATIONS ################# #if not ValidateEQChecks(tc): # return False # verify that state is now moved to ERR (2) if not VerifyErrQState(tc): return False elif step.step_id == 2: if not ValidatePostSyncCQChecks(tc): return False # update current as pre_qstate ... so next step_id can use it as pre_qstate tc.pvtdata.sq_pre_qstate = copy.deepcopy(rs.lqp.sq.qstate.data) return True
def TestCaseStepVerify(tc, step): if (GlobalOptions.dryrun): return True logger.info("RDMA TestCaseStepVerify() Implementation for Step: %d" % step.step_id) rs = tc.config.rdmasession rs.lqp.sq.qstate.Read() ring0_mask = (rs.lqp.num_sq_wqes - 1) ring4_mask = (rs.lqp.num_rrq_wqes - 1) tc.pvtdata.sq_post_qstate = rs.lqp.sq.qstate.data if step.step_id == 0: # verify that tx_psn is incremented by 2 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'tx_psn', 2): return False # verify that p_index sq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'p_index0', ring0_mask, 1): return False # verify that c_index sq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'c_index0', ring0_mask, 1): return False # verify that p_index of rrq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'p_index4', ring4_mask, 1): return False # verify that ssn is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'ssn', 1): return False # verify that lsn incremented if tc.pvtdata.sq_pre_qstate.disable_credits != 1: if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'lsn', 1): return False # verify that busy is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'busy', 0): return False # verify that in_progress is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'in_progress', 0): return False elif step.step_id == 1: msn = tc.pvtdata.sq_pre_qstate.ssn - 1 # verify that c_index of rrq is not incremented if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'c_index4', ring4_mask, 0): return False # verify rexmit_psn is not incremented if not VerifyFieldModify(tc, tc.pvtdata.sq_post_qstate, tc.pvtdata.sq_post_qstate, 'rexmit_psn', 0): return False # verify that busy is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'busy', 0): return False # verify that in_progress is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'in_progress', 0): return False # verify that tx_psn is not incremented if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'tx_psn', 0): return False # verify that token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'token_id', 1): return False # verify that nxt_to_go_token_id is not incremented if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'nxt_to_go_token_id', 0): return False # make sure sqcb1 state has moved to ERR if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'sqcb1_state', 2): return False # make sure sqcb0 state has also moved to ERR if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'state', 2): return False # verify that max_recirc_cnt_err is captured if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'sqcb5_max_recirc_cnt_err', 1): return False # recirc reason should be 1 (inorder_work_not_done) if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'sqcb5_recirc_reason', 1): return False # recirc bth opcode should be 13 (read-resp-first) if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'sqcb5_recirc_bth_opcode', 13): return False # recirc bth psn should be the psn of the packet (which is same as pre_qstate.tx_psn - 2) if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'sqcb5_recirc_bth_psn', tc.pvtdata.sq_pre_qstate.tx_psn - 2): return False # update current as pre_qstate ... so next step_id can use it as pre_qstate tc.pvtdata.sq_pre_qstate = copy.deepcopy(rs.lqp.sq.qstate.data) return True
def ProcessHALResponse(self, req_spec, resp_spec): logger.info(" - Collector %s = %s" %\ (self.GID(), \ haldefs.common.ApiStatus.Name(resp_spec.api_status))) #pdb.set_trace() return
def ProcessHALGetResponse(self, req_spec, resp_spec): logger.info( "- GET LIF %s = %s" % (self.GID(), haldefs.common.ApiStatus.Name(resp_spec.api_status))) self.get_resp = copy.deepcopy(resp_spec) return
def TestCaseVerify(tc): if (GlobalOptions.dryrun): return True logger.info("RDMA TestCaseVerify() Implementation.") rs = tc.config.rdmasession rs.lqp.rq.qstate.Read() ring0_mask = (rs.lqp.num_rq_wqes - 1) tc.pvtdata.rq_post_qstate = rs.lqp.rq.qstate.data rs.lqp.ReadDcqcnCb() tc.pvtdata.dcqcn_post_qstate = rs.lqp.dcqcn_data ############ RQ VALIDATIONS ################# # verify that e_psn is incremented by 3 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'e_psn', 1): return False # verify that p_index is not incremented if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'p_index0', ring0_mask, 0): return False # verify that c_index is not incremented if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'proxy_cindex', ring0_mask, 0): return False # verify that token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'token_id', 1): return False # verify that nxt_to_go_token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'nxt_to_go_token_id', 1): return False ############ RSQ VALIDATIONS ################# logger.info("RSQ VALIDATIONS:") ring1_mask = (rs.lqp.num_rsq_wqes - 1) # verify that p_index is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'p_index1', ring1_mask, 1): return False # verify that c_index is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'c_index1', ring1_mask, 1): return False # verify that cur_avail_tokens in dcqcn state is . Since at end of 2 iteration 1*9834+120=9954 bits will be accumulated # with core-clock running at 833 MHz. # 8*64=512 bits will be consumed by packet. So 9954-512=9442 tokens remain. if not VerifyFieldAbsolute(tc, tc.pvtdata.dcqcn_post_qstate, 'cur_avail_tokens', 9442): return False # verify that last_sched_timestamp in dcqcn state is set to cur_timestamp of iteration 1 which is 8192000 + 100000 ticks if not VerifyFieldAbsolute(tc, tc.pvtdata.dcqcn_post_qstate, 'last_sched_timestamp', 0x7E86A0): return False # verify that packets dropped = 0 to accumulate the required tokens to send out packets eventually. # It requires 1 iterations to accumulate enough tokens to send 64B packet at rate 1 Mbps, # for clock which ticks 833 times per us and program scheduled every 8192K ticks. if not VerifyFieldAbsolute(tc, tc.pvtdata.dcqcn_post_qstate, 'num_sched_drop', 1): return False ############ CQ VALIDATIONS ################# if not ValidateNoCQChanges(tc): return False return True
def SetPromiscous(self): logger.info("Setting PROMISCUOUS mode for LIF:%s" % self.GID()) self.promiscuous = True return
def TestCaseStepVerify(tc, step): if (GlobalOptions.dryrun): return True logger.info("RDMA TestCaseStepVerify() Implementation for Step: %d" %step.step_id) rs = tc.config.rdmasession rs.lqp.sq.qstate.Read() ring0_mask = (rs.lqp.num_sq_wqes - 1) ring4_mask = (rs.lqp.num_rrq_wqes - 1) tc.pvtdata.sq_post_qstate = rs.lqp.sq.qstate.data if step.step_id == 0: # verify that tx_psn is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'tx_psn', 1): return False # verify that p_index sq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'p_index0', ring0_mask, 1): return False # verify that c_index sq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'c_index0', ring0_mask, 1): return False # verify that p_index of rrq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'p_index4', ring4_mask, 1): return False # verify that ssn is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'ssn', 1): return False # verify that lsn incremented if tc.pvtdata.sq_pre_qstate.disable_credits != 1: if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'lsn', 1): return False # verify that busy is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'busy', 0): return False # verify that in_progress is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'in_progress', 0): return False elif step.step_id == 1: msn = tc.pvtdata.sq_pre_qstate.ssn - 1 # verify that msn is incremented to that of ssn of this msg if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'msn', msn): return False # verify that c_index of rrq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'c_index4', ring4_mask, 1): return False # verify rexmit_psn is incremented to that of tx_psn if not VerifyFieldsEqual(tc, tc.pvtdata.sq_post_qstate, 'rexmit_psn', tc.pvtdata.sq_post_qstate, 'tx_psn'): return False # verify that busy is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'busy', 0): return False # verify that in_progress is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'in_progress', 0): return False # verify that tx_psn is not incremented if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'tx_psn', 0): return False # verify that token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'token_id', 1): return False # verify that nxt_to_go_token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'nxt_to_go_token_id', 1): return False if not ValidateReqRxCQChecks(tc, 'EXP_CQ_DESC'): return False elif step.step_id == 2: if not ValidatePostSyncCQChecks(tc): return False # update current as pre_qstate ... so next step_id can use it as pre_qstate tc.pvtdata.sq_pre_qstate = copy.deepcopy(rs.lqp.sq.qstate.data) return True
def SetAllMulticast(self): logger.info("Setting ALL MULTICAST mode for LIF:%s" % self.GID()) self.allmulticast = True return
def TestCaseVerify(tc): logger.info("RDMA TestCaseVerify() Implementation.") return True
def Update(self): logger.info("Updating %d LIFs." % len(self.lifs)) halapi.ConfigureLifs(self.lifs, update=True) for lif in self.lifs: lif.ConfigureQueueTypes()
def TestCaseStepVerify(tc, step): if (GlobalOptions.dryrun): return True logger.info("RDMA TestCaseStepVerify() Implementation for Step: %d" % step.step_id) rs = tc.config.rdmasession rs.lqp.sq.qstate.Read() ring0_mask = (rs.lqp.num_sq_wqes - 1) ring4_mask = (rs.lqp.num_rrq_wqes - 1) tc.pvtdata.sq_post_qstate = rs.lqp.sq.qstate.data if step.step_id == 0: # verify that tx_psn is incremented by 3 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'tx_psn', 3): return False # verify that p_index sq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'p_index0', ring0_mask, 1): return False # verify that c_index sq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'c_index0', ring0_mask, 1): return False # verify that p_index of rrq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'p_index4', ring4_mask, 1): return False # verify that ssn is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'ssn', 1): return False # verify that lsn is incremented by 1 if tc.pvtdata.sq_pre_qstate.disable_credits != 1: if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'lsn', 1): return False # verify that busy is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'busy', 0): return False # verify that in_progress is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'in_progress', 0): return False elif step.step_id == 1: # verify that c_index of rrq is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'c_index4', ring4_mask, 1): return False # verify that busy is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'busy', 0): return False # verify that in_progress is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'in_progress', 0): return False # verify that tx_psn is not incremented if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'tx_psn', 0): return False # verify rexmit_psn is same as tx_psn if not VerifyFieldsEqual(tc, tc.pvtdata.sq_post_qstate, 'rexmit_psn', tc.pvtdata.sq_post_qstate, 'tx_psn'): return False # verify that token_id is incremented by 3 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'token_id', 3): return False # verify that nxt_to_go_token_id is incremented by 3 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'nxt_to_go_token_id', 3): return False if not ValidateReqRxCQChecks(tc, 'EXP_READ_CQ_DESC'): return False elif step.step_id == 2: # verify that busy is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'busy', 0): return False # verify that in_progress is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'in_progress', 0): return False # verify that tx_psn is incremented by 3 if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'tx_psn', 3): return False # verify that rexmit_psn is 3 less than tx_psn if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'rexmit_psn', tc.pvtdata.sq_post_qstate.tx_psn - 3): return False # verify that rrq_pindex/rrq_cindex fence check has not failed since rrq_pindex == rrq_cindex if not VerifyFieldModify(tc, tc.pvtdata.sq_pre_qstate, tc.pvtdata.sq_post_qstate, 'timestamp', 0): return False # verify that fence bit is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'fence', 0): return False # verify that fence_done is set if not VerifyFieldAbsolute(tc, tc.pvtdata.sq_post_qstate, 'fence_done', 1): return False elif step.step_id == 3: if not ValidatePostSyncCQChecks(tc): return False # update current as pre_qstate ... so next step_id can use it as pre_qstate tc.pvtdata.sq_pre_qstate = copy.deepcopy(rs.lqp.sq.qstate.data) return True
def Show(self): logger.info("Service List for %s" % self.GID()) return
def TestCaseTeardown(tc): logger.info("RDMA TestCaseTeardown() Implementation.") return
def TestCaseTeardown(tc): logger.info("RDMA TestCaseTeardown() Implementation.") ResetErrQState(tc) return
def TestCaseVerify(tc): if (GlobalOptions.dryrun): return True logger.info("RDMA TestCaseVerify() Implementation.") rs = tc.config.rdmasession rs.lqp.rq.qstate.Read() ring0_mask = (rs.lqp.num_rq_wqes - 1) tc.pvtdata.rq_post_qstate = rs.lqp.rq.qstate.data ############ RQ VALIDATIONS ################# # verify that e_psn is incremented by 3 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'e_psn', 3): return False # verify that p_index is not incremented if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'p_index0', ring0_mask, 0): return False # verify that c_index is not incremented if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'proxy_cindex', ring0_mask, 0): return False # verify that token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'token_id', 1): return False # verify that nxt_to_go_token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'nxt_to_go_token_id', 1): return False ############ RSQ VALIDATIONS ################# logger.info("RSQ VALIDATIONS:") ring1_mask = (rs.lqp.num_rsq_wqes - 1) color_mask = 1 # verify that p_index is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'p_index1', ring1_mask, 1): return False # verify that c_index is incremented by 1 if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'c_index1', ring1_mask, 1): return False # verify that curr_psn is 0 if not VerifyFieldAbsolute(tc, tc.pvtdata.rq_post_qstate, 'curr_read_rsp_psn', 0): return False ############ CQ VALIDATIONS ################# if not ValidateNoCQChanges(tc): return False ############ RESP_RX VALIDATIONS ################ # verify that curr_color is changed by design if not ValidateRespRx(tc): return False return True
def TestCaseStepTrigger(tc, step): logger.info("RDMA TestCaseStepTrigger() Implementation with step_id: %d" % (step.step_id)) if (GlobalOptions.dryrun): return True return
def Show(self): logger.info("- LIF : %s" % self.GID()) logger.info(" - # Queue Types : %d" % len(self.obj_helper_q.queue_types))
def TestCaseStepVerify(tc, step): if (GlobalOptions.dryrun): return True logger.info("RDMA TestCaseStepVerify() Implementation.") logger.info("step id: %d" % (step.step_id)) PopulatePostQStates(tc) rs = tc.config.rdmasession rs.lqp.rq.qstate.Read() ring0_mask = (rs.lqp.num_rq_wqes - 1) tc.pvtdata.rq_post_qstate = rs.lqp.rq.qstate.data if step.step_id == 0: # verify that e_psn is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'e_psn', 1): return False # verify that proxy_cindex is NOT incremented if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'proxy_cindex', ring0_mask, 0): return False # verify that token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'token_id', 1): return False # verify that nxt_to_go_token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'nxt_to_go_token_id', 1): return False elif step.step_id == 1: # verify that e_psn is NOT incremented if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'e_psn', 0): return False # verify that proxy_cindex is NOT incremented if not VerifyFieldMaskModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'proxy_cindex', ring0_mask, 0): return False # verify that token_id is incremented by 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'token_id', 1): return False # verify that nxt_to_go_token_id is NOT incremented if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'nxt_to_go_token_id', 0): return False # verify that state is now moved to ERR (2) if not VerifyErrQState(tc): return False ############ STATS VALIDATIONS ################# # verify that error disable stats are updated if not VerifyErrStatistics(tc): return False #verify that opcode_err is set to 1 if not VerifyFieldModify(tc, tc.pvtdata.rq_pre_qstate, tc.pvtdata.rq_post_qstate, 'qp_err_dis_opcode_err', 1): return False # last bth opcode should be 7 (write_middle) if not VerifyFieldAbsolute(tc, tc.pvtdata.rq_post_qstate, 'last_bth_opcode', 7): return False # update current as pre_qstate ... so next step_id can use it as pre_qstate tc.pvtdata.rq_pre_qstate = copy.deepcopy(rs.lqp.rq.qstate.data) tc.pvtdata.rq_cq_pre_qstate = copy.deepcopy(rs.lqp.rq_cq.qstate.data) return True
def Configure(self): logger.info("Configuring %d Collector." % len(self.collectors)) halapi.ConfigureCollectors(self.collectors) return