igb: Define macros for wreg_nsegs, instead of using magic number
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 28 Jan 2013 09:22:17 +0000 (17:22 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 28 Jan 2013 09:22:17 +0000 (17:22 +0800)
sys/dev/netif/igb/if_igb.c
sys/dev/netif/igb/if_igb.h

index 84e3ad5..e6a6fde 100644 (file)
@@ -1776,7 +1776,7 @@ igb_create_tx_ring(struct igb_tx_ring *txr)
         */
        txr->spare_desc = IGB_TX_SPARE;
        txr->intr_nsegs = txr->num_tx_desc / 16;
-       txr->wreg_nsegs = 8;
+       txr->wreg_nsegs = IGB_DEF_TXWREG_NSEGS;
        txr->oact_hi_desc = txr->num_tx_desc / 2;
        txr->oact_lo_desc = txr->num_tx_desc / 8;
        if (txr->oact_lo_desc > IGB_TX_OACTIVE_MAX)
@@ -2137,7 +2137,7 @@ igb_create_rx_ring(struct igb_rx_ring *rxr)
        /*
         * Initialize various watermark
         */
-       rxr->wreg_nsegs = 32;
+       rxr->wreg_nsegs = IGB_DEF_RXWREG_NSEGS;
 
        return 0;
 }
index 389b054..d4bec2c 100644 (file)
 #define IGB_MAX_IVAR_VF                1
 
 /*
+ * Default number of segments received before writing to RX related registers
+ */
+#define IGB_DEF_RXWREG_NSEGS   32
+
+/*
+ * Default number of segments sent before writing to RX related registers
+ */
+#define IGB_DEF_TXWREG_NSEGS   8
+
+/*
  * IGB_TXD: Maximum number of Transmit Descriptors
  *
  *   This value is the number of transmit descriptors allocated by the driver.