linux/drivers/net/ethernet/qlogic/qede/qede_filter.c

// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
/* QLogic qede NIC Driver
 * Copyright (c) 2015-2017  QLogic Corporation
 * Copyright (c) 2019-2020 Marvell International Ltd.
 */

#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <net/udp_tunnel.h>
#include <linux/bitops.h>
#include <linux/vmalloc.h>

#include <linux/qed/qed_if.h>
#include "qede.h"

#define QEDE_FILTER_PRINT_MAX_LEN
struct qede_arfs_tuple {};

struct qede_arfs_fltr_node {};

struct qede_arfs {};

static void qede_configure_arfs_fltr(struct qede_dev *edev,
				     struct qede_arfs_fltr_node *n,
				     u16 rxq_id, bool add_fltr)
{}

static void
qede_free_arfs_filter(struct qede_dev *edev,  struct qede_arfs_fltr_node *fltr)
{}

static int
qede_enqueue_fltr_and_config_searcher(struct qede_dev *edev,
				      struct qede_arfs_fltr_node *fltr,
				      u16 bucket_idx)
{}

static void
qede_dequeue_fltr_and_config_searcher(struct qede_dev *edev,
				      struct qede_arfs_fltr_node *fltr)
{}

void qede_arfs_filter_op(void *dev, void *filter, u8 fw_rc)
{}

/* Should be called while qede_lock is held */
void qede_process_arfs_filters(struct qede_dev *edev, bool free_fltr)
{}

/* This function waits until all aRFS filters get deleted and freed.
 * On timeout it frees all filters forcefully.
 */
void qede_poll_for_freeing_arfs_filters(struct qede_dev *edev)
{}

int qede_alloc_arfs(struct qede_dev *edev)
{}

void qede_free_arfs(struct qede_dev *edev)
{}

#ifdef CONFIG_RFS_ACCEL
static bool qede_compare_ip_addr(struct qede_arfs_fltr_node *tpos,
				 const struct sk_buff *skb)
{}

static struct qede_arfs_fltr_node *
qede_arfs_htbl_key_search(struct hlist_head *h, const struct sk_buff *skb,
			  __be16 src_port, __be16 dst_port, u8 ip_proto)
{}

static struct qede_arfs_fltr_node *
qede_alloc_filter(struct qede_dev *edev, int min_hlen)
{}

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

void qede_udp_ports_update(void *dev, u16 vxlan_port, u16 geneve_port)
{}

void qede_force_mac(void *dev, u8 *mac, bool forced)
{}

void qede_fill_rss_params(struct qede_dev *edev,
			  struct qed_update_vport_rss_params *rss, u8 *update)
{}

static int qede_set_ucast_rx_mac(struct qede_dev *edev,
				 enum qed_filter_xcast_params_type opcode,
				 const unsigned char mac[ETH_ALEN])
{}

static int qede_set_ucast_rx_vlan(struct qede_dev *edev,
				  enum qed_filter_xcast_params_type opcode,
				  u16 vid)
{}

static int qede_config_accept_any_vlan(struct qede_dev *edev, bool action)
{}

int qede_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
{}

static void qede_del_vlan_from_list(struct qede_dev *edev,
				    struct qede_vlan *vlan)
{}

int qede_configure_vlan_filters(struct qede_dev *edev)
{}

int qede_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
{}

void qede_vlan_mark_nonconfigured(struct qede_dev *edev)
{}

static void qede_set_features_reload(struct qede_dev *edev,
				     struct qede_reload_args *args)
{}

netdev_features_t qede_fix_features(struct net_device *dev,
				    netdev_features_t features)
{}

int qede_set_features(struct net_device *dev, netdev_features_t features)
{}

static int qede_udp_tunnel_sync(struct net_device *dev, unsigned int table)
{}

static const struct udp_tunnel_nic_info qede_udp_tunnels_both =, qede_udp_tunnels_vxlan =, qede_udp_tunnels_geneve =;

void qede_set_udp_tunnels(struct qede_dev *edev)
{}

static void qede_xdp_reload_func(struct qede_dev *edev,
				 struct qede_reload_args *args)
{}

static int qede_xdp_set(struct qede_dev *edev, struct bpf_prog *prog)
{}

int qede_xdp(struct net_device *dev, struct netdev_bpf *xdp)
{}

static int qede_set_mcast_rx_mac(struct qede_dev *edev,
				 enum qed_filter_xcast_params_type opcode,
				 unsigned char *mac, int num_macs)
{}

int qede_set_mac_addr(struct net_device *ndev, void *p)
{}

static int
qede_configure_mcast_filtering(struct net_device *ndev,
			       enum qed_filter_rx_mode_type *accept_flags)
{}

void qede_set_rx_mode(struct net_device *ndev)
{}

/* Must be called with qede_lock held */
void qede_config_rx_mode(struct net_device *ndev)
{}

static struct qede_arfs_fltr_node *
qede_get_arfs_fltr_by_loc(struct hlist_head *head, u64 location)
{}

int qede_get_cls_rule_all(struct qede_dev *edev, struct ethtool_rxnfc *info,
			  u32 *rule_locs)
{}

int qede_get_cls_rule_entry(struct qede_dev *edev, struct ethtool_rxnfc *cmd)
{}

static int
qede_poll_arfs_filter_config(struct qede_dev *edev,
			     struct qede_arfs_fltr_node *fltr)
{}

static int qede_flow_get_min_header_size(struct qede_arfs_tuple *t)
{}

static bool qede_flow_spec_ipv4_cmp(struct qede_arfs_tuple *a,
				    struct qede_arfs_tuple *b)
{}

static void qede_flow_build_ipv4_hdr(struct qede_arfs_tuple *t,
				     void *header)
{}

static void qede_flow_stringify_ipv4_hdr(struct qede_arfs_tuple *t,
					 void *buffer)
{}

static bool qede_flow_spec_ipv6_cmp(struct qede_arfs_tuple *a,
				    struct qede_arfs_tuple *b)
{}

static void qede_flow_build_ipv6_hdr(struct qede_arfs_tuple *t,
				     void *header)
{}

/* Validate fields which are set and not accepted by the driver */
static int qede_flow_spec_validate_unused(struct qede_dev *edev,
					  struct ethtool_rx_flow_spec *fs)
{}

static int qede_set_v4_tuple_to_profile(struct qede_arfs_tuple *t,
					struct netlink_ext_ack *extack)
{}

static int qede_set_v6_tuple_to_profile(struct qede_arfs_tuple *t,
					struct in6_addr *zaddr,
					struct netlink_ext_ack *extack)
{}

/* Must be called while qede lock is held */
static struct qede_arfs_fltr_node *
qede_flow_find_fltr(struct qede_dev *edev, struct qede_arfs_tuple *t)
{}

static void qede_flow_set_destination(struct qede_dev *edev,
				      struct qede_arfs_fltr_node *n,
				      struct ethtool_rx_flow_spec *fs)
{}

int qede_delete_flow_filter(struct qede_dev *edev, u64 cookie)
{}

int qede_get_arfs_filter_count(struct qede_dev *edev)
{}

static int qede_parse_actions(struct qede_dev *edev,
			      struct flow_action *flow_action,
			      struct netlink_ext_ack *extack)
{}

static int
qede_flow_parse_ports(struct flow_rule *rule, struct qede_arfs_tuple *t,
		      struct netlink_ext_ack *extack)
{}

static int
qede_flow_parse_v6_common(struct flow_rule *rule,
			  struct qede_arfs_tuple *t,
			  struct netlink_ext_ack *extack)
{}

static int
qede_flow_parse_v4_common(struct flow_rule *rule,
			  struct qede_arfs_tuple *t,
			  struct netlink_ext_ack *extack)
{}

static int
qede_flow_parse_tcp_v6(struct flow_rule *rule, struct qede_arfs_tuple *tuple,
		       struct netlink_ext_ack *extack)
{}

static int
qede_flow_parse_tcp_v4(struct flow_rule *rule, struct qede_arfs_tuple *tuple,
		       struct netlink_ext_ack *extack)
{}

static int
qede_flow_parse_udp_v6(struct flow_rule *rule, struct qede_arfs_tuple *tuple,
		       struct netlink_ext_ack *extack)
{}

static int
qede_flow_parse_udp_v4(struct flow_rule *rule, struct qede_arfs_tuple *tuple,
		       struct netlink_ext_ack *extack)
{}

static int
qede_parse_flow_attr(__be16 proto, struct flow_rule *rule,
		     struct qede_arfs_tuple *tuple,
		     struct netlink_ext_ack *extack)
{}

int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
			    struct flow_cls_offload *f)
{}

static int qede_flow_spec_validate(struct qede_dev *edev,
				   struct flow_action *flow_action,
				   struct qede_arfs_tuple *t,
				   __u32 location,
				   struct netlink_ext_ack *extack)
{}

static int qede_flow_spec_to_rule(struct qede_dev *edev,
				  struct qede_arfs_tuple *t,
				  struct ethtool_rx_flow_spec *fs)
{}

int qede_add_cls_rule(struct qede_dev *edev, struct ethtool_rxnfc *info)
{}