Esempio n. 1
0
 def dump_string(self):
     rx_tx_type = "rx"
     return "matcher_id %s, index %s, rx_tx_type %s, lu_type %s\n" % (
         _srd(self.data, "matcher_id"),
         _srd(self.data, "index"),
         rx_tx_type,
         dr_prettify.lu_type_conv(_srd(self.data, "lu_type")))
Esempio n. 2
0
    def dump_str(self, verbose, raw):
        nic_version = None
        if self.data['dr_dump_rec_type'] in [
                DR_DUMP_REC_TYPE_RULE_RX_ENTRY_V1,
                DR_DUMP_REC_TYPE_RULE_TX_ENTRY_V1
        ]:
            nic_version = MLX5_HW_CONNECTX_6DX
        else:
            nic_version = MLX5_HW_CONNECTX_5

        parsed_ste = mlx5_hw_ste_parser(nic_version, self.data['ste_data'],
                                        raw, verbose)
        if "tag" not in parsed_ste.keys():
            return ""

        if verbose == 0:
            return "%s" % dict_join_str(parsed_ste["tag"])
        else:
            if self.data['dr_dump_rec_type'] in [
                    DR_DUMP_REC_TYPE_RULE_RX_ENTRY_V0,
                    DR_DUMP_REC_TYPE_RULE_RX_ENTRY_V1
            ]:
                rx_tx = "RX"
            else:
                rx_tx = "TX"

            if verbose == 1:
                return "(%s STE, icm_idx %s): %s" % (
                    rx_tx, _srd(self.data, "ste_icm_addr"),
                    dict_join_str(parsed_ste["tag"]))
            elif verbose >= 2:
                return "(%s STE, icm_idx %s): %s (%s)" % (
                    rx_tx, _srd(self.data,
                                "ste_icm_addr"), _srd(self.data, "ste_data"),
                    dict_join_str(parsed_ste["tag"]))
Esempio n. 3
0
    def dump_string(self):
        flex_str = felx_parser_dump_string(int(self.data["flex_protocols"],
                                               16))

        return "caps: eswitch_manager %s, num_vports %s, flex_protocols: %s, nic_rx_drop_address %s, nic_tx_drop_address %s\n" % (
            _srd(self.data, "eswitch_manager"), _srd(self.data, "num_vports"),
            flex_str, _srd(self.data, "nic_rx_drop_address"),
            _srd(self.data, "nic_tx_drop_address"))
Esempio n. 4
0
 def dump_str(self):
     return "SAMPLER, next flow table %s, sample table devx obj id %s, sampler devx obj id %s, rx_icm_addr %s " \
            "rx_icm_addr %s" % (
         _srd(self.data, "next_ft"),
         _srd(self.data, "sample_tbl_devx_id"),
         _srd(self.data, "devx_id"),
         _srd(self.data, "rx_icm_addr"),
         _srd(self.data, "tx_icm_addr"))
Esempio n. 5
0
    def print_rule_view(self, dump_ctx, verbose, raw):
        dmn_str = "domain %s, " % (_srd(dump_ctx.domain.data, "id"))
        tbl_str = "table %s, " % (_srd(dump_ctx.table.data, "id"))
        matcher_str = "matcher %s, " % (_srd(dump_ctx.matcher.data, "id"))

        print_dr(dr_print_color.DOMAIN, dmn_str)
        print_dr(dr_print_color.TABLE, tbl_str)
        print_dr(dr_print_color.MATCHER, matcher_str)
        print_dr(dr_print_color.RULE, self.dump_str())

        inc_indent()
        print_dr(dr_print_color.RULE_MATCH, self.dump_match_str(verbose, raw))
        print_dr(dr_print_color.RULE_ACTIONS, self.dump_actions_str(verbose))
        dec_indent()
Esempio n. 6
0
    def dump_str(self):
        rx_tx_e_anchor = ""

        if self.matcher_rx:
            rx_tx_e_anchor += "rx e_anchor %s" % (_srd(self.matcher_rx.data,
                                                       "e_anchor"))

        if self.matcher_tx:
            if self.matcher_rx:
                rx_tx_e_anchor += ", "
            rx_tx_e_anchor += "tx e_anchor %s" % (_srd(self.matcher_tx.data,
                                                       "e_anchor"))

        return "matcher %s: priority %s, %s\n" % (_srd(
            self.data, "id"), _srd(self.data, "priority"), rx_tx_e_anchor)
Esempio n. 7
0
    def dump_str(self, verbose):
        if verbose == 0:
            return "table %s: level: %s, type: %s\n" % (_srd(
                self.data, "id"), _srd(self.data,
                                       "level"), _srd(self.data, "type"))
        else:
            rx_s_anchor = ""
            tx_s_anchor = ""

            if self.table_rx:
                rx_s_anchor = "rx s_anchor %s," % (self.table_rx.dump_str())
            if self.table_tx:
                tx_s_anchor = "tx s_anchor %s" % (self.table_tx.dump_str())

            return "table %s: level: %s, type: %s, %s %s\n" % (
                _srd(self.data, "id"), _srd(self.data, "level"),
                _srd(self.data, "type"), rx_s_anchor, tx_s_anchor)
Esempio n. 8
0
 def dump_str(self):
     return "TAG, value %s" % (_srd(self.data, "tag"))
Esempio n. 9
0
 def dump_str(self):
     return "%s" % (_srd(self.data, "s_anchor"))
Esempio n. 10
0
 def dump_string(self):
     return "rx_builder_num: %s, rx_s_htbl_idx: %s, rx_e_anchor_idx: %s\n" % (
         _srd(self.data, "num_of_builders"), _srd(
             self.data, "s_htbl"), _srd(self.data, "e_anchor"))
Esempio n. 11
0
 def dump_str(self):
     return "MODIFY_HDR, rewrite index %s" % (_srd(self.data,
                                                   "rewrite_index"))
Esempio n. 12
0
 def dump_str(self):
     return "ASO CT devx_id %s" % (_srd(self.data, "devx_id"))
Esempio n. 13
0
 def dump_string(self):
     return "send ring: CQ num %s, QP num %s\n" % (_srd(
         self.data, "cq_num"), _srd(self.data, "qp_num"))
Esempio n. 14
0
 def dump_str(self):
     return "DEST_ARRAY, devx obj id %s, rx_icm_addr %s rx_icm_addr %s" % (
         _srd(self.data, "devx_id"), _srd(
             self.data, "rx_icm_addr"), _srd(self.data, "tx_icm_addr"))
Esempio n. 15
0
 def dump_str(self):
     return "ASO, flow_hit_aso %s" % (_srd(self.data, "flow_hit_aso"))
Esempio n. 16
0
 def dump_str(self):
     return "PUSH_VLAN, vlan id %s" % (_srd(self.data, "vlan_id"))
Esempio n. 17
0
 def dump_str(self):
     return "METER, next flow table %s, devx obj id %s, rx_icm_addr %s rx_icm_addr %s" % (
         _srd(self.data, "next_ft"), _srd(self.data, "devx_id"),
         _srd(self.data, "rx_icm_addr"), _srd(self.data, "tx_icm_addr"))
Esempio n. 18
0
 def dump_str(self):
     return "ENCAP_L3, devx obj id %s" % (_srd(self.data, "devx_obj_id"))
Esempio n. 19
0
 def dump_str(self):
     return "DECAP_L3, rewrite index %s" % (_srd(self.data,
                                                 "rewrite_index"))
Esempio n. 20
0
 def dump_str(self):
     return "VPORT, num %s" % (_srd(self.data, "vport_num"))
Esempio n. 21
0
 def dump_string(self):
     return "device: ports_num %s, FW version %s\n" % (_srd(
         self.data, "ports_num"), _srd(self.data, "fw_version"))
Esempio n. 22
0
 def dump_str(self):
     if self.data["single_action_opt"]:
         if int(self.data["single_action_opt"], 16) == 1:
             return "MODIFY_HDR, single modify action optimized"
     return "MODIFY_HDR, rewrite index %s" % (_srd(self.data,
                                                   "rewrite_index"))
Esempio n. 23
0
 def dump_string(self):
     return "flex parser: name %s, value %s\n" % (_srd(
         self.data, "name"), _srd(self.data, "value"))
Esempio n. 24
0
 def dump_str(self):
     return "QP num %s" % (_srd(self.data, "qp_num"))
Esempio n. 25
0
 def dump_string(self):
     return "vport: index %s, gvmi %s, icm_addr_rx %s, icm_addr_tx %s\n" % (
         _srd(self.data, "index"), _srd(self.data, "gvmi"),
         _srd(self.data, "icm_addr_rx"), _srd(self.data, "icm_addr_tx"))
Esempio n. 26
0
 def dump_str(self):
     return "DEVX_TIR, ICM addr %s" % (_srd(self.data, "icm_addr"))
Esempio n. 27
0
 def dump_str(self):
     return "domain %s: type: %s, gvmi: %s, support_sw_steering %s, dev_name %s, package_version %s\n" % (
         _srd(self.data, "id"), _srd(self.data, "type"),
         _srd(self.data, "gvmi"), _srd(self.data, "support_sw_steering"),
         _srd(self.data, "dev_name"), _srd(self.data, "package_version"))
Esempio n. 28
0
 def dump_str(self):
     return "CTR, index %s" % (_srd(self.data, "ctr_index"))
Esempio n. 29
0
 def dump_str(self):
     return "FT devx id %s, dest_ft %s" % (_srd(
         self.data, "table_devx_id"), _srd(self.data, "dest_ft"))
Esempio n. 30
0
 def dump_str(self):
     return "rule %s\n" % (_srd(self.data, "id"))