net/sfc: support runtime VI window size

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>
This commit is contained in:
Andrew Rybchenko 2018-03-21 13:51:31 +00:00 committed by Ferruh Yigit
parent f82e33afbb
commit 714bff55a4
6 changed files with 8 additions and 2 deletions

View 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;
};
/**

View 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;
};
/**

View 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;

View 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;

View 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,

View 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,