cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

ice_lib.h (4175B)


      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
     10const char *ice_vsi_type_str(enum ice_vsi_type vsi_type);
     11
     12bool ice_pf_state_is_nominal(struct ice_pf *pf);
     13
     14void ice_update_eth_stats(struct ice_vsi *vsi);
     15
     16int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx);
     17
     18int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx);
     19
     20int ice_vsi_cfg_rxqs(struct ice_vsi *vsi);
     21
     22int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi);
     23
     24void ice_vsi_cfg_msix(struct ice_vsi *vsi);
     25
     26int ice_vsi_start_all_rx_rings(struct ice_vsi *vsi);
     27
     28int ice_vsi_stop_all_rx_rings(struct ice_vsi *vsi);
     29
     30int
     31ice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,
     32			  u16 rel_vmvf_num);
     33
     34int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi);
     35
     36int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi);
     37
     38bool ice_vsi_is_vlan_pruning_ena(struct ice_vsi *vsi);
     39
     40void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create);
     41
     42int ice_set_link(struct ice_vsi *vsi, bool ena);
     43
     44void ice_vsi_delete(struct ice_vsi *vsi);
     45int ice_vsi_clear(struct ice_vsi *vsi);
     46
     47int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc);
     48
     49int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi);
     50
     51void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi, u8 ena_tc);
     52
     53struct ice_vsi *
     54ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,
     55	      enum ice_vsi_type vsi_type, struct ice_vf *vf,
     56	      struct ice_channel *ch);
     57
     58void ice_napi_del(struct ice_vsi *vsi);
     59
     60int ice_vsi_release(struct ice_vsi *vsi);
     61
     62void ice_vsi_close(struct ice_vsi *vsi);
     63
     64int ice_ena_vsi(struct ice_vsi *vsi, bool locked);
     65
     66void ice_dis_vsi(struct ice_vsi *vsi, bool locked);
     67
     68int ice_free_res(struct ice_res_tracker *res, u16 index, u16 id);
     69
     70int
     71ice_get_res(struct ice_pf *pf, struct ice_res_tracker *res, u16 needed, u16 id);
     72
     73int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi);
     74
     75bool ice_is_reset_in_progress(unsigned long *state);
     76int ice_wait_for_reset(struct ice_pf *pf, unsigned long timeout);
     77
     78void
     79ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio,
     80			bool ena_ts);
     81
     82void ice_vsi_dis_irq(struct ice_vsi *vsi);
     83
     84void ice_vsi_free_irq(struct ice_vsi *vsi);
     85
     86void ice_vsi_free_rx_rings(struct ice_vsi *vsi);
     87
     88void ice_vsi_free_tx_rings(struct ice_vsi *vsi);
     89
     90void ice_vsi_manage_rss_lut(struct ice_vsi *vsi, bool ena);
     91
     92void ice_update_tx_ring_stats(struct ice_tx_ring *ring, u64 pkts, u64 bytes);
     93
     94void ice_update_rx_ring_stats(struct ice_rx_ring *ring, u64 pkts, u64 bytes);
     95
     96void ice_vsi_cfg_frame_size(struct ice_vsi *vsi);
     97void ice_write_intrl(struct ice_q_vector *q_vector, u8 intrl);
     98void ice_write_itr(struct ice_ring_container *rc, u16 itr);
     99void ice_set_q_vector_intrl(struct ice_q_vector *q_vector);
    100
    101int ice_vsi_cfg_mac_fltr(struct ice_vsi *vsi, const u8 *macaddr, bool set);
    102
    103bool ice_is_safe_mode(struct ice_pf *pf);
    104bool ice_is_rdma_ena(struct ice_pf *pf);
    105bool ice_is_dflt_vsi_in_use(struct ice_sw *sw);
    106
    107bool ice_is_vsi_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi);
    108
    109int ice_set_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi);
    110
    111int ice_clear_dflt_vsi(struct ice_sw *sw);
    112int ice_set_min_bw_limit(struct ice_vsi *vsi, u64 min_tx_rate);
    113int ice_set_max_bw_limit(struct ice_vsi *vsi, u64 max_tx_rate);
    114int ice_get_link_speed_kbps(struct ice_vsi *vsi);
    115int ice_get_link_speed_mbps(struct ice_vsi *vsi);
    116int
    117ice_vsi_update_security(struct ice_vsi *vsi, void (*fill)(struct ice_vsi_ctx *));
    118
    119void ice_vsi_ctx_set_antispoof(struct ice_vsi_ctx *ctx);
    120
    121void ice_vsi_ctx_clear_antispoof(struct ice_vsi_ctx *ctx);
    122
    123void ice_vsi_ctx_set_allow_override(struct ice_vsi_ctx *ctx);
    124
    125void ice_vsi_ctx_clear_allow_override(struct ice_vsi_ctx *ctx);
    126int ice_vsi_add_vlan_zero(struct ice_vsi *vsi);
    127int ice_vsi_del_vlan_zero(struct ice_vsi *vsi);
    128bool ice_vsi_has_non_zero_vlans(struct ice_vsi *vsi);
    129u16 ice_vsi_num_non_zero_vlans(struct ice_vsi *vsi);
    130bool ice_is_feature_supported(struct ice_pf *pf, enum ice_feature f);
    131void ice_clear_feature_support(struct ice_pf *pf, enum ice_feature f);
    132void ice_init_feature_support(struct ice_pf *pf);
    133#endif /* !_ICE_LIB_H_ */