- /* Remove the hdr bit maps that are internal or computed */
- ulp_matcher_hdr_fields_normalize(hdr_bitmap, &hdr_bitmap_masked);
-
- /* Loop through the list of class templates to find the match */
- for (idx = 0; idx < hdr_num; idx++, sel_hdr_match++) {
- if (ULP_BITSET_CMP(&sel_hdr_match->hdr_bitmap,
- &hdr_bitmap_masked)) {
- /* no match found */
- BNXT_TF_DBG(DEBUG, "Pattern Match failed template=%d\n",
- idx);
- continue;
- }
- match = ULP_BITMAP_ISSET(act_bitmap->bits,
- BNXT_ULP_ACTION_BIT_VNIC);
- if (match != sel_hdr_match->act_vnic) {
- /* no match found */
- BNXT_TF_DBG(DEBUG, "Vnic Match failed template=%d\n",
- idx);
- continue;
- } else {
- match = 1;
- }
-
- /* Found a matching hdr bitmap, match the fields next */
- start_idx = sel_hdr_match->start_idx;
- for (jdx = 0; jdx < sel_hdr_match->num_entries; jdx++) {
- m_field = &hdr_field[jdx + BNXT_ULP_HDR_FIELD_LAST - 1];
- sf = &ulp_field_match[start_idx + jdx];
- switch (sf->mask_opcode) {
- case BNXT_ULP_FMF_MASK_ANY:
- match &= ulp_field_mask_is_zero(m_field->mask,
- m_field->size);
- break;
- case BNXT_ULP_FMF_MASK_EXACT:
- match &= ulp_field_mask_is_ones(m_field->mask,
- m_field->size);
- break;
- case BNXT_ULP_FMF_MASK_WILDCARD:
- match &= ulp_field_mask_notzero(m_field->mask,
- m_field->size);
- break;
- case BNXT_ULP_FMF_MASK_IGNORE:
- default:
- break;
- }
- if (!match)
- break;
- }
- if (match) {
- BNXT_TF_DBG(DEBUG,
- "Found matching pattern template %d\n",
- sel_hdr_match->class_tmpl_id);
- *class_id = sel_hdr_match->class_tmpl_id;
- return BNXT_TF_RC_SUCCESS;
- }
+ /* Match the application id before proceeding */
+ if (params->app_id != class_match->app_sig) {
+ BNXT_TF_DBG(DEBUG, "Field to match the app id %u:%u\n",
+ params->app_id, class_match->app_sig);
+ goto error;