diff mbox series

net/ixgbe: fix fdir flows with RTE_FLOW_ITEM_TYPE_RAW

Message ID 20200810203108.28770-1-pawelwod@gmail.com (mailing list archive)
State Rejected, archived
Delegated to: Qi Zhang
Headers show
Series net/ixgbe: fix fdir flows with RTE_FLOW_ITEM_TYPE_RAW | expand

Checks

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

Commit Message

Pawel Wodkowski Aug. 10, 2020, 8:31 p.m. UTC
Flows like IP4 / UDP / RAW are not working because after parsing
RTE_FLOW_ITEM_TYPE_RAW item pointer is not advanced. This make whole
parsing fail.

Fixes: f35fec63dde1 ("net/ixgbe: enable flex bytes for generic flow API")
Cc: qi.z.zhang@intel.com
Signed-off-by: Pawel Wodkowski <pawelwod@gmail.com>
---
 drivers/net/ixgbe/ixgbe_flow.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Zhang, Qi Z Aug. 31, 2020, 3:46 a.m. UTC | #1
> -----Original Message-----
> From: Pawel Wodkowski <pawelwod@gmail.com>
> Sent: Tuesday, August 11, 2020 4:31 AM
> To: dev@dpdk.org
> Cc: Pawel Wodkowski <pawelwod@gmail.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>; Guo, Jia
> <jia.guo@intel.com>
> Subject: [PATCH] net/ixgbe: fix fdir flows with RTE_FLOW_ITEM_TYPE_RAW
> 
> Flows like IP4 / UDP / RAW are not working because after parsing
> RTE_FLOW_ITEM_TYPE_RAW item pointer is not advanced. This make whole
> parsing fail.
> 
> Fixes: f35fec63dde1 ("net/ixgbe: enable flex bytes for generic flow API")
> Cc: qi.z.zhang@intel.com
> Signed-off-by: Pawel Wodkowski <pawelwod@gmail.com>
> ---
>  drivers/net/ixgbe/ixgbe_flow.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
> index b2a2bfc02..a2cb599b1 100644
> --- a/drivers/net/ixgbe/ixgbe_flow.c
> +++ b/drivers/net/ixgbe/ixgbe_flow.c
> @@ -2251,6 +2251,8 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev
> *dev,
>  			(((uint16_t)raw_spec->pattern[1]) << 8) |
>  			raw_spec->pattern[0];
>  		rule->flex_bytes_offset = raw_spec->offset;
> +
> +		item = next_no_fuzzy_pattern(pattern, item);

why we need to advance item pointer?
The next branch will advance it and compare with RTe_FLOW_ITEM_TYPE_END.
Can you double check if your pattern is IPv4/UDP/RAW/END ?

>  	}
> 
>  	if (item->type != RTE_FLOW_ITEM_TYPE_END) {
> --
> 2.17.1
Pawel Wodkowski Sept. 2, 2020, 8:51 a.m. UTC | #2
On 31.08.2020 05:46, Zhang, Qi Z wrote:
>
>> -----Original Message-----
>> From: Pawel Wodkowski <pawelwod@gmail.com>
>> Sent: Tuesday, August 11, 2020 4:31 AM
>> To: dev@dpdk.org
>> Cc: Pawel Wodkowski <pawelwod@gmail.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>; Guo, Jia
>> <jia.guo@intel.com>
>> Subject: [PATCH] net/ixgbe: fix fdir flows with RTE_FLOW_ITEM_TYPE_RAW
>>
>> Flows like IP4 / UDP / RAW are not working because after parsing
>> RTE_FLOW_ITEM_TYPE_RAW item pointer is not advanced. This make whole
>> parsing fail.
>>
>> Fixes: f35fec63dde1 ("net/ixgbe: enable flex bytes for generic flow API")
>> Cc: qi.z.zhang@intel.com
>> Signed-off-by: Pawel Wodkowski <pawelwod@gmail.com>
>> ---
>>   drivers/net/ixgbe/ixgbe_flow.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
>> index b2a2bfc02..a2cb599b1 100644
>> --- a/drivers/net/ixgbe/ixgbe_flow.c
>> +++ b/drivers/net/ixgbe/ixgbe_flow.c
>> @@ -2251,6 +2251,8 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev
>> *dev,
>>   			(((uint16_t)raw_spec->pattern[1]) << 8) |
>>   			raw_spec->pattern[0];
>>   		rule->flex_bytes_offset = raw_spec->offset;
>> +
>> +		item = next_no_fuzzy_pattern(pattern, item);
> why we need to advance item pointer?
> The next branch will advance it and compare with RTe_FLOW_ITEM_TYPE_END.
> Can you double check if your pattern is IPv4/UDP/RAW/END ?

True, pls ignore this patch.

>
>>   	}
>>
>>   	if (item->type != RTE_FLOW_ITEM_TYPE_END) {
>> --
>> 2.17.1
diff mbox series

Patch

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index b2a2bfc02..a2cb599b1 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -2251,6 +2251,8 @@  ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 			(((uint16_t)raw_spec->pattern[1]) << 8) |
 			raw_spec->pattern[0];
 		rule->flex_bytes_offset = raw_spec->offset;
+
+		item = next_no_fuzzy_pattern(pattern, item);
 	}
 
 	if (item->type != RTE_FLOW_ITEM_TYPE_END) {