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 <arybchenko@solarflare.com>
This commit is contained in:
Andrew Rybchenko 2019-02-07 12:17:27 +00:00 committed by Ferruh Yigit
parent e2c3639abf
commit 5befcecbe0
3 changed files with 9 additions and 12 deletions

View File

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

View File

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

View File

@ -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);