tir.h (1795B)
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 9struct mlx5e_rss_params_hash { 10 u8 hfunc; 11 u8 toeplitz_hash_key[40]; 12}; 13 14struct mlx5e_rss_params_traffic_type { 15 u8 l3_prot_type; 16 u8 l4_prot_type; 17 u32 rx_hash_fields; 18}; 19 20struct mlx5e_tir_builder; 21struct mlx5e_packet_merge_param; 22 23struct mlx5e_tir_builder *mlx5e_tir_builder_alloc(bool modify); 24void mlx5e_tir_builder_free(struct mlx5e_tir_builder *builder); 25void mlx5e_tir_builder_clear(struct mlx5e_tir_builder *builder); 26 27void mlx5e_tir_builder_build_inline(struct mlx5e_tir_builder *builder, u32 tdn, u32 rqn); 28void mlx5e_tir_builder_build_rqt(struct mlx5e_tir_builder *builder, u32 tdn, 29 u32 rqtn, bool inner_ft_support); 30void mlx5e_tir_builder_build_packet_merge(struct mlx5e_tir_builder *builder, 31 const struct mlx5e_packet_merge_param *pkt_merge_param); 32void mlx5e_tir_builder_build_rss(struct mlx5e_tir_builder *builder, 33 const struct mlx5e_rss_params_hash *rss_hash, 34 const struct mlx5e_rss_params_traffic_type *rss_tt, 35 bool inner); 36void mlx5e_tir_builder_build_direct(struct mlx5e_tir_builder *builder); 37void mlx5e_tir_builder_build_tls(struct mlx5e_tir_builder *builder); 38 39struct mlx5_core_dev; 40 41struct mlx5e_tir { 42 struct mlx5_core_dev *mdev; 43 u32 tirn; 44 struct list_head list; 45}; 46 47int mlx5e_tir_init(struct mlx5e_tir *tir, struct mlx5e_tir_builder *builder, 48 struct mlx5_core_dev *mdev, bool reg); 49void mlx5e_tir_destroy(struct mlx5e_tir *tir); 50 51static inline u32 mlx5e_tir_get_tirn(struct mlx5e_tir *tir) 52{ 53 return tir->tirn; 54} 55 56int mlx5e_tir_modify(struct mlx5e_tir *tir, struct mlx5e_tir_builder *builder); 57 58#endif /* __MLX5_EN_TIR_H__ */