mbuf: add accessors for data room and private size
[dpdk.git] / lib / librte_pmd_fm10k / fm10k_ethdev.c
index 0c7a80c..275c19c 100644 (file)
@@ -397,7 +397,6 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev)
        uint32_t size;
        uint32_t rxdctl = FM10K_RXDCTL_WRITE_BACK_MIN_DELAY;
        uint16_t buf_size;
-       struct rte_pktmbuf_pool_private *mbp_priv;
 
        /* Disable RXINT to avoid possible interrupt */
        for (i = 0; i < hw->mac.max_queues; i++)
@@ -425,9 +424,8 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev)
                FM10K_WRITE_REG(hw, FM10K_RDLEN(i), size);
 
                /* Configure the Rx buffer size for one buff without split */
-               mbp_priv = rte_mempool_get_priv(rxq->mp);
-               buf_size = (uint16_t) (mbp_priv->mbuf_data_room_size -
-                                       RTE_PKTMBUF_HEADROOM);
+               buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) -
+                       RTE_PKTMBUF_HEADROOM);
                FM10K_WRITE_REG(hw, FM10K_SRRCTL(i),
                                buf_size >> FM10K_SRRCTL_BSIZEPKT_SHIFT);
 
@@ -1651,7 +1649,7 @@ fm10k_close_mbx_service(struct fm10k_hw *hw)
        hw->mbx.ops.disconnect(hw, &hw->mbx);
 }
 
-static struct eth_dev_ops fm10k_eth_dev_ops = {
+static const struct eth_dev_ops fm10k_eth_dev_ops = {
        .dev_configure          = fm10k_dev_configure,
        .dev_start              = fm10k_dev_start,
        .dev_stop               = fm10k_dev_stop,
@@ -1835,7 +1833,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
  * The set of PCI devices this driver supports. This driver will enable both PF
  * and SRIOV-VF devices.
  */
-static struct rte_pci_id pci_id_fm10k_map[] = {
+static const struct rte_pci_id pci_id_fm10k_map[] = {
 #define RTE_PCI_DEV_ID_DECL_FM10K(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
 #define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
 #include "rte_pci_dev_ids.h"