diff --git a/drivers/net/cpfl/cpfl_flow_engine_fxp.c b/drivers/net/cpfl/cpfl_flow_engine_fxp.c index b9e825ef571..2c75ea6577e 100644 --- a/drivers/net/cpfl/cpfl_flow_engine_fxp.c +++ b/drivers/net/cpfl/cpfl_flow_engine_fxp.c @@ -292,6 +292,17 @@ cpfl_fxp_parse_action(struct cpfl_itf *itf, is_vsi = (action_type == RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR || dst_itf->type == CPFL_ITF_TYPE_REPRESENTOR); + /* Added checks to throw an error for the invalid action types. */ + if (action_type == RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR && + dst_itf->type == CPFL_ITF_TYPE_REPRESENTOR) { + PMD_DRV_LOG(ERR, "Cannot use port_representor action for the represented_port"); + goto err; + } + if (action_type == RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT && + dst_itf->type == CPFL_ITF_TYPE_VPORT) { + PMD_DRV_LOG(ERR, "Cannot use represented_port action for the local vport"); + goto err; + } if (is_vsi) dev_id = cpfl_get_vsi_id(dst_itf); else