[03/52] net/ice/base: disable profile merge for FDIR
diff mbox series

Message ID 20200603024016.30636-4-qi.z.zhang@intel.com
State Superseded
Delegated to: xiaolong ye
Headers show
Series
  • net/ice: base code update
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Zhang, Qi Z June 3, 2020, 2:39 a.m. UTC
For Flow Director, we don't want to re-use a existed profile with the
same field vector and mask. Merging two different flow_type’s field
vector will also make them sharing trained rule and cause rule
interference.

For example:
issue rule A: IPV4_TCP matching tcp src&dst port 80  to queue 8
issue rule B: IPV6_TCP matching tcp src&dst port 200 to queue 20
Below behavior is found but not expected:
IPV4_TCP pkt with src&dst port 200 hits rule B and goes to queue 20
IPV6_TCP pkt with src&dst port 80  hits rule A and goes to queue 8

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Signed-off-by: Paul M. Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_flex_pipe.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Yang, Qiming June 3, 2020, 6:42 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Wednesday, June 3, 2020 10:39
> To: Yang, Qiming <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Cao, Yahui <yahui.cao@intel.com>; Stillwell Jr, Paul
> M <paul.m.stillwell.jr@intel.com>
> Subject: [PATCH 03/52] net/ice/base: disable profile merge for FDIR
> 
> For Flow Director, we don't want to re-use a existed profile with the same

a/an

> field vector and mask. Merging two different flow_type’s field vector will
> also make them sharing trained rule and cause rule interference.
> 
> For example:
> issue rule A: IPV4_TCP matching tcp src&dst port 80  to queue 8 issue rule B:
> IPV6_TCP matching tcp src&dst port 200 to queue 20 Below behavior is found
> but not expected:
> IPV4_TCP pkt with src&dst port 200 hits rule B and goes to queue 20
> IPV6_TCP pkt with src&dst port 80  hits rule A and goes to queue 8
> 
> Signed-off-by: Yahui Cao <yahui.cao@intel.com>
> Signed-off-by: Paul M. Stillwell Jr <paul.m.stillwell.jr@intel.com>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>  drivers/net/ice/base/ice_flex_pipe.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ice/base/ice_flex_pipe.c
> b/drivers/net/ice/base/ice_flex_pipe.c
> index 512ced6b8..2a7b74207 100644
> --- a/drivers/net/ice/base/ice_flex_pipe.c
> +++ b/drivers/net/ice/base/ice_flex_pipe.c
> @@ -2811,6 +2811,12 @@ ice_find_prof_id_with_mask(struct ice_hw *hw,
> enum ice_block blk,
>  	struct ice_es *es = &hw->blk[blk].es;
>  	u8 i;
> 
> +	/* For FD, we don't want to re-use a existed profile with the same

Same as above

> +	 * field vector and mask. This will cause rule interference.
> +	 */
> +	if (blk == ICE_BLK_FD)
> +		return ICE_ERR_DOES_NOT_EXIST;
> +
>  	for (i = 0; i < (u8)es->count; i++) {
>  		u16 off = i * es->fvw;
> 
> --
> 2.13.6

Patch
diff mbox series

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index 512ced6b8..2a7b74207 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -2811,6 +2811,12 @@  ice_find_prof_id_with_mask(struct ice_hw *hw, enum ice_block blk,
 	struct ice_es *es = &hw->blk[blk].es;
 	u8 i;
 
+	/* For FD, we don't want to re-use a existed profile with the same
+	 * field vector and mask. This will cause rule interference.
+	 */
+	if (blk == ICE_BLK_FD)
+		return ICE_ERR_DOES_NOT_EXIST;
+
 	for (i = 0; i < (u8)es->count; i++) {
 		u16 off = i * es->fvw;