[5/5] net/softnic: update headers size calculation

Message ID 0bbc7b578dc8ad9348e802e2553de977805f80db.1605493464.git.jackmin@nvidia.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers
Series fix protocol size calculation |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Functional fail Functional Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed

Commit Message

Xiaoyu Min Nov. 16, 2020, 7:55 a.m. UTC
  From: Dekel Peled <dekelp@nvidia.com>

The rte_flow_item_eth and rte_flow_item_vlan items were updated in [1].
The rte_flow_item_ipv6 item was updated in [2].
The structs now contain additional metadata following the header data.
The size to use for match should be the header data size only, and
not the size of the whole struct.

This patch replaces the rte_flow_item_* with the corresponding rte_*_hdr.

[1]:commit 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLAN
items")

[2]: commit ad976bd40d28 ("ethdev: add extensions attributes to IPv6 item")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
---
 drivers/net/softnic/rte_eth_softnic_flow.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Ferruh Yigit Nov. 16, 2020, 4:27 p.m. UTC | #1
On 11/16/2020 7:55 AM, Xiaoyu Min wrote:
> From: Dekel Peled <dekelp@nvidia.com>
> 
> The rte_flow_item_eth and rte_flow_item_vlan items were updated in [1].
> The rte_flow_item_ipv6 item was updated in [2].
> The structs now contain additional metadata following the header data.
> The size to use for match should be the header data size only, and
> not the size of the whole struct.
> 
> This patch replaces the rte_flow_item_* with the corresponding rte_*_hdr.
> 
> [1]:commit 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLAN
> items")
> 
> [2]: commit ad976bd40d28 ("ethdev: add extensions attributes to IPv6 item")
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> ---
>   drivers/net/softnic/rte_eth_softnic_flow.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c
> index f05ff092fa..7925bad1c0 100644
> --- a/drivers/net/softnic/rte_eth_softnic_flow.c
> +++ b/drivers/net/softnic/rte_eth_softnic_flow.c
> @@ -169,22 +169,22 @@ flow_item_is_proto(enum rte_flow_item_type type,
>   
>   	case RTE_FLOW_ITEM_TYPE_ETH:
>   		*mask = &rte_flow_item_eth_mask;
> -		*size = sizeof(struct rte_flow_item_eth);
> +		*size = sizeof(struct rte_ether_hdr);
>   		return 1; /* TRUE */
>   
>   	case RTE_FLOW_ITEM_TYPE_VLAN:
>   		*mask = &rte_flow_item_vlan_mask;
> -		*size = sizeof(struct rte_flow_item_vlan);
> +		*size = sizeof(struct rte_vlan_hdr);
>   		return 1;
>   
>   	case RTE_FLOW_ITEM_TYPE_IPV4:
>   		*mask = &rte_flow_item_ipv4_mask;
> -		*size = sizeof(struct rte_flow_item_ipv4);
> +		*size = sizeof(struct rte_ipv4_hdr);
>   		return 1;
>   
>   	case RTE_FLOW_ITEM_TYPE_IPV6:
>   		*mask = &rte_flow_item_ipv6_mask;
> -		*size = sizeof(struct rte_flow_item_ipv6);
> +		*size = sizeof(struct rte_ipv6_hdr);
>   		return 1;
>   

As far as I can see the 'flow_item_is_proto' sets the size to be used over 
'rte_flow_item_*" types, the original values seems correct to me, am I missing 
something.

Can you please elaborate why the change is needed?
  
Dekel Peled Nov. 16, 2020, 7:09 p.m. UTC | #2
Hi Ferruh,

The failure occur at hash_key_mask_is_same() which uses the size returned by flow_item_is_proto() for comparison.
Since the rte_flow_item_* of some types is now different than the rte_*_hdr size of these types, need to use the rte_*_hdr size.

Regards,
Dekel

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Monday, November 16, 2020 6:27 PM
> To: Xiaoyu Min <jackmin@mellanox.com>; Jasvinder Singh
> <jasvinder.singh@intel.com>; Cristian Dumitrescu
> <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org; Dekel Peled <dekelp@nvidia.com>
> Subject: Re: [dpdk-dev] [PATCH 5/5] net/softnic: update headers size
> calculation
> 
> On 11/16/2020 7:55 AM, Xiaoyu Min wrote:
> > From: Dekel Peled <dekelp@nvidia.com>
> >
> > The rte_flow_item_eth and rte_flow_item_vlan items were updated in
> [1].
> > The rte_flow_item_ipv6 item was updated in [2].
> > The structs now contain additional metadata following the header data.
> > The size to use for match should be the header data size only, and not
> > the size of the whole struct.
> >
> > This patch replaces the rte_flow_item_* with the corresponding
> rte_*_hdr.
> >
> > [1]:commit 09315fc83861 ("ethdev: add VLAN attributes to ethernet and
> > VLAN
> > items")
> >
> > [2]: commit ad976bd40d28 ("ethdev: add extensions attributes to IPv6
> > item")
> >
> > Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> > ---
> >   drivers/net/softnic/rte_eth_softnic_flow.c | 8 ++++----
> >   1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c
> > b/drivers/net/softnic/rte_eth_softnic_flow.c
> > index f05ff092fa..7925bad1c0 100644
> > --- a/drivers/net/softnic/rte_eth_softnic_flow.c
> > +++ b/drivers/net/softnic/rte_eth_softnic_flow.c
> > @@ -169,22 +169,22 @@ flow_item_is_proto(enum rte_flow_item_type
> type,
> >
> >   	case RTE_FLOW_ITEM_TYPE_ETH:
> >   		*mask = &rte_flow_item_eth_mask;
> > -		*size = sizeof(struct rte_flow_item_eth);
> > +		*size = sizeof(struct rte_ether_hdr);
> >   		return 1; /* TRUE */
> >
> >   	case RTE_FLOW_ITEM_TYPE_VLAN:
> >   		*mask = &rte_flow_item_vlan_mask;
> > -		*size = sizeof(struct rte_flow_item_vlan);
> > +		*size = sizeof(struct rte_vlan_hdr);
> >   		return 1;
> >
> >   	case RTE_FLOW_ITEM_TYPE_IPV4:
> >   		*mask = &rte_flow_item_ipv4_mask;
> > -		*size = sizeof(struct rte_flow_item_ipv4);
> > +		*size = sizeof(struct rte_ipv4_hdr);
> >   		return 1;
> >
> >   	case RTE_FLOW_ITEM_TYPE_IPV6:
> >   		*mask = &rte_flow_item_ipv6_mask;
> > -		*size = sizeof(struct rte_flow_item_ipv6);
> > +		*size = sizeof(struct rte_ipv6_hdr);
> >   		return 1;
> >
> 
> As far as I can see the 'flow_item_is_proto' sets the size to be used over
> 'rte_flow_item_*" types, the original values seems correct to me, am I
> missing something.
> 
> Can you please elaborate why the change is needed?
  
Ferruh Yigit Nov. 17, 2020, 10:30 a.m. UTC | #3
On 11/16/2020 7:09 PM, Dekel Peled wrote:

< Please don't top post, reply moved to the bottom >

>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> Sent: Monday, November 16, 2020 6:27 PM
>> To: Xiaoyu Min <jackmin@mellanox.com>; Jasvinder Singh
>> <jasvinder.singh@intel.com>; Cristian Dumitrescu
>> <cristian.dumitrescu@intel.com>
>> Cc: dev@dpdk.org; Dekel Peled <dekelp@nvidia.com>
>> Subject: Re: [dpdk-dev] [PATCH 5/5] net/softnic: update headers size
>> calculation
>>
>> On 11/16/2020 7:55 AM, Xiaoyu Min wrote:
>>> From: Dekel Peled <dekelp@nvidia.com>
>>>
>>> The rte_flow_item_eth and rte_flow_item_vlan items were updated in
>> [1].
>>> The rte_flow_item_ipv6 item was updated in [2].
>>> The structs now contain additional metadata following the header data.
>>> The size to use for match should be the header data size only, and not
>>> the size of the whole struct.
>>>
>>> This patch replaces the rte_flow_item_* with the corresponding
>> rte_*_hdr.
>>>
>>> [1]:commit 09315fc83861 ("ethdev: add VLAN attributes to ethernet and
>>> VLAN
>>> items")
>>>
>>> [2]: commit ad976bd40d28 ("ethdev: add extensions attributes to IPv6
>>> item")
>>>
>>> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
>>> ---
>>>    drivers/net/softnic/rte_eth_softnic_flow.c | 8 ++++----
>>>    1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c
>>> b/drivers/net/softnic/rte_eth_softnic_flow.c
>>> index f05ff092fa..7925bad1c0 100644
>>> --- a/drivers/net/softnic/rte_eth_softnic_flow.c
>>> +++ b/drivers/net/softnic/rte_eth_softnic_flow.c
>>> @@ -169,22 +169,22 @@ flow_item_is_proto(enum rte_flow_item_type
>> type,
>>>
>>>    	case RTE_FLOW_ITEM_TYPE_ETH:
>>>    		*mask = &rte_flow_item_eth_mask;
>>> -		*size = sizeof(struct rte_flow_item_eth);
>>> +		*size = sizeof(struct rte_ether_hdr);
>>>    		return 1; /* TRUE */
>>>
>>>    	case RTE_FLOW_ITEM_TYPE_VLAN:
>>>    		*mask = &rte_flow_item_vlan_mask;
>>> -		*size = sizeof(struct rte_flow_item_vlan);
>>> +		*size = sizeof(struct rte_vlan_hdr);
>>>    		return 1;
>>>
>>>    	case RTE_FLOW_ITEM_TYPE_IPV4:
>>>    		*mask = &rte_flow_item_ipv4_mask;
>>> -		*size = sizeof(struct rte_flow_item_ipv4);
>>> +		*size = sizeof(struct rte_ipv4_hdr);
>>>    		return 1;
>>>
>>>    	case RTE_FLOW_ITEM_TYPE_IPV6:
>>>    		*mask = &rte_flow_item_ipv6_mask;
>>> -		*size = sizeof(struct rte_flow_item_ipv6);
>>> +		*size = sizeof(struct rte_ipv6_hdr);
>>>    		return 1;
>>>
>>
>> As far as I can see the 'flow_item_is_proto' sets the size to be used over
>> 'rte_flow_item_*" types, the original values seems correct to me, am I
>> missing something.
>>
>> Can you please elaborate why the change is needed?
> 
 > Hi Ferruh,
 >
 > The failure occur at hash_key_mask_is_same() which uses the size returned by 
flow_item_is_proto() for comparison.
 > Since the rte_flow_item_* of some types is now different than the rte_*_hdr 
size of these types, need to use the rte_*_hdr size.
 >

Got it.

Using "rte_*_hdr" structs size will strip the new additions to the 
"rte_flow_item_*" structs and won't able to use them.
But at least using old sizes should preserve old functionality and prevent any 
unexpected side affect, so I am OK to continue with this change but code needs 
to be updated later to benefit from latest "rte_flow_item_*" structs.

Cristian, Jasvinder,

Can you please acknowledge that you are aware of the reason of this change and 
possible updates may be required later?
  
Dekel Peled Nov. 17, 2020, 12:41 p.m. UTC | #4
PSB.

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Tuesday, November 17, 2020 12:30 PM
> To: Dekel Peled <dekelp@nvidia.com>; Xiaoyu Min
> <jackmin@mellanox.com>; Jasvinder Singh <jasvinder.singh@intel.com>;
> Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 5/5] net/softnic: update headers size
> calculation
> 
> On 11/16/2020 7:09 PM, Dekel Peled wrote:
> 
> < Please don't top post, reply moved to the bottom >
> 
> >> -----Original Message-----
> >> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >> Sent: Monday, November 16, 2020 6:27 PM
> >> To: Xiaoyu Min <jackmin@mellanox.com>; Jasvinder Singh
> >> <jasvinder.singh@intel.com>; Cristian Dumitrescu
> >> <cristian.dumitrescu@intel.com>
> >> Cc: dev@dpdk.org; Dekel Peled <dekelp@nvidia.com>
> >> Subject: Re: [dpdk-dev] [PATCH 5/5] net/softnic: update headers size
> >> calculation
> >>
> >> On 11/16/2020 7:55 AM, Xiaoyu Min wrote:
> >>> From: Dekel Peled <dekelp@nvidia.com>
> >>>
> >>> The rte_flow_item_eth and rte_flow_item_vlan items were updated in
> >> [1].
> >>> The rte_flow_item_ipv6 item was updated in [2].
> >>> The structs now contain additional metadata following the header data.
> >>> The size to use for match should be the header data size only, and
> >>> not the size of the whole struct.
> >>>
> >>> This patch replaces the rte_flow_item_* with the corresponding
> >> rte_*_hdr.
> >>>
> >>> [1]:commit 09315fc83861 ("ethdev: add VLAN attributes to ethernet
> >>> and VLAN
> >>> items")
> >>>
> >>> [2]: commit ad976bd40d28 ("ethdev: add extensions attributes to IPv6
> >>> item")
> >>>
> >>> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> >>> ---
> >>>    drivers/net/softnic/rte_eth_softnic_flow.c | 8 ++++----
> >>>    1 file changed, 4 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c
> >>> b/drivers/net/softnic/rte_eth_softnic_flow.c
> >>> index f05ff092fa..7925bad1c0 100644
> >>> --- a/drivers/net/softnic/rte_eth_softnic_flow.c
> >>> +++ b/drivers/net/softnic/rte_eth_softnic_flow.c
> >>> @@ -169,22 +169,22 @@ flow_item_is_proto(enum
> rte_flow_item_type
> >> type,
> >>>
> >>>    	case RTE_FLOW_ITEM_TYPE_ETH:
> >>>    		*mask = &rte_flow_item_eth_mask;
> >>> -		*size = sizeof(struct rte_flow_item_eth);
> >>> +		*size = sizeof(struct rte_ether_hdr);
> >>>    		return 1; /* TRUE */
> >>>
> >>>    	case RTE_FLOW_ITEM_TYPE_VLAN:
> >>>    		*mask = &rte_flow_item_vlan_mask;
> >>> -		*size = sizeof(struct rte_flow_item_vlan);
> >>> +		*size = sizeof(struct rte_vlan_hdr);
> >>>    		return 1;
> >>>
> >>>    	case RTE_FLOW_ITEM_TYPE_IPV4:
> >>>    		*mask = &rte_flow_item_ipv4_mask;
> >>> -		*size = sizeof(struct rte_flow_item_ipv4);
> >>> +		*size = sizeof(struct rte_ipv4_hdr);
> >>>    		return 1;
> >>>
> >>>    	case RTE_FLOW_ITEM_TYPE_IPV6:
> >>>    		*mask = &rte_flow_item_ipv6_mask;
> >>> -		*size = sizeof(struct rte_flow_item_ipv6);
> >>> +		*size = sizeof(struct rte_ipv6_hdr);
> >>>    		return 1;
> >>>
> >>
> >> As far as I can see the 'flow_item_is_proto' sets the size to be used
> >> over 'rte_flow_item_*" types, the original values seems correct to
> >> me, am I missing something.
> >>
> >> Can you please elaborate why the change is needed?
> >
>  > Hi Ferruh,
>  >
>  > The failure occur at hash_key_mask_is_same() which uses the size
> returned by
> flow_item_is_proto() for comparison.
>  > Since the rte_flow_item_* of some types is now different than the
> rte_*_hdr size of these types, need to use the rte_*_hdr size.
>  >
> 
> Got it.
> 
> Using "rte_*_hdr" structs size will strip the new additions to the
> "rte_flow_item_*" structs and won't able to use them.
> But at least using old sizes should preserve old functionality and prevent any
> unexpected side affect, so I am OK to continue with this change but code
> needs to be updated later to benefit from latest "rte_flow_item_*" structs.
> 
> Cristian, Jasvinder,
> 
> Can you please acknowledge that you are aware of the reason of this change
> and possible updates may be required later?

Please see related issues fixed by this patch:
https://bugs.dpdk.org/show_bug.cgi?id=564
https://bugs.dpdk.org/show_bug.cgi?id=565
  
Jasvinder Singh Nov. 17, 2020, 3:43 p.m. UTC | #5
<snip>
> > >>
> > >> On 11/16/2020 7:55 AM, Xiaoyu Min wrote:
> > >>> From: Dekel Peled <dekelp@nvidia.com>
> > >>>
> > >>> The rte_flow_item_eth and rte_flow_item_vlan items were updated in
> > >> [1].
> > >>> The rte_flow_item_ipv6 item was updated in [2].
> > >>> The structs now contain additional metadata following the header
> data.
> > >>> The size to use for match should be the header data size only, and
> > >>> not the size of the whole struct.
> > >>>
> > >>> This patch replaces the rte_flow_item_* with the corresponding
> > >> rte_*_hdr.
> > >>>
> > >>> [1]:commit 09315fc83861 ("ethdev: add VLAN attributes to ethernet
> > >>> and VLAN
> > >>> items")
> > >>>
> > >>> [2]: commit ad976bd40d28 ("ethdev: add extensions attributes to
> > >>> IPv6
> > >>> item")
> > >>>
> > >>> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> > >>> ---
> > >>>    drivers/net/softnic/rte_eth_softnic_flow.c | 8 ++++----
> > >>>    1 file changed, 4 insertions(+), 4 deletions(-)
> > >>>
> > >>> diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c
> > >>> b/drivers/net/softnic/rte_eth_softnic_flow.c
> > >>> index f05ff092fa..7925bad1c0 100644
> > >>> --- a/drivers/net/softnic/rte_eth_softnic_flow.c
> > >>> +++ b/drivers/net/softnic/rte_eth_softnic_flow.c
> > >>> @@ -169,22 +169,22 @@ flow_item_is_proto(enum
> > rte_flow_item_type
> > >> type,
> > >>>
> > >>>    	case RTE_FLOW_ITEM_TYPE_ETH:
> > >>>    		*mask = &rte_flow_item_eth_mask;
> > >>> -		*size = sizeof(struct rte_flow_item_eth);
> > >>> +		*size = sizeof(struct rte_ether_hdr);
> > >>>    		return 1; /* TRUE */
> > >>>
> > >>>    	case RTE_FLOW_ITEM_TYPE_VLAN:
> > >>>    		*mask = &rte_flow_item_vlan_mask;
> > >>> -		*size = sizeof(struct rte_flow_item_vlan);
> > >>> +		*size = sizeof(struct rte_vlan_hdr);
> > >>>    		return 1;
> > >>>
> > >>>    	case RTE_FLOW_ITEM_TYPE_IPV4:
> > >>>    		*mask = &rte_flow_item_ipv4_mask;
> > >>> -		*size = sizeof(struct rte_flow_item_ipv4);
> > >>> +		*size = sizeof(struct rte_ipv4_hdr);
> > >>>    		return 1;
> > >>>
> > >>>    	case RTE_FLOW_ITEM_TYPE_IPV6:
> > >>>    		*mask = &rte_flow_item_ipv6_mask;
> > >>> -		*size = sizeof(struct rte_flow_item_ipv6);
> > >>> +		*size = sizeof(struct rte_ipv6_hdr);
> > >>>    		return 1;
> > >>>
> > >>

Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
  
Zhou, JunX W Nov. 18, 2020, 2:23 a.m. UTC | #6
Tested-by: Zhou, Jun <junx.w.zhou@intel.com>

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xiaoyu Min
Sent: Monday, November 16, 2020 3:55 PM
To: Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
Cc: dev@dpdk.org; Dekel Peled <dekelp@nvidia.com>
Subject: [dpdk-dev] [PATCH 5/5] net/softnic: update headers size calculation

From: Dekel Peled <dekelp@nvidia.com>

The rte_flow_item_eth and rte_flow_item_vlan items were updated in [1].
The rte_flow_item_ipv6 item was updated in [2].
The structs now contain additional metadata following the header data.
The size to use for match should be the header data size only, and not the size of the whole struct.

This patch replaces the rte_flow_item_* with the corresponding rte_*_hdr.

[1]:commit 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLAN
items")

[2]: commit ad976bd40d28 ("ethdev: add extensions attributes to IPv6 item")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
---
 drivers/net/softnic/rte_eth_softnic_flow.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c
index f05ff092fa..7925bad1c0 100644
--- a/drivers/net/softnic/rte_eth_softnic_flow.c
+++ b/drivers/net/softnic/rte_eth_softnic_flow.c
@@ -169,22 +169,22 @@ flow_item_is_proto(enum rte_flow_item_type type,
 
 	case RTE_FLOW_ITEM_TYPE_ETH:
 		*mask = &rte_flow_item_eth_mask;
-		*size = sizeof(struct rte_flow_item_eth);
+		*size = sizeof(struct rte_ether_hdr);
 		return 1; /* TRUE */
 
 	case RTE_FLOW_ITEM_TYPE_VLAN:
 		*mask = &rte_flow_item_vlan_mask;
-		*size = sizeof(struct rte_flow_item_vlan);
+		*size = sizeof(struct rte_vlan_hdr);
 		return 1;
 
 	case RTE_FLOW_ITEM_TYPE_IPV4:
 		*mask = &rte_flow_item_ipv4_mask;
-		*size = sizeof(struct rte_flow_item_ipv4);
+		*size = sizeof(struct rte_ipv4_hdr);
 		return 1;
 
 	case RTE_FLOW_ITEM_TYPE_IPV6:
 		*mask = &rte_flow_item_ipv6_mask;
-		*size = sizeof(struct rte_flow_item_ipv6);
+		*size = sizeof(struct rte_ipv6_hdr);
 		return 1;
 
 	case RTE_FLOW_ITEM_TYPE_ICMP:
--
2.25.1
  

Patch

diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c
index f05ff092fa..7925bad1c0 100644
--- a/drivers/net/softnic/rte_eth_softnic_flow.c
+++ b/drivers/net/softnic/rte_eth_softnic_flow.c
@@ -169,22 +169,22 @@  flow_item_is_proto(enum rte_flow_item_type type,
 
 	case RTE_FLOW_ITEM_TYPE_ETH:
 		*mask = &rte_flow_item_eth_mask;
-		*size = sizeof(struct rte_flow_item_eth);
+		*size = sizeof(struct rte_ether_hdr);
 		return 1; /* TRUE */
 
 	case RTE_FLOW_ITEM_TYPE_VLAN:
 		*mask = &rte_flow_item_vlan_mask;
-		*size = sizeof(struct rte_flow_item_vlan);
+		*size = sizeof(struct rte_vlan_hdr);
 		return 1;
 
 	case RTE_FLOW_ITEM_TYPE_IPV4:
 		*mask = &rte_flow_item_ipv4_mask;
-		*size = sizeof(struct rte_flow_item_ipv4);
+		*size = sizeof(struct rte_ipv4_hdr);
 		return 1;
 
 	case RTE_FLOW_ITEM_TYPE_IPV6:
 		*mask = &rte_flow_item_ipv6_mask;
-		*size = sizeof(struct rte_flow_item_ipv6);
+		*size = sizeof(struct rte_ipv6_hdr);
 		return 1;
 
 	case RTE_FLOW_ITEM_TYPE_ICMP: