Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v6.3 173 lines 5.4 kB view raw
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* Copyright (c) 2018, Intel Corporation. */ 3 4#ifndef _ICE_LIB_H_ 5#define _ICE_LIB_H_ 6 7#include "ice.h" 8#include "ice_vlan.h" 9 10/* Flags used for VSI configuration and rebuild */ 11#define ICE_VSI_FLAG_INIT BIT(0) 12#define ICE_VSI_FLAG_NO_INIT 0 13 14/** 15 * struct ice_vsi_cfg_params - VSI configuration parameters 16 * @pi: pointer to the port_info instance for the VSI 17 * @ch: pointer to the channel structure for the VSI, may be NULL 18 * @vf: pointer to the VF associated with this VSI, may be NULL 19 * @type: the type of VSI to configure 20 * @flags: VSI flags used for rebuild and configuration 21 * 22 * Parameter structure used when configuring a new VSI. 23 */ 24struct ice_vsi_cfg_params { 25 struct ice_port_info *pi; 26 struct ice_channel *ch; 27 struct ice_vf *vf; 28 enum ice_vsi_type type; 29 u32 flags; 30}; 31 32/** 33 * ice_vsi_to_params - Get parameters for an existing VSI 34 * @vsi: the VSI to get parameters for 35 * 36 * Fill a parameter structure for reconfiguring a VSI with its current 37 * parameters, such as during a rebuild operation. 38 */ 39static inline struct ice_vsi_cfg_params ice_vsi_to_params(struct ice_vsi *vsi) 40{ 41 struct ice_vsi_cfg_params params = {}; 42 43 params.pi = vsi->port_info; 44 params.ch = vsi->ch; 45 params.vf = vsi->vf; 46 params.type = vsi->type; 47 48 return params; 49} 50 51const char *ice_vsi_type_str(enum ice_vsi_type vsi_type); 52 53bool ice_pf_state_is_nominal(struct ice_pf *pf); 54 55void ice_update_eth_stats(struct ice_vsi *vsi); 56 57int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx); 58 59int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx); 60 61int ice_vsi_cfg_rxqs(struct ice_vsi *vsi); 62 63int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi); 64 65void ice_vsi_cfg_msix(struct ice_vsi *vsi); 66 67int ice_vsi_start_all_rx_rings(struct ice_vsi *vsi); 68 69int ice_vsi_stop_all_rx_rings(struct ice_vsi *vsi); 70 71int 72ice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, 73 u16 rel_vmvf_num); 74 75int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi); 76 77int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi); 78 79bool ice_vsi_is_vlan_pruning_ena(struct ice_vsi *vsi); 80 81void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create); 82 83int ice_set_link(struct ice_vsi *vsi, bool ena); 84 85void ice_vsi_delete(struct ice_vsi *vsi); 86 87int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc); 88 89int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi); 90 91void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi, u8 ena_tc); 92 93struct ice_vsi * 94ice_vsi_setup(struct ice_pf *pf, struct ice_vsi_cfg_params *params); 95 96void ice_napi_del(struct ice_vsi *vsi); 97 98int ice_vsi_release(struct ice_vsi *vsi); 99 100void ice_vsi_close(struct ice_vsi *vsi); 101 102int ice_ena_vsi(struct ice_vsi *vsi, bool locked); 103 104void ice_vsi_decfg(struct ice_vsi *vsi); 105void ice_dis_vsi(struct ice_vsi *vsi, bool locked); 106 107int ice_free_res(struct ice_res_tracker *res, u16 index, u16 id); 108 109int 110ice_get_res(struct ice_pf *pf, struct ice_res_tracker *res, u16 needed, u16 id); 111 112int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags); 113int ice_vsi_cfg(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params); 114 115bool ice_is_reset_in_progress(unsigned long *state); 116int ice_wait_for_reset(struct ice_pf *pf, unsigned long timeout); 117 118void 119ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio, 120 bool ena_ts); 121 122void ice_vsi_dis_irq(struct ice_vsi *vsi); 123 124void ice_vsi_free_irq(struct ice_vsi *vsi); 125 126void ice_vsi_free_rx_rings(struct ice_vsi *vsi); 127 128void ice_vsi_free_tx_rings(struct ice_vsi *vsi); 129 130void ice_vsi_manage_rss_lut(struct ice_vsi *vsi, bool ena); 131 132void ice_vsi_cfg_crc_strip(struct ice_vsi *vsi, bool disable); 133 134void ice_update_tx_ring_stats(struct ice_tx_ring *ring, u64 pkts, u64 bytes); 135 136void ice_update_rx_ring_stats(struct ice_rx_ring *ring, u64 pkts, u64 bytes); 137 138void ice_vsi_cfg_frame_size(struct ice_vsi *vsi); 139void ice_write_intrl(struct ice_q_vector *q_vector, u8 intrl); 140void ice_write_itr(struct ice_ring_container *rc, u16 itr); 141void ice_set_q_vector_intrl(struct ice_q_vector *q_vector); 142 143int ice_vsi_cfg_mac_fltr(struct ice_vsi *vsi, const u8 *macaddr, bool set); 144 145bool ice_is_safe_mode(struct ice_pf *pf); 146bool ice_is_rdma_ena(struct ice_pf *pf); 147bool ice_is_dflt_vsi_in_use(struct ice_port_info *pi); 148bool ice_is_vsi_dflt_vsi(struct ice_vsi *vsi); 149int ice_set_dflt_vsi(struct ice_vsi *vsi); 150int ice_clear_dflt_vsi(struct ice_vsi *vsi); 151int ice_set_min_bw_limit(struct ice_vsi *vsi, u64 min_tx_rate); 152int ice_set_max_bw_limit(struct ice_vsi *vsi, u64 max_tx_rate); 153int ice_get_link_speed_kbps(struct ice_vsi *vsi); 154int ice_get_link_speed_mbps(struct ice_vsi *vsi); 155int 156ice_vsi_update_security(struct ice_vsi *vsi, void (*fill)(struct ice_vsi_ctx *)); 157 158void ice_vsi_ctx_set_antispoof(struct ice_vsi_ctx *ctx); 159 160void ice_vsi_ctx_clear_antispoof(struct ice_vsi_ctx *ctx); 161 162void ice_vsi_ctx_set_allow_override(struct ice_vsi_ctx *ctx); 163 164void ice_vsi_ctx_clear_allow_override(struct ice_vsi_ctx *ctx); 165int ice_vsi_add_vlan_zero(struct ice_vsi *vsi); 166int ice_vsi_del_vlan_zero(struct ice_vsi *vsi); 167bool ice_vsi_has_non_zero_vlans(struct ice_vsi *vsi); 168u16 ice_vsi_num_non_zero_vlans(struct ice_vsi *vsi); 169bool ice_is_feature_supported(struct ice_pf *pf, enum ice_feature f); 170void ice_clear_feature_support(struct ice_pf *pf, enum ice_feature f); 171void ice_init_feature_support(struct ice_pf *pf); 172bool ice_vsi_is_rx_queue_active(struct ice_vsi *vsi); 173#endif /* !_ICE_LIB_H_ */