1837f08fdSAnirudh Venkataramanan /* SPDX-License-Identifier: GPL-2.0 */ 2837f08fdSAnirudh Venkataramanan /* Copyright (c) 2018, Intel Corporation. */ 3837f08fdSAnirudh Venkataramanan 4837f08fdSAnirudh Venkataramanan #ifndef _ICE_H_ 5837f08fdSAnirudh Venkataramanan #define _ICE_H_ 6837f08fdSAnirudh Venkataramanan 7837f08fdSAnirudh Venkataramanan #include <linux/types.h> 8837f08fdSAnirudh Venkataramanan #include <linux/errno.h> 9837f08fdSAnirudh Venkataramanan #include <linux/kernel.h> 10837f08fdSAnirudh Venkataramanan #include <linux/module.h> 11462acf6aSTony Nguyen #include <linux/firmware.h> 12837f08fdSAnirudh Venkataramanan #include <linux/netdevice.h> 13837f08fdSAnirudh Venkataramanan #include <linux/compiler.h> 14dc49c772SAnirudh Venkataramanan #include <linux/etherdevice.h> 15cdedef59SAnirudh Venkataramanan #include <linux/skbuff.h> 163a858ba3SAnirudh Venkataramanan #include <linux/cpumask.h> 17fcea6f3dSAnirudh Venkataramanan #include <linux/rtnetlink.h> 183a858ba3SAnirudh Venkataramanan #include <linux/if_vlan.h> 19cdedef59SAnirudh Venkataramanan #include <linux/dma-mapping.h> 20837f08fdSAnirudh Venkataramanan #include <linux/pci.h> 21940b61afSAnirudh Venkataramanan #include <linux/workqueue.h> 22d69ea414SJacob Keller #include <linux/wait.h> 23837f08fdSAnirudh Venkataramanan #include <linux/aer.h> 24940b61afSAnirudh Venkataramanan #include <linux/interrupt.h> 25fcea6f3dSAnirudh Venkataramanan #include <linux/ethtool.h> 26940b61afSAnirudh Venkataramanan #include <linux/timer.h> 277ec59eeaSAnirudh Venkataramanan #include <linux/delay.h> 28837f08fdSAnirudh Venkataramanan #include <linux/bitmap.h> 293a858ba3SAnirudh Venkataramanan #include <linux/log2.h> 30d76a60baSAnirudh Venkataramanan #include <linux/ip.h> 31cf909e19SAnirudh Venkataramanan #include <linux/sctp.h> 32d76a60baSAnirudh Venkataramanan #include <linux/ipv6.h> 33efc2214bSMaciej Fijalkowski #include <linux/pkt_sched.h> 34940b61afSAnirudh Venkataramanan #include <linux/if_bridge.h> 35e3710a01SPaul M Stillwell Jr #include <linux/ctype.h> 36efc2214bSMaciej Fijalkowski #include <linux/bpf.h> 37ddf30f7fSAnirudh Venkataramanan #include <linux/avf/virtchnl.h> 3828bf2672SBrett Creeley #include <linux/cpu_rmap.h> 391adf7eadSJacob Keller #include <net/devlink.h> 40d76a60baSAnirudh Venkataramanan #include <net/ipv6.h> 412d4238f5SKrzysztof Kazimierczak #include <net/xdp_sock.h> 42a4e82a81STony Nguyen #include <net/geneve.h> 43a4e82a81STony Nguyen #include <net/gre.h> 44a4e82a81STony Nguyen #include <net/udp_tunnel.h> 45a4e82a81STony Nguyen #include <net/vxlan.h> 46837f08fdSAnirudh Venkataramanan #include "ice_devids.h" 47837f08fdSAnirudh Venkataramanan #include "ice_type.h" 48940b61afSAnirudh Venkataramanan #include "ice_txrx.h" 4937b6f646SAnirudh Venkataramanan #include "ice_dcb.h" 509c20346bSAnirudh Venkataramanan #include "ice_switch.h" 51f31e4b6fSAnirudh Venkataramanan #include "ice_common.h" 529c20346bSAnirudh Venkataramanan #include "ice_sched.h" 53ddf30f7fSAnirudh Venkataramanan #include "ice_virtchnl_pf.h" 54007676b4SAnirudh Venkataramanan #include "ice_sriov.h" 55148beb61SHenry Tieman #include "ice_fdir.h" 562d4238f5SKrzysztof Kazimierczak #include "ice_xsk.h" 5728bf2672SBrett Creeley #include "ice_arfs.h" 58837f08fdSAnirudh Venkataramanan 59837f08fdSAnirudh Venkataramanan #define ICE_BAR0 0 603a858ba3SAnirudh Venkataramanan #define ICE_REQ_DESC_MULTIPLE 32 618be92a76SPreethi Banala #define ICE_MIN_NUM_DESC 64 623b6bf296SBruce Allan #define ICE_MAX_NUM_DESC 8160 631aec6e1bSBrett Creeley #define ICE_DFLT_MIN_RX_DESC 512 64dd47e1fdSJesse Brandeburg #define ICE_DFLT_NUM_TX_DESC 256 65dd47e1fdSJesse Brandeburg #define ICE_DFLT_NUM_RX_DESC 2048 66ad71b256SBrett Creeley 675513b920SAnirudh Venkataramanan #define ICE_DFLT_TRAFFIC_CLASS BIT(0) 68940b61afSAnirudh Venkataramanan #define ICE_INT_NAME_STR_LEN (IFNAMSIZ + 16) 69f31e4b6fSAnirudh Venkataramanan #define ICE_AQ_LEN 64 7011836214SBrett Creeley #define ICE_MBXSQ_LEN 64 71*f3fe97f6SBrett Creeley #define ICE_MIN_LAN_TXRX_MSIX 1 72*f3fe97f6SBrett Creeley #define ICE_MIN_LAN_OICR_MSIX 1 73*f3fe97f6SBrett Creeley #define ICE_MIN_MSIX (ICE_MIN_LAN_TXRX_MSIX + ICE_MIN_LAN_OICR_MSIX) 74148beb61SHenry Tieman #define ICE_FDIR_MSIX 1 753a858ba3SAnirudh Venkataramanan #define ICE_NO_VSI 0xffff 763a858ba3SAnirudh Venkataramanan #define ICE_VSI_MAP_CONTIG 0 773a858ba3SAnirudh Venkataramanan #define ICE_VSI_MAP_SCATTER 1 783a858ba3SAnirudh Venkataramanan #define ICE_MAX_SCATTER_TXQS 16 793a858ba3SAnirudh Venkataramanan #define ICE_MAX_SCATTER_RXQS 16 80cdedef59SAnirudh Venkataramanan #define ICE_Q_WAIT_RETRY_LIMIT 10 81cdedef59SAnirudh Venkataramanan #define ICE_Q_WAIT_MAX_RETRY (5 * ICE_Q_WAIT_RETRY_LIMIT) 82d76a60baSAnirudh Venkataramanan #define ICE_MAX_LG_RSS_QS 256 83940b61afSAnirudh Venkataramanan #define ICE_RES_VALID_BIT 0x8000 84940b61afSAnirudh Venkataramanan #define ICE_RES_MISC_VEC_ID (ICE_RES_VALID_BIT - 1) 853a858ba3SAnirudh Venkataramanan #define ICE_INVAL_Q_INDEX 0xffff 860f9d5027SAnirudh Venkataramanan #define ICE_INVAL_VFID 256 87837f08fdSAnirudh Venkataramanan 88afd9d4abSAnirudh Venkataramanan #define ICE_MAX_RESET_WAIT 20 89afd9d4abSAnirudh Venkataramanan 90fcea6f3dSAnirudh Venkataramanan #define ICE_VSIQF_HKEY_ARRAY_SIZE ((VSIQF_HKEY_MAX_INDEX + 1) * 4) 91fcea6f3dSAnirudh Venkataramanan 92837f08fdSAnirudh Venkataramanan #define ICE_DFLT_NETIF_M (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK) 93837f08fdSAnirudh Venkataramanan 94efc2214bSMaciej Fijalkowski #define ICE_MAX_MTU (ICE_AQ_SET_MAC_FRAME_SIZE_MAX - ICE_ETH_PKT_HDR_PAD) 953a858ba3SAnirudh Venkataramanan 963a858ba3SAnirudh Venkataramanan #define ICE_UP_TABLE_TRANSLATE(val, i) \ 973a858ba3SAnirudh Venkataramanan (((val) << ICE_AQ_VSI_UP_TABLE_UP##i##_S) & \ 983a858ba3SAnirudh Venkataramanan ICE_AQ_VSI_UP_TABLE_UP##i##_M) 993a858ba3SAnirudh Venkataramanan 1002b245cb2SAnirudh Venkataramanan #define ICE_TX_DESC(R, i) (&(((struct ice_tx_desc *)((R)->desc))[i])) 101cdedef59SAnirudh Venkataramanan #define ICE_RX_DESC(R, i) (&(((union ice_32b_rx_flex_desc *)((R)->desc))[i])) 102d76a60baSAnirudh Venkataramanan #define ICE_TX_CTX_DESC(R, i) (&(((struct ice_tx_ctx_desc *)((R)->desc))[i])) 103cac2a27cSHenry Tieman #define ICE_TX_FDIRDESC(R, i) (&(((struct ice_fltr_desc *)((R)->desc))[i])) 104cdedef59SAnirudh Venkataramanan 1050b28b702SAnirudh Venkataramanan /* Macro for each VSI in a PF */ 1060b28b702SAnirudh Venkataramanan #define ice_for_each_vsi(pf, i) \ 1070b28b702SAnirudh Venkataramanan for ((i) = 0; (i) < (pf)->num_alloc_vsi; (i)++) 1080b28b702SAnirudh Venkataramanan 109d337f2afSAnirudh Venkataramanan /* Macros for each Tx/Rx ring in a VSI */ 110cdedef59SAnirudh Venkataramanan #define ice_for_each_txq(vsi, i) \ 111cdedef59SAnirudh Venkataramanan for ((i) = 0; (i) < (vsi)->num_txq; (i)++) 112cdedef59SAnirudh Venkataramanan 113cdedef59SAnirudh Venkataramanan #define ice_for_each_rxq(vsi, i) \ 114cdedef59SAnirudh Venkataramanan for ((i) = 0; (i) < (vsi)->num_rxq; (i)++) 115cdedef59SAnirudh Venkataramanan 116d337f2afSAnirudh Venkataramanan /* Macros for each allocated Tx/Rx ring whether used or not in a VSI */ 117f8ba7db8SJacob Keller #define ice_for_each_alloc_txq(vsi, i) \ 118f8ba7db8SJacob Keller for ((i) = 0; (i) < (vsi)->alloc_txq; (i)++) 119f8ba7db8SJacob Keller 120f8ba7db8SJacob Keller #define ice_for_each_alloc_rxq(vsi, i) \ 121f8ba7db8SJacob Keller for ((i) = 0; (i) < (vsi)->alloc_rxq; (i)++) 122f8ba7db8SJacob Keller 12367fe64d7SBrett Creeley #define ice_for_each_q_vector(vsi, i) \ 12467fe64d7SBrett Creeley for ((i) = 0; (i) < (vsi)->num_q_vectors; (i)++) 12567fe64d7SBrett Creeley 1265eda8afdSAkeem G Abodunrin #define ICE_UCAST_PROMISC_BITS (ICE_PROMISC_UCAST_TX | ICE_PROMISC_MCAST_TX | \ 1275eda8afdSAkeem G Abodunrin ICE_PROMISC_UCAST_RX | ICE_PROMISC_MCAST_RX) 1285eda8afdSAkeem G Abodunrin 1295eda8afdSAkeem G Abodunrin #define ICE_UCAST_VLAN_PROMISC_BITS (ICE_PROMISC_UCAST_TX | \ 1305eda8afdSAkeem G Abodunrin ICE_PROMISC_MCAST_TX | \ 1315eda8afdSAkeem G Abodunrin ICE_PROMISC_UCAST_RX | \ 1325eda8afdSAkeem G Abodunrin ICE_PROMISC_MCAST_RX | \ 1335eda8afdSAkeem G Abodunrin ICE_PROMISC_VLAN_TX | \ 1345eda8afdSAkeem G Abodunrin ICE_PROMISC_VLAN_RX) 1355eda8afdSAkeem G Abodunrin 1365eda8afdSAkeem G Abodunrin #define ICE_MCAST_PROMISC_BITS (ICE_PROMISC_MCAST_TX | ICE_PROMISC_MCAST_RX) 1375eda8afdSAkeem G Abodunrin 1385eda8afdSAkeem G Abodunrin #define ICE_MCAST_VLAN_PROMISC_BITS (ICE_PROMISC_MCAST_TX | \ 1395eda8afdSAkeem G Abodunrin ICE_PROMISC_MCAST_RX | \ 1405eda8afdSAkeem G Abodunrin ICE_PROMISC_VLAN_TX | \ 1415eda8afdSAkeem G Abodunrin ICE_PROMISC_VLAN_RX) 1425eda8afdSAkeem G Abodunrin 1434015d11eSBrett Creeley #define ice_pf_to_dev(pf) (&((pf)->pdev->dev)) 1444015d11eSBrett Creeley 145eff380aaSAnirudh Venkataramanan struct ice_txq_meta { 146eff380aaSAnirudh Venkataramanan u32 q_teid; /* Tx-scheduler element identifier */ 147eff380aaSAnirudh Venkataramanan u16 q_id; /* Entry in VSI's txq_map bitmap */ 148eff380aaSAnirudh Venkataramanan u16 q_handle; /* Relative index of Tx queue within TC */ 149eff380aaSAnirudh Venkataramanan u16 vsi_idx; /* VSI index that Tx queue belongs to */ 150eff380aaSAnirudh Venkataramanan u8 tc; /* TC number that Tx queue belongs to */ 151eff380aaSAnirudh Venkataramanan }; 152eff380aaSAnirudh Venkataramanan 1533a858ba3SAnirudh Venkataramanan struct ice_tc_info { 1543a858ba3SAnirudh Venkataramanan u16 qoffset; 155c5a2a4a3SUsha Ketineni u16 qcount_tx; 156c5a2a4a3SUsha Ketineni u16 qcount_rx; 157c5a2a4a3SUsha Ketineni u8 netdev_tc; 1583a858ba3SAnirudh Venkataramanan }; 1593a858ba3SAnirudh Venkataramanan 1603a858ba3SAnirudh Venkataramanan struct ice_tc_cfg { 1613a858ba3SAnirudh Venkataramanan u8 numtc; /* Total number of enabled TCs */ 162f9867df6SAnirudh Venkataramanan u8 ena_tc; /* Tx map */ 1633a858ba3SAnirudh Venkataramanan struct ice_tc_info tc_info[ICE_MAX_TRAFFIC_CLASS]; 1643a858ba3SAnirudh Venkataramanan }; 1653a858ba3SAnirudh Venkataramanan 166940b61afSAnirudh Venkataramanan struct ice_res_tracker { 167940b61afSAnirudh Venkataramanan u16 num_entries; 168cbe66bfeSBrett Creeley u16 end; 169940b61afSAnirudh Venkataramanan u16 list[1]; 170940b61afSAnirudh Venkataramanan }; 171940b61afSAnirudh Venkataramanan 17203f7a986SAnirudh Venkataramanan struct ice_qs_cfg { 17394c4441bSAnirudh Venkataramanan struct mutex *qs_mutex; /* will be assigned to &pf->avail_q_mutex */ 17403f7a986SAnirudh Venkataramanan unsigned long *pf_map; 17503f7a986SAnirudh Venkataramanan unsigned long pf_map_size; 17603f7a986SAnirudh Venkataramanan unsigned int q_count; 17703f7a986SAnirudh Venkataramanan unsigned int scatter_count; 17803f7a986SAnirudh Venkataramanan u16 *vsi_map; 17903f7a986SAnirudh Venkataramanan u16 vsi_map_offset; 18003f7a986SAnirudh Venkataramanan u8 mapping_mode; 18103f7a986SAnirudh Venkataramanan }; 18203f7a986SAnirudh Venkataramanan 183940b61afSAnirudh Venkataramanan struct ice_sw { 184940b61afSAnirudh Venkataramanan struct ice_pf *pf; 185940b61afSAnirudh Venkataramanan u16 sw_id; /* switch ID for this switch */ 186940b61afSAnirudh Venkataramanan u16 bridge_mode; /* VEB/VEPA/Port Virtualizer */ 187fc0f39bcSBrett Creeley struct ice_vsi *dflt_vsi; /* default VSI for this switch */ 188fc0f39bcSBrett Creeley u8 dflt_vsi_ena:1; /* true if above dflt_vsi is enabled */ 189940b61afSAnirudh Venkataramanan }; 190940b61afSAnirudh Venkataramanan 191837f08fdSAnirudh Venkataramanan enum ice_state { 1920e674aebSAnirudh Venkataramanan __ICE_TESTING, 193837f08fdSAnirudh Venkataramanan __ICE_DOWN, 1940b28b702SAnirudh Venkataramanan __ICE_NEEDS_RESTART, 1950f9d5027SAnirudh Venkataramanan __ICE_PREPARED_FOR_RESET, /* set by driver when prepared */ 1965df7e45dSDave Ertman __ICE_RESET_OICR_RECV, /* set by driver after rcv reset OICR */ 197b94b013eSDave Ertman __ICE_DCBNL_DEVRESET, /* set by dcbnl devreset */ 198940b61afSAnirudh Venkataramanan __ICE_PFR_REQ, /* set by driver and peers */ 1990b28b702SAnirudh Venkataramanan __ICE_CORER_REQ, /* set by driver and peers */ 2000b28b702SAnirudh Venkataramanan __ICE_GLOBR_REQ, /* set by driver and peers */ 2010b28b702SAnirudh Venkataramanan __ICE_CORER_RECV, /* set by OICR handler */ 2020b28b702SAnirudh Venkataramanan __ICE_GLOBR_RECV, /* set by OICR handler */ 2030b28b702SAnirudh Venkataramanan __ICE_EMPR_RECV, /* set by OICR handler */ 2040b28b702SAnirudh Venkataramanan __ICE_SUSPENDED, /* set on module remove path */ 2050b28b702SAnirudh Venkataramanan __ICE_RESET_FAILED, /* set by reset/rebuild */ 206ddf30f7fSAnirudh Venkataramanan /* When checking for the PF to be in a nominal operating state, the 207ddf30f7fSAnirudh Venkataramanan * bits that are grouped at the beginning of the list need to be 208ddf30f7fSAnirudh Venkataramanan * checked. Bits occurring before __ICE_STATE_NOMINAL_CHECK_BITS will 209ddf30f7fSAnirudh Venkataramanan * be checked. If you need to add a bit into consideration for nominal 210ddf30f7fSAnirudh Venkataramanan * operating state, it must be added before 211ddf30f7fSAnirudh Venkataramanan * __ICE_STATE_NOMINAL_CHECK_BITS. Do not move this entry's position 212ddf30f7fSAnirudh Venkataramanan * without appropriate consideration. 213ddf30f7fSAnirudh Venkataramanan */ 214ddf30f7fSAnirudh Venkataramanan __ICE_STATE_NOMINAL_CHECK_BITS, 215940b61afSAnirudh Venkataramanan __ICE_ADMINQ_EVENT_PENDING, 21675d2b253SAnirudh Venkataramanan __ICE_MAILBOXQ_EVENT_PENDING, 217b3969fd7SSudheer Mogilappagari __ICE_MDD_EVENT_PENDING, 218007676b4SAnirudh Venkataramanan __ICE_VFLR_EVENT_PENDING, 219e94d4478SAnirudh Venkataramanan __ICE_FLTR_OVERFLOW_PROMISC, 220ddf30f7fSAnirudh Venkataramanan __ICE_VF_DIS, 221fcea6f3dSAnirudh Venkataramanan __ICE_CFG_BUSY, 222940b61afSAnirudh Venkataramanan __ICE_SERVICE_SCHED, 2238d81fa55SAkeem G Abodunrin __ICE_SERVICE_DIS, 224cac2a27cSHenry Tieman __ICE_FD_FLUSH_REQ, 225d82dd83dSAkeem G Abodunrin __ICE_OICR_INTR_DIS, /* Global OICR interrupt disabled */ 2269d5c5a52SPaul Greenwalt __ICE_MDD_VF_PRINT_PENDING, /* set when MDD event handle */ 227f844d521SBrett Creeley __ICE_VF_RESETS_DISABLED, /* disable resets during ice_remove */ 228ea78ce4dSPaul Greenwalt __ICE_LINK_DEFAULT_OVERRIDE_PENDING, 2291a3571b5SPaul Greenwalt __ICE_PHY_INIT_COMPLETE, 230837f08fdSAnirudh Venkataramanan __ICE_STATE_NBITS /* must be last */ 231837f08fdSAnirudh Venkataramanan }; 232837f08fdSAnirudh Venkataramanan 233e94d4478SAnirudh Venkataramanan enum ice_vsi_flags { 234e94d4478SAnirudh Venkataramanan ICE_VSI_FLAG_UMAC_FLTR_CHANGED, 235e94d4478SAnirudh Venkataramanan ICE_VSI_FLAG_MMAC_FLTR_CHANGED, 236e94d4478SAnirudh Venkataramanan ICE_VSI_FLAG_VLAN_FLTR_CHANGED, 237e94d4478SAnirudh Venkataramanan ICE_VSI_FLAG_PROMISC_CHANGED, 238e94d4478SAnirudh Venkataramanan ICE_VSI_FLAG_NBITS /* must be last */ 239e94d4478SAnirudh Venkataramanan }; 240e94d4478SAnirudh Venkataramanan 241940b61afSAnirudh Venkataramanan /* struct that defines a VSI, associated with a dev */ 242940b61afSAnirudh Venkataramanan struct ice_vsi { 243940b61afSAnirudh Venkataramanan struct net_device *netdev; 2443a858ba3SAnirudh Venkataramanan struct ice_sw *vsw; /* switch this VSI is on */ 2453a858ba3SAnirudh Venkataramanan struct ice_pf *back; /* back pointer to PF */ 246940b61afSAnirudh Venkataramanan struct ice_port_info *port_info; /* back pointer to port_info */ 247d337f2afSAnirudh Venkataramanan struct ice_ring **rx_rings; /* Rx ring array */ 248d337f2afSAnirudh Venkataramanan struct ice_ring **tx_rings; /* Tx ring array */ 2493a858ba3SAnirudh Venkataramanan struct ice_q_vector **q_vectors; /* q_vector array */ 250cdedef59SAnirudh Venkataramanan 251cdedef59SAnirudh Venkataramanan irqreturn_t (*irq_handler)(int irq, void *data); 252cdedef59SAnirudh Venkataramanan 253fcea6f3dSAnirudh Venkataramanan u64 tx_linearize; 2543a858ba3SAnirudh Venkataramanan DECLARE_BITMAP(state, __ICE_STATE_NBITS); 255e94d4478SAnirudh Venkataramanan DECLARE_BITMAP(flags, ICE_VSI_FLAG_NBITS); 256e94d4478SAnirudh Venkataramanan unsigned int current_netdev_flags; 257fcea6f3dSAnirudh Venkataramanan u32 tx_restart; 258fcea6f3dSAnirudh Venkataramanan u32 tx_busy; 259fcea6f3dSAnirudh Venkataramanan u32 rx_buf_failed; 260fcea6f3dSAnirudh Venkataramanan u32 rx_page_failed; 261a8fffd7aSJesse Brandeburg u32 rx_gro_dropped; 26288865fc4SKarol Kolacinski u16 num_q_vectors; 26388865fc4SKarol Kolacinski u16 base_vector; /* IRQ base for OS reserved vectors */ 2643a858ba3SAnirudh Venkataramanan enum ice_vsi_type type; 265940b61afSAnirudh Venkataramanan u16 vsi_num; /* HW (absolute) index of this VSI */ 2663a858ba3SAnirudh Venkataramanan u16 idx; /* software index in pf->vsi[] */ 2673a858ba3SAnirudh Venkataramanan 2688ede0178SAnirudh Venkataramanan s16 vf_id; /* VF ID for SR-IOV VSIs */ 2698ede0178SAnirudh Venkataramanan 270d95276ceSAkeem G Abodunrin u16 ethtype; /* Ethernet protocol for pause frame */ 271148beb61SHenry Tieman u16 num_gfltr; 272148beb61SHenry Tieman u16 num_bfltr; 273d95276ceSAkeem G Abodunrin 274d76a60baSAnirudh Venkataramanan /* RSS config */ 275d76a60baSAnirudh Venkataramanan u16 rss_table_size; /* HW RSS table size */ 276d76a60baSAnirudh Venkataramanan u16 rss_size; /* Allocated RSS queues */ 277d76a60baSAnirudh Venkataramanan u8 *rss_hkey_user; /* User configured hash keys */ 278d76a60baSAnirudh Venkataramanan u8 *rss_lut_user; /* User configured lookup table entries */ 279d76a60baSAnirudh Venkataramanan u8 rss_lut_type; /* used to configure Get/Set RSS LUT AQ call */ 280d76a60baSAnirudh Venkataramanan 28128bf2672SBrett Creeley /* aRFS members only allocated for the PF VSI */ 28228bf2672SBrett Creeley #define ICE_MAX_ARFS_LIST 1024 28328bf2672SBrett Creeley #define ICE_ARFS_LST_MASK (ICE_MAX_ARFS_LIST - 1) 28428bf2672SBrett Creeley struct hlist_head *arfs_fltr_list; 28528bf2672SBrett Creeley struct ice_arfs_active_fltr_cntrs *arfs_fltr_cntrs; 28628bf2672SBrett Creeley spinlock_t arfs_lock; /* protects aRFS hash table and filter state */ 28728bf2672SBrett Creeley atomic_t *arfs_last_fltr_id; 28828bf2672SBrett Creeley 28948d40025SJacob Keller /* devlink port data */ 29048d40025SJacob Keller struct devlink_port devlink_port; 29148d40025SJacob Keller bool devlink_port_registered; 29248d40025SJacob Keller 293cdedef59SAnirudh Venkataramanan u16 max_frame; 294cdedef59SAnirudh Venkataramanan u16 rx_buf_len; 295cdedef59SAnirudh Venkataramanan 2963a858ba3SAnirudh Venkataramanan struct ice_aqc_vsi_props info; /* VSI properties */ 2973a858ba3SAnirudh Venkataramanan 298fcea6f3dSAnirudh Venkataramanan /* VSI stats */ 299fcea6f3dSAnirudh Venkataramanan struct rtnl_link_stats64 net_stats; 300fcea6f3dSAnirudh Venkataramanan struct ice_eth_stats eth_stats; 301fcea6f3dSAnirudh Venkataramanan struct ice_eth_stats eth_stats_prev; 302fcea6f3dSAnirudh Venkataramanan 303e94d4478SAnirudh Venkataramanan struct list_head tmp_sync_list; /* MAC filters to be synced */ 304e94d4478SAnirudh Venkataramanan struct list_head tmp_unsync_list; /* MAC filters to be unsynced */ 305e94d4478SAnirudh Venkataramanan 3060ab54c5fSJesse Brandeburg u8 irqs_ready:1; 3070ab54c5fSJesse Brandeburg u8 current_isup:1; /* Sync 'link up' logging */ 3080ab54c5fSJesse Brandeburg u8 stat_offsets_loaded:1; 309cd6d6b83SBrett Creeley u16 num_vlan; 310cdedef59SAnirudh Venkataramanan 3113a858ba3SAnirudh Venkataramanan /* queue information */ 3123a858ba3SAnirudh Venkataramanan u8 tx_mapping_mode; /* ICE_MAP_MODE_[CONTIG|SCATTER] */ 3133a858ba3SAnirudh Venkataramanan u8 rx_mapping_mode; /* ICE_MAP_MODE_[CONTIG|SCATTER] */ 31478b5713aSAnirudh Venkataramanan u16 *txq_map; /* index in pf->avail_txqs */ 31578b5713aSAnirudh Venkataramanan u16 *rxq_map; /* index in pf->avail_rxqs */ 3163a858ba3SAnirudh Venkataramanan u16 alloc_txq; /* Allocated Tx queues */ 3173a858ba3SAnirudh Venkataramanan u16 num_txq; /* Used Tx queues */ 3183a858ba3SAnirudh Venkataramanan u16 alloc_rxq; /* Allocated Rx queues */ 3193a858ba3SAnirudh Venkataramanan u16 num_rxq; /* Used Rx queues */ 32087324e74SHenry Tieman u16 req_txq; /* User requested Tx queues */ 32187324e74SHenry Tieman u16 req_rxq; /* User requested Rx queues */ 322ad71b256SBrett Creeley u16 num_rx_desc; 323ad71b256SBrett Creeley u16 num_tx_desc; 3243a858ba3SAnirudh Venkataramanan struct ice_tc_cfg tc_cfg; 325efc2214bSMaciej Fijalkowski struct bpf_prog *xdp_prog; 326efc2214bSMaciej Fijalkowski struct ice_ring **xdp_rings; /* XDP ring array */ 327efc2214bSMaciej Fijalkowski u16 num_xdp_txq; /* Used XDP queues */ 328efc2214bSMaciej Fijalkowski u8 xdp_mapping_mode; /* ICE_MAP_MODE_[CONTIG|SCATTER] */ 3291742b3d5SMagnus Karlsson struct xsk_buff_pool **xsk_pools; 3301742b3d5SMagnus Karlsson u16 num_xsk_pools_used; 3311742b3d5SMagnus Karlsson u16 num_xsk_pools; 3323a858ba3SAnirudh Venkataramanan } ____cacheline_internodealigned_in_smp; 3333a858ba3SAnirudh Venkataramanan 3343a858ba3SAnirudh Venkataramanan /* struct that defines an interrupt vector */ 3353a858ba3SAnirudh Venkataramanan struct ice_q_vector { 3363a858ba3SAnirudh Venkataramanan struct ice_vsi *vsi; 3378244dd2dSBrett Creeley 3383a858ba3SAnirudh Venkataramanan u16 v_idx; /* index in the vsi->q_vector array. */ 339b07833a0SBrett Creeley u16 reg_idx; 340d337f2afSAnirudh Venkataramanan u8 num_ring_rx; /* total number of Rx rings in vector */ 3418244dd2dSBrett Creeley u8 num_ring_tx; /* total number of Tx rings in vector */ 3428244dd2dSBrett Creeley u8 itr_countdown; /* when 0 should adjust adaptive ITR */ 3439e4ab4c2SBrett Creeley /* in usecs, need to use ice_intrl_to_usecs_reg() before writing this 3449e4ab4c2SBrett Creeley * value to the device 3459e4ab4c2SBrett Creeley */ 3469e4ab4c2SBrett Creeley u8 intrl; 3478244dd2dSBrett Creeley 3488244dd2dSBrett Creeley struct napi_struct napi; 3498244dd2dSBrett Creeley 3508244dd2dSBrett Creeley struct ice_ring_container rx; 3518244dd2dSBrett Creeley struct ice_ring_container tx; 3528244dd2dSBrett Creeley 3538244dd2dSBrett Creeley cpumask_t affinity_mask; 3548244dd2dSBrett Creeley struct irq_affinity_notify affinity_notify; 3558244dd2dSBrett Creeley 3568244dd2dSBrett Creeley char name[ICE_INT_NAME_STR_LEN]; 357940b61afSAnirudh Venkataramanan } ____cacheline_internodealigned_in_smp; 358940b61afSAnirudh Venkataramanan 359940b61afSAnirudh Venkataramanan enum ice_pf_flags { 360940b61afSAnirudh Venkataramanan ICE_FLAG_FLTR_SYNC, 361940b61afSAnirudh Venkataramanan ICE_FLAG_RSS_ENA, 362ddf30f7fSAnirudh Venkataramanan ICE_FLAG_SRIOV_ENA, 36375d2b253SAnirudh Venkataramanan ICE_FLAG_SRIOV_CAPABLE, 36437b6f646SAnirudh Venkataramanan ICE_FLAG_DCB_CAPABLE, 36537b6f646SAnirudh Venkataramanan ICE_FLAG_DCB_ENA, 366148beb61SHenry Tieman ICE_FLAG_FD_ENA, 367462acf6aSTony Nguyen ICE_FLAG_ADV_FEATURES, 368ab4ab73fSBruce Allan ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, 369b4e813ddSBruce Allan ICE_FLAG_TOTAL_PORT_SHUTDOWN_ENA, 3706d599946STony Nguyen ICE_FLAG_NO_MEDIA, 37184a118abSDave Ertman ICE_FLAG_FW_LLDP_AGENT, 3723a257a14SAnirudh Venkataramanan ICE_FLAG_ETHTOOL_CTXT, /* set when ethtool holds RTNL lock */ 3737237f5b0SMaciej Fijalkowski ICE_FLAG_LEGACY_RX, 37401b5e89aSBrett Creeley ICE_FLAG_VF_TRUE_PROMISC_ENA, 3759d5c5a52SPaul Greenwalt ICE_FLAG_MDD_AUTO_RESET_VF, 376ea78ce4dSPaul Greenwalt ICE_FLAG_LINK_LENIENT_MODE_ENA, 377940b61afSAnirudh Venkataramanan ICE_PF_FLAGS_NBITS /* must be last */ 378940b61afSAnirudh Venkataramanan }; 379940b61afSAnirudh Venkataramanan 380837f08fdSAnirudh Venkataramanan struct ice_pf { 381837f08fdSAnirudh Venkataramanan struct pci_dev *pdev; 382eb0208ecSPreethi Banala 383dce730f1SJacob Keller struct devlink_region *nvm_region; 3848d7aab35SJacob Keller struct devlink_region *devcaps_region; 385dce730f1SJacob Keller 386eb0208ecSPreethi Banala /* OS reserved IRQ details */ 387940b61afSAnirudh Venkataramanan struct msix_entry *msix_entries; 388cbe66bfeSBrett Creeley struct ice_res_tracker *irq_tracker; 389cbe66bfeSBrett Creeley /* First MSIX vector used by SR-IOV VFs. Calculated by subtracting the 390cbe66bfeSBrett Creeley * number of MSIX vectors needed for all SR-IOV VFs from the number of 391cbe66bfeSBrett Creeley * MSIX vectors allowed on this PF. 392cbe66bfeSBrett Creeley */ 393cbe66bfeSBrett Creeley u16 sriov_base_vector; 394eb0208ecSPreethi Banala 395148beb61SHenry Tieman u16 ctrl_vsi_idx; /* control VSI index in pf->vsi array */ 396148beb61SHenry Tieman 397940b61afSAnirudh Venkataramanan struct ice_vsi **vsi; /* VSIs created by the driver */ 398940b61afSAnirudh Venkataramanan struct ice_sw *first_sw; /* first switch created by firmware */ 399ddf30f7fSAnirudh Venkataramanan /* Virtchnl/SR-IOV config info */ 400ddf30f7fSAnirudh Venkataramanan struct ice_vf *vf; 40153bb6698SJesse Brandeburg u16 num_alloc_vfs; /* actual number of VFs allocated */ 40275d2b253SAnirudh Venkataramanan u16 num_vfs_supported; /* num VFs supported for this PF */ 40346c276ceSBrett Creeley u16 num_qps_per_vf; 40446c276ceSBrett Creeley u16 num_msix_per_vf; 4059d5c5a52SPaul Greenwalt /* used to ratelimit the MDD event logging */ 4069d5c5a52SPaul Greenwalt unsigned long last_printed_mdd_jiffies; 407837f08fdSAnirudh Venkataramanan DECLARE_BITMAP(state, __ICE_STATE_NBITS); 408940b61afSAnirudh Venkataramanan DECLARE_BITMAP(flags, ICE_PF_FLAGS_NBITS); 40978b5713aSAnirudh Venkataramanan unsigned long *avail_txqs; /* bitmap to track PF Tx queue usage */ 41078b5713aSAnirudh Venkataramanan unsigned long *avail_rxqs; /* bitmap to track PF Rx queue usage */ 411940b61afSAnirudh Venkataramanan unsigned long serv_tmr_period; 412940b61afSAnirudh Venkataramanan unsigned long serv_tmr_prev; 413940b61afSAnirudh Venkataramanan struct timer_list serv_tmr; 414940b61afSAnirudh Venkataramanan struct work_struct serv_task; 415940b61afSAnirudh Venkataramanan struct mutex avail_q_mutex; /* protects access to avail_[rx|tx]qs */ 416940b61afSAnirudh Venkataramanan struct mutex sw_mutex; /* lock for protecting VSI alloc flow */ 417b94b013eSDave Ertman struct mutex tc_mutex; /* lock to protect TC changes */ 418837f08fdSAnirudh Venkataramanan u32 msg_enable; 419d69ea414SJacob Keller 420d69ea414SJacob Keller /* spinlock to protect the AdminQ wait list */ 421d69ea414SJacob Keller spinlock_t aq_wait_lock; 422d69ea414SJacob Keller struct hlist_head aq_wait_list; 423d69ea414SJacob Keller wait_queue_head_t aq_wait_queue; 424d69ea414SJacob Keller 425d76a60baSAnirudh Venkataramanan u32 hw_csum_rx_error; 42688865fc4SKarol Kolacinski u16 oicr_idx; /* Other interrupt cause MSIX vector index */ 42788865fc4SKarol Kolacinski u16 num_avail_sw_msix; /* remaining MSIX SW vectors left unclaimed */ 42878b5713aSAnirudh Venkataramanan u16 max_pf_txqs; /* Total Tx queues PF wide */ 42978b5713aSAnirudh Venkataramanan u16 max_pf_rxqs; /* Total Rx queues PF wide */ 43088865fc4SKarol Kolacinski u16 num_lan_msix; /* Total MSIX vectors for base driver */ 431f9867df6SAnirudh Venkataramanan u16 num_lan_tx; /* num LAN Tx queues setup */ 432f9867df6SAnirudh Venkataramanan u16 num_lan_rx; /* num LAN Rx queues setup */ 433940b61afSAnirudh Venkataramanan u16 next_vsi; /* Next free slot in pf->vsi[] - 0-based! */ 434940b61afSAnirudh Venkataramanan u16 num_alloc_vsi; 4350b28b702SAnirudh Venkataramanan u16 corer_count; /* Core reset count */ 4360b28b702SAnirudh Venkataramanan u16 globr_count; /* Global reset count */ 4370b28b702SAnirudh Venkataramanan u16 empr_count; /* EMP reset count */ 4380b28b702SAnirudh Venkataramanan u16 pfr_count; /* PF reset count */ 4390b28b702SAnirudh Venkataramanan 440769c500dSAkeem G Abodunrin u8 wol_ena : 1; /* software state of WoL */ 441769c500dSAkeem G Abodunrin u32 wakeup_reason; /* last wakeup reason */ 442fcea6f3dSAnirudh Venkataramanan struct ice_hw_port_stats stats; 443fcea6f3dSAnirudh Venkataramanan struct ice_hw_port_stats stats_prev; 444837f08fdSAnirudh Venkataramanan struct ice_hw hw; 4450ab54c5fSJesse Brandeburg u8 stat_prev_loaded:1; /* has previous stats been loaded */ 4467b9ffc76SAnirudh Venkataramanan #ifdef CONFIG_DCB 4477b9ffc76SAnirudh Venkataramanan u16 dcbx_cap; 4487b9ffc76SAnirudh Venkataramanan #endif /* CONFIG_DCB */ 449b3969fd7SSudheer Mogilappagari u32 tx_timeout_count; 450b3969fd7SSudheer Mogilappagari unsigned long tx_timeout_last_recovery; 451b3969fd7SSudheer Mogilappagari u32 tx_timeout_recovery_level; 452940b61afSAnirudh Venkataramanan char int_name[ICE_INT_NAME_STR_LEN]; 4530e674aebSAnirudh Venkataramanan u32 sw_int_count; 4541a3571b5SPaul Greenwalt 4551a3571b5SPaul Greenwalt __le64 nvm_phy_type_lo; /* NVM PHY type low */ 4561a3571b5SPaul Greenwalt __le64 nvm_phy_type_hi; /* NVM PHY type high */ 457ea78ce4dSPaul Greenwalt struct ice_link_default_override_tlv link_dflt_override; 458837f08fdSAnirudh Venkataramanan }; 459940b61afSAnirudh Venkataramanan 4603a858ba3SAnirudh Venkataramanan struct ice_netdev_priv { 4613a858ba3SAnirudh Venkataramanan struct ice_vsi *vsi; 4623a858ba3SAnirudh Venkataramanan }; 4633a858ba3SAnirudh Venkataramanan 464940b61afSAnirudh Venkataramanan /** 465940b61afSAnirudh Venkataramanan * ice_irq_dynamic_ena - Enable default interrupt generation settings 466f9867df6SAnirudh Venkataramanan * @hw: pointer to HW struct 467f9867df6SAnirudh Venkataramanan * @vsi: pointer to VSI struct, can be NULL 468cdedef59SAnirudh Venkataramanan * @q_vector: pointer to q_vector, can be NULL 469940b61afSAnirudh Venkataramanan */ 470c8b7abddSBruce Allan static inline void 471c8b7abddSBruce Allan ice_irq_dynamic_ena(struct ice_hw *hw, struct ice_vsi *vsi, 472cdedef59SAnirudh Venkataramanan struct ice_q_vector *q_vector) 473940b61afSAnirudh Venkataramanan { 474b07833a0SBrett Creeley u32 vector = (vsi && q_vector) ? q_vector->reg_idx : 475cbe66bfeSBrett Creeley ((struct ice_pf *)hw->back)->oicr_idx; 476940b61afSAnirudh Venkataramanan int itr = ICE_ITR_NONE; 477940b61afSAnirudh Venkataramanan u32 val; 478940b61afSAnirudh Venkataramanan 479940b61afSAnirudh Venkataramanan /* clear the PBA here, as this function is meant to clean out all 480940b61afSAnirudh Venkataramanan * previous interrupts and enable the interrupt 481940b61afSAnirudh Venkataramanan */ 482940b61afSAnirudh Venkataramanan val = GLINT_DYN_CTL_INTENA_M | GLINT_DYN_CTL_CLEARPBA_M | 483940b61afSAnirudh Venkataramanan (itr << GLINT_DYN_CTL_ITR_INDX_S); 484cdedef59SAnirudh Venkataramanan if (vsi) 485cdedef59SAnirudh Venkataramanan if (test_bit(__ICE_DOWN, vsi->state)) 486cdedef59SAnirudh Venkataramanan return; 487940b61afSAnirudh Venkataramanan wr32(hw, GLINT_DYN_CTL(vector), val); 488940b61afSAnirudh Venkataramanan } 489cdedef59SAnirudh Venkataramanan 490c2a23e00SBrett Creeley /** 491462acf6aSTony Nguyen * ice_netdev_to_pf - Retrieve the PF struct associated with a netdev 492462acf6aSTony Nguyen * @netdev: pointer to the netdev struct 493462acf6aSTony Nguyen */ 494462acf6aSTony Nguyen static inline struct ice_pf *ice_netdev_to_pf(struct net_device *netdev) 495462acf6aSTony Nguyen { 496462acf6aSTony Nguyen struct ice_netdev_priv *np = netdev_priv(netdev); 497462acf6aSTony Nguyen 498462acf6aSTony Nguyen return np->vsi->back; 499462acf6aSTony Nguyen } 500462acf6aSTony Nguyen 501efc2214bSMaciej Fijalkowski static inline bool ice_is_xdp_ena_vsi(struct ice_vsi *vsi) 502efc2214bSMaciej Fijalkowski { 503efc2214bSMaciej Fijalkowski return !!vsi->xdp_prog; 504efc2214bSMaciej Fijalkowski } 505efc2214bSMaciej Fijalkowski 506efc2214bSMaciej Fijalkowski static inline void ice_set_ring_xdp(struct ice_ring *ring) 507efc2214bSMaciej Fijalkowski { 508efc2214bSMaciej Fijalkowski ring->flags |= ICE_TX_FLAGS_RING_XDP; 509efc2214bSMaciej Fijalkowski } 510efc2214bSMaciej Fijalkowski 511462acf6aSTony Nguyen /** 5121742b3d5SMagnus Karlsson * ice_xsk_pool - get XSK buffer pool bound to a ring 513b50f7bcaSJesse Brandeburg * @ring: ring to use 5142d4238f5SKrzysztof Kazimierczak * 5151742b3d5SMagnus Karlsson * Returns a pointer to xdp_umem structure if there is a buffer pool present, 5162d4238f5SKrzysztof Kazimierczak * NULL otherwise. 5172d4238f5SKrzysztof Kazimierczak */ 5181742b3d5SMagnus Karlsson static inline struct xsk_buff_pool *ice_xsk_pool(struct ice_ring *ring) 5192d4238f5SKrzysztof Kazimierczak { 5201742b3d5SMagnus Karlsson struct xsk_buff_pool **pools = ring->vsi->xsk_pools; 52165bb559bSKrzysztof Kazimierczak u16 qid = ring->q_index; 5222d4238f5SKrzysztof Kazimierczak 5232d4238f5SKrzysztof Kazimierczak if (ice_ring_is_xdp(ring)) 5242d4238f5SKrzysztof Kazimierczak qid -= ring->vsi->num_xdp_txq; 5252d4238f5SKrzysztof Kazimierczak 5261742b3d5SMagnus Karlsson if (qid >= ring->vsi->num_xsk_pools || !pools || !pools[qid] || 52765bb559bSKrzysztof Kazimierczak !ice_is_xdp_ena_vsi(ring->vsi)) 5282d4238f5SKrzysztof Kazimierczak return NULL; 5292d4238f5SKrzysztof Kazimierczak 5301742b3d5SMagnus Karlsson return pools[qid]; 5312d4238f5SKrzysztof Kazimierczak } 5322d4238f5SKrzysztof Kazimierczak 5332d4238f5SKrzysztof Kazimierczak /** 534208ff751SAnirudh Venkataramanan * ice_get_main_vsi - Get the PF VSI 535208ff751SAnirudh Venkataramanan * @pf: PF instance 536208ff751SAnirudh Venkataramanan * 537208ff751SAnirudh Venkataramanan * returns pf->vsi[0], which by definition is the PF VSI 538c2a23e00SBrett Creeley */ 539208ff751SAnirudh Venkataramanan static inline struct ice_vsi *ice_get_main_vsi(struct ice_pf *pf) 540c2a23e00SBrett Creeley { 541208ff751SAnirudh Venkataramanan if (pf->vsi) 542208ff751SAnirudh Venkataramanan return pf->vsi[0]; 543c2a23e00SBrett Creeley 544c2a23e00SBrett Creeley return NULL; 545c2a23e00SBrett Creeley } 546c2a23e00SBrett Creeley 547148beb61SHenry Tieman /** 548148beb61SHenry Tieman * ice_get_ctrl_vsi - Get the control VSI 549148beb61SHenry Tieman * @pf: PF instance 550148beb61SHenry Tieman */ 551148beb61SHenry Tieman static inline struct ice_vsi *ice_get_ctrl_vsi(struct ice_pf *pf) 552148beb61SHenry Tieman { 553148beb61SHenry Tieman /* if pf->ctrl_vsi_idx is ICE_NO_VSI, control VSI was not set up */ 554148beb61SHenry Tieman if (!pf->vsi || pf->ctrl_vsi_idx == ICE_NO_VSI) 555148beb61SHenry Tieman return NULL; 556148beb61SHenry Tieman 557148beb61SHenry Tieman return pf->vsi[pf->ctrl_vsi_idx]; 558148beb61SHenry Tieman } 559148beb61SHenry Tieman 5604ab95646SHenry Tieman #define ICE_FD_STAT_CTR_BLOCK_COUNT 256 5614ab95646SHenry Tieman #define ICE_FD_STAT_PF_IDX(base_idx) \ 5624ab95646SHenry Tieman ((base_idx) * ICE_FD_STAT_CTR_BLOCK_COUNT) 5634ab95646SHenry Tieman #define ICE_FD_SB_STAT_IDX(base_idx) ICE_FD_STAT_PF_IDX(base_idx) 5644ab95646SHenry Tieman 5650e674aebSAnirudh Venkataramanan int ice_vsi_setup_tx_rings(struct ice_vsi *vsi); 5660e674aebSAnirudh Venkataramanan int ice_vsi_setup_rx_rings(struct ice_vsi *vsi); 567148beb61SHenry Tieman int ice_vsi_open_ctrl(struct ice_vsi *vsi); 568fcea6f3dSAnirudh Venkataramanan void ice_set_ethtool_ops(struct net_device *netdev); 569462acf6aSTony Nguyen void ice_set_ethtool_safe_mode_ops(struct net_device *netdev); 5708c243700SAnirudh Venkataramanan u16 ice_get_avail_txq_count(struct ice_pf *pf); 5718c243700SAnirudh Venkataramanan u16 ice_get_avail_rxq_count(struct ice_pf *pf); 57287324e74SHenry Tieman int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx); 5735a4a8673SBruce Allan void ice_update_vsi_stats(struct ice_vsi *vsi); 5745a4a8673SBruce Allan void ice_update_pf_stats(struct ice_pf *pf); 575fcea6f3dSAnirudh Venkataramanan int ice_up(struct ice_vsi *vsi); 576fcea6f3dSAnirudh Venkataramanan int ice_down(struct ice_vsi *vsi); 5770e674aebSAnirudh Venkataramanan int ice_vsi_cfg(struct ice_vsi *vsi); 5780e674aebSAnirudh Venkataramanan struct ice_vsi *ice_lb_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi); 579efc2214bSMaciej Fijalkowski int ice_prepare_xdp_rings(struct ice_vsi *vsi, struct bpf_prog *prog); 580efc2214bSMaciej Fijalkowski int ice_destroy_xdp_rings(struct ice_vsi *vsi); 581efc2214bSMaciej Fijalkowski int 582efc2214bSMaciej Fijalkowski ice_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames, 583efc2214bSMaciej Fijalkowski u32 flags); 584d76a60baSAnirudh Venkataramanan int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size); 585d76a60baSAnirudh Venkataramanan int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size); 586d76a60baSAnirudh Venkataramanan void ice_fill_rss_lut(u8 *lut, u16 rss_table_size, u16 rss_size); 58787324e74SHenry Tieman int ice_schedule_reset(struct ice_pf *pf, enum ice_reset_req reset); 588fcea6f3dSAnirudh Venkataramanan void ice_print_link_msg(struct ice_vsi *vsi, bool isup); 5890fee3577SLihong Yang const char *ice_stat_str(enum ice_status stat_err); 5900fee3577SLihong Yang const char *ice_aq_str(enum ice_aq_err aq_err); 591769c500dSAkeem G Abodunrin bool ice_is_wol_supported(struct ice_pf *pf); 59228bf2672SBrett Creeley int 59328bf2672SBrett Creeley ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add, 59428bf2672SBrett Creeley bool is_tun); 595148beb61SHenry Tieman void ice_vsi_manage_fdir(struct ice_vsi *vsi, bool ena); 596cac2a27cSHenry Tieman int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd); 597cac2a27cSHenry Tieman int ice_del_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd); 5984ab95646SHenry Tieman int ice_get_ethtool_fdir_entry(struct ice_hw *hw, struct ethtool_rxnfc *cmd); 5994ab95646SHenry Tieman int 6004ab95646SHenry Tieman ice_get_fdir_fltr_ids(struct ice_hw *hw, struct ethtool_rxnfc *cmd, 6014ab95646SHenry Tieman u32 *rule_locs); 602148beb61SHenry Tieman void ice_fdir_release_flows(struct ice_hw *hw); 60383af0039SHenry Tieman void ice_fdir_replay_flows(struct ice_hw *hw); 60483af0039SHenry Tieman void ice_fdir_replay_fltrs(struct ice_pf *pf); 605148beb61SHenry Tieman int ice_fdir_create_dflt_rules(struct ice_pf *pf); 606d69ea414SJacob Keller int ice_aq_wait_for_event(struct ice_pf *pf, u16 opcode, unsigned long timeout, 607d69ea414SJacob Keller struct ice_rq_event_info *event); 6080e674aebSAnirudh Venkataramanan int ice_open(struct net_device *netdev); 6090e674aebSAnirudh Venkataramanan int ice_stop(struct net_device *netdev); 61028bf2672SBrett Creeley void ice_service_task_schedule(struct ice_pf *pf); 611d76a60baSAnirudh Venkataramanan 612837f08fdSAnirudh Venkataramanan #endif /* _ICE_H_ */ 613