]> git.droids-corp.org - dpdk.git/commitdiff
mem: remove API to get physical address in dom0
authorJianfeng Tan <jianfeng.tan@intel.com>
Thu, 14 Sep 2017 02:40:28 +0000 (02:40 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 8 Oct 2017 23:52:37 +0000 (01:52 +0200)
Previously, to get MFN address in dom0, this API is a wrapper to
obtain the "physical address".

As we will removed xen dom0 support, this API is not necessary.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
doc/guides/rel_notes/release_17_11.rst
drivers/net/e1000/em_rxtx.c
drivers/net/e1000/igb_rxtx.c
drivers/net/fm10k/fm10k_ethdev.c
drivers/net/i40e/i40e_ethdev.c
drivers/net/i40e/i40e_fdir.c
drivers/net/i40e/i40e_rxtx.c
drivers/net/ixgbe/ixgbe_rxtx.c
drivers/net/sfc/sfc.c
lib/librte_eal/common/include/rte_memory.h
lib/librte_mempool/rte_mempool.c

index f71e9241a9d302c8743aa24db8265e8e6e3d385f..17d5a0ff01a2ce768785ba289bcf9ce65c0e1473 100644 (file)
@@ -178,6 +178,9 @@ API Changes
   * Added ``flags`` param in ``rte_mempool_xmem_size`` and
     ``rte_mempool_xmem_usage``.
 
+* ``rte_mem_phy2mch`` was used in Xen dom0 to obtain the physical address;
+  remove this API as Xen dom0 support was removed.
+
 
 ABI Changes
 -----------
index 06ba68e3913c54b9f4e81f0b7d7978005c8d2337..92b66b0eae83c1f7ebc8cddfe16047e13461a69d 100644 (file)
@@ -1289,7 +1289,7 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev,
        txq->port_id = dev->data->port_id;
 
        txq->tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(queue_idx));
-       txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+       txq->tx_ring_phys_addr = tz->phys_addr;
        txq->tx_ring = (struct e1000_data_desc *) tz->addr;
 
        PMD_INIT_LOG(DEBUG, "sw_ring=%p hw_ring=%p dma_addr=0x%"PRIx64,
@@ -1416,7 +1416,7 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev,
 
        rxq->rdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDT(queue_idx));
        rxq->rdh_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDH(queue_idx));
-       rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+       rxq->rx_ring_phys_addr = rz->phys_addr;
        rxq->rx_ring = (struct e1000_rx_desc *) rz->addr;
 
        PMD_INIT_LOG(DEBUG, "sw_ring=%p hw_ring=%p dma_addr=0x%"PRIx64,
index a800d9c2bb1a2d04e747e44219d0137f9446e2b6..8a1e5b18eb310cd07debeea4de55accd44032c05 100644 (file)
@@ -1530,7 +1530,7 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev,
        txq->port_id = dev->data->port_id;
 
        txq->tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(txq->reg_idx));
-       txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+       txq->tx_ring_phys_addr = tz->phys_addr;
 
        txq->tx_ring = (union e1000_adv_tx_desc *) tz->addr;
        /* Allocate software ring */
@@ -1667,7 +1667,7 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
        }
        rxq->rdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDT(rxq->reg_idx));
        rxq->rdh_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_RDH(rxq->reg_idx));
-       rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+       rxq->rx_ring_phys_addr = rz->phys_addr;
        rxq->rx_ring = (union e1000_adv_rx_desc *) rz->addr;
 
        /* Allocate software ring. */
index e60d3a365bc525caa63bc0695167f08b91cbf770..15ea2a535b927f59b4562731fa53f37ee7920ca9 100644 (file)
@@ -1887,7 +1887,7 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
                return -ENOMEM;
        }
        q->hw_ring = mz->addr;
-       q->hw_ring_phys_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+       q->hw_ring_phys_addr = mz->phys_addr;
 
        /* Check if number of descs satisfied Vector requirement */
        if (!rte_is_power_of_2(nb_desc)) {
@@ -2047,7 +2047,7 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
                return -ENOMEM;
        }
        q->hw_ring = mz->addr;
-       q->hw_ring_phys_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+       q->hw_ring_phys_addr = mz->phys_addr;
 
        /*
         * allocate memory for the RS bit tracker. Enough slots to hold the
index e2af51c89a5c9e01b9bcd52e97e534a771811c9c..536365d355e623931f30689a66d40bfc99dc2c99 100644 (file)
@@ -3824,7 +3824,7 @@ i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
 
        mem->size = size;
        mem->va = mz->addr;
-       mem->pa = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+       mem->pa = mz->phys_addr;
        mem->zone = (const void *)mz;
        PMD_DRV_LOG(DEBUG,
                "memzone %s allocated with physical address: %"PRIu64,
index 7c46578d4352a61e6a6491381e3f7f021382f044..491c64331589e77afcd26e99d75e5ede16662972 100644 (file)
@@ -264,7 +264,7 @@ i40e_fdir_setup(struct i40e_pf *pf)
                goto fail_mem;
        }
        pf->fdir.prg_pkt = mz->addr;
-       pf->fdir.dma_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+       pf->fdir.dma_addr = mz->phys_addr;
 
        pf->fdir.match_counter_index = I40E_COUNTER_INDEX_FDIR(hw->pf_id);
        PMD_DRV_LOG(INFO, "FDIR setup successfully, with programming queue %u.",
index 751c82b618197026aef1c055535886712947ad7e..3a8d32c86140edc0c42a9a2a71588601b42fe550 100644 (file)
@@ -1823,7 +1823,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
        /* Zero all the descriptors in the ring. */
        memset(rz->addr, 0, ring_size);
 
-       rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+       rxq->rx_ring_phys_addr = rz->phys_addr;
        rxq->rx_ring = (union i40e_rx_desc *)rz->addr;
 
        len = (uint16_t)(nb_desc + RTE_PMD_I40E_RX_MAX_BURST);
@@ -2161,7 +2161,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
        txq->vsi = vsi;
        txq->tx_deferred_start = tx_conf->tx_deferred_start;
 
-       txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+       txq->tx_ring_phys_addr = tz->phys_addr;
        txq->tx_ring = (struct i40e_tx_desc *)tz->addr;
 
        /* Allocate software ring */
@@ -2673,7 +2673,7 @@ i40e_fdir_setup_tx_resources(struct i40e_pf *pf)
        txq->reg_idx = pf->fdir.fdir_vsi->base_queue;
        txq->vsi = pf->fdir.fdir_vsi;
 
-       txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+       txq->tx_ring_phys_addr = tz->phys_addr;
        txq->tx_ring = (struct i40e_tx_desc *)tz->addr;
        /*
         * don't need to allocate software ring and reset for the fdir
@@ -2729,7 +2729,7 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf)
        rxq->reg_idx = pf->fdir.fdir_vsi->base_queue;
        rxq->vsi = pf->fdir.fdir_vsi;
 
-       rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+       rxq->rx_ring_phys_addr = rz->phys_addr;
        rxq->rx_ring = (union i40e_rx_desc *)rz->addr;
 
        /*
index 98d0e1a86a278c8d87c918a47c924264d88fb175..0038dfbb4bc837ac6811a5bcbac44763ff3b61bc 100644 (file)
@@ -2548,7 +2548,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
        else
                txq->tdt_reg_addr = IXGBE_PCI_REG_ADDR(hw, IXGBE_TDT(txq->reg_idx));
 
-       txq->tx_ring_phys_addr = rte_mem_phy2mch(tz->memseg_id, tz->phys_addr);
+       txq->tx_ring_phys_addr = tz->phys_addr;
        txq->tx_ring = (union ixgbe_adv_tx_desc *) tz->addr;
 
        /* Allocate software ring */
@@ -2850,7 +2850,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
                        IXGBE_PCI_REG_ADDR(hw, IXGBE_RDH(rxq->reg_idx));
        }
 
-       rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr);
+       rxq->rx_ring_phys_addr = rz->phys_addr;
        rxq->rx_ring = (union ixgbe_adv_rx_desc *) rz->addr;
 
        /*
index cc81fd9988c6aebc33cbe28798e7c3648ce324cf..390823a8c8c18fde75c7c18364109f4e8a9b4a0c 100644 (file)
@@ -61,7 +61,7 @@ sfc_dma_alloc(const struct sfc_adapter *sa, const char *name, uint16_t id,
                return ENOMEM;
        }
 
-       esmp->esm_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+       esmp->esm_addr = mz->phys_addr;
        if (esmp->esm_addr == RTE_BAD_PHYS_ADDR) {
                (void)rte_memzone_free(mz);
                return EFAULT;
index 4aa5d1f77566cdcb1c3d3d6d619b88e6b5e1c0c6..8d3960d0094deeb1008bd5ce8fad8a600016eb1f 100644 (file)
@@ -200,30 +200,6 @@ unsigned rte_memory_get_nrank(void);
 /**< Internal use only - should DOM0 memory mapping be used */
 int rte_xen_dom0_supported(void);
 
-/**< Internal use only - phys to virt mapping for xen */
-phys_addr_t rte_xen_mem_phy2mch(int32_t, const phys_addr_t);
-
-/**
- * Return the physical address of elt, which is an element of the pool mp.
- *
- * @param memseg_id
- *   Identifier of the memory segment owning the physical address. If
- *   set to -1, find it automatically.
- * @param phy_addr
- *   physical address of elt.
- *
- * @return
- *   The physical address or RTE_BAD_PHYS_ADDR on error.
- */
-static inline phys_addr_t
-rte_mem_phy2mch(int32_t memseg_id, const phys_addr_t phy_addr)
-{
-       if (rte_xen_dom0_supported())
-               return rte_xen_mem_phy2mch(memseg_id, phy_addr);
-       else
-               return phy_addr;
-}
-
 /**
  * Memory init for supporting application running on Xen domain0.
  *
@@ -250,12 +226,6 @@ static inline int rte_xen_dom0_supported(void)
 {
        return 0;
 }
-
-static inline phys_addr_t
-rte_mem_phy2mch(int32_t memseg_id __rte_unused, const phys_addr_t phy_addr)
-{
-       return phy_addr;
-}
 #endif
 
 #ifdef __cplusplus
index 412bda16e1cbd17a64ebd632f230b60b1690aaf3..57a4f8122a2b606c58d3d0eb83f39f36ec82272b 100644 (file)
@@ -504,8 +504,6 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
                     mp->populated_size < mp->size; off += phys_len) {
 
                paddr = rte_mem_virt2phy(addr + off);
-               /* required for xen_dom0 to get the machine address */
-               paddr = rte_mem_phy2mch(-1, paddr);
 
                if (paddr == RTE_BAD_PHYS_ADDR && rte_eal_has_hugepages()) {
                        ret = -EINVAL;
@@ -517,7 +515,6 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
                        phys_addr_t paddr_tmp;
 
                        paddr_tmp = rte_mem_virt2phy(addr + off + phys_len);
-                       paddr_tmp = rte_mem_phy2mch(-1, paddr_tmp);
 
                        if (paddr_tmp != paddr + phys_len)
                                break;