[PATCH] net/rte_net: fix inner L2 length for tunneled Ethernet packets

Khadem Ullah 14pwcse1224 at uetpeshawar.edu.pk
Fri Aug 1 13:28:34 CEST 2025


Hi Andrew, 

Thanks for your feedback.

Please check mbuf packet types and the following test case:
https://doc.dpdk.org/dts-20.02/test_plans/uni_pkt_test_plan.html#test-case-vxlan-tunnel-packet-type-detect
sendp([Ether()/IP()/UDP()/Vxlan()/Ether()/IP(frag=5)/Raw('\0'*40)],
iface=txItf)

(outer) L2 type: ETHER
(outer) L3 type: IPV4_EXT_UNKNOWN
(outer) L4 type: Unknown
Tunnel type: GRENAT
Inner L2 type: ETHER
Inner L3 type: IPV4_EXT_UNKNOWN
Inner L4 type: L4_FRAG


union {
        uint32_t packet_type; /**< L2/L3/L4 and tunnel information. */
        __extension__
        struct {
          uint8_t l2_type:4;   /**< (Outer) L2 type. */
          uint8_t l3_type:4;   /**< (Outer) L3 type. */
          uint8_t l4_type:4;   /**< (Outer) L4 type. */
          uint8_t tun_type:4;  /**< Tunnel type. */
          union {
            uint8_t inner_esp_next_proto;
            /**< ESP next protocol type, valid if
             * RTE_PTYPE_TUNNEL_ESP tunnel type is set
             * on both Tx and Rx.
             */
            __extension__
            struct {
              uint8_t inner_l2_type:4;
              /**< Inner L2 type. */
              uint8_t inner_l3_type:4;
              /**< Inner L3 type. */
            };
          };
          uint8_t inner_l4_type:4; /**< Inner L4 type. */
        };
      };


Based on the above, it seems that inner_l2_len have to the length of Ether. 
Ther might need to be some correspondent between both fields to potray the same information. 
Or, the inner_l2_type and inner_l2_len are completly different ? 

Best Regards, 
Khadem


More information about the dev mailing list