git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/mlx5: fix meter policy flow match item
[dpdk.git]
/
drivers
/
net
/
bnxt
/
tf_ulp
/
ulp_matcher.c
diff --git
a/drivers/net/bnxt/tf_ulp/ulp_matcher.c
b/drivers/net/bnxt/tf_ulp/ulp_matcher.c
index
f665700
..
67fa61f
100644
(file)
--- a/
drivers/net/bnxt/tf_ulp/ulp_matcher.c
+++ b/
drivers/net/bnxt/tf_ulp/ulp_matcher.c
@@
-1,5
+1,5
@@
/* SPDX-License-Identifier: BSD-3-Clause
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2014-202
0
Broadcom
+ * Copyright(c) 2014-202
1
Broadcom
* All rights reserved.
*/
* All rights reserved.
*/
@@
-23,13
+23,15
@@
ulp_matcher_class_hash_calculate(uint64_t hi_sig, uint64_t lo_sig)
/* Utility function to calculate the action matcher hash */
static uint32_t
/* Utility function to calculate the action matcher hash */
static uint32_t
-ulp_matcher_action_hash_calculate(uint64_t hi_sig)
+ulp_matcher_action_hash_calculate(uint64_t hi_sig
, uint64_t app_id
)
{
uint64_t hash;
hi_sig |= ((hi_sig % BNXT_ULP_ACT_HID_HIGH_PRIME) <<
BNXT_ULP_ACT_HID_SHFTL);
{
uint64_t hash;
hi_sig |= ((hi_sig % BNXT_ULP_ACT_HID_HIGH_PRIME) <<
BNXT_ULP_ACT_HID_SHFTL);
- hash = hi_sig;
+ app_id |= ((app_id % BNXT_ULP_CLASS_HID_LOW_PRIME) <<
+ (BNXT_ULP_CLASS_HID_SHFTL + 2));
+ hash = hi_sig ^ app_id;
hash = (hash >> BNXT_ULP_ACT_HID_SHFTR) & BNXT_ULP_ACT_HID_MASK;
return (uint32_t)hash;
}
hash = (hash >> BNXT_ULP_ACT_HID_SHFTR) & BNXT_ULP_ACT_HID_MASK;
return (uint32_t)hash;
}
@@
-47,18
+49,13
@@
ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
uint8_t vf_to_vf;
uint16_t tmpl_id;
uint8_t vf_to_vf;
uint16_t tmpl_id;
- /* determine vf to vf flow */
- if (params->dir == ULP_DIR_EGRESS &&
- ULP_BITMAP_ISSET(params->act_bitmap.bits,
- BNXT_ULP_ACTION_BIT_VNIC)) {
- vf_to_vf = 1;
- } else {
- vf_to_vf = 0;
- }
+ /* Get vf to vf flow */
+ vf_to_vf = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_VF_TO_VF);
/* calculate the hash of the given flow */
/* calculate the hash of the given flow */
- class_hid = ulp_matcher_class_hash_calculate(params->hdr_bitmap.bits,
- params->fld_bitmap.bits);
+ class_hid = ulp_matcher_class_hash_calculate((params->hdr_bitmap.bits ^
+ params->app_id),
+ params->fld_s_bitmap.bits);
/* validate the calculate hash values */
if (class_hid >= BNXT_ULP_CLASS_SIG_TBL_MAX_SZ)
/* validate the calculate hash values */
if (class_hid >= BNXT_ULP_CLASS_SIG_TBL_MAX_SZ)
@@
-72,10
+69,18
@@
ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
BNXT_TF_DBG(DEBUG, "Proto Header does not match\n");
goto error;
}
BNXT_TF_DBG(DEBUG, "Proto Header does not match\n");
goto error;
}
- if (ULP_BITMAP_CMP(¶ms->fld_bitmap, &class_match->field_sig)) {
+ if (ULP_BITMAP_CMP(¶ms->fld_
s_
bitmap, &class_match->field_sig)) {
BNXT_TF_DBG(DEBUG, "Field signature does not match\n");
goto error;
}
BNXT_TF_DBG(DEBUG, "Field signature does not match\n");
goto error;
}
+
+ /* 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;
+ }
+
if (vf_to_vf != class_match->act_vnic) {
BNXT_TF_DBG(DEBUG, "Vnic Match failed\n");
goto error;
if (vf_to_vf != class_match->act_vnic) {
BNXT_TF_DBG(DEBUG, "Vnic Match failed\n");
goto error;
@@
-83,6
+88,9
@@
ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
BNXT_TF_DBG(DEBUG, "Found matching pattern template %d\n",
class_match->class_tid);
*class_id = class_match->class_tid;
BNXT_TF_DBG(DEBUG, "Found matching pattern template %d\n",
class_match->class_tid);
*class_id = class_match->class_tid;
+ params->hdr_sig_id = class_match->hdr_sig_id;
+ params->flow_sig_id = class_match->flow_sig_id;
+ params->flow_pattern_id = class_match->flow_pattern_id;
return BNXT_TF_RC_SUCCESS;
error:
return BNXT_TF_RC_SUCCESS;
error:
@@
-104,7
+112,8
@@
ulp_matcher_action_match(struct ulp_rte_parser_params *params,
struct bnxt_ulp_act_match_info *act_match;
/* calculate the hash of the given flow action */
struct bnxt_ulp_act_match_info *act_match;
/* calculate the hash of the given flow action */
- act_hid = ulp_matcher_action_hash_calculate(params->act_bitmap.bits);
+ act_hid = ulp_matcher_action_hash_calculate(params->act_bitmap.bits,
+ params->app_id);
/* validate the calculate hash values */
if (act_hid >= BNXT_ULP_ACT_SIG_TBL_MAX_SZ)
/* validate the calculate hash values */
if (act_hid >= BNXT_ULP_ACT_SIG_TBL_MAX_SZ)
@@
-118,7
+127,16
@@
ulp_matcher_action_match(struct ulp_rte_parser_params *params,
BNXT_TF_DBG(DEBUG, "Action Header does not match\n");
goto error;
}
BNXT_TF_DBG(DEBUG, "Action Header does not match\n");
goto error;
}
+
+ /* Match the application id before proceeding */
+ if (params->app_id != act_match->app_sig) {
+ BNXT_TF_DBG(DEBUG, "Field to match the app id %u:%u\n",
+ params->app_id, act_match->app_sig);
+ goto error;
+ }
+
*act_id = act_match->act_tid;
*act_id = act_match->act_tid;
+ params->act_pattern_id = act_match->act_pattern_id;
BNXT_TF_DBG(DEBUG, "Found matching action template %u\n", *act_id);
return BNXT_TF_RC_SUCCESS;
BNXT_TF_DBG(DEBUG, "Found matching action template %u\n", *act_id);
return BNXT_TF_RC_SUCCESS;