mbuf: add accessors for data room and private size
[dpdk.git] / lib / librte_pmd_e1000 / igb_rxtx.c
index 5c394a9..80d05c0 100644 (file)
@@ -51,7 +51,6 @@
 #include <rte_memcpy.h>
 #include <rte_memzone.h>
 #include <rte_launch.h>
-#include <rte_tailq.h>
 #include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include "e1000/e1000_api.h"
 #include "e1000_ethdev.h"
 
-#define IGB_RSS_OFFLOAD_ALL ( \
-               ETH_RSS_IPV4 | \
-               ETH_RSS_IPV4_TCP | \
-               ETH_RSS_IPV6 | \
-               ETH_RSS_IPV6_EX | \
-               ETH_RSS_IPV6_TCP | \
-               ETH_RSS_IPV6_TCP_EX | \
-               ETH_RSS_IPV4_UDP | \
-               ETH_RSS_IPV6_UDP | \
-               ETH_RSS_IPV6_UDP_EX)
-
 /* Bit Mask to indicate what bits required for building TX context */
 #define IGB_TX_OFFLOAD_MASK (                   \
                PKT_TX_VLAN_PKT |                \
@@ -1176,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;
@@ -1342,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 */
@@ -1582,19 +1568,19 @@ igb_hw_rss_hash_set(struct e1000_hw *hw, struct rte_eth_rss_conf *rss_conf)
        mrqc = E1000_MRQC_ENABLE_RSS_4Q; /* RSS enabled. */
        if (rss_hf & ETH_RSS_IPV4)
                mrqc |= E1000_MRQC_RSS_FIELD_IPV4;
-       if (rss_hf & ETH_RSS_IPV4_TCP)
+       if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP)
                mrqc |= E1000_MRQC_RSS_FIELD_IPV4_TCP;
        if (rss_hf & ETH_RSS_IPV6)
                mrqc |= E1000_MRQC_RSS_FIELD_IPV6;
        if (rss_hf & ETH_RSS_IPV6_EX)
                mrqc |= E1000_MRQC_RSS_FIELD_IPV6_EX;
-       if (rss_hf & ETH_RSS_IPV6_TCP)
+       if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP)
                mrqc |= E1000_MRQC_RSS_FIELD_IPV6_TCP;
        if (rss_hf & ETH_RSS_IPV6_TCP_EX)
                mrqc |= E1000_MRQC_RSS_FIELD_IPV6_TCP_EX;
-       if (rss_hf & ETH_RSS_IPV4_UDP)
+       if (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP)
                mrqc |= E1000_MRQC_RSS_FIELD_IPV4_UDP;
-       if (rss_hf & ETH_RSS_IPV6_UDP)
+       if (rss_hf & ETH_RSS_NONFRAG_IPV6_UDP)
                mrqc |= E1000_MRQC_RSS_FIELD_IPV6_UDP;
        if (rss_hf & ETH_RSS_IPV6_UDP_EX)
                mrqc |= E1000_MRQC_RSS_FIELD_IPV6_UDP_EX;
@@ -1664,19 +1650,19 @@ int eth_igb_rss_hash_conf_get(struct rte_eth_dev *dev,
        if (mrqc & E1000_MRQC_RSS_FIELD_IPV4)
                rss_hf |= ETH_RSS_IPV4;
        if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_TCP)
-               rss_hf |= ETH_RSS_IPV4_TCP;
+               rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP;
        if (mrqc & E1000_MRQC_RSS_FIELD_IPV6)
                rss_hf |= ETH_RSS_IPV6;
        if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_EX)
                rss_hf |= ETH_RSS_IPV6_EX;
        if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP)
-               rss_hf |= ETH_RSS_IPV6_TCP;
+               rss_hf |= ETH_RSS_NONFRAG_IPV6_TCP;
        if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP_EX)
                rss_hf |= ETH_RSS_IPV6_TCP_EX;
        if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_UDP)
-               rss_hf |= ETH_RSS_IPV4_UDP;
+               rss_hf |= ETH_RSS_NONFRAG_IPV4_UDP;
        if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_UDP)
-               rss_hf |= ETH_RSS_IPV6_UDP;
+               rss_hf |= ETH_RSS_NONFRAG_IPV6_UDP;
        if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_UDP_EX)
                rss_hf |= ETH_RSS_IPV6_UDP_EX;
        rss_conf->rss_hf = rss_hf;
@@ -1935,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;
@@ -2005,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
@@ -2235,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;
@@ -2276,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