#include <linux/mlx5/fs.h>
#include "en.h"
#include "en/params.h"
#include "en/xsk/pool.h"
#include "en/fs_ethtool.h"
struct mlx5e_ethtool_table { … };
#define ETHTOOL_NUM_L3_L4_FTS …
#define ETHTOOL_NUM_L2_FTS …
struct mlx5e_ethtool_steering { … };
static int flow_type_to_traffic_type(u32 flow_type);
static u32 flow_type_mask(u32 flow_type)
{ … }
struct mlx5e_ethtool_rule { … };
static void put_flow_table(struct mlx5e_ethtool_table *eth_ft)
{ … }
#define MLX5E_ETHTOOL_L3_L4_PRIO …
#define MLX5E_ETHTOOL_L2_PRIO …
#define MLX5E_ETHTOOL_NUM_ENTRIES …
#define MLX5E_ETHTOOL_NUM_GROUPS …
static struct mlx5e_ethtool_table *get_flow_table(struct mlx5e_priv *priv,
struct ethtool_rx_flow_spec *fs,
int num_tuples)
{ … }
static void mask_spec(u8 *mask, u8 *val, size_t size)
{ … }
#define MLX5E_FTE_SET(header_p, fld, v) …
#define MLX5E_FTE_ADDR_OF(header_p, fld) …
static void
set_ip4(void *headers_c, void *headers_v, __be32 ip4src_m,
__be32 ip4src_v, __be32 ip4dst_m, __be32 ip4dst_v)
{ … }
static void
set_ip6(void *headers_c, void *headers_v, __be32 ip6src_m[4],
__be32 ip6src_v[4], __be32 ip6dst_m[4], __be32 ip6dst_v[4])
{ … }
static void
set_tcp(void *headers_c, void *headers_v, __be16 psrc_m, __be16 psrc_v,
__be16 pdst_m, __be16 pdst_v)
{ … }
static void
set_udp(void *headers_c, void *headers_v, __be16 psrc_m, __be16 psrc_v,
__be16 pdst_m, __be16 pdst_v)
{ … }
static void
parse_tcp4(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs)
{ … }
static void
parse_udp4(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs)
{ … }
static void
parse_ip4(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs)
{ … }
static void
parse_ip6(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs)
{ … }
static void
parse_tcp6(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs)
{ … }
static void
parse_udp6(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs)
{ … }
static void
parse_ether(void *headers_c, void *headers_v, struct ethtool_rx_flow_spec *fs)
{ … }
static void
set_cvlan(void *headers_c, void *headers_v, __be16 vlan_tci)
{ … }
static void
set_dmac(void *headers_c, void *headers_v,
unsigned char m_dest[ETH_ALEN], unsigned char v_dest[ETH_ALEN])
{ … }
static int set_flow_attrs(u32 *match_c, u32 *match_v,
struct ethtool_rx_flow_spec *fs)
{ … }
static void add_rule_to_list(struct mlx5e_priv *priv,
struct mlx5e_ethtool_rule *rule)
{ … }
static bool outer_header_zero(u32 *match_criteria)
{ … }
static int flow_get_tirn(struct mlx5e_priv *priv,
struct mlx5e_ethtool_rule *eth_rule,
struct ethtool_rx_flow_spec *fs,
u32 rss_context, u32 *tirn)
{ … }
static struct mlx5_flow_handle *
add_ethtool_flow_rule(struct mlx5e_priv *priv,
struct mlx5e_ethtool_rule *eth_rule,
struct mlx5_flow_table *ft,
struct ethtool_rx_flow_spec *fs, u32 rss_context)
{ … }
static void del_ethtool_rule(struct mlx5e_flow_steering *fs,
struct mlx5e_ethtool_rule *eth_rule)
{ … }
static struct mlx5e_ethtool_rule *find_ethtool_rule(struct mlx5e_priv *priv,
int location)
{ … }
static struct mlx5e_ethtool_rule *get_ethtool_rule(struct mlx5e_priv *priv,
int location)
{ … }
#define MAX_NUM_OF_ETHTOOL_RULES …
#define all_ones(field) …
#define all_zeros_or_all_ones(field) …
static int validate_ethter(struct ethtool_rx_flow_spec *fs)
{ … }
static int validate_tcpudp4(struct ethtool_rx_flow_spec *fs)
{ … }
static int validate_ip4(struct ethtool_rx_flow_spec *fs)
{ … }
static int validate_ip6(struct ethtool_rx_flow_spec *fs)
{ … }
static int validate_tcpudp6(struct ethtool_rx_flow_spec *fs)
{ … }
static int validate_vlan(struct ethtool_rx_flow_spec *fs)
{ … }
static int validate_flow(struct mlx5e_priv *priv,
struct ethtool_rx_flow_spec *fs)
{ … }
static int
mlx5e_ethtool_flow_replace(struct mlx5e_priv *priv,
struct ethtool_rx_flow_spec *fs, u32 rss_context)
{ … }
static int
mlx5e_ethtool_flow_remove(struct mlx5e_priv *priv, int location)
{ … }
static int
mlx5e_ethtool_get_flow(struct mlx5e_priv *priv,
struct ethtool_rxnfc *info, int location)
{ … }
static int
mlx5e_ethtool_get_all_flows(struct mlx5e_priv *priv,
struct ethtool_rxnfc *info, u32 *rule_locs)
{ … }
int mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering **ethtool)
{ … }
void mlx5e_ethtool_free(struct mlx5e_ethtool_steering *ethtool)
{ … }
void mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering *fs)
{ … }
void mlx5e_ethtool_init_steering(struct mlx5e_flow_steering *fs)
{ … }
static int flow_type_to_traffic_type(u32 flow_type)
{ … }
static int mlx5e_set_rss_hash_opt(struct mlx5e_priv *priv,
struct ethtool_rxnfc *nfc)
{ … }
static int mlx5e_get_rss_hash_opt(struct mlx5e_priv *priv,
struct ethtool_rxnfc *nfc)
{ … }
int mlx5e_ethtool_set_rxnfc(struct mlx5e_priv *priv, struct ethtool_rxnfc *cmd)
{ … }
int mlx5e_ethtool_get_rxnfc(struct mlx5e_priv *priv,
struct ethtool_rxnfc *info, u32 *rule_locs)
{ … }