Skip to content

Commit

Permalink
net/cpfl: fix invalid action types
Browse files Browse the repository at this point in the history
In CPFL PMD, port_representor action is used for the local vport and
represented_port action is used for the remote port (remote port in this
case is either the idpf pf or the vf port that is being represented by
the cpfl pmd). Using these the other way around is an error, so add a
check for those cases.

Fixes: 441e777 ("net/cpfl: support represented port action")
Cc: stable@dpdk.org

Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
PraveenShettyINC authored and bruce-richardson committed Aug 22, 2024
1 parent 02b8f20 commit fe44ec3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/net/cpfl/cpfl_flow_engine_fxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe44ec3

Please sign in to comment.