patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v1] net/cpfl: fix invalid action types
@ 2024-07-30 11:45 Praveen Shetty
  2024-08-22 16:14 ` Bruce Richardson
  2024-08-22 16:25 ` Bruce Richardson
  0 siblings, 2 replies; 4+ messages in thread
From: Praveen Shetty @ 2024-07-30 11:45 UTC (permalink / raw)
  To: dev, bruce.richardson; +Cc: stable

In case of 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 represeted by the cpfl pmd).
Any mismatch in either of the cases PMD will throw
an error.

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

Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
---
 drivers/net/cpfl/cpfl_flow_engine_fxp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/cpfl/cpfl_flow_engine_fxp.c b/drivers/net/cpfl/cpfl_flow_engine_fxp.c
index b9e825ef57..e760acd722 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
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-23  7:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-30 11:45 [PATCH v1] net/cpfl: fix invalid action types Praveen Shetty
2024-08-22 16:14 ` Bruce Richardson
2024-08-23  7:26   ` Shetty, Praveen
2024-08-22 16:25 ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).