Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/ixl.h
Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | |||||
/* used in the vlan field of the filter when not a vlan */ | /* used in the vlan field of the filter when not a vlan */ | ||||
#define IXL_VLAN_ANY -1 | #define IXL_VLAN_ANY -1 | ||||
#define CSUM_OFFLOAD_IPV4 (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) | #define CSUM_OFFLOAD_IPV4 (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) | ||||
#define CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6|CSUM_UDP_IPV6|CSUM_SCTP_IPV6) | #define CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6|CSUM_UDP_IPV6|CSUM_SCTP_IPV6) | ||||
#define CSUM_OFFLOAD (CSUM_OFFLOAD_IPV4|CSUM_OFFLOAD_IPV6|CSUM_TSO) | #define CSUM_OFFLOAD (CSUM_OFFLOAD_IPV4|CSUM_OFFLOAD_IPV6|CSUM_TSO) | ||||
/* Misc flags for ixl_vsi.flags */ | |||||
#define IXL_FLAGS_KEEP_TSO4 (1 << 0) | |||||
#define IXL_FLAGS_KEEP_TSO6 (1 << 1) | |||||
#define IXL_FLAGS_USES_MSIX (1 << 2) | |||||
#define IXL_FLAGS_IS_VF (1 << 3) | |||||
#define IXL_VSI_IS_PF(v) ((v->flags & IXL_FLAGS_IS_VF) == 0) | |||||
#define IXL_VSI_IS_VF(v) ((v->flags & IXL_FLAGS_IS_VF) != 0) | |||||
#define IXL_VF_RESET_TIMEOUT 100 | #define IXL_VF_RESET_TIMEOUT 100 | ||||
#define IXL_VSI_DATA_PORT 0x01 | #define IXL_VSI_DATA_PORT 0x01 | ||||
#define IAVF_MAX_QUEUES 16 | #define IAVF_MAX_QUEUES 16 | ||||
#define IXL_MAX_VSI_QUEUES (2 * (I40E_VSILAN_QTABLE_MAX_INDEX + 1)) | #define IXL_MAX_VSI_QUEUES (2 * (I40E_VSILAN_QTABLE_MAX_INDEX + 1)) | ||||
#define IXL_RX_CTX_BASE_UNITS 128 | #define IXL_RX_CTX_BASE_UNITS 128 | ||||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | |||||
#define IXL_SET_IMCASTS(vsi, count) (vsi)->ifp->if_imcasts = (count) | #define IXL_SET_IMCASTS(vsi, count) (vsi)->ifp->if_imcasts = (count) | ||||
#define IXL_SET_OMCASTS(vsi, count) (vsi)->ifp->if_omcasts = (count) | #define IXL_SET_OMCASTS(vsi, count) (vsi)->ifp->if_omcasts = (count) | ||||
#define IXL_SET_IQDROPS(vsi, count) (vsi)->ifp->if_iqdrops = (count) | #define IXL_SET_IQDROPS(vsi, count) (vsi)->ifp->if_iqdrops = (count) | ||||
#define IXL_SET_OQDROPS(vsi, odrops) (vsi)->ifp->if_snd.ifq_drops = (odrops) | #define IXL_SET_OQDROPS(vsi, odrops) (vsi)->ifp->if_snd.ifq_drops = (odrops) | ||||
#define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count) | #define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count) | ||||
#endif | #endif | ||||
/* For stats sysctl naming */ | /* For stats sysctl naming */ | ||||
#define QUEUE_NAME_LEN 32 | #define IXL_QUEUE_NAME_LEN 32 | ||||
#define IXL_DEV_ERR(_dev, _format, ...) \ | #define IXL_DEV_ERR(_dev, _format, ...) \ | ||||
device_printf(_dev, "%s: " _format " (%s:%d)\n", __func__, ##__VA_ARGS__, __FILE__, __LINE__) | device_printf(_dev, "%s: " _format " (%s:%d)\n", __func__, ##__VA_ARGS__, __FILE__, __LINE__) | ||||
/* | /* | ||||
***************************************************************************** | ***************************************************************************** | ||||
* vendor_info_array | * vendor_info_array | ||||
* | * | ||||
▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | struct ixl_vsi { | ||||
struct ixl_tx_queue *tx_queues; /* TX queue array */ | struct ixl_tx_queue *tx_queues; /* TX queue array */ | ||||
struct ixl_rx_queue *rx_queues; /* RX queue array */ | struct ixl_rx_queue *rx_queues; /* RX queue array */ | ||||
struct if_irq irq; | struct if_irq irq; | ||||
u32 link_speed; | u32 link_speed; | ||||
/* MAC/VLAN Filter list */ | /* MAC/VLAN Filter list */ | ||||
struct ixl_ftl_head ftl; | struct ixl_ftl_head ftl; | ||||
u16 num_macs; | u16 num_macs; | ||||
u64 num_hw_filters; | |||||
/* Contains readylist & stat counter id */ | /* Contains readylist & stat counter id */ | ||||
struct i40e_aqc_vsi_properties_data info; | struct i40e_aqc_vsi_properties_data info; | ||||
u16 num_vlans; | u16 num_vlans; | ||||
/* Per-VSI stats from hardware */ | /* Per-VSI stats from hardware */ | ||||
struct i40e_eth_stats eth_stats; | struct i40e_eth_stats eth_stats; | ||||
struct i40e_eth_stats eth_stats_offsets; | struct i40e_eth_stats eth_stats_offsets; | ||||
bool stat_offsets_loaded; | bool stat_offsets_loaded; | ||||
/* VSI stat counters */ | /* VSI stat counters */ | ||||
u64 ipackets; | u64 ipackets; | ||||
u64 ierrors; | u64 ierrors; | ||||
u64 opackets; | u64 opackets; | ||||
u64 oerrors; | u64 oerrors; | ||||
u64 ibytes; | u64 ibytes; | ||||
u64 obytes; | u64 obytes; | ||||
u64 imcasts; | u64 imcasts; | ||||
u64 omcasts; | u64 omcasts; | ||||
u64 iqdrops; | u64 iqdrops; | ||||
u64 oqdrops; | u64 oqdrops; | ||||
u64 noproto; | u64 noproto; | ||||
/* Driver statistics */ | |||||
u64 hw_filters_del; | |||||
u64 hw_filters_add; | |||||
/* Misc. */ | /* Misc. */ | ||||
u64 flags; | u64 flags; | ||||
/* Stats sysctls for this VSI */ | /* Stats sysctls for this VSI */ | ||||
struct sysctl_oid *vsi_node; | struct sysctl_oid *vsi_node; | ||||
struct sysctl_ctx_list sysctl_ctx; | |||||
}; | }; | ||||
/* | /* | ||||
** Creates new filter with given MAC address and VLAN ID | ** Creates new filter with given MAC address and VLAN ID | ||||
*/ | */ | ||||
static inline struct ixl_mac_filter * | static inline struct ixl_mac_filter * | ||||
ixl_new_filter(struct ixl_vsi *vsi, const u8 *macaddr, s16 vlan) | ixl_new_filter(struct ixl_vsi *vsi, const u8 *macaddr, s16 vlan) | ||||
{ | { | ||||
Show All 12 Lines | ixl_new_filter(struct ixl_vsi *vsi, const u8 *macaddr, s16 vlan) | ||||
return (f); | return (f); | ||||
} | } | ||||
/* | /* | ||||
** Compare two ethernet addresses | ** Compare two ethernet addresses | ||||
*/ | */ | ||||
static inline bool | static inline bool | ||||
cmp_etheraddr(const u8 *ea1, const u8 *ea2) | cmp_etheraddr(const u8 *ea1, const u8 *ea2) | ||||
{ | { | ||||
return (bcmp(ea1, ea2, 6) == 0); | return (bcmp(ea1, ea2, ETHER_ADDR_LEN) == 0); | ||||
} | } | ||||
/* | /* | ||||
* Return next largest power of 2, unsigned | * Return next largest power of 2, unsigned | ||||
* | * | ||||
* Public domain, from Bit Twiddling Hacks | * Public domain, from Bit Twiddling Hacks | ||||
*/ | */ | ||||
static inline u32 | static inline u32 | ||||
next_power_of_two(u32 n) | next_power_of_two(u32 n) | ||||
Show All 32 Lines | |||||
void ixl_init_tx_rsqs(struct ixl_vsi *vsi); | void ixl_init_tx_rsqs(struct ixl_vsi *vsi); | ||||
void ixl_init_tx_cidx(struct ixl_vsi *vsi); | void ixl_init_tx_cidx(struct ixl_vsi *vsi); | ||||
u64 ixl_max_vc_speed_to_value(u8 link_speeds); | u64 ixl_max_vc_speed_to_value(u8 link_speeds); | ||||
void ixl_add_vsi_sysctls(device_t dev, struct ixl_vsi *vsi, | void ixl_add_vsi_sysctls(device_t dev, struct ixl_vsi *vsi, | ||||
struct sysctl_ctx_list *ctx, const char *sysctl_name); | struct sysctl_ctx_list *ctx, const char *sysctl_name); | ||||
void ixl_add_sysctls_eth_stats(struct sysctl_ctx_list *ctx, | void ixl_add_sysctls_eth_stats(struct sysctl_ctx_list *ctx, | ||||
struct sysctl_oid_list *child, | struct sysctl_oid_list *child, | ||||
struct i40e_eth_stats *eth_stats); | struct i40e_eth_stats *eth_stats); | ||||
void ixl_add_queues_sysctls(device_t dev, struct ixl_vsi *vsi); | void ixl_vsi_add_queues_stats(struct ixl_vsi *vsi); | ||||
#endif /* _IXL_H_ */ | #endif /* _IXL_H_ */ |