From 5befcecbe0285cf8b4e7efe41b595785d02ac4d5 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 7 Feb 2019 12:17:27 +0000 Subject: [PATCH] net/sfc: avoid usage of RxQ control structure in info get RxQ control structure contains primary process only data and will become primary process only. RxQ info get is supported in secondary process. Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc_ethdev.c | 7 ++----- drivers/net/sfc/sfc_rx.c | 10 +++++----- drivers/net/sfc/sfc_rx.h | 4 ++-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 10e032400e..da697c1348 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -1067,18 +1067,15 @@ sfc_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id, { struct sfc_adapter *sa = dev->data->dev_private; struct sfc_rxq_info *rxq_info; - struct sfc_rxq *rxq; sfc_adapter_lock(sa); SFC_ASSERT(rx_queue_id < sa->rxq_count); rxq_info = &sa->rxq_info[rx_queue_id]; - rxq = rxq_info->rxq; - SFC_ASSERT(rxq != NULL); - qinfo->mp = rxq->refill_mb_pool; - qinfo->conf.rx_free_thresh = rxq->refill_threshold; + qinfo->mp = rxq_info->refill_mb_pool; + qinfo->conf.rx_free_thresh = rxq_info->refill_threshold; qinfo->conf.rx_drop_en = 1; qinfo->conf.rx_deferred_start = rxq_info->deferred_start; qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads; diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index c792e0b2e4..dcccb96b1c 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -688,7 +688,7 @@ sfc_rx_qstart(struct sfc_adapter *sa, unsigned int sw_index) rxq_info->type_flags, evq->common, &rxq->common); break; case EFX_RXQ_TYPE_ES_SUPER_BUFFER: { - struct rte_mempool *mp = rxq->refill_mb_pool; + struct rte_mempool *mp = rxq_info->refill_mb_pool; struct rte_mempool_info mp_info; rc = rte_mempool_ops_get_info(mp, &mp_info); @@ -1033,9 +1033,9 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index, rxq->evq = evq; rxq->hw_index = sw_index; - rxq->refill_threshold = + rxq_info->refill_threshold = RTE_MAX(rx_conf->rx_free_thresh, SFC_RX_REFILL_BULK); - rxq->refill_mb_pool = mb_pool; + rxq_info->refill_mb_pool = mb_pool; rxq->buf_size = buf_size; rc = sfc_dma_alloc(sa, "rxq", sw_index, EFX_RXQ_SIZE(rxq_info->entries), @@ -1044,9 +1044,9 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index, goto fail_dma_alloc; memset(&info, 0, sizeof(info)); - info.refill_mb_pool = rxq->refill_mb_pool; + info.refill_mb_pool = rxq_info->refill_mb_pool; info.max_fill_level = rxq_max_fill_level; - info.refill_threshold = rxq->refill_threshold; + info.refill_threshold = rxq_info->refill_threshold; info.buf_size = buf_size; info.batch_max = encp->enc_rx_batch_max; info.prefix_size = encp->enc_rx_prefix_size; diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h index 3fba7d8ac6..7231379a6e 100644 --- a/drivers/net/sfc/sfc_rx.h +++ b/drivers/net/sfc/sfc_rx.h @@ -58,8 +58,6 @@ struct sfc_rxq { efx_rxq_t *common; efsys_mem_t mem; unsigned int hw_index; - unsigned int refill_threshold; - struct rte_mempool *refill_mb_pool; uint16_t buf_size; struct sfc_dp_rxq *dp; unsigned int state; @@ -128,6 +126,8 @@ struct sfc_rxq_info { struct sfc_rxq *rxq; boolean_t deferred_start; boolean_t deferred_started; + unsigned int refill_threshold; + struct rte_mempool *refill_mb_pool; }; int sfc_rx_configure(struct sfc_adapter *sa); -- 2.20.1