igb: Improve tiny packets reception performance on low frequency CPU
[dragonfly.git] / sys / dev / netif / igb / if_igb.h
index 009e5aa..792a413 100644 (file)
@@ -87,7 +87,7 @@
  *      (num_tx_desc * sizeof(struct e1000_tx_desc)) % 128 == 0
  */
 #define IGB_MIN_RXD            256
-#define IGB_DEFAULT_RXD                1024
+#define IGB_DEFAULT_RXD                512
 #define IGB_MAX_RXD            4096
 
 /*
 #define MAX_NUM_MULTICAST_ADDRESSES    128
 #define IGB_FC_PAUSE_TIME              0x0680
 
-#define IGB_INTR_RATE                  10000
+#define IGB_INTR_RATE                  6000
 #define IGB_MSIX_RX_RATE               6000
 #define IGB_MSIX_TX_RATE               4000
 
 
 #define IGB_MAX_SCATTER                        64
 #define IGB_VFTA_SIZE                  128
-#define IGB_TSO_SIZE                   (65535 + \
+#define IGB_TSO_SIZE                   (IP_MAXPACKET + \
                                         sizeof(struct ether_vlan_header))
-#define IGB_TSO_SEG_SIZE               4096    /* Max dma segment size */
 #define IGB_HDR_BUF                    128
 #define IGB_PKTTYPE_MASK               0x0000FFF0
 
 #define IGB_TX_RESERVED                        3
 
 /* Large enough for 64K TSO */
-#define IGB_TX_SPARE                   32
+#define IGB_TX_SPARE                   33
 
 #define IGB_TX_OACTIVE_MAX             64
 
 #define IGB_RETA_SHIFT                 0
 #define IGB_RETA_SHIFT_82575           6
 
+#define IGB_EITR_INTVL_MASK            0x7ffc
+#define IGB_EITR_INTVL_SHIFT           2
+
 struct igb_softc;
 
 /*
@@ -213,10 +215,6 @@ struct igb_tx_ring {
        struct lwkt_serialize   tx_serialize;
        struct igb_softc        *sc;
        uint32_t                me;
-       struct igb_dma          txdma;
-       bus_dma_tag_t           tx_hdr_dtag;
-       bus_dmamap_t            tx_hdr_dmap;
-       bus_addr_t              tx_hdr_paddr;
        struct e1000_tx_desc    *tx_base;
        int                     num_tx_desc;
        uint32_t                next_avail_desc;
@@ -230,20 +228,19 @@ struct igb_tx_ring {
        int                     oact_lo_desc;
        int                     oact_hi_desc;
        int                     intr_nsegs;
+       int                     wreg_nsegs;
        int                     tx_intr_bit;
        uint32_t                tx_intr_mask;
 
+       /* Soft stats */
        u_long                  no_desc_avail;
        u_long                  tx_packets;
 
-       u_long                  ctx_try_pullup;
-       u_long                  ctx_drop1;
-       u_long                  ctx_drop2;
-       u_long                  ctx_pullup1;
-       u_long                  ctx_pullup1_failed;
-       u_long                  ctx_pullup2;
-       u_long                  ctx_pullup2_failed;
-};
+       struct igb_dma          txdma;
+       bus_dma_tag_t           tx_hdr_dtag;
+       bus_dmamap_t            tx_hdr_dmap;
+       bus_addr_t              tx_hdr_paddr;
+} __cachealign;
 
 /*
  * Receive ring: one per queue
@@ -252,7 +249,6 @@ struct igb_rx_ring {
        struct lwkt_serialize   rx_serialize;
        struct igb_softc        *sc;
        uint32_t                me;
-       struct igb_dma          rxdma;
        union e1000_adv_rx_desc *rx_base;
        boolean_t               discard;
        int                     num_rx_desc;
@@ -269,10 +265,13 @@ struct igb_rx_ring {
         */
        struct mbuf             *fmp;
        struct mbuf             *lmp;
+       int                     rx_wreg;
 
        /* Soft stats */
        u_long                  rx_packets;
-};
+
+       struct igb_dma          rxdma;
+} __cachealign;
 
 struct igb_msix_data {
        struct lwkt_serialize   *msix_serialize;
@@ -293,7 +292,7 @@ struct igb_msix_data {
        u_int                   msix_vector;
        int                     msix_rate;
        char                    msix_rate_desc[32];
-};
+} __cachealign;
 
 struct igb_softc {
        struct arpcom           arpcom;
@@ -304,6 +303,7 @@ struct igb_softc {
        uint32_t                flags;
 #define IGB_FLAG_SHARED_INTR   0x1
 #define IGB_FLAG_HAS_MGMT      0x2
+#define IGB_FLAG_TSO_IPLEN0    0x4
 
        bus_dma_tag_t           parent_tag;
 
@@ -312,6 +312,7 @@ struct igb_softc {
 
        struct ifmedia          media;
        struct callout          timer;
+       int                     timer_cpuid;
 
        int                     intr_type;
        int                     intr_rid;
@@ -336,6 +337,8 @@ struct igb_softc {
        /* Multicast array pointer */
        uint8_t                 *mta;
 
+       int                     rx_npoll_off;
+       int                     tx_npoll_off;
        int                     serialize_cnt;
        int                     tx_serialize;
        int                     rx_serialize;