net/sfc: support runtime VI window size
authorAndrew Rybchenko <arybchenko@solarflare.com>
Wed, 21 Mar 2018 13:51:31 +0000 (13:51 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:44 +0000 (14:08 +0200)
Medford2 uses a configurable VI window size, and requires
updates to register accesses to use a runtime VI window size
rather than the *_STEP register constants used for earlier
controllers.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
drivers/net/sfc/sfc_dp_rx.h
drivers/net/sfc/sfc_dp_tx.h
drivers/net/sfc/sfc_ef10_rx.c
drivers/net/sfc/sfc_ef10_tx.c
drivers/net/sfc/sfc_rx.c
drivers/net/sfc/sfc_tx.c

index be725dc..cc9e7c4 100644 (file)
@@ -78,6 +78,8 @@ struct sfc_dp_rx_qcreate_info {
         * doorbell
         */
        volatile void           *mem_bar;
+       /** VI window size shift */
+       unsigned int            vi_window_shift;
 };
 
 /**
index 0c1aad9..a075612 100644 (file)
@@ -57,6 +57,8 @@ struct sfc_dp_tx_qcreate_info {
        unsigned int            hw_index;
        /** Virtual address of the memory-mapped BAR to push Tx doorbell */
        volatile void           *mem_bar;
+       /** VI window size shift */
+       unsigned int            vi_window_shift;
 };
 
 /**
index ad98727..7d6b64e 100644 (file)
@@ -726,7 +726,7 @@ sfc_ef10_rx_qcreate(uint16_t port_id, uint16_t queue_id,
        rxq->rxq_hw_ring = info->rxq_hw_ring;
        rxq->doorbell = (volatile uint8_t *)info->mem_bar +
                        ER_DZ_RX_DESC_UPD_REG_OFST +
-                       info->hw_index * ER_DZ_RX_DESC_UPD_REG_STEP;
+                       (info->hw_index << info->vi_window_shift);
 
        *dp_rxqp = &rxq->dp;
        return 0;
index 1238797..d0daa3b 100644 (file)
@@ -531,7 +531,7 @@ sfc_ef10_tx_qcreate(uint16_t port_id, uint16_t queue_id,
        txq->txq_hw_ring = info->txq_hw_ring;
        txq->doorbell = (volatile uint8_t *)info->mem_bar +
                        ER_DZ_TX_DESC_UPD_REG_OFST +
-                       info->hw_index * ER_DZ_TX_DESC_UPD_REG_STEP;
+                       (info->hw_index << info->vi_window_shift);
        txq->evq_hw_ring = info->evq_hw_ring;
 
        *dp_txqp = &txq->dp;
index 2478a15..734ce24 100644 (file)
@@ -1079,6 +1079,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index,
        info.evq_hw_ring = evq->mem.esm_base;
        info.hw_index = rxq->hw_index;
        info.mem_bar = sa->mem_bar.esb_base;
+       info.vi_window_shift = encp->enc_vi_window_shift;
 
        rc = sa->dp_rx->qcreate(sa->eth_dev->data->port_id, sw_index,
                                &RTE_ETH_DEV_TO_PCI(sa->eth_dev)->addr,
index 0035c5c..1cd08d8 100644 (file)
@@ -229,6 +229,7 @@ sfc_tx_qinit(struct sfc_adapter *sa, unsigned int sw_index,
        info.evq_hw_ring = evq->mem.esm_base;
        info.hw_index = txq->hw_index;
        info.mem_bar = sa->mem_bar.esb_base;
+       info.vi_window_shift = encp->enc_vi_window_shift;
 
        rc = sa->dp_tx->qcreate(sa->eth_dev->data->port_id, sw_index,
                                &RTE_ETH_DEV_TO_PCI(sa->eth_dev)->addr,