/* VSI state flags */ enum i40e_vsi_state {
__I40E_VSI_DOWN,
__I40E_VSI_NEEDS_RESTART,
__I40E_VSI_SYNCING_FILTERS,
__I40E_VSI_OVERFLOW_PROMISC,
__I40E_VSI_REINIT_REQUESTED,
__I40E_VSI_DOWN_REQUESTED,
__I40E_VSI_RELEASING, /* This must be last as it determines the size of the BITMAP */
__I40E_VSI_STATE_SIZE__,
};
enum i40e_pf_flags {
I40E_FLAG_MSI_ENA,
I40E_FLAG_MSIX_ENA,
I40E_FLAG_RSS_ENA,
I40E_FLAG_VMDQ_ENA,
I40E_FLAG_SRIOV_ENA,
I40E_FLAG_DCB_CAPABLE,
I40E_FLAG_DCB_ENA,
I40E_FLAG_FD_SB_ENA,
I40E_FLAG_FD_ATR_ENA,
I40E_FLAG_MFP_ENA,
I40E_FLAG_HW_ATR_EVICT_ENA,
I40E_FLAG_VEB_MODE_ENA,
I40E_FLAG_VEB_STATS_ENA,
I40E_FLAG_LINK_POLLING_ENA,
I40E_FLAG_TRUE_PROMISC_ENA,
I40E_FLAG_LEGACY_RX_ENA,
I40E_FLAG_PTP_ENA,
I40E_FLAG_IWARP_ENA,
I40E_FLAG_LINK_DOWN_ON_CLOSE_ENA,
I40E_FLAG_SOURCE_PRUNING_DIS,
I40E_FLAG_TC_MQPRIO_ENA,
I40E_FLAG_FD_SB_INACTIVE,
I40E_FLAG_FD_SB_TO_CLOUD_FILTER,
I40E_FLAG_FW_LLDP_DIS,
I40E_FLAG_RS_FEC,
I40E_FLAG_BASE_R_FEC, /* TOTAL_PORT_SHUTDOWN_ENA * Allows to physically disable the link on the NIC's port. * If enabled, (after link down request from the OS) * no link, traffic or led activity is possible on that port. * * If I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENA is set, the * I40E_FLAG_LINK_DOWN_ON_CLOSE_ENA must be explicitly forced * to true and cannot be disabled by system admin at that time. * The functionalities are exclusive in terms of configuration, but * they also have similar behavior (allowing to disable physical * link of the port), with following differences: * - LINK_DOWN_ON_CLOSE_ENA is configurable at host OS run-time and * is supported by whole family of 7xx Intel Ethernet Controllers * - TOTAL_PORT_SHUTDOWN_ENA may be enabled only before OS loads * (in BIOS) only if motherboard's BIOS and NIC's FW has support of it * - when LINK_DOWN_ON_CLOSE_ENABLED is used, the link is being brought * down by sending phy_type=0 to NIC's FW * - when TOTAL_PORT_SHUTDOWN_ENA is used, phy_type is not altered, * instead the link is being brought down by clearing * bit (I40E_AQ_PHY_ENABLE_LINK) in abilities field of * i40e_aq_set_phy_config structure
*/
I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENA,
I40E_FLAG_VF_VLAN_PRUNING_ENA,
I40E_FLAG_MDD_AUTO_RESET_VF,
I40E_PF_FLAGS_NBITS, /* must be last */
};
/* The following structure contains the data parsed from the user-defined * field of the ethtool_rx_flow_spec structure.
*/ struct i40e_rx_flow_userdef { bool flex_filter;
u16 flex_word;
u16 flex_offset;
};
u16 num_vmdq_vsis; /* num vmdq vsis this PF has set up */
u16 num_vmdq_qps; /* num queue pairs per vmdq pool */
u16 num_vmdq_msix; /* num queue vectors per vmdq pool */
u16 num_req_vfs; /* num VFs requested for this PF */
u16 num_vf_qps; /* num queue pairs per VF */
u16 num_lan_qps; /* num lan queues this PF has set up */
u16 num_lan_msix; /* num queue vectors for the base PF vsi */
u16 num_fdsb_msix; /* num queue vectors for sideband Fdir */
u16 num_iwarp_msix; /* num of iwarp vectors for this PF */ int iwarp_base_vector; int queues_left; /* queues left unclaimed */
u16 alloc_rss_size; /* allocated RSS queues */
u16 rss_size_max; /* HW defined max RSS queues */
u16 fdir_pf_filter_count; /* num of guaranteed filters for this PF */
u16 num_alloc_vsi; /* num VSIs this driver supports */ bool wol_en;
/* Book-keeping of side-band filter count per flow-type. * This is used to detect and handle input set changes for * respective flow-type.
*/
u16 fd_tcp4_filter_cnt;
u16 fd_udp4_filter_cnt;
u16 fd_sctp4_filter_cnt;
u16 fd_ip4_filter_cnt;
/* Flexible filter table values that need to be programmed into * hardware, which expects L3 and L4 to be programmed separately. We * need to ensure that the values are in ascended order and don't have * duplicates, so we track each L3 and L4 values in separate lists.
*/ struct list_head l3_flex_pit_list; struct list_head l4_flex_pit_list;
/* sr-iov config info */ struct i40e_vf *vf; int num_alloc_vfs; /* actual number of VFs allocated */
u32 vf_aq_requests;
u32 arq_overflows; /* Not fatal, possibly indicative of problems */ struct ratelimit_state mdd_message_rate_limit; /* DCBx/DCBNL capability for PF that indicates * whether DCBx is managed by firmware or host * based agent (LLDPAD). Also, indicates what * flavor of DCBx protocol (IEEE/CEE) is supported * by the device. For now we're supporting IEEE * mode only.
*/
u16 dcbx_cap;
u16 last_sw_conf_flags;
u16 last_sw_conf_valid_flags; /* List to keep previous DDP profiles to be rolled back in the future */ struct list_head ddp_old_prof;
};
/** * __i40e_pf_next_vsi - get next valid VSI * @pf: pointer to the PF struct * @idx: pointer to start position number * * Find and return next non-NULL VSI pointer in pf->vsi array and * updates idx position. Returns NULL if no VSI is found.
**/ static __always_inline struct i40e_vsi *
__i40e_pf_next_vsi(struct i40e_pf *pf, int *idx)
{ while (*idx < pf->num_alloc_vsi) { if (pf->vsi[*idx]) return pf->vsi[*idx];
(*idx)++;
} return NULL;
}
/** * __i40e_pf_next_veb - get next valid VEB * @pf: pointer to the PF struct * @idx: pointer to start position number * * Find and return next non-NULL VEB pointer in pf->veb array and * updates idx position. Returns NULL if no VEB is found.
**/ static __always_inline struct i40e_veb *
__i40e_pf_next_veb(struct i40e_pf *pf, int *idx)
{ while (*idx < I40E_MAX_VEB) { if (pf->veb[*idx]) return pf->veb[*idx];
(*idx)++;
} return NULL;
}
/** * i40e_addr_to_hkey - Convert a 6-byte MAC Address to a u64 hash key * @macaddr: the MAC Address as the base key * * Simply copies the address and returns it as a u64 for hashing
**/ staticinline u64 i40e_addr_to_hkey(const u8 *macaddr)
{
u64 key = 0;
enum i40e_filter_state {
I40E_FILTER_INVALID = 0, /* Invalid state */
I40E_FILTER_NEW, /* New, not sent to FW yet */
I40E_FILTER_ACTIVE, /* Added to switch by FW */
I40E_FILTER_FAILED, /* Rejected by FW */
I40E_FILTER_REMOVE, /* To be removed */
I40E_FILTER_NEW_SYNC, /* New, not sent yet, is in i40e_sync_vsi_filters() */ /* There is no 'removed' state; the filter struct is freed */
}; struct i40e_mac_filter { struct hlist_node hlist;
u8 macaddr[ETH_ALEN]; #define I40E_VLAN_ANY -1
s16 vlan; enum i40e_filter_state state;
};
/* Wrapper structure to keep track of filters while we are preparing to send * firmware commands. We cannot send firmware commands while holding a * spinlock, since it might sleep. To avoid this, we wrap the added filters in * a separate structure, which will track the state change and update the real * filter while under lock. We can't simply hold the filters in a separate * list, as this opens a window for a race condition when adding new MAC * addresses to all VLANs, or when adding new VLANs to all MAC addresses.
*/ struct i40e_new_mac_filter { struct hlist_node hlist; struct i40e_mac_filter *f;
/* Track future changes to state separately */ enum i40e_filter_state state;
};
/* struct that defines a VSI, associated with a dev */ struct i40e_vsi { struct net_device *netdev; unsignedlong active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; bool netdev_registered; bool stat_offsets_loaded;
/* Per VSI lock to protect elements/hash (MAC filter) */
spinlock_t mac_filter_hash_lock; /* Fixed size hash table with 2^8 buckets for MAC filters */
DECLARE_HASHTABLE(mac_filter_hash, 8); bool has_vlan_filter;
/* These are containers of ring pointers, allocated at run-time */ struct i40e_ring **rx_rings; struct i40e_ring **tx_rings; struct i40e_ring **xdp_rings; /* XDP Tx rings */
u32 active_filters;
u32 promisc_threshold;
u16 work_limit;
u16 int_rate_limit; /* value in usecs */
/* VSI BW limit (absolute across all TCs) */
u16 bw_limit; /* VSI BW Limit (0 = disabled) */
u8 bw_max_quanta; /* Max Quanta when BW limit is enabled */
/* Relative TC credits across VSIs */
u8 bw_ets_share_credits[I40E_MAX_TRAFFIC_CLASS]; /* TC BW limit credits within VSI */
u16 bw_ets_limit_credits[I40E_MAX_TRAFFIC_CLASS]; /* TC BW limit max quanta within VSI */
u8 bw_ets_max_quanta[I40E_MAX_TRAFFIC_CLASS];
struct i40e_pf *back; /* Backreference to associated PF */
u16 idx; /* index in pf->vsi[] */
u16 veb_idx; /* index of VEB parent */ struct kobject *kobj; /* sysfs object */ bool current_isup; /* Sync 'link up' logging */ enum i40e_aq_link_speed current_speed; /* Sync link speed logging */
/* channel specific fields */
u16 cnt_q_avail; /* num of queues available for channel usage */
u16 orig_rss_size;
u16 current_rss_size; bool reconfig_rss;
u16 next_base_queue; /* next queue to be used for channel setup */
major = FIELD_GET(I40E_NVM_VERSION_HI_MASK, nvm->version);
minor = FIELD_GET(I40E_NVM_VERSION_LO_MASK, nvm->version);
snprintf(buf, len, "%x.%02x", major, minor);
}
}
/** * i40e_info_eetrack - format the EETrackID string * @hw: ptr to the hardware info * @buf: string buffer to store * @len: buffer size * * Returns hexadecimally formated EETrackID if it is * different from I40E_OEM_EETRACK_ID or empty string.
**/ staticinlinevoid i40e_info_eetrack(struct i40e_hw *hw, char *buf, size_t len)
{ struct i40e_nvm_info *nvm = &hw->nvm;
/** * i40e_info_civd_ver - format the NVM version strings * @hw: ptr to the hardware info * @buf: string buffer to store * @len: buffer size * * Returns formated combo image version if adapter's EETrackID is * different from I40E_OEM_EETRACK_ID or empty string.
**/ staticinlinevoid i40e_info_civd_ver(struct i40e_hw *hw, char *buf, size_t len)
{ struct i40e_nvm_info *nvm = &hw->nvm;
/** * i40e_get_fd_cnt_all - get the total FD filter space available * @pf: pointer to the PF struct
**/ staticinlineint i40e_get_fd_cnt_all(struct i40e_pf *pf)
{ return pf->hw.fdir_shared_filter_count + pf->fdir_pf_filter_count;
}
/** * i40e_read_fd_input_set - reads value of flow director input set register * @pf: pointer to the PF struct * @addr: register addr * * This function reads value of flow director input set register * specified by 'addr' (which is specific to flow-type)
**/ staticinline u64 i40e_read_fd_input_set(struct i40e_pf *pf, u16 addr)
{
u64 val;
val = i40e_read_rx_ctl(&pf->hw, I40E_PRTQF_FD_INSET(addr, 1));
val <<= 32;
val += i40e_read_rx_ctl(&pf->hw, I40E_PRTQF_FD_INSET(addr, 0));
return val;
}
/** * i40e_write_fd_input_set - writes value into flow director input set register * @pf: pointer to the PF struct * @addr: register addr * @val: value to be written * * This function writes specified value to the register specified by 'addr'. * This register is input set register based on flow-type.
**/ staticinlinevoid i40e_write_fd_input_set(struct i40e_pf *pf,
u16 addr, u64 val)
{
i40e_write_rx_ctl(&pf->hw, I40E_PRTQF_FD_INSET(addr, 1),
(u32)(val >> 32));
i40e_write_rx_ctl(&pf->hw, I40E_PRTQF_FD_INSET(addr, 0),
(u32)(val & 0xFFFFFFFFULL));
}
/** * i40e_get_pf_count - get PCI PF count. * @hw: pointer to a hw. * * Reports the function number of the highest PCI physical * function plus 1 as it is loaded from the NVM. * * Return: PCI PF count.
**/ staticinline u32 i40e_get_pf_count(struct i40e_hw *hw)
{ return FIELD_GET(I40E_GLGEN_PCIFCNCNT_PCIPFCNT_MASK,
rd32(hw, I40E_GLGEN_PCIFCNCNT));
}
/* needed by i40e_ethtool.c */ int i40e_up(struct i40e_vsi *vsi); void i40e_down(struct i40e_vsi *vsi); externconstchar i40e_driver_name[]; void i40e_do_reset_safe(struct i40e_pf *pf, u32 reset_flags); void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired); int i40e_config_rss(struct i40e_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size); int i40e_get_rss(struct i40e_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size); void i40e_fill_rss_lut(struct i40e_pf *pf, u8 *lut,
u16 rss_table_size, u16 rss_size); struct i40e_vsi *i40e_find_vsi_from_id(struct i40e_pf *pf, u16 id); /** * i40e_find_vsi_by_type - Find and return Flow Director VSI * @pf: PF to search for VSI * @type: Value indicating type of VSI we are looking for
**/ staticinlinestruct i40e_vsi *
i40e_find_vsi_by_type(struct i40e_pf *pf, u16 type)
{ struct i40e_vsi *vsi; int i;
i40e_pf_for_each_vsi(pf, i, vsi) if (vsi->type == type) return vsi;
int i40e_create_queue_channel(struct i40e_vsi *vsi, struct i40e_channel *ch); int i40e_set_bw_limit(struct i40e_vsi *vsi, u16 seid, u64 max_tx_rate); int i40e_add_del_cloud_filter(struct i40e_vsi *vsi, struct i40e_cloud_filter *filter, bool add); int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi, struct i40e_cloud_filter *filter, bool add);
/** * i40e_is_tc_mqprio_enabled - check if TC MQPRIO is enabled on PF * @pf: pointer to a pf. * * Check and return state of flag I40E_FLAG_TC_MQPRIO. * * Return: true/false if I40E_FLAG_TC_MQPRIO is set or not
**/ staticinlinebool i40e_is_tc_mqprio_enabled(struct i40e_pf *pf)
{ return test_bit(I40E_FLAG_TC_MQPRIO_ENA, pf->flags);
}
/** * i40e_hw_to_pf - get pf pointer from the hardware structure * @hw: pointer to the device HW structure
**/ staticinlinestruct i40e_pf *i40e_hw_to_pf(struct i40e_hw *hw)
{ return container_of(hw, struct i40e_pf, hw);
}
/** * i40e_pf_get_vsi_by_seid - find VSI by SEID * @pf: pointer to a PF * @seid: SEID of the VSI
**/ staticinlinestruct i40e_vsi *
i40e_pf_get_vsi_by_seid(struct i40e_pf *pf, u16 seid)
{ struct i40e_vsi *vsi; int i;
i40e_pf_for_each_vsi(pf, i, vsi) if (vsi->seid == seid) return vsi;
return NULL;
}
/** * i40e_pf_get_main_vsi - get pointer to main VSI * @pf: pointer to a PF * * Return: pointer to main VSI or NULL if it does not exist
**/ staticinlinestruct i40e_vsi *i40e_pf_get_main_vsi(struct i40e_pf *pf)
{ return (pf->lan_vsi != I40E_NO_VSI) ? pf->vsi[pf->lan_vsi] : NULL;
}
/** * i40e_pf_get_veb_by_seid - find VEB by SEID * @pf: pointer to a PF * @seid: SEID of the VSI
**/ staticinlinestruct i40e_veb *
i40e_pf_get_veb_by_seid(struct i40e_pf *pf, u16 seid)
{ struct i40e_veb *veb; int i;
i40e_pf_for_each_veb(pf, i, veb) if (veb->seid == seid) return veb;
return NULL;
}
/** * i40e_pf_get_main_veb - get pointer to main VEB * @pf: pointer to a PF * * Return: pointer to main VEB or NULL if it does not exist
**/ staticinlinestruct i40e_veb *i40e_pf_get_main_veb(struct i40e_pf *pf)
{ return (pf->lan_veb != I40E_NO_VEB) ? pf->veb[pf->lan_veb] : NULL;
}
#endif/* _I40E_H_ */
Messung V0.5
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.