net/ice: track DCF state of PF
[dpdk.git] / drivers / net / sfc / sfc_rx.c
index 23df27c..cd58d60 100644 (file)
@@ -139,7 +139,7 @@ sfc_efx_rx_qrefill(struct sfc_efx_rxq *rxq)
        SFC_ASSERT(added != rxq->added);
        rxq->added = added;
        efx_rx_qpush(rxq->common, added, &rxq->pushed);
-       rxq->dp.dpq.rx_dbells++;
+       rxq->dp.dpq.dbells++;
 }
 
 static uint64_t
@@ -149,15 +149,15 @@ sfc_efx_rx_desc_flags_to_offload_flags(const unsigned int desc_flags)
 
        switch (desc_flags & (EFX_PKT_IPV4 | EFX_CKSUM_IPV4)) {
        case (EFX_PKT_IPV4 | EFX_CKSUM_IPV4):
-               mbuf_flags |= PKT_RX_IP_CKSUM_GOOD;
+               mbuf_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD;
                break;
        case EFX_PKT_IPV4:
-               mbuf_flags |= PKT_RX_IP_CKSUM_BAD;
+               mbuf_flags |= RTE_MBUF_F_RX_IP_CKSUM_BAD;
                break;
        default:
-               RTE_BUILD_BUG_ON(PKT_RX_IP_CKSUM_UNKNOWN != 0);
-               SFC_ASSERT((mbuf_flags & PKT_RX_IP_CKSUM_MASK) ==
-                          PKT_RX_IP_CKSUM_UNKNOWN);
+               RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN != 0);
+               SFC_ASSERT((mbuf_flags & RTE_MBUF_F_RX_IP_CKSUM_MASK) ==
+                          RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN);
                break;
        }
 
@@ -165,16 +165,16 @@ sfc_efx_rx_desc_flags_to_offload_flags(const unsigned int desc_flags)
                 (EFX_PKT_TCP | EFX_PKT_UDP | EFX_CKSUM_TCPUDP))) {
        case (EFX_PKT_TCP | EFX_CKSUM_TCPUDP):
        case (EFX_PKT_UDP | EFX_CKSUM_TCPUDP):
-               mbuf_flags |= PKT_RX_L4_CKSUM_GOOD;
+               mbuf_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD;
                break;
        case EFX_PKT_TCP:
        case EFX_PKT_UDP:
-               mbuf_flags |= PKT_RX_L4_CKSUM_BAD;
+               mbuf_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD;
                break;
        default:
-               RTE_BUILD_BUG_ON(PKT_RX_L4_CKSUM_UNKNOWN != 0);
-               SFC_ASSERT((mbuf_flags & PKT_RX_L4_CKSUM_MASK) ==
-                          PKT_RX_L4_CKSUM_UNKNOWN);
+               RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN != 0);
+               SFC_ASSERT((mbuf_flags & RTE_MBUF_F_RX_L4_CKSUM_MASK) ==
+                          RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN);
                break;
        }
 
@@ -225,7 +225,7 @@ sfc_efx_rx_set_rss_hash(struct sfc_efx_rxq *rxq, unsigned int flags,
                                                      EFX_RX_HASHALG_TOEPLITZ,
                                                      mbuf_data);
 
-               m->ol_flags |= PKT_RX_RSS_HASH;
+               m->ol_flags |= RTE_MBUF_F_RX_RSS_HASH;
        }
 }
 
@@ -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);