1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2001-2021 Intel Corporation
5 #include "ice_common.h"
6 #include "ice_parser_util.h"
8 #define ICE_PTYPE_MK_TCAM_TABLE_SIZE 1024
11 * ice_ptype_mk_tcam_dump - dump an ptype marker tcam info_
12 * @ice_hw: pointer to the hardware structure
13 * @item: ptype marker tcam to dump
15 void ice_ptype_mk_tcam_dump(struct ice_hw *hw,
16 struct ice_ptype_mk_tcam_item *item)
20 ice_info(hw, "address = %d\n", item->address);
21 ice_info(hw, "ptype = %d\n", item->ptype);
22 ice_info(hw, "key :");
23 for (i = 0; i < 10; i++)
24 ice_info(hw, "%02x ", item->key[i]);
26 ice_info(hw, "key_inv:");
27 for (i = 0; i < 10; i++)
28 ice_info(hw, "%02x ", item->key_inv[i]);
32 static void _parse_ptype_mk_tcam_item(struct ice_hw *hw, u16 idx, void *item,
35 ice_parse_item_dflt(hw, idx, item, data, size);
37 if (hw->debug_mask & ICE_DBG_PARSER)
38 ice_ptype_mk_tcam_dump(hw,
39 (struct ice_ptype_mk_tcam_item *)item);
43 * ice_ptype_mk_tcam_table_get - create a ptype marker tcam table
44 * @ice_hw: pointer to the hardware structure
46 struct ice_ptype_mk_tcam_item *ice_ptype_mk_tcam_table_get(struct ice_hw *hw)
48 return (struct ice_ptype_mk_tcam_item *)
49 ice_parser_create_table(hw, ICE_SID_RXPARSER_MARKER_PTYPE,
50 sizeof(struct ice_ptype_mk_tcam_item),
51 ICE_PTYPE_MK_TCAM_TABLE_SIZE,
52 ice_parser_sect_item_get,
53 _parse_ptype_mk_tcam_item, true);