From: Yongseok Koh <yskoh@mellanox.com>
To: Shahaf Shuler <shahafs@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Yongseok Koh <yskoh@mellanox.com>
Subject: [dpdk-dev] [PATCH 6/7] net/mlx5: add missing VLAN action constraints
Date: Mon, 8 Oct 2018 18:02:17 +0000 [thread overview]
Message-ID: <20181008180150.39273-7-yskoh@mellanox.com> (raw)
In-Reply-To: <20181008180150.39273-1-yskoh@mellanox.com>
1) VLAN modify isn't supported by driver.
2) FW syndrome (0xA9C090):
set_flow_table_entry: push vlan action fte in fdb can ONLY be
forward to the uplink.
3) FW syndrome (0x294609):
set_flow_table_entry: modify/pop/push actions in fdb flow table are
supported only while forwarding to vport.
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
drivers/net/mlx5/mlx5_flow_tcf.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c
index 4c660d72b..0406e84f6 100644
--- a/drivers/net/mlx5/mlx5_flow_tcf.c
+++ b/drivers/net/mlx5/mlx5_flow_tcf.c
@@ -226,6 +226,9 @@ struct flow_tcf_ptoi {
};
#define MLX5_TCF_FATE_ACTIONS (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_PORT_ID)
+#define MLX5_TCF_VLAN_ACTIONS \
+ (MLX5_FLOW_ACTION_OF_POP_VLAN | MLX5_FLOW_ACTION_OF_PUSH_VLAN | \
+ MLX5_FLOW_ACTION_OF_SET_VLAN_VID | MLX5_FLOW_ACTION_OF_SET_VLAN_PCP)
/**
* Retrieve mask for pattern item.
@@ -436,6 +439,7 @@ flow_tcf_validate(struct rte_eth_dev *dev,
uint8_t next_protocol = -1;
unsigned int tcm_ifindex = 0;
struct flow_tcf_ptoi ptoi[PTOI_TABLE_SZ_MAX(dev)];
+ struct rte_eth_dev *port_id_dev = NULL;
bool in_port_id_set;
int ret;
@@ -669,6 +673,7 @@ flow_tcf_validate(struct rte_eth_dev *dev,
"missing data to convert port ID to"
" ifindex");
action_flags |= MLX5_FLOW_ACTION_PORT_ID;
+ port_id_dev = &rte_eth_devices[conf.port_id->id];
break;
case RTE_FLOW_ACTION_TYPE_DROP:
if (action_flags & MLX5_TCF_FATE_ACTIONS)
@@ -685,9 +690,21 @@ flow_tcf_validate(struct rte_eth_dev *dev,
action_flags |= MLX5_FLOW_ACTION_OF_PUSH_VLAN;
break;
case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
+ if (!(action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN))
+ return rte_flow_error_set
+ (error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ACTION, actions,
+ "vlan modify is not supported,"
+ " set action must follow push action");
action_flags |= MLX5_FLOW_ACTION_OF_SET_VLAN_VID;
break;
case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:
+ if (!(action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN))
+ return rte_flow_error_set
+ (error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ACTION, actions,
+ "vlan modify is not supported,"
+ " set action must follow push action");
action_flags |= MLX5_FLOW_ACTION_OF_SET_VLAN_PCP;
break;
default:
@@ -697,6 +714,29 @@ flow_tcf_validate(struct rte_eth_dev *dev,
"action not supported");
}
}
+ /*
+ * FW syndrome (0xA9C090):
+ * set_flow_table_entry: push vlan action fte in fdb can ONLY be
+ * forward to the uplink.
+ */
+ if ((action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN) &&
+ (action_flags & MLX5_FLOW_ACTION_PORT_ID) &&
+ ((struct priv *)port_id_dev->data->dev_private)->representor)
+ return rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ACTION, actions,
+ "vlan push can only be applied"
+ " when forwarding to uplink port");
+ /*
+ * FW syndrome (0x294609):
+ * set_flow_table_entry: modify/pop/push actions in fdb flow table
+ * are supported only while forwarding to vport.
+ */
+ if ((action_flags & MLX5_TCF_VLAN_ACTIONS) &&
+ !(action_flags & MLX5_FLOW_ACTION_PORT_ID))
+ return rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ACTION, actions,
+ "vlan actions are supported"
+ " only with port_id action");
if (!(action_flags & MLX5_TCF_FATE_ACTIONS))
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION, actions,
--
2.11.0
next prev parent reply other threads:[~2018-10-08 18:02 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-08 18:02 [dpdk-dev] [PATCH 0/7] net/mlx5: fixes for the new flow engine Yongseok Koh
2018-10-08 18:02 ` [dpdk-dev] [PATCH 1/7] net/mlx5: fix wrong flow action macro usage Yongseok Koh
2018-10-09 7:45 ` Ori Kam
2018-10-08 18:02 ` [dpdk-dev] [PATCH 2/7] net/mlx5: use standard IP protocol numbers Yongseok Koh
2018-10-09 7:37 ` Ori Kam
2018-10-09 8:02 ` Yongseok Koh
2018-10-09 15:39 ` Ferruh Yigit
2018-10-08 18:02 ` [dpdk-dev] [PATCH 3/7] net/mlx5: rename flow macros Yongseok Koh
2018-10-09 7:43 ` Ori Kam
2018-10-09 8:05 ` Yongseok Koh
2018-10-09 8:17 ` Yongseok Koh
2018-10-10 11:57 ` Ferruh Yigit
2018-10-08 18:02 ` [dpdk-dev] [PATCH 4/7] net/mlx5: fix validation of VLAN ID in flow spec Yongseok Koh
2018-10-09 7:47 ` Ori Kam
2018-10-09 15:44 ` Ferruh Yigit
2018-10-08 18:02 ` [dpdk-dev] [PATCH 5/7] net/mlx5: fix flow validation for no fate action Yongseok Koh
2018-10-09 7:49 ` Ori Kam
2018-10-10 12:24 ` Ferruh Yigit
2018-10-08 18:02 ` Yongseok Koh [this message]
2018-10-08 19:48 ` [dpdk-dev] [PATCH 6/7] net/mlx5: add missing VLAN action constraints Or Gerlitz
2018-10-08 18:02 ` [dpdk-dev] [PATCH 7/7] net/mlx5: fix errno values for flow engine Yongseok Koh
2018-10-09 7:53 ` Ori Kam
2018-10-10 12:59 ` Ferruh Yigit
2018-10-09 8:58 ` [dpdk-dev] [PATCH 0/7] net/mlx5: fixes for the new " Shahaf Shuler
2018-10-09 15:49 ` Ferruh Yigit
2018-10-10 5:57 ` Shahaf Shuler
2018-10-10 10:57 ` Ferruh Yigit
2018-10-10 13:01 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181008180150.39273-7-yskoh@mellanox.com \
--to=yskoh@mellanox.com \
--cc=dev@dpdk.org \
--cc=shahafs@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).