linux/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c

/*
 * Copyright (c) 2016, Mellanox Technologies. All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#include <linux/hash.h>
#include <linux/mlx5/fs.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <net/rps.h>
#include "en.h"

#define ARFS_HASH_SHIFT
#define ARFS_HASH_SIZE

struct arfs_table {};

enum {};

enum arfs_type {};

struct mlx5e_arfs_tables {};

struct arfs_tuple {};

struct arfs_rule {};

#define mlx5e_for_each_arfs_rule(hn, tmp, arfs_tables, i, j)

#define mlx5e_for_each_hash_arfs_rule(hn, tmp, hash, j)

static enum mlx5_traffic_types arfs_get_tt(enum arfs_type type)
{}

static int arfs_disable(struct mlx5e_flow_steering *fs)
{}

static void arfs_del_rules(struct mlx5e_flow_steering *fs);

int mlx5e_arfs_disable(struct mlx5e_flow_steering *fs)
{}

int mlx5e_arfs_enable(struct mlx5e_flow_steering *fs)
{}

static void arfs_destroy_table(struct arfs_table *arfs_t)
{}

static void _mlx5e_cleanup_tables(struct mlx5e_flow_steering *fs)
{}

void mlx5e_arfs_destroy_tables(struct mlx5e_flow_steering *fs, bool ntuple)
{}

static int arfs_add_default_rule(struct mlx5e_flow_steering *fs,
				 struct mlx5e_rx_res *rx_res,
				 enum arfs_type type)
{}

#define MLX5E_ARFS_NUM_GROUPS
#define MLX5E_ARFS_GROUP1_SIZE
#define MLX5E_ARFS_GROUP2_SIZE
#define MLX5E_ARFS_TABLE_SIZE
static int arfs_create_groups(struct mlx5e_flow_table *ft,
			      enum  arfs_type type)
{}

static int arfs_create_table(struct mlx5e_flow_steering *fs,
			     struct mlx5e_rx_res *rx_res,
			     enum arfs_type type)
{}

int mlx5e_arfs_create_tables(struct mlx5e_flow_steering *fs,
			     struct mlx5e_rx_res *rx_res, bool ntuple)
{}

#define MLX5E_ARFS_EXPIRY_QUOTA

static void arfs_may_expire_flow(struct mlx5e_priv *priv)
{}

static void arfs_del_rules(struct mlx5e_flow_steering *fs)
{}

static struct hlist_head *
arfs_hash_bucket(struct arfs_table *arfs_t, __be16 src_port,
		 __be16 dst_port)
{}

static struct arfs_table *arfs_get_table(struct mlx5e_arfs_tables *arfs,
					 u8 ip_proto, __be16 etype)
{}

static struct mlx5_flow_handle *arfs_add_rule(struct mlx5e_priv *priv,
					      struct arfs_rule *arfs_rule)
{}

static void arfs_modify_rule_rq(struct mlx5e_priv *priv,
				struct mlx5_flow_handle *rule, u16 rxq)
{}

static void arfs_handle_work(struct work_struct *work)
{}

static struct arfs_rule *arfs_alloc_rule(struct mlx5e_priv *priv,
					 struct arfs_table *arfs_t,
					 const struct flow_keys *fk,
					 u16 rxq, u32 flow_id)
{}

static bool arfs_cmp(const struct arfs_tuple *tuple, const struct flow_keys *fk)
{}

static struct arfs_rule *arfs_find_rule(struct arfs_table *arfs_t,
					const struct flow_keys *fk)
{}

int mlx5e_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
			u16 rxq_index, u32 flow_id)
{}