| 1 |
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ |
| 2 |
/* Copyright (c) 2021, Mellanox Technologies inc. All rights reserved. */ |
| 3 |
|
| 4 |
#ifndef __MLX5_EN_TIR_H__ |
| 5 |
#define __MLX5_EN_TIR_H__ |
| 6 |
|
| 7 |
#include <linux/kernel.h> |
| 8 |
|
| 9 |
struct mlx5e_rss_params_hash { |
| 10 |
u8 hfunc; |
| 11 |
u8 toeplitz_hash_key[40]; |
| 12 |
bool symmetric; |
| 13 |
}; |
| 14 |
|
| 15 |
struct mlx5e_rss_params_traffic_type { |
| 16 |
u8 l3_prot_type; |
| 17 |
u8 l4_prot_type; |
| 18 |
u32 rx_hash_fields; |
| 19 |
}; |
| 20 |
|
| 21 |
struct mlx5e_tir_builder; |
| 22 |
struct mlx5e_packet_merge_param; |
| 23 |
|
| 24 |
struct mlx5e_tir_builder *mlx5e_tir_builder_alloc(bool modify); |
| 25 |
void mlx5e_tir_builder_free(struct mlx5e_tir_builder *builder); |
| 26 |
void mlx5e_tir_builder_clear(struct mlx5e_tir_builder *builder); |
| 27 |
|
| 28 |
void mlx5e_tir_builder_build_inline(struct mlx5e_tir_builder *builder, u32 tdn, u32 rqn); |
| 29 |
void mlx5e_tir_builder_build_rqt(struct mlx5e_tir_builder *builder, u32 tdn, |
| 30 |
u32 rqtn, bool inner_ft_support); |
| 31 |
void mlx5e_tir_builder_build_packet_merge(struct mlx5e_tir_builder *builder, |
| 32 |
const struct mlx5e_packet_merge_param *pkt_merge_param); |
| 33 |
void mlx5e_tir_builder_build_rss(struct mlx5e_tir_builder *builder, |
| 34 |
const struct mlx5e_rss_params_hash *rss_hash, |
| 35 |
const struct mlx5e_rss_params_traffic_type *rss_tt, |
| 36 |
bool inner); |
| 37 |
void mlx5e_tir_builder_build_direct(struct mlx5e_tir_builder *builder); |
| 38 |
void mlx5e_tir_builder_build_self_lb_block(struct mlx5e_tir_builder *builder, |
| 39 |
bool enable_uc_lb, |
| 40 |
bool enable_mc_lb); |
| 41 |
void mlx5e_tir_builder_build_tls(struct mlx5e_tir_builder *builder); |
| 42 |
|
| 43 |
struct mlx5_core_dev; |
| 44 |
|
| 45 |
struct mlx5e_tir { |
| 46 |
struct mlx5_core_dev *mdev; |
| 47 |
u32 tirn; |
| 48 |
struct list_head list; |
| 49 |
}; |
| 50 |
|
| 51 |
int mlx5e_tir_init(struct mlx5e_tir *tir, struct mlx5e_tir_builder *builder, |
| 52 |
struct mlx5_core_dev *mdev, bool reg); |
| 53 |
void mlx5e_tir_destroy(struct mlx5e_tir *tir); |
| 54 |
|
| 55 |
static inline u32 mlx5e_tir_get_tirn(struct mlx5e_tir *tir) |
| 56 |
{ |
| 57 |
return tir->tirn; |
| 58 |
} |
| 59 |
|
| 60 |
int mlx5e_tir_modify(struct mlx5e_tir *tir, struct mlx5e_tir_builder *builder); |
| 61 |
|
| 62 |
#endif /* __MLX5_EN_TIR_H__ */ |