]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
net/mlx5e: Support accept action
[mirror_ubuntu-jammy-kernel.git] / drivers / net / ethernet / mellanox / mlx5 / core / eswitch.h
index 2c7444101bb93e53c3720188311b0db0074d18bd..2f13b480a8dd7b755f404a8e221aeadfeeebdbe3 100644 (file)
@@ -51,6 +51,7 @@
 enum mlx5_mapped_obj_type {
        MLX5_MAPPED_OBJ_CHAIN,
        MLX5_MAPPED_OBJ_SAMPLE,
+       MLX5_MAPPED_OBJ_INT_PORT_METADATA,
 };
 
 struct mlx5_mapped_obj {
@@ -63,6 +64,7 @@ struct mlx5_mapped_obj {
                        u32 trunc_size;
                        u32 tunnel_id;
                } sample;
+               u32 int_port_metadata;
        };
 };
 
@@ -88,6 +90,7 @@ enum {
        MAPPING_TYPE_TUNNEL_ENC_OPTS,
        MAPPING_TYPE_LABELS,
        MAPPING_TYPE_ZONE,
+       MAPPING_TYPE_INT_PORT,
 };
 
 struct vport_ingress {
@@ -336,6 +339,9 @@ void mlx5_esw_match_metadata_free(struct mlx5_eswitch *esw, u32 metadata);
 
 int mlx5_esw_qos_modify_vport_rate(struct mlx5_eswitch *esw, u16 vport_num, u32 rate_mbps);
 
+bool mlx5_esw_vport_match_metadata_supported(const struct mlx5_eswitch *esw);
+int mlx5_esw_offloads_vport_metadata_set(struct mlx5_eswitch *esw, bool enable);
+
 /* E-Switch API */
 int mlx5_eswitch_init(struct mlx5_core_dev *dev);
 void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw);
@@ -447,8 +453,16 @@ enum {
        MLX5_ESW_ATTR_FLAG_NO_IN_PORT    = BIT(2),
        MLX5_ESW_ATTR_FLAG_SRC_REWRITE   = BIT(3),
        MLX5_ESW_ATTR_FLAG_SAMPLE        = BIT(4),
+       MLX5_ESW_ATTR_FLAG_ACCEPT        = BIT(5),
 };
 
+/* Returns true if any of the flags that require skipping further TC/NF processing are set. */
+static inline bool
+mlx5_esw_attr_flags_skip(u32 attr_flags)
+{
+       return attr_flags & (MLX5_ESW_ATTR_FLAG_SLOW_PATH | MLX5_ESW_ATTR_FLAG_ACCEPT);
+}
+
 struct mlx5_esw_flow_attr {
        struct mlx5_eswitch_rep *in_rep;
        struct mlx5_core_dev    *in_mdev;