[v3,08/10] net/mlx5: shared action create conf drv support

Message ID 20201003220619.19231-9-andreyv@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series RTE flow shared action |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Andrey Vesnovaty Oct. 3, 2020, 10:06 p.m. UTC
  Add support for configuration argument in shared action validate/create
API. Currently the inly shared action implemented is RSS.
For shared RSS action configuration argument ignpred but it can be
utilized by other types of shared actions.

Signed-off-by: Andrey Vesnovaty <andreyv@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 13effc0af0..2c39b061bb 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -9669,6 +9669,8 @@  __flow_dv_action_rss_setup(struct rte_eth_dev *dev,
  *
  * @param[in] dev
  *   Pointer to the Ethernet device structure.
+ * @param[in] conf
+ *   Shared action configuration.
  * @param[in] rss
  *   RSS action specification used to create shared action.
  * @param[out] error
@@ -9681,8 +9683,9 @@  __flow_dv_action_rss_setup(struct rte_eth_dev *dev,
  */
 static struct rte_flow_shared_action *
 __flow_dv_action_rss_create(struct rte_eth_dev *dev,
-			const struct rte_flow_action_rss *rss,
-			struct rte_flow_error *error)
+			    const struct rte_flow_shared_action_conf *conf,
+			    const struct rte_flow_action_rss *rss,
+			    struct rte_flow_error *error)
 {
 	struct rte_flow_shared_action *shared_action = NULL;
 	void *queue = NULL;
@@ -9691,6 +9694,7 @@  __flow_dv_action_rss_create(struct rte_eth_dev *dev,
 	struct rte_flow_action_rss *origin;
 	const uint8_t *rss_key;
 
+	(void)conf;
 	queue_size = RTE_ALIGN_CEIL(rss->queue_num * sizeof(uint16_t),
 				    sizeof(void *));
 	queue = rte_calloc(__func__, 1, queue_size, 0);
@@ -9774,6 +9778,8 @@  __flow_dv_action_rss_release(struct rte_eth_dev *dev,
  *
  * @param[in] dev
  *   Pointer to the Ethernet device structure.
+ * @param[in] conf
+ *   Shared action configuration.
  * @param[in] action
  *   Action specification used to create shared action.
  * @param[out] error
@@ -9786,6 +9792,7 @@  __flow_dv_action_rss_release(struct rte_eth_dev *dev,
  */
 static struct rte_flow_shared_action *
 __flow_dv_action_create(struct rte_eth_dev *dev,
+			const struct rte_flow_shared_action_conf *conf,
 			const struct rte_flow_action *action,
 			struct rte_flow_error *error)
 {
@@ -9794,7 +9801,8 @@  __flow_dv_action_create(struct rte_eth_dev *dev,
 
 	switch (action->type) {
 	case RTE_FLOW_ACTION_TYPE_RSS:
-		shared_action = __flow_dv_action_rss_create(dev, action->conf,
+		shared_action = __flow_dv_action_rss_create(dev, conf,
+							    action->conf,
 							    error);
 		break;
 	default:
@@ -10647,6 +10655,8 @@  flow_dv_counter_free(struct rte_eth_dev *dev, uint32_t cnt)
  *
  * @param[in] dev
  *   Pointer to the Ethernet device structure.
+ * @param[in] conf
+ *   Shared action configuration.
  * @param[in] action
  *   The shared action object to validate.
  * @param[out] error
@@ -10658,9 +10668,11 @@  flow_dv_counter_free(struct rte_eth_dev *dev, uint32_t cnt)
  */
 static int
 flow_dv_action_validate(struct rte_eth_dev *dev,
+			const struct rte_flow_shared_action_conf *conf,
 			const struct rte_flow_action *action,
 			struct rte_flow_error *error)
 {
+	(void)conf;
 	switch (action->type) {
 	case RTE_FLOW_ACTION_TYPE_RSS:
 		return mlx5_validate_action_rss(dev, action, error);
@@ -10677,13 +10689,14 @@  flow_dv_action_validate(struct rte_eth_dev *dev,
  */
 static struct rte_flow_shared_action *
 flow_dv_action_create(struct rte_eth_dev *dev,
+		      const struct rte_flow_shared_action_conf *conf,
 		      const struct rte_flow_action *action,
 		      struct rte_flow_error *error)
 {
 	struct rte_flow_shared_action *shared_action = NULL;
 
 	flow_dv_shared_lock(dev);
-	shared_action = __flow_dv_action_create(dev, action, error);
+	shared_action = __flow_dv_action_create(dev, conf, action, error);
 	flow_dv_shared_unlock(dev);
 	return shared_action;
 }