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

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

#include <linux/bitfield.h>
#include <linux/mpls.h>
#include <net/pkt_cls.h>
#include <net/tc_act/tc_csum.h>
#include <net/tc_act/tc_gact.h>
#include <net/tc_act/tc_mirred.h>
#include <net/tc_act/tc_mpls.h>
#include <net/tc_act/tc_pedit.h>
#include <net/tc_act/tc_vlan.h>
#include <net/tc_act/tc_tunnel_key.h>

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

/* The kernel versions of TUNNEL_* are not ABI and therefore vulnerable
 * to change. Such changes will break our FW ABI.
 */
#define NFP_FL_TUNNEL_CSUM
#define NFP_FL_TUNNEL_KEY
#define NFP_FL_TUNNEL_GENEVE_OPT
#define NFP_FL_SUPPORTED_TUNNEL_INFO_FLAGS
#define NFP_FL_SUPPORTED_UDP_TUN_FLAGS

static int
nfp_fl_push_mpls(struct nfp_fl_push_mpls *push_mpls,
		 const struct flow_action_entry *act,
		 struct netlink_ext_ack *extack)
{}

static void
nfp_fl_pop_mpls(struct nfp_fl_pop_mpls *pop_mpls,
		const struct flow_action_entry *act)
{}

static void
nfp_fl_set_mpls(struct nfp_fl_set_mpls *set_mpls,
		const struct flow_action_entry *act)
{}

static void nfp_fl_pop_vlan(struct nfp_fl_pop_vlan *pop_vlan)
{}

static void
nfp_fl_push_vlan(struct nfp_fl_push_vlan *push_vlan,
		 const struct flow_action_entry *act)
{}

static int
nfp_fl_pre_lag(struct nfp_app *app, const struct flow_action_entry *act,
	       struct nfp_fl_payload *nfp_flow, int act_len,
	       struct netlink_ext_ack *extack)
{}

static int
nfp_fl_output(struct nfp_app *app, struct nfp_fl_output *output,
	      const struct flow_action_entry *act,
	      struct nfp_fl_payload *nfp_flow,
	      bool last, struct net_device *in_dev,
	      enum nfp_flower_tun_type tun_type, int *tun_out_cnt,
	      bool pkt_host, struct netlink_ext_ack *extack)
{}

static bool
nfp_flower_tun_is_gre(struct flow_rule *rule, int start_idx)
{}

static enum nfp_flower_tun_type
nfp_fl_get_tun_from_act(struct nfp_app *app,
			struct flow_rule *rule,
			const struct flow_action_entry *act, int act_idx)
{}

static struct nfp_fl_pre_tunnel *nfp_fl_pre_tunnel(char *act_data, int act_len)
{}

static int
nfp_fl_push_geneve_options(struct nfp_fl_payload *nfp_fl, int *list_len,
			   const struct flow_action_entry *act,
			   struct netlink_ext_ack *extack)
{}

#define NFP_FL_CHECK(flag)

static int
nfp_fl_set_tun(struct nfp_app *app, struct nfp_fl_set_tun *set_tun,
	       const struct flow_action_entry *act,
	       struct nfp_fl_pre_tunnel *pre_tun,
	       enum nfp_flower_tun_type tun_type,
	       struct net_device *netdev, struct netlink_ext_ack *extack)
{}

static void nfp_fl_set_helper32(u32 value, u32 mask, u8 *p_exact, u8 *p_mask)
{}

static int
nfp_fl_set_eth(const struct flow_action_entry *act, u32 off,
	       struct nfp_fl_set_eth *set_eth, struct netlink_ext_ack *extack)
{}

struct ipv4_ttl_word {};

static int
nfp_fl_set_ip4(const struct flow_action_entry *act, u32 off,
	       struct nfp_fl_set_ip4_addrs *set_ip_addr,
	       struct nfp_fl_set_ip4_ttl_tos *set_ip_ttl_tos,
	       struct netlink_ext_ack *extack)
{}

static void
nfp_fl_set_ip6_helper(int opcode_tag, u8 word, __be32 exact, __be32 mask,
		      struct nfp_fl_set_ipv6_addr *ip6)
{}

struct ipv6_hop_limit_word {};

static int
nfp_fl_set_ip6_hop_limit_flow_label(u32 off, __be32 exact, __be32 mask,
				    struct nfp_fl_set_ipv6_tc_hl_fl *ip_hl_fl,
				    struct netlink_ext_ack *extack)
{}

static int
nfp_fl_set_ip6(const struct flow_action_entry *act, u32 off,
	       struct nfp_fl_set_ipv6_addr *ip_dst,
	       struct nfp_fl_set_ipv6_addr *ip_src,
	       struct nfp_fl_set_ipv6_tc_hl_fl *ip_hl_fl,
	       struct netlink_ext_ack *extack)
{}

static int
nfp_fl_set_tport(const struct flow_action_entry *act, u32 off,
		 struct nfp_fl_set_tport *set_tport, int opcode,
		 struct netlink_ext_ack *extack)
{}

static u32 nfp_fl_csum_l4_to_flag(u8 ip_proto)
{}

struct nfp_flower_pedit_acts {};

static int
nfp_fl_commit_mangle(struct flow_rule *rule, char *nfp_action,
		     int *a_len, struct nfp_flower_pedit_acts *set_act,
		     u32 *csum_updated)
{}

static int
nfp_fl_pedit(const struct flow_action_entry *act,
	     char *nfp_action, int *a_len,
	     u32 *csum_updated, struct nfp_flower_pedit_acts *set_act,
	     struct netlink_ext_ack *extack)
{}

static struct nfp_fl_meter *nfp_fl_meter(char *act_data)
{}

static int
nfp_flower_meter_action(struct nfp_app *app,
			const struct flow_action_entry *action,
			struct nfp_fl_payload *nfp_fl, int *a_len,
			struct net_device *netdev,
			struct netlink_ext_ack *extack)
{}

static int
nfp_flower_output_action(struct nfp_app *app,
			 const struct flow_action_entry *act,
			 struct nfp_fl_payload *nfp_fl, int *a_len,
			 struct net_device *netdev, bool last,
			 enum nfp_flower_tun_type *tun_type, int *tun_out_cnt,
			 int *out_cnt, u32 *csum_updated, bool pkt_host,
			 struct netlink_ext_ack *extack)
{}

static int
nfp_flower_loop_action(struct nfp_app *app, const struct flow_action_entry *act,
		       struct flow_rule *rule,
		       struct nfp_fl_payload *nfp_fl, int *a_len,
		       struct net_device *netdev,
		       enum nfp_flower_tun_type *tun_type, int *tun_out_cnt,
		       int *out_cnt, u32 *csum_updated,
		       struct nfp_flower_pedit_acts *set_act, bool *pkt_host,
		       struct netlink_ext_ack *extack, int act_idx)
{}

static bool nfp_fl_check_mangle_start(struct flow_action *flow_act,
				      int current_act_idx)
{}

static bool nfp_fl_check_mangle_end(struct flow_action *flow_act,
				    int current_act_idx)
{}

int nfp_flower_compile_action(struct nfp_app *app,
			      struct flow_rule *rule,
			      struct net_device *netdev,
			      struct nfp_fl_payload *nfp_flow,
			      struct netlink_ext_ack *extack)
{}