linux/drivers/net/ethernet/intel/ice/ice_tc_lib.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2019-2021, Intel Corporation. */

#ifndef _ICE_TC_LIB_H_
#define _ICE_TC_LIB_H_

#include <linux/bits.h>
#include <net/pfcp.h>

#define ICE_TC_FLWR_FIELD_DST_MAC
#define ICE_TC_FLWR_FIELD_SRC_MAC
#define ICE_TC_FLWR_FIELD_VLAN
#define ICE_TC_FLWR_FIELD_DEST_IPV4
#define ICE_TC_FLWR_FIELD_SRC_IPV4
#define ICE_TC_FLWR_FIELD_DEST_IPV6
#define ICE_TC_FLWR_FIELD_SRC_IPV6
#define ICE_TC_FLWR_FIELD_DEST_L4_PORT
#define ICE_TC_FLWR_FIELD_SRC_L4_PORT
#define ICE_TC_FLWR_FIELD_TENANT_ID
#define ICE_TC_FLWR_FIELD_ENC_DEST_IPV4
#define ICE_TC_FLWR_FIELD_ENC_SRC_IPV4
#define ICE_TC_FLWR_FIELD_ENC_DEST_IPV6
#define ICE_TC_FLWR_FIELD_ENC_SRC_IPV6
#define ICE_TC_FLWR_FIELD_ENC_DEST_L4_PORT
#define ICE_TC_FLWR_FIELD_ENC_SRC_L4_PORT
#define ICE_TC_FLWR_FIELD_ENC_DST_MAC
#define ICE_TC_FLWR_FIELD_ETH_TYPE_ID
#define ICE_TC_FLWR_FIELD_GTP_OPTS
#define ICE_TC_FLWR_FIELD_CVLAN
#define ICE_TC_FLWR_FIELD_PPPOE_SESSID
#define ICE_TC_FLWR_FIELD_PPP_PROTO
#define ICE_TC_FLWR_FIELD_IP_TOS
#define ICE_TC_FLWR_FIELD_IP_TTL
#define ICE_TC_FLWR_FIELD_ENC_IP_TOS
#define ICE_TC_FLWR_FIELD_ENC_IP_TTL
#define ICE_TC_FLWR_FIELD_L2TPV3_SESSID
#define ICE_TC_FLWR_FIELD_VLAN_PRIO
#define ICE_TC_FLWR_FIELD_CVLAN_PRIO
#define ICE_TC_FLWR_FIELD_VLAN_TPID
#define ICE_TC_FLWR_FIELD_PFCP_OPTS

#define ICE_TC_FLOWER_MASK_32

#define ICE_IPV6_HDR_TC_MASK

struct ice_indr_block_priv {};

struct ice_tc_flower_action {};

struct ice_tc_vlan_hdr {};

struct ice_tc_pppoe_hdr {};

struct ice_tc_l2_hdr {};

struct ice_tc_l3_hdr {};

struct ice_tc_l2tpv3_hdr {};

struct ice_tc_l4_hdr {};

struct ice_tc_flower_lyr_2_4_hdrs {};

enum ice_eswitch_fltr_direction {};

struct ice_tc_flower_fltr {};

/**
 * ice_is_chnl_fltr - is this a valid channel filter
 * @f: Pointer to tc-flower filter
 *
 * Criteria to determine of given filter is valid channel filter
 * or not is based on its destination.
 * For forward to VSI action, if destination is valid hw_tc (aka tc_class)
 * and in supported range of TCs for ADQ, then return true.
 * For forward to queue, as long as dest_vsi is valid and it is of type
 * VSI_CHNL (PF ADQ VSI is of type VSI_CHNL), return true.
 * NOTE: For forward to queue, correct dest_vsi is still set in tc_fltr based
 * on destination queue specified.
 */
static inline bool ice_is_chnl_fltr(struct ice_tc_flower_fltr *f)
{}

/**
 * ice_chnl_dmac_fltr_cnt - DMAC based CHNL filter count
 * @pf: Pointer to PF
 */
static inline int ice_chnl_dmac_fltr_cnt(struct ice_pf *pf)
{}

struct ice_vsi *ice_locate_vsi_using_queue(struct ice_vsi *vsi, int queue);
int
ice_add_cls_flower(struct net_device *netdev, struct ice_vsi *vsi,
		   struct flow_cls_offload *cls_flower);
int
ice_del_cls_flower(struct ice_vsi *vsi, struct flow_cls_offload *cls_flower);
void ice_replay_tc_fltrs(struct ice_pf *pf);
bool ice_is_tunnel_supported(struct net_device *dev);

static inline bool ice_is_forward_action(enum ice_sw_fwd_act_type fltr_act)
{}
#endif /* _ICE_TC_LIB_H_ */