summaryrefslogtreecommitdiff
path: root/include/linux/mlx5/fs.h
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2017-02-01 20:01:18 +0300
committerSaeed Mahameed <saeedm@mellanox.com>2017-03-28 15:34:01 +0300
commite753b2b50dc3c6582e9d5971555693db41a6d821 (patch)
treed0e3eb99fca8fd2b5ed684c07e5f4849e1ee78af /include/linux/mlx5/fs.h
parentaa0cbbae5d360ea23a15038d24f6f7c9573eecaf (diff)
downloadlinux-e753b2b50dc3c6582e9d5971555693db41a6d821.tar.xz
net/mlx5: Add helper to initialize a flow steering actions struct instance
There are bunch of places in the code where the intermediate struct that keeps the elements related to flow actions is initialized with the same default values. Put that into a small DECLARE type helper. This patch doesn't change any functionality. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Hadar Hen Zion <hadarh@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/fs.h')
-rw-r--r--include/linux/mlx5/fs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h
index 949b24b6c479..5eea1ba2e593 100644
--- a/include/linux/mlx5/fs.h
+++ b/include/linux/mlx5/fs.h
@@ -136,6 +136,10 @@ struct mlx5_flow_act {
u32 encap_id;
};
+#define MLX5_DECLARE_FLOW_ACT(name) \
+ struct mlx5_flow_act name = {MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,\
+ MLX5_FS_DEFAULT_FLOW_TAG, 0}
+
/* Single destination per rule.
* Group ID is implied by the match criteria.
*/
@@ -156,5 +160,4 @@ struct mlx5_fc *mlx5_fc_create(struct mlx5_core_dev *dev, bool aging);
void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter);
void mlx5_fc_query_cached(struct mlx5_fc *counter,
u64 *bytes, u64 *packets, u64 *lastuse);
-
#endif