linux/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c

// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/* Copyright (C) 2017-2018 Netronome Systems, Inc. */

#include <linux/etherdevice.h>
#include <linux/inetdevice.h>
#include <net/netevent.h>
#include <linux/idr.h>
#include <net/dst_metadata.h>
#include <net/arp.h>

#include "cmsg.h"
#include "main.h"
#include "../nfp_net_repr.h"
#include "../nfp_net.h"

#define NFP_FL_MAX_ROUTES

#define NFP_TUN_PRE_TUN_RULE_LIMIT
#define NFP_TUN_PRE_TUN_RULE_DEL
#define NFP_TUN_PRE_TUN_IDX_BIT
#define NFP_TUN_PRE_TUN_IPV6_BIT

/**
 * struct nfp_tun_pre_tun_rule - rule matched before decap
 * @flags:		options for the rule offset
 * @port_idx:		index of destination MAC address for the rule
 * @vlan_tci:		VLAN info associated with MAC
 * @host_ctx_id:	stats context of rule to update
 */
struct nfp_tun_pre_tun_rule {};

/**
 * struct nfp_tun_active_tuns - periodic message of active tunnels
 * @seq:		sequence number of the message
 * @count:		number of tunnels report in message
 * @flags:		options part of the request
 * @tun_info.ipv4:		dest IPv4 address of active route
 * @tun_info.egress_port:	port the encapsulated packet egressed
 * @tun_info.extra:		reserved for future use
 * @tun_info:		tunnels that have sent traffic in reported period
 */
struct nfp_tun_active_tuns {};

/**
 * struct nfp_tun_active_tuns_v6 - periodic message of active IPv6 tunnels
 * @seq:		sequence number of the message
 * @count:		number of tunnels report in message
 * @flags:		options part of the request
 * @tun_info.ipv6:		dest IPv6 address of active route
 * @tun_info.egress_port:	port the encapsulated packet egressed
 * @tun_info.extra:		reserved for future use
 * @tun_info:		tunnels that have sent traffic in reported period
 */
struct nfp_tun_active_tuns_v6 {};

/**
 * struct nfp_tun_req_route_ipv4 - NFP requests a route/neighbour lookup
 * @ingress_port:	ingress port of packet that signalled request
 * @ipv4_addr:		destination ipv4 address for route
 * @reserved:		reserved for future use
 */
struct nfp_tun_req_route_ipv4 {};

/**
 * struct nfp_tun_req_route_ipv6 - NFP requests an IPv6 route/neighbour lookup
 * @ingress_port:	ingress port of packet that signalled request
 * @ipv6_addr:		destination ipv6 address for route
 */
struct nfp_tun_req_route_ipv6 {};

/**
 * struct nfp_offloaded_route - routes that are offloaded to the NFP
 * @list:	list pointer
 * @ip_add:	destination of route - can be IPv4 or IPv6
 */
struct nfp_offloaded_route {};

#define NFP_FL_IPV4_ADDRS_MAX

/**
 * struct nfp_tun_ipv4_addr - set the IP address list on the NFP
 * @count:	number of IPs populated in the array
 * @ipv4_addr:	array of IPV4_ADDRS_MAX 32 bit IPv4 addresses
 */
struct nfp_tun_ipv4_addr {};

/**
 * struct nfp_ipv4_addr_entry - cached IPv4 addresses
 * @ipv4_addr:	IP address
 * @ref_count:	number of rules currently using this IP
 * @list:	list pointer
 */
struct nfp_ipv4_addr_entry {};

#define NFP_FL_IPV6_ADDRS_MAX

/**
 * struct nfp_tun_ipv6_addr - set the IP address list on the NFP
 * @count:	number of IPs populated in the array
 * @ipv6_addr:	array of IPV6_ADDRS_MAX 128 bit IPv6 addresses
 */
struct nfp_tun_ipv6_addr {};

#define NFP_TUN_MAC_OFFLOAD_DEL_FLAG

/**
 * struct nfp_tun_mac_addr_offload - configure MAC address of tunnel EP on NFP
 * @flags:	MAC address offload options
 * @count:	number of MAC addresses in the message (should be 1)
 * @index:	index of MAC address in the lookup table
 * @addr:	interface MAC address
 */
struct nfp_tun_mac_addr_offload {};

/**
 * struct nfp_neigh_update_work - update neighbour information to nfp
 * @work:	Work queue for writing neigh to the nfp
 * @n:		neighbour entry
 * @app:	Back pointer to app
 */
struct nfp_neigh_update_work {};

enum nfp_flower_mac_offload_cmd {};

#define NFP_MAX_MAC_INDEX

/**
 * struct nfp_tun_offloaded_mac - hashtable entry for an offloaded MAC
 * @ht_node:		Hashtable entry
 * @addr:		Offloaded MAC address
 * @index:		Offloaded index for given MAC address
 * @ref_count:		Number of devs using this MAC address
 * @repr_list:		List of reprs sharing this MAC address
 * @bridge_count:	Number of bridge/internal devs with MAC
 */
struct nfp_tun_offloaded_mac {};

static const struct rhashtable_params offloaded_macs_params =;

void nfp_tunnel_keep_alive(struct nfp_app *app, struct sk_buff *skb)
{}

void nfp_tunnel_keep_alive_v6(struct nfp_app *app, struct sk_buff *skb)
{}

static int
nfp_flower_xmit_tun_conf(struct nfp_app *app, u8 mtype, u16 plen, void *pdata,
			 gfp_t flag)
{}

static void
nfp_tun_mutual_link(struct nfp_predt_entry *predt,
		    struct nfp_neigh_entry *neigh)
{}

static void
nfp_tun_link_predt_entries(struct nfp_app *app,
			   struct nfp_neigh_entry *nn_entry)
{}

void nfp_tun_link_and_update_nn_entries(struct nfp_app *app,
					struct nfp_predt_entry *predt)
{}

static void nfp_tun_cleanup_nn_entries(struct nfp_app *app)
{}

void nfp_tun_unlink_and_update_nn_entries(struct nfp_app *app,
					  struct nfp_predt_entry *predt)
{}

static void
nfp_tun_write_neigh(struct net_device *netdev, struct nfp_app *app,
		    void *flow, struct neighbour *neigh, bool is_ipv6,
		    bool override)
{}

static void
nfp_tun_release_neigh_update_work(struct nfp_neigh_update_work *update_work)
{}

static void nfp_tun_neigh_update(struct work_struct *work)
{}

static struct nfp_neigh_update_work *
nfp_tun_alloc_neigh_update_work(struct nfp_app *app, struct neighbour *n)
{}

static int
nfp_tun_neigh_event_handler(struct notifier_block *nb, unsigned long event,
			    void *ptr)
{}

void nfp_tunnel_request_route_v4(struct nfp_app *app, struct sk_buff *skb)
{}

void nfp_tunnel_request_route_v6(struct nfp_app *app, struct sk_buff *skb)
{}

static void nfp_tun_write_ipv4_list(struct nfp_app *app)
{}

void nfp_tunnel_add_ipv4_off(struct nfp_app *app, __be32 ipv4)
{}

void nfp_tunnel_del_ipv4_off(struct nfp_app *app, __be32 ipv4)
{}

static void nfp_tun_write_ipv6_list(struct nfp_app *app)
{}

struct nfp_ipv6_addr_entry *
nfp_tunnel_add_ipv6_off(struct nfp_app *app, struct in6_addr *ipv6)
{}

void
nfp_tunnel_put_ipv6_off(struct nfp_app *app, struct nfp_ipv6_addr_entry *entry)
{}

static int
__nfp_tunnel_offload_mac(struct nfp_app *app, const u8 *mac, u16 idx, bool del)
{}

static bool nfp_tunnel_port_is_phy_repr(int port)
{}

static u16 nfp_tunnel_get_mac_idx_from_phy_port_id(int port)
{}

static u16 nfp_tunnel_get_global_mac_idx_from_ida(int id)
{}

static int nfp_tunnel_get_ida_from_global_mac_idx(u16 nfp_mac_idx)
{}

static bool nfp_tunnel_is_mac_idx_global(u16 nfp_mac_idx)
{}

static struct nfp_tun_offloaded_mac *
nfp_tunnel_lookup_offloaded_macs(struct nfp_app *app, const u8 *mac)
{}

static void
nfp_tunnel_offloaded_macs_inc_ref_and_link(struct nfp_tun_offloaded_mac *entry,
					   struct net_device *netdev, bool mod)
{}

static int
nfp_tunnel_add_shared_mac(struct nfp_app *app, struct net_device *netdev,
			  int port, bool mod)
{}

static int
nfp_tunnel_del_shared_mac(struct nfp_app *app, struct net_device *netdev,
			  const u8 *mac, bool mod)
{}

static int
nfp_tunnel_offload_mac(struct nfp_app *app, struct net_device *netdev,
		       enum nfp_flower_mac_offload_cmd cmd)
{}

int nfp_tunnel_mac_event_handler(struct nfp_app *app,
				 struct net_device *netdev,
				 unsigned long event, void *ptr)
{}

int nfp_flower_xmit_pre_tun_flow(struct nfp_app *app,
				 struct nfp_fl_payload *flow)
{}

int nfp_flower_xmit_pre_tun_del_flow(struct nfp_app *app,
				     struct nfp_fl_payload *flow)
{}

int nfp_tunnel_config_start(struct nfp_app *app)
{}

void nfp_tunnel_config_stop(struct nfp_app *app)
{}