[PATCH v2] app/testpmd: fix wrong encap/decap size calculation

Ori Kam orika at nvidia.com
Thu Mar 23 11:34:24 CET 2023


Hi Michael,

> -----Original Message-----
> From: Michael Baum <michaelba at nvidia.com>
> Sent: Thursday, 16 March 2023 20:24
> 
> Testpmd app has some functions to create either encap or decap buffer
> for some special cases:
>  - "l2_encap" and "l2_decap"
>  - "mplsogre_encap" and "mplsogre_decap"
>  - "mplsoudp_encap" and "mplsoudp_decap"
> 
> The functions use both "rte_flow_item_eth" and "rte_flow_item_vlan"
> structures to represent the headers and copy them into "raw_encap"
> action. The size of either "raw_encap" or "raw_decap" is calculated as
> sum of headers size.
> 
> However, the both "rte_flow_item_eth" and "rte_flow_item_vlan" contain
> more fields than original headers, so using them cause bad size
> calculation.
> 
> This patch uses "rte_ether_hdr" and "rte_vlan_hdr" structures for header
> size calculation.
> 
> Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation")
> Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation")
> Cc: orika at nvidia.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Michael Baum <michaelba at nvidia.com>
> ---
> 

Acked-by: Ori Kam <orika at nvidia.com>
Best,
Ori


More information about the stable mailing list