rss.h (2049B)
1/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 2/* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. */ 3 4#ifndef __MLX5_EN_RSS_H__ 5#define __MLX5_EN_RSS_H__ 6 7#include "rqt.h" 8#include "tir.h" 9#include "fs.h" 10 11struct mlx5e_rss_params_traffic_type 12mlx5e_rss_get_default_tt_config(enum mlx5_traffic_types tt); 13 14struct mlx5e_rss; 15 16struct mlx5e_rss *mlx5e_rss_alloc(void); 17void mlx5e_rss_free(struct mlx5e_rss *rss); 18int mlx5e_rss_init(struct mlx5e_rss *rss, struct mlx5_core_dev *mdev, 19 bool inner_ft_support, u32 drop_rqn, 20 const struct mlx5e_packet_merge_param *init_pkt_merge_param); 21int mlx5e_rss_init_no_tirs(struct mlx5e_rss *rss, struct mlx5_core_dev *mdev, 22 bool inner_ft_support, u32 drop_rqn); 23int mlx5e_rss_cleanup(struct mlx5e_rss *rss); 24 25void mlx5e_rss_refcnt_inc(struct mlx5e_rss *rss); 26void mlx5e_rss_refcnt_dec(struct mlx5e_rss *rss); 27unsigned int mlx5e_rss_refcnt_read(struct mlx5e_rss *rss); 28 29u32 mlx5e_rss_get_tirn(struct mlx5e_rss *rss, enum mlx5_traffic_types tt, 30 bool inner); 31int mlx5e_rss_obtain_tirn(struct mlx5e_rss *rss, 32 enum mlx5_traffic_types tt, 33 const struct mlx5e_packet_merge_param *init_pkt_merge_param, 34 bool inner, u32 *tirn); 35 36void mlx5e_rss_enable(struct mlx5e_rss *rss, u32 *rqns, unsigned int num_rqns); 37void mlx5e_rss_disable(struct mlx5e_rss *rss); 38 39int mlx5e_rss_packet_merge_set_param(struct mlx5e_rss *rss, 40 struct mlx5e_packet_merge_param *pkt_merge_param); 41int mlx5e_rss_get_rxfh(struct mlx5e_rss *rss, u32 *indir, u8 *key, u8 *hfunc); 42int mlx5e_rss_set_rxfh(struct mlx5e_rss *rss, const u32 *indir, 43 const u8 *key, const u8 *hfunc, 44 u32 *rqns, unsigned int num_rqns); 45struct mlx5e_rss_params_hash mlx5e_rss_get_hash(struct mlx5e_rss *rss); 46u8 mlx5e_rss_get_hash_fields(struct mlx5e_rss *rss, enum mlx5_traffic_types tt); 47int mlx5e_rss_set_hash_fields(struct mlx5e_rss *rss, enum mlx5_traffic_types tt, 48 u8 rx_hash_fields); 49void mlx5e_rss_set_indir_uniform(struct mlx5e_rss *rss, unsigned int nch); 50#endif /* __MLX5_EN_RSS_H__ */