mbuf: add accessors for data room and private size
[dpdk.git] / lib / librte_pmd_e1000 / igb_rxtx.c
index 946b39d..80d05c0 100644 (file)
@@ -1164,8 +1164,7 @@ igb_reset_tx_queue_stat(struct igb_tx_queue *txq)
 static void
 igb_reset_tx_queue(struct igb_tx_queue *txq, struct rte_eth_dev *dev)
 {
-       static const union e1000_adv_tx_desc zeroed_desc = { .read = {
-                       .buffer_addr = 0}};
+       static const union e1000_adv_tx_desc zeroed_desc = {{0}};
        struct igb_tx_entry *txe = txq->sw_ring;
        uint16_t i, prev;
        struct e1000_hw *hw;
@@ -1330,8 +1329,7 @@ eth_igb_rx_queue_release(void *rxq)
 static void
 igb_reset_rx_queue(struct igb_rx_queue *rxq)
 {
-       static const union e1000_adv_rx_desc zeroed_desc = { .read = {
-                       .pkt_addr = 0}};
+       static const union e1000_adv_rx_desc zeroed_desc = {{0}};
        unsigned i;
 
        /* Zero out HW ring memory */
@@ -1923,7 +1921,6 @@ eth_igb_rx_init(struct rte_eth_dev *dev)
 {
        struct e1000_hw     *hw;
        struct igb_rx_queue *rxq;
-       struct rte_pktmbuf_pool_private *mbp_priv;
        uint32_t rctl;
        uint32_t rxcsum;
        uint32_t srrctl;
@@ -1993,9 +1990,8 @@ eth_igb_rx_init(struct rte_eth_dev *dev)
                /*
                 * Configure RX buffer size.
                 */
-               mbp_priv = rte_mempool_get_priv(rxq->mb_pool);
-               buf_size = (uint16_t) (mbp_priv->mbuf_data_room_size -
-                                      RTE_PKTMBUF_HEADROOM);
+               buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mb_pool) -
+                       RTE_PKTMBUF_HEADROOM);
                if (buf_size >= 1024) {
                        /*
                         * Configure the BSIZEPACKET field of the SRRCTL
@@ -2223,7 +2219,6 @@ eth_igbvf_rx_init(struct rte_eth_dev *dev)
 {
        struct e1000_hw     *hw;
        struct igb_rx_queue *rxq;
-       struct rte_pktmbuf_pool_private *mbp_priv;
        uint32_t srrctl;
        uint16_t buf_size;
        uint16_t rctl_bsize;
@@ -2264,9 +2259,8 @@ eth_igbvf_rx_init(struct rte_eth_dev *dev)
                /*
                 * Configure RX buffer size.
                 */
-               mbp_priv = rte_mempool_get_priv(rxq->mb_pool);
-               buf_size = (uint16_t) (mbp_priv->mbuf_data_room_size -
-                                      RTE_PKTMBUF_HEADROOM);
+               buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mb_pool) -
+                       RTE_PKTMBUF_HEADROOM);
                if (buf_size >= 1024) {
                        /*
                         * Configure the BSIZEPACKET field of the SRRCTL