net/ice: track DCF state of PF
[dpdk.git] / drivers / net / sfc / sfc_rx.c
index 17ff2aa..cd58d60 100644 (file)
@@ -483,6 +483,10 @@ sfc_efx_rx_qcreate(uint16_t port_id, uint16_t queue_id,
        struct sfc_efx_rxq *rxq;
        int rc;
 
+       rc = ENOTSUP;
+       if (info->nic_dma_info->nb_regions > 0)
+               goto fail_nic_dma;
+
        rc = ENOMEM;
        rxq = rte_zmalloc_socket("sfc-efx-rxq", sizeof(*rxq),
                                 RTE_CACHE_LINE_SIZE, socket_id);
@@ -518,6 +522,7 @@ fail_desc_alloc:
        rte_free(rxq);
 
 fail_rxq_alloc:
+fail_nic_dma:
        return rc;
 }
 
@@ -1052,7 +1057,7 @@ sfc_rx_mb_pool_buf_size(struct sfc_adapter *sa, struct rte_mempool *mb_pool)
        /* Make sure that end padding does not write beyond the buffer */
        if (buf_aligned < nic_align_end) {
                /*
-                * Estimate space which can be lost. If guarnteed buffer
+                * Estimate space which can be lost. If guaranteed buffer
                 * size is odd, lost space is (nic_align_end - 1). More
                 * accurate formula is below.
                 */
@@ -1218,7 +1223,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index,
 
        rxq->buf_size = buf_size;
 
-       rc = sfc_dma_alloc(sa, "rxq", sw_index,
+       rc = sfc_dma_alloc(sa, "rxq", sw_index, EFX_NIC_DMA_ADDR_RX_RING,
                           efx_rxq_size(sa->nic, rxq_info->entries),
                           socket_id, &rxq->mem);
        if (rc != 0)
@@ -1248,6 +1253,8 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index,
        info.vi_window_shift = encp->enc_vi_window_shift;
        info.fcw_offset = sa->fcw_offset;
 
+       info.nic_dma_info = &sas->nic_dma_info;
+
        rc = sa->priv.dp_rx->qcreate(sa->eth_dev->data->port_id, sw_index,
                                     &RTE_ETH_DEV_TO_PCI(sa->eth_dev)->addr,
                                     socket_id, &info, &rxq_info->dp);
@@ -1695,7 +1702,7 @@ sfc_rx_fini_queues(struct sfc_adapter *sa, unsigned int nb_rx_queues)
 
        /*
         * Finalize only ethdev queues since other ones are finalized only
-        * on device close and they may require additional deinitializaton.
+        * on device close and they may require additional deinitialization.
         */
        ethdev_qid = sas->ethdev_rxq_count;
        while (--ethdev_qid >= (int)nb_rx_queues) {
@@ -1768,7 +1775,7 @@ sfc_rx_configure(struct sfc_adapter *sa)
 
                reconfigure = true;
 
-               /* Do not ununitialize reserved queues */
+               /* Do not uninitialize reserved queues */
                if (nb_rx_queues < sas->ethdev_rxq_count)
                        sfc_rx_fini_queues(sa, nb_rx_queues);