ethdev: init all builtin drivers
[dpdk.git] / examples / ipv4_frag / main.c
index 0f0c5f6..5983986 100644 (file)
@@ -30,7 +30,6 @@
  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * 
- *  version: DPDK.L.1.2.3-3
  */
 
 #include <stdio.h>
@@ -288,7 +287,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t port_in)
                        rte_panic("No headroom in mbuf.\n");
                }
 
-               m->pkt.l2_len = sizeof(struct ether_hdr);
+               m->pkt.vlan_macip.f.l2_len = sizeof(struct ether_hdr);
 
                ether_addr_copy(&remote_eth_addr, &eth_hdr->d_addr);
                ether_addr_copy(&ports_eth_addr[port_out], &eth_hdr->s_addr);
@@ -558,14 +557,8 @@ MAIN(int argc, char **argv)
                rte_panic("Cannot init indirect mbuf pool\n");
 
        /* init driver */
-#ifdef RTE_LIBRTE_IGB_PMD
-       if (rte_igb_pmd_init() < 0)
-               rte_panic("Cannot init igb pmd\n");
-#endif
-#ifdef RTE_LIBRTE_IXGBE_PMD
-       if (rte_ixgbe_pmd_init() < 0)
-               rte_panic("Cannot init ixgbe pmd\n");
-#endif
+       if (rte_pmd_init_all() < 0)
+               rte_panic("Cannot init PMD\n");
 
        if (rte_eal_pci_probe() < 0)
                rte_panic("Cannot probe PCI\n");
@@ -673,8 +666,7 @@ MAIN(int argc, char **argv)
        }
 
        /* create the LPM table */
-       l3fwd_lpm = rte_lpm_create("L3FWD_LPM", SOCKET0, L3FWD_LPM_MAX_RULES,
-                       RTE_LPM_MEMZONE);
+       l3fwd_lpm = rte_lpm_create("L3FWD_LPM", SOCKET0, L3FWD_LPM_MAX_RULES, 0);
        if (l3fwd_lpm == NULL)
                rte_panic("Unable to create the l3fwd LPM table\n");