return NULL;
}
+
+static bool _start_with(const char *prefix, const char *string)
+{
+ int len1 = strlen(prefix);
+ int len2 = strlen(string);
+
+ if (len2 < len1)
+ return false;
+
+ return !memcmp(prefix, string, len1);
+}
+
+struct ice_bst_tcam_item *
+ice_bst_tcam_search(struct ice_bst_tcam_item *tcam_table,
+ struct ice_lbl_item *lbl_table,
+ const char *prefix, u16 *start)
+{
+ u16 i = *start;
+
+ for (; i < ICE_BST_TCAM_TABLE_SIZE; i++) {
+ if (_start_with(prefix, lbl_table[i].label)) {
+ *start = i;
+ return &tcam_table[lbl_table[i].idx];
+ }
+ }
+
+ return NULL;
+}
struct ice_bst_tcam_item *
ice_bst_tcam_match(struct ice_bst_tcam_item *tcam_table, u8 *pat);
+struct ice_bst_tcam_item *
+ice_bst_tcam_search(struct ice_bst_tcam_item *tcam_table,
+ struct ice_lbl_item *lbl_table,
+ const char *prefix, u16 *start);
#endif /*_ICE_BST_TCAM_H_ */
ice_info(hw, "flags_fd = 0x%04x\n", rslt->flags_fd);
ice_info(hw, "flags_rss = 0x%04x\n", rslt->flags_rss);
}
+
+static void _bst_vm_set(struct ice_parser *psr, const char *prefix, bool on)
+{
+ struct ice_bst_tcam_item *item;
+ u16 i = 0;
+
+ while (true) {
+ item = ice_bst_tcam_search(psr->bst_tcam_table,
+ psr->bst_lbl_table,
+ prefix, &i);
+ if (!item)
+ break;
+ item->key[0] = (u8)(on ? 0xff : 0xfe);
+ item->key_inv[0] = (u8)(on ? 0xff : 0xfe);
+ i++;
+ }
+}
+
+/**
+ * ice_parser_dvm_set - configure double vlan mode for parser
+ * @psr: pointer to a parser instance
+ */
+void ice_parser_dvm_set(struct ice_parser *psr, bool on)
+{
+ _bst_vm_set(psr, "BOOST_MAC_VLAN_DVM", on);
+ _bst_vm_set(psr, "BOOST_MAC_VLAN_SVM", !on);
+}
enum ice_status ice_parser_create(struct ice_hw *hw, struct ice_parser **psr);
void ice_parser_destroy(struct ice_parser *psr);
+void ice_parser_dvm_set(struct ice_parser *psr, bool on);
struct ice_parser_proto_off {
u8 proto_id; /* hardware protocol ID */