summaryrefslogtreecommitdiff
path: root/drivers/staging/fsl_dpa_offload
diff options
context:
space:
mode:
authorMarian Chereji <marian.chereji@freescale.com>2013-07-02 11:23:08 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-07-06 07:09:47 (GMT)
commit1ac9f7fc84ced02bba7248175062365be7460b0e (patch)
tree58f105ab018dca79e2cb07797369f52c7d649840 /drivers/staging/fsl_dpa_offload
parent241de423bfadd8ab257220f0fd119ff4aea87946 (diff)
downloadlinux-fsl-qoriq-1ac9f7fc84ced02bba7248175062365be7460b0e.tar.xz
dpa_offload: Add support for header manipulation on DPA Classifier next_table action
The DPA Classifier API did not allow the user to add header manipulation on an entry whose action was sending the frames to a new classification table. This change adds this support to the DPA Classifier by adding an "hmd" (header manipulation descriptor) attribute to the "dpa_cls_tbl_next_table_desc" parameters structure. Signed-off-by: Marian Chereji <marian.chereji@freescale.com> Change-Id: I126cdfad8e76a8bec4453c8f7b506ad3380349e2 Reviewed-on: http://git.am.freescale.net:8181/3106 Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/staging/fsl_dpa_offload')
-rw-r--r--drivers/staging/fsl_dpa_offload/dpa_classifier.c27
-rw-r--r--drivers/staging/fsl_dpa_offload/wrp_dpa_classifier.c2
2 files changed, 29 insertions, 0 deletions
diff --git a/drivers/staging/fsl_dpa_offload/dpa_classifier.c b/drivers/staging/fsl_dpa_offload/dpa_classifier.c
index 6b8097f..676f11c 100644
--- a/drivers/staging/fsl_dpa_offload/dpa_classifier.c
+++ b/drivers/staging/fsl_dpa_offload/dpa_classifier.c
@@ -3027,6 +3027,33 @@ static int action_to_next_engine_params(const struct dpa_cls_tbl_action *action,
return -EINVAL;
}
+ if (action->next_table_params.hmd != DPA_OFFLD_DESC_NONE) {
+ if (!hmd) {
+ log_err("Header manipulations are not allowed on "
+ "this action.\n");
+ return -EINVAL;
+ }
+ if (!dpa_classif_hm_is_chain_head(
+ action->next_table_params.hmd)) {
+ log_err("hmd=%d is not a header manipulation "
+ "chain head. Only chain heads can be "
+ "used by the classifier table.\n",
+ action->next_table_params.hmd);
+ return -EINVAL;
+ }
+ next_engine_params->h_Manip = (t_Handle)
+ dpa_classif_hm_lock_chain(action->next_table_params.hmd);
+ if (!next_engine_params->h_Manip) {
+ log_err("Failed to attach HM op hmd=%d to "
+ "classification entry.",
+ action->next_table_params.hmd);
+ return -EINVAL;
+ }
+
+ *hmd = action->next_table_params.hmd;
+ } else
+ next_engine_params->h_Manip = NULL;
+
next_engine_params->nextEngine = e_FM_PCD_CC;
next_table = (struct dpa_cls_table *)
table_array.object[action->next_table_params.next_td];
diff --git a/drivers/staging/fsl_dpa_offload/wrp_dpa_classifier.c b/drivers/staging/fsl_dpa_offload/wrp_dpa_classifier.c
index d9c18b5..7c63cb5 100644
--- a/drivers/staging/fsl_dpa_offload/wrp_dpa_classifier.c
+++ b/drivers/staging/fsl_dpa_offload/wrp_dpa_classifier.c
@@ -2507,6 +2507,7 @@ int dpa_cls_tbl_action_params_compatcpy(
case DPA_CLS_TBL_ACTION_NEXT_TABLE:
kparam->next_table_params.next_td =
uparam->next_table_params.next_td;
+ kparam->next_table_params.hmd = uparam->next_table_params.hmd;
break;
case DPA_CLS_TBL_ACTION_MCAST:
kparam->mcast_params.grpd = uparam->mcast_params.grpd;
@@ -2551,6 +2552,7 @@ int dpa_cls_tbl_action_params_rcompatcpy(
case DPA_CLS_TBL_ACTION_NEXT_TABLE:
uparam->next_table_params.next_td =
kparam->next_table_params.next_td;
+ uparam->next_table_params.hmd = kparam->next_table_params.hmd;
break;
default:
break;