162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* Copyright(c) 2013 - 2018 Intel Corporation. */ 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci#ifndef _IAVF_H_ 562306a36Sopenharmony_ci#define _IAVF_H_ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#include <linux/module.h> 862306a36Sopenharmony_ci#include <linux/pci.h> 962306a36Sopenharmony_ci#include <linux/netdevice.h> 1062306a36Sopenharmony_ci#include <linux/vmalloc.h> 1162306a36Sopenharmony_ci#include <linux/interrupt.h> 1262306a36Sopenharmony_ci#include <linux/ethtool.h> 1362306a36Sopenharmony_ci#include <linux/if_vlan.h> 1462306a36Sopenharmony_ci#include <linux/ip.h> 1562306a36Sopenharmony_ci#include <linux/tcp.h> 1662306a36Sopenharmony_ci#include <linux/sctp.h> 1762306a36Sopenharmony_ci#include <linux/ipv6.h> 1862306a36Sopenharmony_ci#include <linux/kernel.h> 1962306a36Sopenharmony_ci#include <linux/bitops.h> 2062306a36Sopenharmony_ci#include <linux/timer.h> 2162306a36Sopenharmony_ci#include <linux/workqueue.h> 2262306a36Sopenharmony_ci#include <linux/wait.h> 2362306a36Sopenharmony_ci#include <linux/delay.h> 2462306a36Sopenharmony_ci#include <linux/gfp.h> 2562306a36Sopenharmony_ci#include <linux/skbuff.h> 2662306a36Sopenharmony_ci#include <linux/dma-mapping.h> 2762306a36Sopenharmony_ci#include <linux/etherdevice.h> 2862306a36Sopenharmony_ci#include <linux/socket.h> 2962306a36Sopenharmony_ci#include <linux/jiffies.h> 3062306a36Sopenharmony_ci#include <net/ip6_checksum.h> 3162306a36Sopenharmony_ci#include <net/pkt_cls.h> 3262306a36Sopenharmony_ci#include <net/pkt_sched.h> 3362306a36Sopenharmony_ci#include <net/udp.h> 3462306a36Sopenharmony_ci#include <net/tc_act/tc_gact.h> 3562306a36Sopenharmony_ci#include <net/tc_act/tc_mirred.h> 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci#include "iavf_type.h" 3862306a36Sopenharmony_ci#include <linux/avf/virtchnl.h> 3962306a36Sopenharmony_ci#include "iavf_txrx.h" 4062306a36Sopenharmony_ci#include "iavf_fdir.h" 4162306a36Sopenharmony_ci#include "iavf_adv_rss.h" 4262306a36Sopenharmony_ci#include <linux/bitmap.h> 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ci#define DEFAULT_DEBUG_LEVEL_SHIFT 3 4562306a36Sopenharmony_ci#define PFX "iavf: " 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ciint iavf_status_to_errno(enum iavf_status status); 4862306a36Sopenharmony_ciint virtchnl_status_to_errno(enum virtchnl_status_code v_status); 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci/* VSI state flags shared with common code */ 5162306a36Sopenharmony_cienum iavf_vsi_state_t { 5262306a36Sopenharmony_ci __IAVF_VSI_DOWN, 5362306a36Sopenharmony_ci /* This must be last as it determines the size of the BITMAP */ 5462306a36Sopenharmony_ci __IAVF_VSI_STATE_SIZE__, 5562306a36Sopenharmony_ci}; 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci/* dummy struct to make common code less painful */ 5862306a36Sopenharmony_cistruct iavf_vsi { 5962306a36Sopenharmony_ci struct iavf_adapter *back; 6062306a36Sopenharmony_ci struct net_device *netdev; 6162306a36Sopenharmony_ci u16 seid; 6262306a36Sopenharmony_ci u16 id; 6362306a36Sopenharmony_ci DECLARE_BITMAP(state, __IAVF_VSI_STATE_SIZE__); 6462306a36Sopenharmony_ci int base_vector; 6562306a36Sopenharmony_ci u16 qs_handle; 6662306a36Sopenharmony_ci void *priv; /* client driver data reference. */ 6762306a36Sopenharmony_ci}; 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci/* How many Rx Buffers do we bundle into one write to the hardware ? */ 7062306a36Sopenharmony_ci#define IAVF_RX_BUFFER_WRITE 16 /* Must be power of 2 */ 7162306a36Sopenharmony_ci#define IAVF_DEFAULT_TXD 512 7262306a36Sopenharmony_ci#define IAVF_DEFAULT_RXD 512 7362306a36Sopenharmony_ci#define IAVF_MAX_TXD 4096 7462306a36Sopenharmony_ci#define IAVF_MIN_TXD 64 7562306a36Sopenharmony_ci#define IAVF_MAX_RXD 4096 7662306a36Sopenharmony_ci#define IAVF_MIN_RXD 64 7762306a36Sopenharmony_ci#define IAVF_REQ_DESCRIPTOR_MULTIPLE 32 7862306a36Sopenharmony_ci#define IAVF_MAX_AQ_BUF_SIZE 4096 7962306a36Sopenharmony_ci#define IAVF_AQ_LEN 32 8062306a36Sopenharmony_ci#define IAVF_AQ_MAX_ERR 20 /* times to try before resetting AQ */ 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci#define MAXIMUM_ETHERNET_VLAN_SIZE (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN) 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ci#define IAVF_RX_DESC(R, i) (&(((union iavf_32byte_rx_desc *)((R)->desc))[i])) 8562306a36Sopenharmony_ci#define IAVF_TX_DESC(R, i) (&(((struct iavf_tx_desc *)((R)->desc))[i])) 8662306a36Sopenharmony_ci#define IAVF_TX_CTXTDESC(R, i) \ 8762306a36Sopenharmony_ci (&(((struct iavf_tx_context_desc *)((R)->desc))[i])) 8862306a36Sopenharmony_ci#define IAVF_MAX_REQ_QUEUES 16 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci#define IAVF_HKEY_ARRAY_SIZE ((IAVF_VFQF_HKEY_MAX_INDEX + 1) * 4) 9162306a36Sopenharmony_ci#define IAVF_HLUT_ARRAY_SIZE ((IAVF_VFQF_HLUT_MAX_INDEX + 1) * 4) 9262306a36Sopenharmony_ci#define IAVF_MBPS_DIVISOR 125000 /* divisor to convert to Mbps */ 9362306a36Sopenharmony_ci#define IAVF_MBPS_QUANTA 50 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci#define IAVF_VIRTCHNL_VF_RESOURCE_SIZE \ 9662306a36Sopenharmony_ci virtchnl_struct_size((struct virtchnl_vf_resource *)NULL, \ 9762306a36Sopenharmony_ci vsi_res, IAVF_MAX_VF_VSI) 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci/* MAX_MSIX_Q_VECTORS of these are allocated, 10062306a36Sopenharmony_ci * but we only use one per queue-specific vector. 10162306a36Sopenharmony_ci */ 10262306a36Sopenharmony_cistruct iavf_q_vector { 10362306a36Sopenharmony_ci struct iavf_adapter *adapter; 10462306a36Sopenharmony_ci struct iavf_vsi *vsi; 10562306a36Sopenharmony_ci struct napi_struct napi; 10662306a36Sopenharmony_ci struct iavf_ring_container rx; 10762306a36Sopenharmony_ci struct iavf_ring_container tx; 10862306a36Sopenharmony_ci u32 ring_mask; 10962306a36Sopenharmony_ci u8 itr_countdown; /* when 0 should adjust adaptive ITR */ 11062306a36Sopenharmony_ci u8 num_ringpairs; /* total number of ring pairs in vector */ 11162306a36Sopenharmony_ci u16 v_idx; /* index in the vsi->q_vector array. */ 11262306a36Sopenharmony_ci u16 reg_idx; /* register index of the interrupt */ 11362306a36Sopenharmony_ci char name[IFNAMSIZ + 15]; 11462306a36Sopenharmony_ci bool arm_wb_state; 11562306a36Sopenharmony_ci cpumask_t affinity_mask; 11662306a36Sopenharmony_ci struct irq_affinity_notify affinity_notify; 11762306a36Sopenharmony_ci}; 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ci/* Helper macros to switch between ints/sec and what the register uses. 12062306a36Sopenharmony_ci * And yes, it's the same math going both ways. The lowest value 12162306a36Sopenharmony_ci * supported by all of the iavf hardware is 8. 12262306a36Sopenharmony_ci */ 12362306a36Sopenharmony_ci#define EITR_INTS_PER_SEC_TO_REG(_eitr) \ 12462306a36Sopenharmony_ci ((_eitr) ? (1000000000 / ((_eitr) * 256)) : 8) 12562306a36Sopenharmony_ci#define EITR_REG_TO_INTS_PER_SEC EITR_INTS_PER_SEC_TO_REG 12662306a36Sopenharmony_ci 12762306a36Sopenharmony_ci#define IAVF_DESC_UNUSED(R) \ 12862306a36Sopenharmony_ci ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \ 12962306a36Sopenharmony_ci (R)->next_to_clean - (R)->next_to_use - 1) 13062306a36Sopenharmony_ci 13162306a36Sopenharmony_ci#define OTHER_VECTOR 1 13262306a36Sopenharmony_ci#define NONQ_VECS (OTHER_VECTOR) 13362306a36Sopenharmony_ci 13462306a36Sopenharmony_ci#define MIN_MSIX_Q_VECTORS 1 13562306a36Sopenharmony_ci#define MIN_MSIX_COUNT (MIN_MSIX_Q_VECTORS + NONQ_VECS) 13662306a36Sopenharmony_ci 13762306a36Sopenharmony_ci#define IAVF_QUEUE_END_OF_LIST 0x7FF 13862306a36Sopenharmony_ci#define IAVF_FREE_VECTOR 0x7FFF 13962306a36Sopenharmony_cistruct iavf_mac_filter { 14062306a36Sopenharmony_ci struct list_head list; 14162306a36Sopenharmony_ci u8 macaddr[ETH_ALEN]; 14262306a36Sopenharmony_ci struct { 14362306a36Sopenharmony_ci u8 is_new_mac:1; /* filter is new, wait for PF decision */ 14462306a36Sopenharmony_ci u8 remove:1; /* filter needs to be removed */ 14562306a36Sopenharmony_ci u8 add:1; /* filter needs to be added */ 14662306a36Sopenharmony_ci u8 is_primary:1; /* filter is a default VF MAC */ 14762306a36Sopenharmony_ci u8 add_handled:1; /* received response for filter add */ 14862306a36Sopenharmony_ci u8 padding:3; 14962306a36Sopenharmony_ci }; 15062306a36Sopenharmony_ci}; 15162306a36Sopenharmony_ci 15262306a36Sopenharmony_ci#define IAVF_VLAN(vid, tpid) ((struct iavf_vlan){ vid, tpid }) 15362306a36Sopenharmony_cistruct iavf_vlan { 15462306a36Sopenharmony_ci u16 vid; 15562306a36Sopenharmony_ci u16 tpid; 15662306a36Sopenharmony_ci}; 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_cienum iavf_vlan_state_t { 15962306a36Sopenharmony_ci IAVF_VLAN_INVALID, 16062306a36Sopenharmony_ci IAVF_VLAN_ADD, /* filter needs to be added */ 16162306a36Sopenharmony_ci IAVF_VLAN_IS_NEW, /* filter is new, wait for PF answer */ 16262306a36Sopenharmony_ci IAVF_VLAN_ACTIVE, /* filter is accepted by PF */ 16362306a36Sopenharmony_ci IAVF_VLAN_DISABLE, /* filter needs to be deleted by PF, then marked INACTIVE */ 16462306a36Sopenharmony_ci IAVF_VLAN_INACTIVE, /* filter is inactive, we are in IFF_DOWN */ 16562306a36Sopenharmony_ci IAVF_VLAN_REMOVE, /* filter needs to be removed from list */ 16662306a36Sopenharmony_ci}; 16762306a36Sopenharmony_ci 16862306a36Sopenharmony_cistruct iavf_vlan_filter { 16962306a36Sopenharmony_ci struct list_head list; 17062306a36Sopenharmony_ci struct iavf_vlan vlan; 17162306a36Sopenharmony_ci enum iavf_vlan_state_t state; 17262306a36Sopenharmony_ci}; 17362306a36Sopenharmony_ci 17462306a36Sopenharmony_ci#define IAVF_MAX_TRAFFIC_CLASS 4 17562306a36Sopenharmony_ci/* State of traffic class creation */ 17662306a36Sopenharmony_cienum iavf_tc_state_t { 17762306a36Sopenharmony_ci __IAVF_TC_INVALID, /* no traffic class, default state */ 17862306a36Sopenharmony_ci __IAVF_TC_RUNNING, /* traffic classes have been created */ 17962306a36Sopenharmony_ci}; 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ci/* channel info */ 18262306a36Sopenharmony_cistruct iavf_channel_config { 18362306a36Sopenharmony_ci struct virtchnl_channel_info ch_info[IAVF_MAX_TRAFFIC_CLASS]; 18462306a36Sopenharmony_ci enum iavf_tc_state_t state; 18562306a36Sopenharmony_ci u8 total_qps; 18662306a36Sopenharmony_ci}; 18762306a36Sopenharmony_ci 18862306a36Sopenharmony_ci/* State of cloud filter */ 18962306a36Sopenharmony_cienum iavf_cloud_filter_state_t { 19062306a36Sopenharmony_ci __IAVF_CF_INVALID, /* cloud filter not added */ 19162306a36Sopenharmony_ci __IAVF_CF_ADD_PENDING, /* cloud filter pending add by the PF */ 19262306a36Sopenharmony_ci __IAVF_CF_DEL_PENDING, /* cloud filter pending del by the PF */ 19362306a36Sopenharmony_ci __IAVF_CF_ACTIVE, /* cloud filter is active */ 19462306a36Sopenharmony_ci}; 19562306a36Sopenharmony_ci 19662306a36Sopenharmony_ci/* Driver state. The order of these is important! */ 19762306a36Sopenharmony_cienum iavf_state_t { 19862306a36Sopenharmony_ci __IAVF_STARTUP, /* driver loaded, probe complete */ 19962306a36Sopenharmony_ci __IAVF_REMOVE, /* driver is being unloaded */ 20062306a36Sopenharmony_ci __IAVF_INIT_VERSION_CHECK, /* aq msg sent, awaiting reply */ 20162306a36Sopenharmony_ci __IAVF_INIT_GET_RESOURCES, /* aq msg sent, awaiting reply */ 20262306a36Sopenharmony_ci __IAVF_INIT_EXTENDED_CAPS, /* process extended caps which require aq msg exchange */ 20362306a36Sopenharmony_ci __IAVF_INIT_CONFIG_ADAPTER, 20462306a36Sopenharmony_ci __IAVF_INIT_SW, /* got resources, setting up structs */ 20562306a36Sopenharmony_ci __IAVF_INIT_FAILED, /* init failed, restarting procedure */ 20662306a36Sopenharmony_ci __IAVF_RESETTING, /* in reset */ 20762306a36Sopenharmony_ci __IAVF_COMM_FAILED, /* communication with PF failed */ 20862306a36Sopenharmony_ci /* Below here, watchdog is running */ 20962306a36Sopenharmony_ci __IAVF_DOWN, /* ready, can be opened */ 21062306a36Sopenharmony_ci __IAVF_DOWN_PENDING, /* descending, waiting for watchdog */ 21162306a36Sopenharmony_ci __IAVF_TESTING, /* in ethtool self-test */ 21262306a36Sopenharmony_ci __IAVF_RUNNING, /* opened, working */ 21362306a36Sopenharmony_ci}; 21462306a36Sopenharmony_ci 21562306a36Sopenharmony_cienum iavf_critical_section_t { 21662306a36Sopenharmony_ci __IAVF_IN_REMOVE_TASK, /* device being removed */ 21762306a36Sopenharmony_ci}; 21862306a36Sopenharmony_ci 21962306a36Sopenharmony_ci#define IAVF_CLOUD_FIELD_OMAC 0x01 22062306a36Sopenharmony_ci#define IAVF_CLOUD_FIELD_IMAC 0x02 22162306a36Sopenharmony_ci#define IAVF_CLOUD_FIELD_IVLAN 0x04 22262306a36Sopenharmony_ci#define IAVF_CLOUD_FIELD_TEN_ID 0x08 22362306a36Sopenharmony_ci#define IAVF_CLOUD_FIELD_IIP 0x10 22462306a36Sopenharmony_ci 22562306a36Sopenharmony_ci#define IAVF_CF_FLAGS_OMAC IAVF_CLOUD_FIELD_OMAC 22662306a36Sopenharmony_ci#define IAVF_CF_FLAGS_IMAC IAVF_CLOUD_FIELD_IMAC 22762306a36Sopenharmony_ci#define IAVF_CF_FLAGS_IMAC_IVLAN (IAVF_CLOUD_FIELD_IMAC |\ 22862306a36Sopenharmony_ci IAVF_CLOUD_FIELD_IVLAN) 22962306a36Sopenharmony_ci#define IAVF_CF_FLAGS_IMAC_TEN_ID (IAVF_CLOUD_FIELD_IMAC |\ 23062306a36Sopenharmony_ci IAVF_CLOUD_FIELD_TEN_ID) 23162306a36Sopenharmony_ci#define IAVF_CF_FLAGS_OMAC_TEN_ID_IMAC (IAVF_CLOUD_FIELD_OMAC |\ 23262306a36Sopenharmony_ci IAVF_CLOUD_FIELD_IMAC |\ 23362306a36Sopenharmony_ci IAVF_CLOUD_FIELD_TEN_ID) 23462306a36Sopenharmony_ci#define IAVF_CF_FLAGS_IMAC_IVLAN_TEN_ID (IAVF_CLOUD_FIELD_IMAC |\ 23562306a36Sopenharmony_ci IAVF_CLOUD_FIELD_IVLAN |\ 23662306a36Sopenharmony_ci IAVF_CLOUD_FIELD_TEN_ID) 23762306a36Sopenharmony_ci#define IAVF_CF_FLAGS_IIP IAVF_CLOUD_FIELD_IIP 23862306a36Sopenharmony_ci 23962306a36Sopenharmony_ci/* bookkeeping of cloud filters */ 24062306a36Sopenharmony_cistruct iavf_cloud_filter { 24162306a36Sopenharmony_ci enum iavf_cloud_filter_state_t state; 24262306a36Sopenharmony_ci struct list_head list; 24362306a36Sopenharmony_ci struct virtchnl_filter f; 24462306a36Sopenharmony_ci unsigned long cookie; 24562306a36Sopenharmony_ci bool del; /* filter needs to be deleted */ 24662306a36Sopenharmony_ci bool add; /* filter needs to be added */ 24762306a36Sopenharmony_ci}; 24862306a36Sopenharmony_ci 24962306a36Sopenharmony_ci#define IAVF_RESET_WAIT_MS 10 25062306a36Sopenharmony_ci#define IAVF_RESET_WAIT_DETECTED_COUNT 500 25162306a36Sopenharmony_ci#define IAVF_RESET_WAIT_COMPLETE_COUNT 2000 25262306a36Sopenharmony_ci 25362306a36Sopenharmony_ci/* board specific private data structure */ 25462306a36Sopenharmony_cistruct iavf_adapter { 25562306a36Sopenharmony_ci struct workqueue_struct *wq; 25662306a36Sopenharmony_ci struct work_struct reset_task; 25762306a36Sopenharmony_ci struct work_struct adminq_task; 25862306a36Sopenharmony_ci struct work_struct finish_config; 25962306a36Sopenharmony_ci struct delayed_work client_task; 26062306a36Sopenharmony_ci wait_queue_head_t down_waitqueue; 26162306a36Sopenharmony_ci wait_queue_head_t reset_waitqueue; 26262306a36Sopenharmony_ci wait_queue_head_t vc_waitqueue; 26362306a36Sopenharmony_ci struct iavf_q_vector *q_vectors; 26462306a36Sopenharmony_ci struct list_head vlan_filter_list; 26562306a36Sopenharmony_ci int num_vlan_filters; 26662306a36Sopenharmony_ci struct list_head mac_filter_list; 26762306a36Sopenharmony_ci struct mutex crit_lock; 26862306a36Sopenharmony_ci struct mutex client_lock; 26962306a36Sopenharmony_ci /* Lock to protect accesses to MAC and VLAN lists */ 27062306a36Sopenharmony_ci spinlock_t mac_vlan_list_lock; 27162306a36Sopenharmony_ci char misc_vector_name[IFNAMSIZ + 9]; 27262306a36Sopenharmony_ci int num_active_queues; 27362306a36Sopenharmony_ci int num_req_queues; 27462306a36Sopenharmony_ci 27562306a36Sopenharmony_ci /* TX */ 27662306a36Sopenharmony_ci struct iavf_ring *tx_rings; 27762306a36Sopenharmony_ci u32 tx_timeout_count; 27862306a36Sopenharmony_ci u32 tx_desc_count; 27962306a36Sopenharmony_ci 28062306a36Sopenharmony_ci /* RX */ 28162306a36Sopenharmony_ci struct iavf_ring *rx_rings; 28262306a36Sopenharmony_ci u64 hw_csum_rx_error; 28362306a36Sopenharmony_ci u32 rx_desc_count; 28462306a36Sopenharmony_ci int num_msix_vectors; 28562306a36Sopenharmony_ci int num_rdma_msix; 28662306a36Sopenharmony_ci int rdma_base_vector; 28762306a36Sopenharmony_ci u32 client_pending; 28862306a36Sopenharmony_ci struct iavf_client_instance *cinst; 28962306a36Sopenharmony_ci struct msix_entry *msix_entries; 29062306a36Sopenharmony_ci 29162306a36Sopenharmony_ci u32 flags; 29262306a36Sopenharmony_ci#define IAVF_FLAG_RX_CSUM_ENABLED BIT(0) 29362306a36Sopenharmony_ci#define IAVF_FLAG_PF_COMMS_FAILED BIT(3) 29462306a36Sopenharmony_ci#define IAVF_FLAG_RESET_PENDING BIT(4) 29562306a36Sopenharmony_ci#define IAVF_FLAG_RESET_NEEDED BIT(5) 29662306a36Sopenharmony_ci#define IAVF_FLAG_WB_ON_ITR_CAPABLE BIT(6) 29762306a36Sopenharmony_ci#define IAVF_FLAG_SERVICE_CLIENT_REQUESTED BIT(9) 29862306a36Sopenharmony_ci#define IAVF_FLAG_CLIENT_NEEDS_OPEN BIT(10) 29962306a36Sopenharmony_ci#define IAVF_FLAG_CLIENT_NEEDS_CLOSE BIT(11) 30062306a36Sopenharmony_ci#define IAVF_FLAG_CLIENT_NEEDS_L2_PARAMS BIT(12) 30162306a36Sopenharmony_ci#define IAVF_FLAG_LEGACY_RX BIT(15) 30262306a36Sopenharmony_ci#define IAVF_FLAG_REINIT_ITR_NEEDED BIT(16) 30362306a36Sopenharmony_ci#define IAVF_FLAG_QUEUES_DISABLED BIT(17) 30462306a36Sopenharmony_ci#define IAVF_FLAG_SETUP_NETDEV_FEATURES BIT(18) 30562306a36Sopenharmony_ci#define IAVF_FLAG_REINIT_MSIX_NEEDED BIT(20) 30662306a36Sopenharmony_ci#define IAVF_FLAG_FDIR_ENABLED BIT(21) 30762306a36Sopenharmony_ci/* duplicates for common code */ 30862306a36Sopenharmony_ci#define IAVF_FLAG_DCB_ENABLED 0 30962306a36Sopenharmony_ci /* flags for admin queue service task */ 31062306a36Sopenharmony_ci u64 aq_required; 31162306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ENABLE_QUEUES BIT_ULL(0) 31262306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DISABLE_QUEUES BIT_ULL(1) 31362306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ADD_MAC_FILTER BIT_ULL(2) 31462306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ADD_VLAN_FILTER BIT_ULL(3) 31562306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DEL_MAC_FILTER BIT_ULL(4) 31662306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DEL_VLAN_FILTER BIT_ULL(5) 31762306a36Sopenharmony_ci#define IAVF_FLAG_AQ_CONFIGURE_QUEUES BIT_ULL(6) 31862306a36Sopenharmony_ci#define IAVF_FLAG_AQ_MAP_VECTORS BIT_ULL(7) 31962306a36Sopenharmony_ci#define IAVF_FLAG_AQ_HANDLE_RESET BIT_ULL(8) 32062306a36Sopenharmony_ci#define IAVF_FLAG_AQ_CONFIGURE_RSS BIT_ULL(9) /* direct AQ config */ 32162306a36Sopenharmony_ci#define IAVF_FLAG_AQ_GET_CONFIG BIT_ULL(10) 32262306a36Sopenharmony_ci/* Newer style, RSS done by the PF so we can ignore hardware vagaries. */ 32362306a36Sopenharmony_ci#define IAVF_FLAG_AQ_GET_HENA BIT_ULL(11) 32462306a36Sopenharmony_ci#define IAVF_FLAG_AQ_SET_HENA BIT_ULL(12) 32562306a36Sopenharmony_ci#define IAVF_FLAG_AQ_SET_RSS_KEY BIT_ULL(13) 32662306a36Sopenharmony_ci#define IAVF_FLAG_AQ_SET_RSS_LUT BIT_ULL(14) 32762306a36Sopenharmony_ci#define IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE BIT_ULL(15) 32862306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ENABLE_VLAN_STRIPPING BIT_ULL(19) 32962306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DISABLE_VLAN_STRIPPING BIT_ULL(20) 33062306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ENABLE_CHANNELS BIT_ULL(21) 33162306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DISABLE_CHANNELS BIT_ULL(22) 33262306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ADD_CLOUD_FILTER BIT_ULL(23) 33362306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DEL_CLOUD_FILTER BIT_ULL(24) 33462306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ADD_FDIR_FILTER BIT_ULL(25) 33562306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DEL_FDIR_FILTER BIT_ULL(26) 33662306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ADD_ADV_RSS_CFG BIT_ULL(27) 33762306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DEL_ADV_RSS_CFG BIT_ULL(28) 33862306a36Sopenharmony_ci#define IAVF_FLAG_AQ_REQUEST_STATS BIT_ULL(29) 33962306a36Sopenharmony_ci#define IAVF_FLAG_AQ_GET_OFFLOAD_VLAN_V2_CAPS BIT_ULL(30) 34062306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ENABLE_CTAG_VLAN_STRIPPING BIT_ULL(31) 34162306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DISABLE_CTAG_VLAN_STRIPPING BIT_ULL(32) 34262306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ENABLE_STAG_VLAN_STRIPPING BIT_ULL(33) 34362306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DISABLE_STAG_VLAN_STRIPPING BIT_ULL(34) 34462306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ENABLE_CTAG_VLAN_INSERTION BIT_ULL(35) 34562306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DISABLE_CTAG_VLAN_INSERTION BIT_ULL(36) 34662306a36Sopenharmony_ci#define IAVF_FLAG_AQ_ENABLE_STAG_VLAN_INSERTION BIT_ULL(37) 34762306a36Sopenharmony_ci#define IAVF_FLAG_AQ_DISABLE_STAG_VLAN_INSERTION BIT_ULL(38) 34862306a36Sopenharmony_ci 34962306a36Sopenharmony_ci /* flags for processing extended capability messages during 35062306a36Sopenharmony_ci * __IAVF_INIT_EXTENDED_CAPS. Each capability exchange requires 35162306a36Sopenharmony_ci * both a SEND and a RECV step, which must be processed in sequence. 35262306a36Sopenharmony_ci * 35362306a36Sopenharmony_ci * During the __IAVF_INIT_EXTENDED_CAPS state, the driver will 35462306a36Sopenharmony_ci * process one flag at a time during each state loop. 35562306a36Sopenharmony_ci */ 35662306a36Sopenharmony_ci u64 extended_caps; 35762306a36Sopenharmony_ci#define IAVF_EXTENDED_CAP_SEND_VLAN_V2 BIT_ULL(0) 35862306a36Sopenharmony_ci#define IAVF_EXTENDED_CAP_RECV_VLAN_V2 BIT_ULL(1) 35962306a36Sopenharmony_ci 36062306a36Sopenharmony_ci#define IAVF_EXTENDED_CAPS \ 36162306a36Sopenharmony_ci (IAVF_EXTENDED_CAP_SEND_VLAN_V2 | \ 36262306a36Sopenharmony_ci IAVF_EXTENDED_CAP_RECV_VLAN_V2) 36362306a36Sopenharmony_ci 36462306a36Sopenharmony_ci /* Lock to prevent possible clobbering of 36562306a36Sopenharmony_ci * current_netdev_promisc_flags 36662306a36Sopenharmony_ci */ 36762306a36Sopenharmony_ci spinlock_t current_netdev_promisc_flags_lock; 36862306a36Sopenharmony_ci netdev_features_t current_netdev_promisc_flags; 36962306a36Sopenharmony_ci 37062306a36Sopenharmony_ci /* OS defined structs */ 37162306a36Sopenharmony_ci struct net_device *netdev; 37262306a36Sopenharmony_ci struct pci_dev *pdev; 37362306a36Sopenharmony_ci 37462306a36Sopenharmony_ci struct iavf_hw hw; /* defined in iavf_type.h */ 37562306a36Sopenharmony_ci 37662306a36Sopenharmony_ci enum iavf_state_t state; 37762306a36Sopenharmony_ci enum iavf_state_t last_state; 37862306a36Sopenharmony_ci unsigned long crit_section; 37962306a36Sopenharmony_ci 38062306a36Sopenharmony_ci struct delayed_work watchdog_task; 38162306a36Sopenharmony_ci bool netdev_registered; 38262306a36Sopenharmony_ci bool link_up; 38362306a36Sopenharmony_ci enum virtchnl_link_speed link_speed; 38462306a36Sopenharmony_ci /* This is only populated if the VIRTCHNL_VF_CAP_ADV_LINK_SPEED is set 38562306a36Sopenharmony_ci * in vf_res->vf_cap_flags. Use ADV_LINK_SUPPORT macro to determine if 38662306a36Sopenharmony_ci * this field is valid. This field should be used going forward and the 38762306a36Sopenharmony_ci * enum virtchnl_link_speed above should be considered the legacy way of 38862306a36Sopenharmony_ci * storing/communicating link speeds. 38962306a36Sopenharmony_ci */ 39062306a36Sopenharmony_ci u32 link_speed_mbps; 39162306a36Sopenharmony_ci 39262306a36Sopenharmony_ci enum virtchnl_ops current_op; 39362306a36Sopenharmony_ci#define CLIENT_ALLOWED(_a) ((_a)->vf_res ? \ 39462306a36Sopenharmony_ci (_a)->vf_res->vf_cap_flags & \ 39562306a36Sopenharmony_ci VIRTCHNL_VF_OFFLOAD_RDMA : \ 39662306a36Sopenharmony_ci 0) 39762306a36Sopenharmony_ci#define CLIENT_ENABLED(_a) ((_a)->cinst) 39862306a36Sopenharmony_ci/* RSS by the PF should be preferred over RSS via other methods. */ 39962306a36Sopenharmony_ci#define RSS_PF(_a) ((_a)->vf_res->vf_cap_flags & \ 40062306a36Sopenharmony_ci VIRTCHNL_VF_OFFLOAD_RSS_PF) 40162306a36Sopenharmony_ci#define RSS_AQ(_a) ((_a)->vf_res->vf_cap_flags & \ 40262306a36Sopenharmony_ci VIRTCHNL_VF_OFFLOAD_RSS_AQ) 40362306a36Sopenharmony_ci#define RSS_REG(_a) (!((_a)->vf_res->vf_cap_flags & \ 40462306a36Sopenharmony_ci (VIRTCHNL_VF_OFFLOAD_RSS_AQ | \ 40562306a36Sopenharmony_ci VIRTCHNL_VF_OFFLOAD_RSS_PF))) 40662306a36Sopenharmony_ci#define VLAN_ALLOWED(_a) ((_a)->vf_res->vf_cap_flags & \ 40762306a36Sopenharmony_ci VIRTCHNL_VF_OFFLOAD_VLAN) 40862306a36Sopenharmony_ci#define VLAN_V2_ALLOWED(_a) ((_a)->vf_res->vf_cap_flags & \ 40962306a36Sopenharmony_ci VIRTCHNL_VF_OFFLOAD_VLAN_V2) 41062306a36Sopenharmony_ci#define VLAN_V2_FILTERING_ALLOWED(_a) \ 41162306a36Sopenharmony_ci (VLAN_V2_ALLOWED((_a)) && \ 41262306a36Sopenharmony_ci ((_a)->vlan_v2_caps.filtering.filtering_support.outer || \ 41362306a36Sopenharmony_ci (_a)->vlan_v2_caps.filtering.filtering_support.inner)) 41462306a36Sopenharmony_ci#define VLAN_FILTERING_ALLOWED(_a) \ 41562306a36Sopenharmony_ci (VLAN_ALLOWED((_a)) || VLAN_V2_FILTERING_ALLOWED((_a))) 41662306a36Sopenharmony_ci#define ADV_LINK_SUPPORT(_a) ((_a)->vf_res->vf_cap_flags & \ 41762306a36Sopenharmony_ci VIRTCHNL_VF_CAP_ADV_LINK_SPEED) 41862306a36Sopenharmony_ci#define FDIR_FLTR_SUPPORT(_a) ((_a)->vf_res->vf_cap_flags & \ 41962306a36Sopenharmony_ci VIRTCHNL_VF_OFFLOAD_FDIR_PF) 42062306a36Sopenharmony_ci#define ADV_RSS_SUPPORT(_a) ((_a)->vf_res->vf_cap_flags & \ 42162306a36Sopenharmony_ci VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF) 42262306a36Sopenharmony_ci struct virtchnl_vf_resource *vf_res; /* incl. all VSIs */ 42362306a36Sopenharmony_ci struct virtchnl_vsi_resource *vsi_res; /* our LAN VSI */ 42462306a36Sopenharmony_ci struct virtchnl_version_info pf_version; 42562306a36Sopenharmony_ci#define PF_IS_V11(_a) (((_a)->pf_version.major == 1) && \ 42662306a36Sopenharmony_ci ((_a)->pf_version.minor == 1)) 42762306a36Sopenharmony_ci struct virtchnl_vlan_caps vlan_v2_caps; 42862306a36Sopenharmony_ci u16 msg_enable; 42962306a36Sopenharmony_ci struct iavf_eth_stats current_stats; 43062306a36Sopenharmony_ci struct iavf_vsi vsi; 43162306a36Sopenharmony_ci u32 aq_wait_count; 43262306a36Sopenharmony_ci /* RSS stuff */ 43362306a36Sopenharmony_ci u64 hena; 43462306a36Sopenharmony_ci u16 rss_key_size; 43562306a36Sopenharmony_ci u16 rss_lut_size; 43662306a36Sopenharmony_ci u8 *rss_key; 43762306a36Sopenharmony_ci u8 *rss_lut; 43862306a36Sopenharmony_ci /* ADQ related members */ 43962306a36Sopenharmony_ci struct iavf_channel_config ch_config; 44062306a36Sopenharmony_ci u8 num_tc; 44162306a36Sopenharmony_ci struct list_head cloud_filter_list; 44262306a36Sopenharmony_ci /* lock to protect access to the cloud filter list */ 44362306a36Sopenharmony_ci spinlock_t cloud_filter_list_lock; 44462306a36Sopenharmony_ci u16 num_cloud_filters; 44562306a36Sopenharmony_ci /* snapshot of "num_active_queues" before setup_tc for qdisc add 44662306a36Sopenharmony_ci * is invoked. This information is useful during qdisc del flow, 44762306a36Sopenharmony_ci * to restore correct number of queues 44862306a36Sopenharmony_ci */ 44962306a36Sopenharmony_ci int orig_num_active_queues; 45062306a36Sopenharmony_ci 45162306a36Sopenharmony_ci#define IAVF_MAX_FDIR_FILTERS 128 /* max allowed Flow Director filters */ 45262306a36Sopenharmony_ci u16 fdir_active_fltr; 45362306a36Sopenharmony_ci struct list_head fdir_list_head; 45462306a36Sopenharmony_ci spinlock_t fdir_fltr_lock; /* protect the Flow Director filter list */ 45562306a36Sopenharmony_ci 45662306a36Sopenharmony_ci struct list_head adv_rss_list_head; 45762306a36Sopenharmony_ci spinlock_t adv_rss_lock; /* protect the RSS management list */ 45862306a36Sopenharmony_ci}; 45962306a36Sopenharmony_ci 46062306a36Sopenharmony_ci 46162306a36Sopenharmony_ci/* Ethtool Private Flags */ 46262306a36Sopenharmony_ci 46362306a36Sopenharmony_ci/* lan device, used by client interface */ 46462306a36Sopenharmony_cistruct iavf_device { 46562306a36Sopenharmony_ci struct list_head list; 46662306a36Sopenharmony_ci struct iavf_adapter *vf; 46762306a36Sopenharmony_ci}; 46862306a36Sopenharmony_ci 46962306a36Sopenharmony_ci/* needed by iavf_ethtool.c */ 47062306a36Sopenharmony_ciextern char iavf_driver_name[]; 47162306a36Sopenharmony_ci 47262306a36Sopenharmony_cistatic inline const char *iavf_state_str(enum iavf_state_t state) 47362306a36Sopenharmony_ci{ 47462306a36Sopenharmony_ci switch (state) { 47562306a36Sopenharmony_ci case __IAVF_STARTUP: 47662306a36Sopenharmony_ci return "__IAVF_STARTUP"; 47762306a36Sopenharmony_ci case __IAVF_REMOVE: 47862306a36Sopenharmony_ci return "__IAVF_REMOVE"; 47962306a36Sopenharmony_ci case __IAVF_INIT_VERSION_CHECK: 48062306a36Sopenharmony_ci return "__IAVF_INIT_VERSION_CHECK"; 48162306a36Sopenharmony_ci case __IAVF_INIT_GET_RESOURCES: 48262306a36Sopenharmony_ci return "__IAVF_INIT_GET_RESOURCES"; 48362306a36Sopenharmony_ci case __IAVF_INIT_EXTENDED_CAPS: 48462306a36Sopenharmony_ci return "__IAVF_INIT_EXTENDED_CAPS"; 48562306a36Sopenharmony_ci case __IAVF_INIT_CONFIG_ADAPTER: 48662306a36Sopenharmony_ci return "__IAVF_INIT_CONFIG_ADAPTER"; 48762306a36Sopenharmony_ci case __IAVF_INIT_SW: 48862306a36Sopenharmony_ci return "__IAVF_INIT_SW"; 48962306a36Sopenharmony_ci case __IAVF_INIT_FAILED: 49062306a36Sopenharmony_ci return "__IAVF_INIT_FAILED"; 49162306a36Sopenharmony_ci case __IAVF_RESETTING: 49262306a36Sopenharmony_ci return "__IAVF_RESETTING"; 49362306a36Sopenharmony_ci case __IAVF_COMM_FAILED: 49462306a36Sopenharmony_ci return "__IAVF_COMM_FAILED"; 49562306a36Sopenharmony_ci case __IAVF_DOWN: 49662306a36Sopenharmony_ci return "__IAVF_DOWN"; 49762306a36Sopenharmony_ci case __IAVF_DOWN_PENDING: 49862306a36Sopenharmony_ci return "__IAVF_DOWN_PENDING"; 49962306a36Sopenharmony_ci case __IAVF_TESTING: 50062306a36Sopenharmony_ci return "__IAVF_TESTING"; 50162306a36Sopenharmony_ci case __IAVF_RUNNING: 50262306a36Sopenharmony_ci return "__IAVF_RUNNING"; 50362306a36Sopenharmony_ci default: 50462306a36Sopenharmony_ci return "__IAVF_UNKNOWN_STATE"; 50562306a36Sopenharmony_ci } 50662306a36Sopenharmony_ci} 50762306a36Sopenharmony_ci 50862306a36Sopenharmony_cistatic inline void iavf_change_state(struct iavf_adapter *adapter, 50962306a36Sopenharmony_ci enum iavf_state_t state) 51062306a36Sopenharmony_ci{ 51162306a36Sopenharmony_ci if (adapter->state != state) { 51262306a36Sopenharmony_ci adapter->last_state = adapter->state; 51362306a36Sopenharmony_ci adapter->state = state; 51462306a36Sopenharmony_ci } 51562306a36Sopenharmony_ci dev_dbg(&adapter->pdev->dev, 51662306a36Sopenharmony_ci "state transition from:%s to:%s\n", 51762306a36Sopenharmony_ci iavf_state_str(adapter->last_state), 51862306a36Sopenharmony_ci iavf_state_str(adapter->state)); 51962306a36Sopenharmony_ci} 52062306a36Sopenharmony_ci 52162306a36Sopenharmony_ciint iavf_up(struct iavf_adapter *adapter); 52262306a36Sopenharmony_civoid iavf_down(struct iavf_adapter *adapter); 52362306a36Sopenharmony_ciint iavf_process_config(struct iavf_adapter *adapter); 52462306a36Sopenharmony_ciint iavf_parse_vf_resource_msg(struct iavf_adapter *adapter); 52562306a36Sopenharmony_civoid iavf_schedule_reset(struct iavf_adapter *adapter, u64 flags); 52662306a36Sopenharmony_civoid iavf_schedule_aq_request(struct iavf_adapter *adapter, u64 flags); 52762306a36Sopenharmony_civoid iavf_schedule_finish_config(struct iavf_adapter *adapter); 52862306a36Sopenharmony_civoid iavf_reset(struct iavf_adapter *adapter); 52962306a36Sopenharmony_civoid iavf_set_ethtool_ops(struct net_device *netdev); 53062306a36Sopenharmony_civoid iavf_update_stats(struct iavf_adapter *adapter); 53162306a36Sopenharmony_civoid iavf_free_all_tx_resources(struct iavf_adapter *adapter); 53262306a36Sopenharmony_civoid iavf_free_all_rx_resources(struct iavf_adapter *adapter); 53362306a36Sopenharmony_ci 53462306a36Sopenharmony_civoid iavf_napi_add_all(struct iavf_adapter *adapter); 53562306a36Sopenharmony_civoid iavf_napi_del_all(struct iavf_adapter *adapter); 53662306a36Sopenharmony_ci 53762306a36Sopenharmony_ciint iavf_send_api_ver(struct iavf_adapter *adapter); 53862306a36Sopenharmony_ciint iavf_verify_api_ver(struct iavf_adapter *adapter); 53962306a36Sopenharmony_ciint iavf_send_vf_config_msg(struct iavf_adapter *adapter); 54062306a36Sopenharmony_ciint iavf_get_vf_config(struct iavf_adapter *adapter); 54162306a36Sopenharmony_ciint iavf_get_vf_vlan_v2_caps(struct iavf_adapter *adapter); 54262306a36Sopenharmony_ciint iavf_send_vf_offload_vlan_v2_msg(struct iavf_adapter *adapter); 54362306a36Sopenharmony_civoid iavf_set_queue_vlan_tag_loc(struct iavf_adapter *adapter); 54462306a36Sopenharmony_ciu16 iavf_get_num_vlans_added(struct iavf_adapter *adapter); 54562306a36Sopenharmony_civoid iavf_irq_enable(struct iavf_adapter *adapter, bool flush); 54662306a36Sopenharmony_civoid iavf_configure_queues(struct iavf_adapter *adapter); 54762306a36Sopenharmony_civoid iavf_deconfigure_queues(struct iavf_adapter *adapter); 54862306a36Sopenharmony_civoid iavf_enable_queues(struct iavf_adapter *adapter); 54962306a36Sopenharmony_civoid iavf_disable_queues(struct iavf_adapter *adapter); 55062306a36Sopenharmony_civoid iavf_map_queues(struct iavf_adapter *adapter); 55162306a36Sopenharmony_ciint iavf_request_queues(struct iavf_adapter *adapter, int num); 55262306a36Sopenharmony_civoid iavf_add_ether_addrs(struct iavf_adapter *adapter); 55362306a36Sopenharmony_civoid iavf_del_ether_addrs(struct iavf_adapter *adapter); 55462306a36Sopenharmony_civoid iavf_add_vlans(struct iavf_adapter *adapter); 55562306a36Sopenharmony_civoid iavf_del_vlans(struct iavf_adapter *adapter); 55662306a36Sopenharmony_civoid iavf_set_promiscuous(struct iavf_adapter *adapter); 55762306a36Sopenharmony_cibool iavf_promiscuous_mode_changed(struct iavf_adapter *adapter); 55862306a36Sopenharmony_civoid iavf_request_stats(struct iavf_adapter *adapter); 55962306a36Sopenharmony_ciint iavf_request_reset(struct iavf_adapter *adapter); 56062306a36Sopenharmony_civoid iavf_get_hena(struct iavf_adapter *adapter); 56162306a36Sopenharmony_civoid iavf_set_hena(struct iavf_adapter *adapter); 56262306a36Sopenharmony_civoid iavf_set_rss_key(struct iavf_adapter *adapter); 56362306a36Sopenharmony_civoid iavf_set_rss_lut(struct iavf_adapter *adapter); 56462306a36Sopenharmony_civoid iavf_enable_vlan_stripping(struct iavf_adapter *adapter); 56562306a36Sopenharmony_civoid iavf_disable_vlan_stripping(struct iavf_adapter *adapter); 56662306a36Sopenharmony_civoid iavf_virtchnl_completion(struct iavf_adapter *adapter, 56762306a36Sopenharmony_ci enum virtchnl_ops v_opcode, 56862306a36Sopenharmony_ci enum iavf_status v_retval, u8 *msg, u16 msglen); 56962306a36Sopenharmony_ciint iavf_config_rss(struct iavf_adapter *adapter); 57062306a36Sopenharmony_ciint iavf_lan_add_device(struct iavf_adapter *adapter); 57162306a36Sopenharmony_ciint iavf_lan_del_device(struct iavf_adapter *adapter); 57262306a36Sopenharmony_civoid iavf_client_subtask(struct iavf_adapter *adapter); 57362306a36Sopenharmony_civoid iavf_notify_client_message(struct iavf_vsi *vsi, u8 *msg, u16 len); 57462306a36Sopenharmony_civoid iavf_notify_client_l2_params(struct iavf_vsi *vsi); 57562306a36Sopenharmony_civoid iavf_notify_client_open(struct iavf_vsi *vsi); 57662306a36Sopenharmony_civoid iavf_notify_client_close(struct iavf_vsi *vsi, bool reset); 57762306a36Sopenharmony_civoid iavf_enable_channels(struct iavf_adapter *adapter); 57862306a36Sopenharmony_civoid iavf_disable_channels(struct iavf_adapter *adapter); 57962306a36Sopenharmony_civoid iavf_add_cloud_filter(struct iavf_adapter *adapter); 58062306a36Sopenharmony_civoid iavf_del_cloud_filter(struct iavf_adapter *adapter); 58162306a36Sopenharmony_civoid iavf_enable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid); 58262306a36Sopenharmony_civoid iavf_disable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid); 58362306a36Sopenharmony_civoid iavf_enable_vlan_insertion_v2(struct iavf_adapter *adapter, u16 tpid); 58462306a36Sopenharmony_civoid iavf_disable_vlan_insertion_v2(struct iavf_adapter *adapter, u16 tpid); 58562306a36Sopenharmony_civoid iavf_add_fdir_filter(struct iavf_adapter *adapter); 58662306a36Sopenharmony_civoid iavf_del_fdir_filter(struct iavf_adapter *adapter); 58762306a36Sopenharmony_civoid iavf_add_adv_rss_cfg(struct iavf_adapter *adapter); 58862306a36Sopenharmony_civoid iavf_del_adv_rss_cfg(struct iavf_adapter *adapter); 58962306a36Sopenharmony_cistruct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter, 59062306a36Sopenharmony_ci const u8 *macaddr); 59162306a36Sopenharmony_ciint iavf_wait_for_reset(struct iavf_adapter *adapter); 59262306a36Sopenharmony_ci#endif /* _IAVF_H_ */ 593