[v3] net: adjust the header length parse size
Checks
Commit Message
Enlarge the L3 and tunnel header length from 8-bit to 16-bit to handle
the bigger headers. And reorder the fields to avoid creating a structure
hole.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
v2: use bit field to avoid creating a structure hole.
v3: use basic type and reorder to avoid structure hole.
---
lib/librte_net/rte_net.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On Mon, 7 Sep 2020 09:56:50 +0800
Haiyue Wang <haiyue.wang@intel.com> wrote:
> Enlarge the L3 and tunnel header length from 8-bit to 16-bit to handle
> the bigger headers. And reorder the fields to avoid creating a structure
> hole.
>
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
> v2: use bit field to avoid creating a structure hole.
> v3: use basic type and reorder to avoid structure hole.
> ---
> lib/librte_net/rte_net.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
> index 94b06d9ee..434435ffa 100644
> --- a/lib/librte_net/rte_net.h
> +++ b/lib/librte_net/rte_net.h
> @@ -20,11 +20,11 @@ extern "C" {
> */
> struct rte_net_hdr_lens {
> uint8_t l2_len;
> - uint8_t l3_len;
> - uint8_t l4_len;
> - uint8_t tunnel_len;
> uint8_t inner_l2_len;
> - uint8_t inner_l3_len;
> + uint16_t l3_len;
> + uint16_t inner_l3_len;
> + uint16_t tunnel_len;
> + uint8_t l4_len;
> uint8_t inner_l4_len;
> };
>
Acked-by: Stephhen Hemminger <stephen@networkplumber.org>
On 9/8/2020 3:53 PM, Stephen Hemminger wrote:
> On Mon, 7 Sep 2020 09:56:50 +0800
> Haiyue Wang <haiyue.wang@intel.com> wrote:
>
>> Enlarge the L3 and tunnel header length from 8-bit to 16-bit to handle
>> the bigger headers. And reorder the fields to avoid creating a structure
>> hole.
>>
>> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
>> ---
>> v2: use bit field to avoid creating a structure hole.
>> v3: use basic type and reorder to avoid structure hole.
>> ---
>> lib/librte_net/rte_net.h | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
>> index 94b06d9ee..434435ffa 100644
>> --- a/lib/librte_net/rte_net.h
>> +++ b/lib/librte_net/rte_net.h
>> @@ -20,11 +20,11 @@ extern "C" {
>> */
>> struct rte_net_hdr_lens {
>> uint8_t l2_len;
>> - uint8_t l3_len;
>> - uint8_t l4_len;
>> - uint8_t tunnel_len;
>> uint8_t inner_l2_len;
>> - uint8_t inner_l3_len;
>> + uint16_t l3_len;
>> + uint16_t inner_l3_len;
>> + uint16_t tunnel_len;
>> + uint8_t l4_len;
>> uint8_t inner_l4_len;
>> };
>>
>
> Acked-by: Stephhen Hemminger <stephen@networkplumber.org>
>
Applied to dpdk-next-net/main, thanks.
@@ -20,11 +20,11 @@ extern "C" {
*/
struct rte_net_hdr_lens {
uint8_t l2_len;
- uint8_t l3_len;
- uint8_t l4_len;
- uint8_t tunnel_len;
uint8_t inner_l2_len;
- uint8_t inner_l3_len;
+ uint16_t l3_len;
+ uint16_t inner_l3_len;
+ uint16_t tunnel_len;
+ uint8_t l4_len;
uint8_t inner_l4_len;
};