padam_singh

Untitled

Apr 12th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.65 KB | None | 0 0
  1. --- main.c  2017-10-06 22:58:52.000000000 +0530
  2. +++ /home/padam.singh/main.c    2018-04-12 11:41:49.460075874 +0530
  3. @@ -119,6 +119,7 @@
  4.         .header_split   = 0, /**< Header Split disabled */
  5.         .hw_ip_checksum = 0, /**< IP checksum offload disabled */
  6.         .hw_vlan_filter = 0, /**< VLAN filtering disabled */
  7. +       .hw_vlan_strip  = 1,
  8.         .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
  9.         .hw_strip_crc   = 1, /**< CRC stripped by hardware */
  10.     },
  11. @@ -210,11 +211,16 @@
  12.     int sent;
  13.     struct rte_eth_dev_tx_buffer *buffer;
  14.  
  15. +   struct ether_hdr *eth;
  16.     dst_port = l2fwd_dst_ports[portid];
  17.  
  18.     if (mac_updating)
  19.         l2fwd_mac_updating(m, dst_port);
  20.  
  21. +   eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
  22. +   printf("mbuff->vlan_tci=%d vlan_tci_outer=%d ethertype=%x \n",
  23. +       m->vlan_tci, m->vlan_tci_outer,
  24. +       eth->ether_type);          
  25.     buffer = tx_buffer[dst_port];
  26.     sent = rte_eth_tx_buffer(dst_port, 0, buffer, m);
  27.     if (sent)
  28. @@ -307,7 +313,6 @@
  29.             portid = qconf->rx_port_list[i];
  30.             nb_rx = rte_eth_rx_burst((uint8_t) portid, 0,
  31.                          pkts_burst, MAX_PKT_BURST);
  32. -
  33.             port_statistics[portid].rx += nb_rx;
  34.  
  35.             for (j = 0; j < nb_rx; j++) {
  36. @@ -665,6 +670,7 @@
  37.         if (ret < 0)
  38.             rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
  39.                   ret, (unsigned) portid);
  40. +        rte_eth_dev_set_vlan_offload(portid, ETH_VLAN_STRIP_OFFLOAD);
  41.  
  42.         rte_eth_macaddr_get(portid,&l2fwd_ports_eth_addr[portid]);
  43.  
  44. @@ -709,6 +715,7 @@
  45.         if (ret < 0)
  46.             rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n",
  47.                   ret, (unsigned) portid);
  48. +        rte_eth_dev_set_vlan_offload(portid, ETH_VLAN_STRIP_OFFLOAD);
  49.  
  50.         printf("done: \n");
Add Comment
Please, Sign In to add comment