Changeset View
Changeset View
Standalone View
Standalone View
stable/10/sys/dev/ixgbe/ixgbe.h
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | |||||
#define PERFORM_RXD 2048 | #define PERFORM_RXD 2048 | ||||
#define MAX_RXD 4096 | #define MAX_RXD 4096 | ||||
#define MIN_RXD 64 | #define MIN_RXD 64 | ||||
/* Alignment for rings */ | /* Alignment for rings */ | ||||
#define DBA_ALIGN 128 | #define DBA_ALIGN 128 | ||||
/* | /* | ||||
* This parameter controls the maximum no of times the driver will loop in | |||||
* the isr. Minimum Value = 1 | |||||
*/ | |||||
#define MAX_LOOP 10 | |||||
/* | |||||
* This is the max watchdog interval, ie. the time that can | * This is the max watchdog interval, ie. the time that can | ||||
* pass between any two TX clean operations, such only happening | * pass between any two TX clean operations, such only happening | ||||
* when the TX hardware is functioning. | * when the TX hardware is functioning. | ||||
*/ | */ | ||||
#define IXGBE_WATCHDOG (10 * hz) | #define IXGBE_WATCHDOG (10 * hz) | ||||
/* | /* | ||||
* This parameters control when the driver calls the routine to reclaim | * This parameters control when the driver calls the routine to reclaim | ||||
* transmit descriptors. | * transmit descriptors. | ||||
*/ | */ | ||||
#define IXGBE_TX_CLEANUP_THRESHOLD (adapter->num_tx_desc / 8) | #define IXGBE_TX_CLEANUP_THRESHOLD (adapter->num_tx_desc / 8) | ||||
#define IXGBE_TX_OP_THRESHOLD (adapter->num_tx_desc / 32) | #define IXGBE_TX_OP_THRESHOLD (adapter->num_tx_desc / 32) | ||||
/* These defines are used in MTU calculations */ | /* These defines are used in MTU calculations */ | ||||
#define IXGBE_MAX_FRAME_SIZE 9728 | #define IXGBE_MAX_FRAME_SIZE 9728 | ||||
#define IXGBE_MTU_HDR (ETHER_HDR_LEN + ETHER_CRC_LEN + \ | #define IXGBE_MTU_HDR (ETHER_HDR_LEN + ETHER_CRC_LEN) | ||||
#define IXGBE_MTU_HDR_VLAN (ETHER_HDR_LEN + ETHER_CRC_LEN + \ | |||||
ETHER_VLAN_ENCAP_LEN) | ETHER_VLAN_ENCAP_LEN) | ||||
#define IXGBE_MAX_MTU (IXGBE_MAX_FRAME_SIZE - IXGBE_MTU_HDR) | #define IXGBE_MAX_MTU (IXGBE_MAX_FRAME_SIZE - IXGBE_MTU_HDR) | ||||
#define IXGBE_MAX_MTU_VLAN (IXGBE_MAX_FRAME_SIZE - IXGBE_MTU_HDR_VLAN) | |||||
/* Flow control constants */ | /* Flow control constants */ | ||||
#define IXGBE_FC_PAUSE 0xFFFF | #define IXGBE_FC_PAUSE 0xFFFF | ||||
#define IXGBE_FC_HI 0x20000 | #define IXGBE_FC_HI 0x20000 | ||||
#define IXGBE_FC_LO 0x10000 | #define IXGBE_FC_LO 0x10000 | ||||
/* | /* | ||||
* Used for optimizing small rx mbufs. Effort is made to keep the copy | * Used for optimizing small rx mbufs. Effort is made to keep the copy | ||||
* small and aligned for the CPU L1 cache. | * small and aligned for the CPU L1 cache. | ||||
* | * | ||||
* MHLEN is typically 168 bytes, giving us 8-byte alignment. Getting | * MHLEN is typically 168 bytes, giving us 8-byte alignment. Getting | ||||
* 32 byte alignment needed for the fast bcopy results in 8 bytes being | * 32 byte alignment needed for the fast bcopy results in 8 bytes being | ||||
* wasted. Getting 64 byte alignment, which _should_ be ideal for | * wasted. Getting 64 byte alignment, which _should_ be ideal for | ||||
* modern Intel CPUs, results in 40 bytes wasted and a significant drop | * modern Intel CPUs, results in 40 bytes wasted and a significant drop | ||||
* in observed efficiency of the optimization, 97.9% -> 81.8%. | * in observed efficiency of the optimization, 97.9% -> 81.8%. | ||||
*/ | */ | ||||
#if __FreeBSD_version < 1002000 | |||||
#define MPKTHSIZE (sizeof(struct m_hdr) + sizeof(struct pkthdr)) | |||||
#endif | |||||
#define IXGBE_RX_COPY_HDR_PADDED ((((MPKTHSIZE - 1) / 32) + 1) * 32) | #define IXGBE_RX_COPY_HDR_PADDED ((((MPKTHSIZE - 1) / 32) + 1) * 32) | ||||
#define IXGBE_RX_COPY_LEN (MSIZE - IXGBE_RX_COPY_HDR_PADDED) | #define IXGBE_RX_COPY_LEN (MSIZE - IXGBE_RX_COPY_HDR_PADDED) | ||||
#define IXGBE_RX_COPY_ALIGN (IXGBE_RX_COPY_HDR_PADDED - MPKTHSIZE) | #define IXGBE_RX_COPY_ALIGN (IXGBE_RX_COPY_HDR_PADDED - MPKTHSIZE) | ||||
/* Keep older OS drivers building... */ | /* Keep older OS drivers building... */ | ||||
#if !defined(SYSCTL_ADD_UQUAD) | #if !defined(SYSCTL_ADD_UQUAD) | ||||
#define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD | #define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD | ||||
#endif | #endif | ||||
Show All 14 Lines | |||||
#define HW_DEBUGOUT2(S, A, B) if (DEBUG_HW) printf(S "\n", A, B) | #define HW_DEBUGOUT2(S, A, B) if (DEBUG_HW) printf(S "\n", A, B) | ||||
#define MAX_NUM_MULTICAST_ADDRESSES 128 | #define MAX_NUM_MULTICAST_ADDRESSES 128 | ||||
#define IXGBE_82598_SCATTER 100 | #define IXGBE_82598_SCATTER 100 | ||||
#define IXGBE_82599_SCATTER 32 | #define IXGBE_82599_SCATTER 32 | ||||
#define MSIX_82598_BAR 3 | #define MSIX_82598_BAR 3 | ||||
#define MSIX_82599_BAR 4 | #define MSIX_82599_BAR 4 | ||||
#define IXGBE_TSO_SIZE 262140 | #define IXGBE_TSO_SIZE 262140 | ||||
#define IXGBE_TX_BUFFER_SIZE ((u32) 1514) | |||||
#define IXGBE_RX_HDR 128 | #define IXGBE_RX_HDR 128 | ||||
#define IXGBE_VFTA_SIZE 128 | #define IXGBE_VFTA_SIZE 128 | ||||
#define IXGBE_BR_SIZE 4096 | #define IXGBE_BR_SIZE 4096 | ||||
#define IXGBE_QUEUE_MIN_FREE 32 | #define IXGBE_QUEUE_MIN_FREE 32 | ||||
#define IXGBE_MAX_TX_BUSY 10 | #define IXGBE_MAX_TX_BUSY 10 | ||||
#define IXGBE_QUEUE_HUNG 0x80000000 | #define IXGBE_QUEUE_HUNG 0x80000000 | ||||
#define IXV_EITR_DEFAULT 128 | #define IXV_EITR_DEFAULT 128 | ||||
/* Offload bits in mbuf flag */ | /* Supported offload bits in mbuf flag */ | ||||
#if __FreeBSD_version >= 800000 | #if __FreeBSD_version >= 1000000 | ||||
#define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ | |||||
CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ | |||||
CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) | |||||
#elif __FreeBSD_version >= 800000 | |||||
#define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) | #define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) | ||||
#else | #else | ||||
#define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP) | #define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP) | ||||
#endif | #endif | ||||
/* Backward compatibility items for very old versions */ | /* Backward compatibility items for very old versions */ | ||||
#ifndef pci_find_cap | #ifndef pci_find_cap | ||||
#define pci_find_cap pci_find_extcap | #define pci_find_cap pci_find_extcap | ||||
#endif | #endif | ||||
#ifndef DEVMETHOD_END | #ifndef DEVMETHOD_END | ||||
#define DEVMETHOD_END { NULL, NULL } | #define DEVMETHOD_END { NULL, NULL } | ||||
#endif | #endif | ||||
/* | /* | ||||
* Interrupt Moderation parameters | * Interrupt Moderation parameters | ||||
*/ | */ | ||||
#define IXGBE_LOW_LATENCY 128 | #define IXGBE_LOW_LATENCY 128 | ||||
#define IXGBE_AVE_LATENCY 400 | #define IXGBE_AVE_LATENCY 400 | ||||
#define IXGBE_BULK_LATENCY 1200 | #define IXGBE_BULK_LATENCY 1200 | ||||
#define IXGBE_LINK_ITR 2000 | |||||
/* Using 1FF (the max value), the interval is ~1.05ms */ | |||||
#define IXGBE_LINK_ITR_QUANTA 0x1FF | |||||
#define IXGBE_LINK_ITR ((IXGBE_LINK_ITR_QUANTA << 3) & \ | |||||
IXGBE_EITR_ITR_INT_MASK) | |||||
/* MAC type macros */ | /* MAC type macros */ | ||||
#define IXGBE_IS_X550VF(_adapter) \ | #define IXGBE_IS_X550VF(_adapter) \ | ||||
((_adapter->hw.mac.type == ixgbe_mac_X550_vf) || \ | ((_adapter->hw.mac.type == ixgbe_mac_X550_vf) || \ | ||||
(_adapter->hw.mac.type == ixgbe_mac_X550EM_x_vf)) | (_adapter->hw.mac.type == ixgbe_mac_X550EM_x_vf)) | ||||
#define IXGBE_IS_VF(_adapter) \ | #define IXGBE_IS_VF(_adapter) \ | ||||
(IXGBE_IS_X550VF(_adapter) || \ | (IXGBE_IS_X550VF(_adapter) || \ | ||||
(_adapter->hw.mac.type == ixgbe_mac_X540_vf) || \ | (_adapter->hw.mac.type == ixgbe_mac_X540_vf) || \ | ||||
▲ Show 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | struct ixgbe_vf { | ||||
uint16_t default_vlan; | uint16_t default_vlan; | ||||
uint16_t vlan_tag; | uint16_t vlan_tag; | ||||
uint16_t api_ver; | uint16_t api_ver; | ||||
}; | }; | ||||
#endif /* PCI_IOV */ | #endif /* PCI_IOV */ | ||||
/* Our adapter structure */ | /* Our adapter structure */ | ||||
struct adapter { | struct adapter { | ||||
struct ifnet *ifp; | |||||
struct ixgbe_hw hw; | struct ixgbe_hw hw; | ||||
struct ixgbe_osdep osdep; | struct ixgbe_osdep osdep; | ||||
struct device *dev; | struct device *dev; | ||||
struct ifnet *ifp; | |||||
struct resource *pci_mem; | struct resource *pci_mem; | ||||
struct resource *msix_mem; | struct resource *msix_mem; | ||||
/* | /* | ||||
* Interrupt resources: this set is | * Interrupt resources: this set is | ||||
* either used for legacy, or for Link | * either used for legacy, or for Link | ||||
* when doing MSIX | * when doing MSIX | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | #endif | ||||
u32 rx_process_limit; | u32 rx_process_limit; | ||||
/* Multicast array memory */ | /* Multicast array memory */ | ||||
struct ixgbe_mc_addr *mta; | struct ixgbe_mc_addr *mta; | ||||
int num_vfs; | int num_vfs; | ||||
int pool; | int pool; | ||||
#ifdef PCI_IOV | #ifdef PCI_IOV | ||||
struct ixgbe_vf *vfs; | struct ixgbe_vf *vfs; | ||||
#endif | |||||
#ifdef DEV_NETMAP | |||||
void (*init_locked)(struct adapter *); | |||||
void (*stop_locked)(void *); | |||||
#endif | #endif | ||||
/* Misc stats maintained by the driver */ | /* Misc stats maintained by the driver */ | ||||
unsigned long dropped_pkts; | unsigned long dropped_pkts; | ||||
unsigned long mbuf_defrag_failed; | unsigned long mbuf_defrag_failed; | ||||
unsigned long mbuf_header_failed; | unsigned long mbuf_header_failed; | ||||
unsigned long mbuf_packet_failed; | unsigned long mbuf_packet_failed; | ||||
unsigned long watchdog_events; | unsigned long watchdog_events; | ||||
▲ Show 20 Lines • Show All 325 Lines • Show Last 20 Lines |