FreeBSD kernel IXGBE device code
ixgbe.h File Reference
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf_ring.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/sockio.h>
#include <sys/eventhandler.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_arp.h>
#include <net/bpf.h>
#include <net/ethernet.h>
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_types.h>
#include <net/if_vlan_var.h>
#include <net/iflib.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <machine/resource.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/clock.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
#include <sys/proc.h>
#include <sys/sysctl.h>
#include <sys/endian.h>
#include <sys/gtaskqueue.h>
#include <sys/pcpu.h>
#include <sys/smp.h>
#include <machine/smp.h>
#include <sys/sbuf.h>
#include "ixgbe_api.h"
#include "ixgbe_common.h"
#include "ixgbe_phy.h"
#include "ixgbe_vf.h"
#include "ixgbe_features.h"
#include "ixgbe_bypass.h"
#include "ixgbe_fdir.h"
#include "ixgbe_rss.h"
Include dependency graph for ixgbe.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _ixgbe_vendor_info_t
 
struct  ixgbe_bp_data
 
struct  ixgbe_dma_alloc
 
struct  ixgbe_mc_addr
 
struct  tx_ring
 
struct  rx_ring
 
struct  ix_rx_queue
 
struct  ix_tx_queue
 
struct  ixgbe_vf
 
struct  ixgbe_softc
 

Macros

#define DEFAULT_TXD   2048
 
#define PERFORM_TXD   2048
 
#define MAX_TXD   4096
 
#define MIN_TXD   64
 
#define DEFAULT_RXD   2048
 
#define PERFORM_RXD   2048
 
#define MAX_RXD   4096
 
#define MIN_RXD   64
 
#define DBA_ALIGN   128
 
#define IXGBE_WATCHDOG   (10 * hz)
 
#define IXGBE_TX_CLEANUP_THRESHOLD(_a)   ((_a)->num_tx_desc / 8)
 
#define IXGBE_TX_OP_THRESHOLD(_a)   ((_a)->num_tx_desc / 32)
 
#define IXGBE_MAX_FRAME_SIZE   9728
 
#define IXGBE_MTU_HDR   (ETHER_HDR_LEN + ETHER_CRC_LEN)
 
#define IXGBE_MTU_HDR_VLAN
 
#define IXGBE_MAX_MTU   (IXGBE_MAX_FRAME_SIZE - IXGBE_MTU_HDR)
 
#define IXGBE_MAX_MTU_VLAN   (IXGBE_MAX_FRAME_SIZE - IXGBE_MTU_HDR_VLAN)
 
#define IXGBE_FC_PAUSE   0xFFFF
 
#define IXGBE_FC_HI   0x20000
 
#define IXGBE_FC_LO   0x10000
 
#define IXGBE_MPKTHSIZE   (sizeof(struct m_hdr) + sizeof(struct pkthdr))
 
#define IXGBE_RX_COPY_HDR_PADDED   ((((IXGBE_MPKTHSIZE - 1) / 32) + 1) * 32)
 
#define IXGBE_RX_COPY_LEN   (MSIZE - IXGBE_RX_COPY_HDR_PADDED)
 
#define IXGBE_RX_COPY_ALIGN   (IXGBE_RX_COPY_HDR_PADDED - IXGBE_MPKTHSIZE)
 
#define DEBUG_INIT   0
 
#define DEBUG_IOCTL   0
 
#define DEBUG_HW   0
 
#define INIT_DEBUGOUT(S)   if (DEBUG_INIT) printf(S "\n")
 
#define INIT_DEBUGOUT1(S, A)   if (DEBUG_INIT) printf(S "\n", A)
 
#define INIT_DEBUGOUT2(S, A, B)   if (DEBUG_INIT) printf(S "\n", A, B)
 
#define IOCTL_DEBUGOUT(S)   if (DEBUG_IOCTL) printf(S "\n")
 
#define IOCTL_DEBUGOUT1(S, A)   if (DEBUG_IOCTL) printf(S "\n", A)
 
#define IOCTL_DEBUGOUT2(S, A, B)   if (DEBUG_IOCTL) printf(S "\n", A, B)
 
#define HW_DEBUGOUT(S)   if (DEBUG_HW) printf(S "\n")
 
#define HW_DEBUGOUT1(S, A)   if (DEBUG_HW) printf(S "\n", A)
 
#define HW_DEBUGOUT2(S, A, B)   if (DEBUG_HW) printf(S "\n", A, B)
 
#define MAX_NUM_MULTICAST_ADDRESSES   128
 
#define IXGBE_82598_SCATTER   100
 
#define IXGBE_82599_SCATTER   32
 
#define IXGBE_TSO_SIZE   262140
 
#define IXGBE_RX_HDR   128
 
#define IXGBE_VFTA_SIZE   128
 
#define IXGBE_BR_SIZE   4096
 
#define IXGBE_QUEUE_MIN_FREE   32
 
#define IXGBE_MAX_TX_BUSY   10
 
#define IXGBE_QUEUE_HUNG   0x80000000
 
#define IXGBE_EITR_DEFAULT   128
 
#define CSUM_OFFLOAD
 
#define IXGBE_CAPS
 
#define DEVMETHOD_END   { NULL, NULL }
 
#define IXGBE_LOW_LATENCY   128
 
#define IXGBE_AVE_LATENCY   400
 
#define IXGBE_BULK_LATENCY   1200
 
#define IXGBE_LINK_ITR_QUANTA   0x1FF
 
#define IXGBE_LINK_ITR
 
#define IXGBE_MAX_VF_MC   30 /* Max number of multicast entries */
 
#define num_tx_queues   shared->isc_ntxqsets
 
#define num_rx_queues   shared->isc_nrxqsets
 
#define max_frame_size   shared->isc_max_frame_size
 
#define intr_type   shared->isc_intr
 
#define ETHERTYPE_IEEE1588   0x88F7
 
#define PICOSECS_PER_TICK   20833
 
#define TSYNC_UDP_PORT   319 /* UDP port for the protocol */
 
#define IXGBE_ADVTXD_TSTAMP   0x00080000
 
#define IXGBE_SET_IPACKETS(sc, count)   (sc)->ipackets = (count)
 
#define IXGBE_SET_IERRORS(sc, count)   (sc)->ierrors = (count)
 
#define IXGBE_SET_OPACKETS(sc, count)   (sc)->opackets = (count)
 
#define IXGBE_SET_OERRORS(sc, count)   (sc)->oerrors = (count)
 
#define IXGBE_SET_COLLISIONS(sc, count)
 
#define IXGBE_SET_IBYTES(sc, count)   (sc)->ibytes = (count)
 
#define IXGBE_SET_OBYTES(sc, count)   (sc)->obytes = (count)
 
#define IXGBE_SET_IMCASTS(sc, count)   (sc)->imcasts = (count)
 
#define IXGBE_SET_OMCASTS(sc, count)   (sc)->omcasts = (count)
 
#define IXGBE_SET_IQDROPS(sc, count)   (sc)->iqdrops = (count)
 
#define IXGBE_PHY_CURRENT_TEMP   0xC820
 
#define IXGBE_PHY_OVERTEMP_STATUS   0xC830
 
#define IXGBE_SYSCTL_DESC_ADV_SPEED
 
#define IXGBE_SYSCTL_DESC_SET_FC
 
#define IXGBE_SYSCTL_DESC_RX_ERRS
 

Typedefs

typedef struct _ixgbe_vendor_info_t ixgbe_vendor_info_t
 

Functions

static bool ixv_check_ether_addr (u8 *addr)
 
int ixgbe_allocate_queues (struct ixgbe_softc *)
 
int ixgbe_setup_transmit_structures (struct ixgbe_softc *)
 
void ixgbe_free_transmit_structures (struct ixgbe_softc *)
 
int ixgbe_setup_receive_structures (struct ixgbe_softc *)
 
void ixgbe_free_receive_structures (struct ixgbe_softc *)
 
int ixgbe_get_regs (SYSCTL_HANDLER_ARGS)
 

Macro Definition Documentation

◆ CSUM_OFFLOAD

#define CSUM_OFFLOAD
Value:
(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)

Definition at line 195 of file ixgbe.h.

◆ DBA_ALIGN

#define DBA_ALIGN   128

Definition at line 121 of file ixgbe.h.

◆ DEBUG_HW

#define DEBUG_HW   0

Definition at line 169 of file ixgbe.h.

◆ DEBUG_INIT

#define DEBUG_INIT   0

Definition at line 167 of file ixgbe.h.

◆ DEBUG_IOCTL

#define DEBUG_IOCTL   0

Definition at line 168 of file ixgbe.h.

◆ DEFAULT_RXD

#define DEFAULT_RXD   2048

Definition at line 115 of file ixgbe.h.

◆ DEFAULT_TXD

#define DEFAULT_TXD   2048

Definition at line 100 of file ixgbe.h.

◆ DEVMETHOD_END

#define DEVMETHOD_END   { NULL, NULL }

Definition at line 205 of file ixgbe.h.

◆ ETHERTYPE_IEEE1588

#define ETHERTYPE_IEEE1588   0x88F7

Definition at line 467 of file ixgbe.h.

◆ HW_DEBUGOUT

#define HW_DEBUGOUT (   S)    if (DEBUG_HW) printf(S "\n")

Definition at line 177 of file ixgbe.h.

◆ HW_DEBUGOUT1

#define HW_DEBUGOUT1 (   S,
 
)    if (DEBUG_HW) printf(S "\n", A)

Definition at line 178 of file ixgbe.h.

◆ HW_DEBUGOUT2

#define HW_DEBUGOUT2 (   S,
  A,
 
)    if (DEBUG_HW) printf(S "\n", A, B)

Definition at line 179 of file ixgbe.h.

◆ INIT_DEBUGOUT

#define INIT_DEBUGOUT (   S)    if (DEBUG_INIT) printf(S "\n")

Definition at line 171 of file ixgbe.h.

◆ INIT_DEBUGOUT1

#define INIT_DEBUGOUT1 (   S,
 
)    if (DEBUG_INIT) printf(S "\n", A)

Definition at line 172 of file ixgbe.h.

◆ INIT_DEBUGOUT2

#define INIT_DEBUGOUT2 (   S,
  A,
 
)    if (DEBUG_INIT) printf(S "\n", A, B)

Definition at line 173 of file ixgbe.h.

◆ intr_type

#define intr_type   shared->isc_intr

Definition at line 360 of file ixgbe.h.

◆ IOCTL_DEBUGOUT

#define IOCTL_DEBUGOUT (   S)    if (DEBUG_IOCTL) printf(S "\n")

Definition at line 174 of file ixgbe.h.

◆ IOCTL_DEBUGOUT1

#define IOCTL_DEBUGOUT1 (   S,
 
)    if (DEBUG_IOCTL) printf(S "\n", A)

Definition at line 175 of file ixgbe.h.

◆ IOCTL_DEBUGOUT2

#define IOCTL_DEBUGOUT2 (   S,
  A,
 
)    if (DEBUG_IOCTL) printf(S "\n", A, B)

Definition at line 176 of file ixgbe.h.

◆ IXGBE_82598_SCATTER

#define IXGBE_82598_SCATTER   100

Definition at line 182 of file ixgbe.h.

◆ IXGBE_82599_SCATTER

#define IXGBE_82599_SCATTER   32

Definition at line 183 of file ixgbe.h.

◆ IXGBE_ADVTXD_TSTAMP

#define IXGBE_ADVTXD_TSTAMP   0x00080000

Definition at line 470 of file ixgbe.h.

◆ IXGBE_AVE_LATENCY

#define IXGBE_AVE_LATENCY   400

Definition at line 212 of file ixgbe.h.

◆ IXGBE_BR_SIZE

#define IXGBE_BR_SIZE   4096

Definition at line 187 of file ixgbe.h.

◆ IXGBE_BULK_LATENCY

#define IXGBE_BULK_LATENCY   1200

Definition at line 213 of file ixgbe.h.

◆ IXGBE_CAPS

#define IXGBE_CAPS
Value:
(IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | IFCAP_TSO | \
IFCAP_LRO | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO | \
IFCAP_VLAN_HWCSUM | IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU | \
IFCAP_VLAN_HWFILTER | IFCAP_WOL)

Definition at line 199 of file ixgbe.h.

◆ IXGBE_EITR_DEFAULT

#define IXGBE_EITR_DEFAULT   128

Definition at line 192 of file ixgbe.h.

◆ IXGBE_FC_HI

#define IXGBE_FC_HI   0x20000

Definition at line 147 of file ixgbe.h.

◆ IXGBE_FC_LO

#define IXGBE_FC_LO   0x10000

Definition at line 148 of file ixgbe.h.

◆ IXGBE_FC_PAUSE

#define IXGBE_FC_PAUSE   0xFFFF

Definition at line 146 of file ixgbe.h.

◆ IXGBE_LINK_ITR

#define IXGBE_LINK_ITR
Value:
#define IXGBE_LINK_ITR_QUANTA
Definition: ixgbe.h:216
#define IXGBE_EITR_ITR_INT_MASK
Definition: ixgbe_type.h:371

Definition at line 217 of file ixgbe.h.

◆ IXGBE_LINK_ITR_QUANTA

#define IXGBE_LINK_ITR_QUANTA   0x1FF

Definition at line 216 of file ixgbe.h.

◆ IXGBE_LOW_LATENCY

#define IXGBE_LOW_LATENCY   128

Definition at line 211 of file ixgbe.h.

◆ IXGBE_MAX_FRAME_SIZE

#define IXGBE_MAX_FRAME_SIZE   9728

Definition at line 138 of file ixgbe.h.

◆ IXGBE_MAX_MTU

#define IXGBE_MAX_MTU   (IXGBE_MAX_FRAME_SIZE - IXGBE_MTU_HDR)

Definition at line 142 of file ixgbe.h.

◆ IXGBE_MAX_MTU_VLAN

#define IXGBE_MAX_MTU_VLAN   (IXGBE_MAX_FRAME_SIZE - IXGBE_MTU_HDR_VLAN)

Definition at line 143 of file ixgbe.h.

◆ IXGBE_MAX_TX_BUSY

#define IXGBE_MAX_TX_BUSY   10

Definition at line 189 of file ixgbe.h.

◆ IXGBE_MAX_VF_MC

#define IXGBE_MAX_VF_MC   30 /* Max number of multicast entries */

Definition at line 336 of file ixgbe.h.

◆ IXGBE_MPKTHSIZE

#define IXGBE_MPKTHSIZE   (sizeof(struct m_hdr) + sizeof(struct pkthdr))

Definition at line 160 of file ixgbe.h.

◆ IXGBE_MTU_HDR

#define IXGBE_MTU_HDR   (ETHER_HDR_LEN + ETHER_CRC_LEN)

Definition at line 139 of file ixgbe.h.

◆ IXGBE_MTU_HDR_VLAN

#define IXGBE_MTU_HDR_VLAN
Value:
(ETHER_HDR_LEN + ETHER_CRC_LEN + \
ETHER_VLAN_ENCAP_LEN)

Definition at line 140 of file ixgbe.h.

◆ IXGBE_PHY_CURRENT_TEMP

#define IXGBE_PHY_CURRENT_TEMP   0xC820

Definition at line 485 of file ixgbe.h.

◆ IXGBE_PHY_OVERTEMP_STATUS

#define IXGBE_PHY_OVERTEMP_STATUS   0xC830

Definition at line 486 of file ixgbe.h.

◆ IXGBE_QUEUE_HUNG

#define IXGBE_QUEUE_HUNG   0x80000000

Definition at line 190 of file ixgbe.h.

◆ IXGBE_QUEUE_MIN_FREE

#define IXGBE_QUEUE_MIN_FREE   32

Definition at line 188 of file ixgbe.h.

◆ IXGBE_RX_COPY_ALIGN

#define IXGBE_RX_COPY_ALIGN   (IXGBE_RX_COPY_HDR_PADDED - IXGBE_MPKTHSIZE)

Definition at line 164 of file ixgbe.h.

◆ IXGBE_RX_COPY_HDR_PADDED

#define IXGBE_RX_COPY_HDR_PADDED   ((((IXGBE_MPKTHSIZE - 1) / 32) + 1) * 32)

Definition at line 162 of file ixgbe.h.

◆ IXGBE_RX_COPY_LEN

#define IXGBE_RX_COPY_LEN   (MSIZE - IXGBE_RX_COPY_HDR_PADDED)

Definition at line 163 of file ixgbe.h.

◆ IXGBE_RX_HDR

#define IXGBE_RX_HDR   128

Definition at line 185 of file ixgbe.h.

◆ IXGBE_SET_COLLISIONS

#define IXGBE_SET_COLLISIONS (   sc,
  count 
)

Definition at line 477 of file ixgbe.h.

◆ IXGBE_SET_IBYTES

#define IXGBE_SET_IBYTES (   sc,
  count 
)    (sc)->ibytes = (count)

Definition at line 478 of file ixgbe.h.

◆ IXGBE_SET_IERRORS

#define IXGBE_SET_IERRORS (   sc,
  count 
)    (sc)->ierrors = (count)

Definition at line 474 of file ixgbe.h.

◆ IXGBE_SET_IMCASTS

#define IXGBE_SET_IMCASTS (   sc,
  count 
)    (sc)->imcasts = (count)

Definition at line 480 of file ixgbe.h.

◆ IXGBE_SET_IPACKETS

#define IXGBE_SET_IPACKETS (   sc,
  count 
)    (sc)->ipackets = (count)

Definition at line 473 of file ixgbe.h.

◆ IXGBE_SET_IQDROPS

#define IXGBE_SET_IQDROPS (   sc,
  count 
)    (sc)->iqdrops = (count)

Definition at line 482 of file ixgbe.h.

◆ IXGBE_SET_OBYTES

#define IXGBE_SET_OBYTES (   sc,
  count 
)    (sc)->obytes = (count)

Definition at line 479 of file ixgbe.h.

◆ IXGBE_SET_OERRORS

#define IXGBE_SET_OERRORS (   sc,
  count 
)    (sc)->oerrors = (count)

Definition at line 476 of file ixgbe.h.

◆ IXGBE_SET_OMCASTS

#define IXGBE_SET_OMCASTS (   sc,
  count 
)    (sc)->omcasts = (count)

Definition at line 481 of file ixgbe.h.

◆ IXGBE_SET_OPACKETS

#define IXGBE_SET_OPACKETS (   sc,
  count 
)    (sc)->opackets = (count)

Definition at line 475 of file ixgbe.h.

◆ IXGBE_SYSCTL_DESC_ADV_SPEED

#define IXGBE_SYSCTL_DESC_ADV_SPEED
Value:
"\nControl advertised link speed using these flags:\n" \
"\t0x1 - advertise 100M\n" \
"\t0x2 - advertise 1G\n" \
"\t0x4 - advertise 10G\n" \
"\t0x8 - advertise 10M\n\n" \
"\t0x10 - advertise 2.5G\n" \
"\t0x20 - advertise 5G\n\n" \
"\t100M and 10M are only supported on certain adapters.\n"

Definition at line 489 of file ixgbe.h.

◆ IXGBE_SYSCTL_DESC_RX_ERRS

#define IXGBE_SYSCTL_DESC_RX_ERRS
Value:
"\nSum of the following RX errors counters:\n" \
" * CRC errors,\n" \
" * illegal byte error count,\n" \
" * checksum error count,\n" \
" * missed packet count,\n" \
" * length error count,\n" \
" * undersized packets count,\n" \
" * fragmented packets count,\n" \
" * oversized packets count,\n" \
" * jabber count."

Definition at line 506 of file ixgbe.h.

◆ IXGBE_SYSCTL_DESC_SET_FC

#define IXGBE_SYSCTL_DESC_SET_FC
Value:
"\nSet flow control mode using these values:\n" \
"\t0 - off\n" \
"\t1 - rx pause\n" \
"\t2 - tx pause\n" \
"\t3 - tx and rx pause"

Definition at line 499 of file ixgbe.h.

◆ IXGBE_TSO_SIZE

#define IXGBE_TSO_SIZE   262140

Definition at line 184 of file ixgbe.h.

◆ IXGBE_TX_CLEANUP_THRESHOLD

#define IXGBE_TX_CLEANUP_THRESHOLD (   _a)    ((_a)->num_tx_desc / 8)

Definition at line 134 of file ixgbe.h.

◆ IXGBE_TX_OP_THRESHOLD

#define IXGBE_TX_OP_THRESHOLD (   _a)    ((_a)->num_tx_desc / 32)

Definition at line 135 of file ixgbe.h.

◆ IXGBE_VFTA_SIZE

#define IXGBE_VFTA_SIZE   128

Definition at line 186 of file ixgbe.h.

◆ IXGBE_WATCHDOG

#define IXGBE_WATCHDOG   (10 * hz)

Definition at line 128 of file ixgbe.h.

◆ max_frame_size

#define max_frame_size   shared->isc_max_frame_size

Definition at line 359 of file ixgbe.h.

◆ MAX_NUM_MULTICAST_ADDRESSES

#define MAX_NUM_MULTICAST_ADDRESSES   128

Definition at line 181 of file ixgbe.h.

◆ MAX_RXD

#define MAX_RXD   4096

Definition at line 117 of file ixgbe.h.

◆ MAX_TXD

#define MAX_TXD   4096

Definition at line 102 of file ixgbe.h.

◆ MIN_RXD

#define MIN_RXD   64

Definition at line 118 of file ixgbe.h.

◆ MIN_TXD

#define MIN_TXD   64

Definition at line 103 of file ixgbe.h.

◆ num_rx_queues

#define num_rx_queues   shared->isc_nrxqsets

Definition at line 358 of file ixgbe.h.

◆ num_tx_queues

#define num_tx_queues   shared->isc_ntxqsets

Definition at line 357 of file ixgbe.h.

◆ PERFORM_RXD

#define PERFORM_RXD   2048

Definition at line 116 of file ixgbe.h.

◆ PERFORM_TXD

#define PERFORM_TXD   2048

Definition at line 101 of file ixgbe.h.

◆ PICOSECS_PER_TICK

#define PICOSECS_PER_TICK   20833

Definition at line 468 of file ixgbe.h.

◆ TSYNC_UDP_PORT

#define TSYNC_UDP_PORT   319 /* UDP port for the protocol */

Definition at line 469 of file ixgbe.h.

Typedef Documentation

◆ ixgbe_vendor_info_t

Function Documentation

◆ ixgbe_allocate_queues()

int ixgbe_allocate_queues ( struct ixgbe_softc )

◆ ixgbe_free_receive_structures()

void ixgbe_free_receive_structures ( struct ixgbe_softc )

◆ ixgbe_free_transmit_structures()

void ixgbe_free_transmit_structures ( struct ixgbe_softc )

◆ ixgbe_get_regs()

int ixgbe_get_regs ( SYSCTL_HANDLER_ARGS  )

◆ ixgbe_setup_receive_structures()

int ixgbe_setup_receive_structures ( struct ixgbe_softc )

◆ ixgbe_setup_transmit_structures()

int ixgbe_setup_transmit_structures ( struct ixgbe_softc )

◆ ixv_check_ether_addr()

static bool ixv_check_ether_addr ( u8 addr)
inlinestatic

Definition at line 523 of file ixgbe.h.

Referenced by ixv_if_attach_pre().

Here is the caller graph for this function: