FILE
ofld.h
File preview with syntax highlighting.
linux-6.19.14/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ofld.h
1/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 2/* Copyright (c) 2020 Mellanox Technologies Inc. All rights reserved. */ 3 4#ifndef __MLX5_ESWITCH_ACL_OFLD_H__ 5#define __MLX5_ESWITCH_ACL_OFLD_H__ 6 7#include "eswitch.h" 8 9#ifdef CONFIG_MLX5_ESWITCH 10/* Eswitch acl egress external APIs */ 11int esw_acl_egress_ofld_setup(struct mlx5_eswitch *esw, struct mlx5_vport *vport); 12void esw_acl_egress_ofld_cleanup(struct mlx5_vport *vport); 13void esw_acl_egress_ofld_bounce_rule_destroy(struct mlx5_vport *vport, int rule_index); 14int mlx5_esw_acl_egress_vport_bond(struct mlx5_eswitch *esw, u16 active_vport_num, 15 u16 passive_vport_num); 16int mlx5_esw_acl_egress_vport_unbond(struct mlx5_eswitch *esw, u16 vport_num); 17 18static inline bool mlx5_esw_acl_egress_fwd2vport_supported(struct mlx5_eswitch *esw) 19{ 20 return esw && esw->mode == MLX5_ESWITCH_OFFLOADS && 21 mlx5_eswitch_vport_match_metadata_enabled(esw) && 22 MLX5_CAP_ESW_FLOWTABLE(esw->dev, egress_acl_forward_to_vport); 23} 24 25/* Eswitch acl ingress external APIs */ 26int esw_acl_ingress_ofld_setup(struct mlx5_eswitch *esw, struct mlx5_vport *vport); 27void esw_acl_ingress_ofld_cleanup(struct mlx5_eswitch *esw, struct mlx5_vport *vport); 28int mlx5_esw_acl_ingress_vport_metadata_update(struct mlx5_eswitch *esw, u16 vport_num, 29 u32 metadata); 30void mlx5_esw_acl_ingress_vport_drop_rule_destroy(struct mlx5_eswitch *esw, u16 vport_num); 31int mlx5_esw_acl_ingress_vport_drop_rule_create(struct mlx5_eswitch *esw, u16 vport_num); 32 33#else /* CONFIG_MLX5_ESWITCH */ 34static void 35mlx5_esw_acl_ingress_vport_drop_rule_destroy(struct mlx5_eswitch *esw, 36 u16 vport_num) 37{} 38 39static int mlx5_esw_acl_ingress_vport_drop_rule_create(struct mlx5_eswitch *esw, 40 u16 vport_num) 41{ 42 return 0; 43} 44#endif /* CONFIG_MLX5_ESWITCH */ 45#endif /* __MLX5_ESWITCH_ACL_OFLD_H__ */
~/
Read-only file preview.