DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix missed i40e filter pctype
@ 2020-07-15  8:08 Shougang Wang
  2020-07-17  7:30 ` Zhao1, Wei
  0 siblings, 1 reply; 3+ messages in thread
From: Shougang Wang @ 2020-07-15  8:08 UTC (permalink / raw)
  To: dev; +Cc: beilei.xing, jia.guo, Shougang Wang, stable

The i40e_filter_pctype TCP_SYN_NO_ACK, UNICAST_IPV4_UDP and
MULTICAST_IPV4_UDP for x722 are missed when translate RSS type to
i40e_filter_pctype. This patche fix it.

Fixes: da7018ec29d4 ("net/i40e: fix queue region in RSS flow")
Cc: stable@dpdk.org

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 45 ++++++++++++++++++++++++++++++------
 1 file changed, 38 insertions(+), 7 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 7cd537340..7f34bc5a4 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4853,11 +4853,12 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	const struct rte_flow_action *act;
 	const struct rte_flow_action_rss *rss;
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct i40e_queue_regions *info = &pf->queue_region;
 	struct i40e_rte_flow_rss_conf *rss_config =
 			&filter->rss_conf;
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
-	uint16_t i, j, n, tmp, nb_types;
+	uint16_t i, j, n, m, tmp, nb_types;
 	uint32_t index = 0;
 	uint64_t hf_bit = 1;
 
@@ -4889,6 +4890,24 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 			I40E_FILTER_PCTYPE_L2_PAYLOAD},
 	};
 
+	static const struct {
+		uint64_t rss_type;
+		enum i40e_filter_pctype pctype;
+	} pctype_match_table_x722[] = {
+		{ETH_RSS_NONFRAG_IPV4_TCP,
+			I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK},
+		{ETH_RSS_NONFRAG_IPV4_UDP,
+			I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP},
+		{ETH_RSS_NONFRAG_IPV4_UDP,
+			I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP},
+		{ETH_RSS_NONFRAG_IPV6_TCP,
+			I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN_NO_ACK},
+		{ETH_RSS_NONFRAG_IPV6_UDP,
+			I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP},
+		{ETH_RSS_NONFRAG_IPV6_UDP,
+			I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP},
+	};
+
 	NEXT_ITEM_OF_ACTION(act, actions, index);
 	rss = act->conf;
 
@@ -4914,6 +4933,18 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 				break;
 			}
 		}
+
+		if (hw->mac.type == I40E_MAC_X722)
+			for (j = 0; j < RTE_DIM(pctype_match_table_x722); j++) {
+				if (rss->types &
+				    pctype_match_table_x722[j].rss_type) {
+					m = conf_info->region[0].flowtype_num;
+					conf_info->region[0].hw_flowtype[m] =
+						pctype_match_table_x722[j].pctype;
+					conf_info->region[0].flowtype_num++;
+					conf_info->queue_region_number = 1;
+				}
+			}
 	}
 
 	/**
@@ -5011,9 +5042,9 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 					info->region[i].user_priority_num++;
 				}
 
-				j = info->region[i].flowtype_num;
-				tmp = conf_info->region[n].hw_flowtype[0];
-				if (conf_info->region[n].flowtype_num) {
+				for (m = 0; m < conf_info->region[n].flowtype_num; m++) {
+					j = info->region[i].flowtype_num;
+					tmp = conf_info->region[n].hw_flowtype[m];
 					info->region[i].hw_flowtype[j] = tmp;
 					info->region[i].flowtype_num++;
 				}
@@ -5026,9 +5057,9 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 					info->region[i].user_priority_num++;
 				}
 
-				j = info->region[i].flowtype_num;
-				tmp = conf_info->region[n].hw_flowtype[0];
-				if (conf_info->region[n].flowtype_num) {
+				for (m = 0; m < conf_info->region[n].flowtype_num; m++) {
+					j = info->region[i].flowtype_num;
+					tmp = conf_info->region[n].hw_flowtype[m];
 					info->region[i].hw_flowtype[j] = tmp;
 					info->region[i].flowtype_num++;
 				}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: fix missed i40e filter pctype
  2020-07-15  8:08 [dpdk-dev] [PATCH] net/i40e: fix missed i40e filter pctype Shougang Wang
@ 2020-07-17  7:30 ` Zhao1, Wei
  2020-07-20 10:07   ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Zhao1, Wei @ 2020-07-17  7:30 UTC (permalink / raw)
  To: Wang, ShougangX, dev; +Cc: Xing, Beilei, Guo, Jia, Wang, ShougangX, stable

Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Shougang Wang
> Sent: Wednesday, July 15, 2020 4:08 PM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; Wang,
> ShougangX <shougangx.wang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/i40e: fix missed i40e filter pctype
> 
> The i40e_filter_pctype TCP_SYN_NO_ACK, UNICAST_IPV4_UDP and
> MULTICAST_IPV4_UDP for x722 are missed when translate RSS type to
> i40e_filter_pctype. This patche fix it.
> 
> Fixes: da7018ec29d4 ("net/i40e: fix queue region in RSS flow")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
> ---
>  drivers/net/i40e/i40e_flow.c | 45 ++++++++++++++++++++++++++++++------
>  1 file changed, 38 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index
> 7cd537340..7f34bc5a4 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -4853,11 +4853,12 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
> *dev,
>  	const struct rte_flow_action *act;
>  	const struct rte_flow_action_rss *rss;
>  	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> +	struct i40e_hw *hw =
> I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	struct i40e_queue_regions *info = &pf->queue_region;
>  	struct i40e_rte_flow_rss_conf *rss_config =
>  			&filter->rss_conf;
>  	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
> -	uint16_t i, j, n, tmp, nb_types;
> +	uint16_t i, j, n, m, tmp, nb_types;
>  	uint32_t index = 0;
>  	uint64_t hf_bit = 1;
> 
> @@ -4889,6 +4890,24 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
> *dev,
>  			I40E_FILTER_PCTYPE_L2_PAYLOAD},
>  	};
> 
> +	static const struct {
> +		uint64_t rss_type;
> +		enum i40e_filter_pctype pctype;
> +	} pctype_match_table_x722[] = {
> +		{ETH_RSS_NONFRAG_IPV4_TCP,
> +			I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK},
> +		{ETH_RSS_NONFRAG_IPV4_UDP,
> +			I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP},
> +		{ETH_RSS_NONFRAG_IPV4_UDP,
> +			I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP},
> +		{ETH_RSS_NONFRAG_IPV6_TCP,
> +			I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN_NO_ACK},
> +		{ETH_RSS_NONFRAG_IPV6_UDP,
> +			I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP},
> +		{ETH_RSS_NONFRAG_IPV6_UDP,
> +			I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP},
> +	};
> +
>  	NEXT_ITEM_OF_ACTION(act, actions, index);
>  	rss = act->conf;
> 
> @@ -4914,6 +4933,18 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
> *dev,
>  				break;
>  			}
>  		}
> +
> +		if (hw->mac.type == I40E_MAC_X722)
> +			for (j = 0; j < RTE_DIM(pctype_match_table_x722); j++) {
> +				if (rss->types &
> +				    pctype_match_table_x722[j].rss_type) {
> +					m = conf_info->region[0].flowtype_num;
> +					conf_info->region[0].hw_flowtype[m] =
> +						pctype_match_table_x722[j].pctype;
> +					conf_info->region[0].flowtype_num++;
> +					conf_info->queue_region_number = 1;
> +				}
> +			}
>  	}
> 
>  	/**
> @@ -5011,9 +5042,9 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
> *dev,
>  					info->region[i].user_priority_num++;
>  				}
> 
> -				j = info->region[i].flowtype_num;
> -				tmp = conf_info->region[n].hw_flowtype[0];
> -				if (conf_info->region[n].flowtype_num) {
> +				for (m = 0; m < conf_info->region[n].flowtype_num; m++) {
> +					j = info->region[i].flowtype_num;
> +					tmp = conf_info->region[n].hw_flowtype[m];
>  					info->region[i].hw_flowtype[j] = tmp;
>  					info->region[i].flowtype_num++;
>  				}
> @@ -5026,9 +5057,9 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
> *dev,
>  					info->region[i].user_priority_num++;
>  				}
> 
> -				j = info->region[i].flowtype_num;
> -				tmp = conf_info->region[n].hw_flowtype[0];
> -				if (conf_info->region[n].flowtype_num) {
> +				for (m = 0; m < conf_info->region[n].flowtype_num; m++) {
> +					j = info->region[i].flowtype_num;
> +					tmp = conf_info->region[n].hw_flowtype[m];
>  					info->region[i].hw_flowtype[j] = tmp;
>  					info->region[i].flowtype_num++;
>  				}
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: fix missed i40e filter pctype
  2020-07-17  7:30 ` Zhao1, Wei
@ 2020-07-20 10:07   ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2020-07-20 10:07 UTC (permalink / raw)
  To: Zhao1, Wei, Wang, ShougangX, dev
  Cc: Xing, Beilei, Guo, Jia, Wang, ShougangX, stable



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Zhao1, Wei
> Sent: Friday, July 17, 2020 3:30 PM
> To: Wang, ShougangX <shougangx.wang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; Wang,
> ShougangX <shougangx.wang@intel.com>; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix missed i40e filter pctype
> 
> Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Shougang Wang
> > Sent: Wednesday, July 15, 2020 4:08 PM
> > To: dev@dpdk.org
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Jia
> > <jia.guo@intel.com>; Wang, ShougangX <shougangx.wang@intel.com>;
> > stable@dpdk.org
> > Subject: [dpdk-dev] [PATCH] net/i40e: fix missed i40e filter pctype
> >
> > The i40e_filter_pctype TCP_SYN_NO_ACK, UNICAST_IPV4_UDP and
> > MULTICAST_IPV4_UDP for x722 are missed when translate RSS type to
> > i40e_filter_pctype. This patche fix it.
> >
> > Fixes: da7018ec29d4 ("net/i40e: fix queue region in RSS flow")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Shougang Wang <shougangx.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-20 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15  8:08 [dpdk-dev] [PATCH] net/i40e: fix missed i40e filter pctype Shougang Wang
2020-07-17  7:30 ` Zhao1, Wei
2020-07-20 10:07   ` Zhang, Qi Z

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git