FILE
rx_res.h
File preview with syntax highlighting.
linux-6.19.14/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.h
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_RX_RES_H__ 5#define __MLX5_EN_RX_RES_H__ 6 7#include <linux/kernel.h> 8#include "rqt.h" 9#include "tir.h" 10#include "fs.h" 11#include "rss.h" 12 13#define MLX5E_MAX_NUM_RSS 16 14 15struct mlx5e_rx_res; 16 17struct mlx5e_channels; 18struct mlx5e_rss_params_hash; 19 20enum mlx5e_rx_res_features { 21 MLX5E_RX_RES_FEATURE_INNER_FT = BIT(0), 22 MLX5E_RX_RES_FEATURE_PTP = BIT(1), 23 MLX5E_RX_RES_FEATURE_MULTI_VHCA = BIT(2), 24 MLX5E_RX_RES_FEATURE_SELF_LB_BLOCK = BIT(3), 25}; 26 27/* Setup */ 28struct mlx5e_rx_res * 29mlx5e_rx_res_create(struct mlx5_core_dev *mdev, enum mlx5e_rx_res_features features, 30 unsigned int max_nch, u32 drop_rqn, 31 const struct mlx5e_packet_merge_param *pkt_merge_param, 32 unsigned int init_nch); 33void mlx5e_rx_res_destroy(struct mlx5e_rx_res *res); 34 35/* TIRN getters for flow steering */ 36u32 mlx5e_rx_res_get_tirn_direct(struct mlx5e_rx_res *res, unsigned int ix); 37u32 mlx5e_rx_res_get_tirn_rss(struct mlx5e_rx_res *res, enum mlx5_traffic_types tt); 38u32 mlx5e_rx_res_get_tirn_rss_inner(struct mlx5e_rx_res *res, enum mlx5_traffic_types tt); 39u32 mlx5e_rx_res_get_tirn_ptp(struct mlx5e_rx_res *res); 40u32 mlx5e_rx_res_get_rqtn_direct(struct mlx5e_rx_res *res, unsigned int ix); 41unsigned int mlx5e_rx_res_get_max_nch(struct mlx5e_rx_res *res); 42bool mlx5_rx_res_rss_inner_ft_support(struct mlx5e_rx_res *res); 43 44/* Activate/deactivate API */ 45void mlx5e_rx_res_channels_activate(struct mlx5e_rx_res *res, struct mlx5e_channels *chs); 46void mlx5e_rx_res_channels_deactivate(struct mlx5e_rx_res *res); 47void mlx5e_rx_res_xsk_update(struct mlx5e_rx_res *res, struct mlx5e_channels *chs, 48 unsigned int ix, bool xsk); 49 50/* Configuration API */ 51void mlx5e_rx_res_rss_set_indir_uniform(struct mlx5e_rx_res *res, unsigned int nch); 52void mlx5e_rx_res_rss_get_rxfh(struct mlx5e_rx_res *res, u32 rss_idx, 53 u32 *indir, u8 *key, u8 *hfunc, 54 bool *symmetric); 55int mlx5e_rx_res_rss_set_rxfh(struct mlx5e_rx_res *res, u32 rss_idx, 56 const u32 *indir, const u8 *key, const u8 *hfunc, 57 const bool *symmetric); 58 59int mlx5e_rx_res_rss_get_hash_fields(struct mlx5e_rx_res *res, u32 rss_idx, 60 enum mlx5_traffic_types tt); 61int mlx5e_rx_res_rss_set_hash_fields(struct mlx5e_rx_res *res, u32 rss_idx, 62 enum mlx5_traffic_types tt, u8 rx_hash_fields); 63int mlx5e_rx_res_packet_merge_set_param(struct mlx5e_rx_res *res, 64 struct mlx5e_packet_merge_param *pkt_merge_param); 65 66int mlx5e_rx_res_rss_init(struct mlx5e_rx_res *res, u32 rss_idx, unsigned int init_nch); 67int mlx5e_rx_res_rss_destroy(struct mlx5e_rx_res *res, u32 rss_idx); 68int mlx5e_rx_res_rss_cnt(struct mlx5e_rx_res *res); 69int mlx5e_rx_res_rss_index(struct mlx5e_rx_res *res, struct mlx5e_rss *rss); 70struct mlx5e_rss *mlx5e_rx_res_rss_get(struct mlx5e_rx_res *res, u32 rss_idx); 71void mlx5e_rx_res_rss_update_num_channels(struct mlx5e_rx_res *res, u32 nch); 72 73/* Workaround for hairpin */ 74struct mlx5e_rss_params_hash mlx5e_rx_res_get_current_hash(struct mlx5e_rx_res *res); 75 76/* Accel TIRs */ 77int mlx5e_rx_res_tls_tir_create(struct mlx5e_rx_res *res, unsigned int rxq, 78 struct mlx5e_tir *tir); 79#endif /* __MLX5_EN_RX_RES_H__ */
~/
Read-only file preview.