DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/e1000: correct queue number in RSS configuration
@ 2018-09-13  7:06 Beilei Xing
  2018-09-14  6:49 ` Zhao1, Wei
  0 siblings, 1 reply; 3+ messages in thread
From: Beilei Xing @ 2018-09-13  7:06 UTC (permalink / raw)
  To: wei.zhao1, wenzhuo.lu; +Cc: dev, stable

RSS configuration works for all e1000 NICs except 82576.
This patch fixes this issue by correcting queue number
in RSS configuration.

Fixes: 424ae915baf0 ("net/e1000: move RSS to flow API")
Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/e1000/e1000_ethdev.h |  6 ++++--
 drivers/net/e1000/igb_flow.c     | 10 +++++++---
 drivers/net/e1000/igb_rxtx.c     | 12 +++++++++---
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethdev.h b/drivers/net/e1000/e1000_ethdev.h
index 902001f..94edff0 100644
--- a/drivers/net/e1000/e1000_ethdev.h
+++ b/drivers/net/e1000/e1000_ethdev.h
@@ -236,7 +236,8 @@ struct igb_ethertype_filter {
 struct igb_rte_flow_rss_conf {
 	struct rte_flow_action_rss conf; /**< RSS parameters. */
 	uint8_t key[IGB_HKEY_MAX_INDEX * sizeof(uint32_t)]; /* Hash key. */
-	uint16_t queue[IGB_MAX_RX_QUEUE_NUM]; /**< Queues indices to use. */
+	/* Queues indices to use. */
+	uint16_t queue[IGB_MAX_RX_QUEUE_NUM_82576];
 };
 
 /*
@@ -506,7 +507,8 @@ int eth_igb_syn_filter_set(struct rte_eth_dev *dev,
 int eth_igb_add_del_flex_filter(struct rte_eth_dev *dev,
 			struct rte_eth_flex_filter *filter,
 			bool add);
-int igb_rss_conf_init(struct igb_rte_flow_rss_conf *out,
+int igb_rss_conf_init(struct rte_eth_dev *dev,
+		      struct igb_rte_flow_rss_conf *out,
 		      const struct rte_flow_action_rss *in);
 int igb_action_rss_same(const struct rte_flow_action_rss *comp,
 			const struct rte_flow_action_rss *with);
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index 0738529..3368349 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -1307,6 +1307,7 @@ igb_parse_rss_filter(struct rte_eth_dev *dev,
 			struct igb_rte_flow_rss_conf *rss_conf,
 			struct rte_flow_error *error)
 {
+	struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	const struct rte_flow_action *act;
 	const struct rte_flow_action_rss *rss;
 	uint16_t n, index;
@@ -1357,11 +1358,14 @@ igb_parse_rss_filter(struct rte_eth_dev *dev,
 		return rte_flow_error_set
 			(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, act,
 			 "RSS hash key must be exactly 40 bytes");
-	if (rss->queue_num > RTE_DIM(rss_conf->queue))
+	if (((hw->mac.type == e1000_82576) &&
+	     (rss->queue_num > IGB_MAX_RX_QUEUE_NUM_82576)) ||
+	    ((hw->mac.type != e1000_82576) &&
+	     (rss->queue_num > IGB_MAX_RX_QUEUE_NUM)))
 		return rte_flow_error_set
 			(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, act,
 			 "too many queues for RSS context");
-	if (igb_rss_conf_init(rss_conf, rss))
+	if (igb_rss_conf_init(dev, rss_conf, rss))
 		return rte_flow_error_set
 			(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act,
 			 "RSS context initialization failure");
@@ -1574,7 +1578,7 @@ igb_flow_create(struct rte_eth_dev *dev,
 				PMD_DRV_LOG(ERR, "failed to allocate memory");
 				goto out;
 			}
-			igb_rss_conf_init(&rss_filter_ptr->filter_info,
+			igb_rss_conf_init(dev, &rss_filter_ptr->filter_info,
 					  &rss_conf.conf);
 			TAILQ_INSERT_TAIL(&igb_filter_rss_list,
 				rss_filter_ptr, entries);
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index b955068..dce42e6 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -2852,11 +2852,17 @@ igb_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 }
 
 int
-igb_rss_conf_init(struct igb_rte_flow_rss_conf *out,
+igb_rss_conf_init(struct rte_eth_dev *dev,
+		  struct igb_rte_flow_rss_conf *out,
 		  const struct rte_flow_action_rss *in)
 {
+	struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
 	if (in->key_len > RTE_DIM(out->key) ||
-	    in->queue_num > RTE_DIM(out->queue))
+	    ((hw->mac.type == e1000_82576) &&
+	     (in->queue_num > IGB_MAX_RX_QUEUE_NUM_82576)) ||
+	    ((hw->mac.type != e1000_82576) &&
+	     (in->queue_num > IGB_MAX_RX_QUEUE_NUM)))
 		return -EINVAL;
 	out->conf = (struct rte_flow_action_rss){
 		.func = in->func,
@@ -2945,7 +2951,7 @@ igb_config_rss_filter(struct rte_eth_dev *dev,
 		rss_conf.rss_key = rss_intel_key; /* Default hash key */
 	igb_hw_rss_hash_set(hw, &rss_conf);
 
-	if (igb_rss_conf_init(&filter_info->rss_info, &conf->conf))
+	if (igb_rss_conf_init(dev, &filter_info->rss_info, &conf->conf))
 		return -EINVAL;
 
 	return 0;
-- 
2.5.5

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

* Re: [dpdk-dev] [PATCH] net/e1000: correct queue number in RSS configuration
  2018-09-13  7:06 [dpdk-dev] [PATCH] net/e1000: correct queue number in RSS configuration Beilei Xing
@ 2018-09-14  6:49 ` Zhao1, Wei
  2018-09-17  7:20   ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Zhao1, Wei @ 2018-09-14  6:49 UTC (permalink / raw)
  To: Xing, Beilei, Lu, Wenzhuo; +Cc: dev, stable

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

> -----Original Message-----
> From: Xing, Beilei
> Sent: Thursday, September 13, 2018 3:06 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/e1000: correct queue number in RSS configuration
> 
> RSS configuration works for all e1000 NICs except 82576.
> This patch fixes this issue by correcting queue number in RSS configuration.
> 
> Fixes: 424ae915baf0 ("net/e1000: move RSS to flow API")
> Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
>  drivers/net/e1000/e1000_ethdev.h |  6 ++++--
>  drivers/net/e1000/igb_flow.c     | 10 +++++++---
>  drivers/net/e1000/igb_rxtx.c     | 12 +++++++++---
>  3 files changed, 20 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/e1000/e1000_ethdev.h
> b/drivers/net/e1000/e1000_ethdev.h
> index 902001f..94edff0 100644
> --- a/drivers/net/e1000/e1000_ethdev.h
> +++ b/drivers/net/e1000/e1000_ethdev.h
> @@ -236,7 +236,8 @@ struct igb_ethertype_filter {  struct
> igb_rte_flow_rss_conf {
>  	struct rte_flow_action_rss conf; /**< RSS parameters. */
>  	uint8_t key[IGB_HKEY_MAX_INDEX * sizeof(uint32_t)]; /* Hash key.
> */
> -	uint16_t queue[IGB_MAX_RX_QUEUE_NUM]; /**< Queues indices
> to use. */
> +	/* Queues indices to use. */
> +	uint16_t queue[IGB_MAX_RX_QUEUE_NUM_82576];
>  };
> 
>  /*
> @@ -506,7 +507,8 @@ int eth_igb_syn_filter_set(struct rte_eth_dev *dev,
> int eth_igb_add_del_flex_filter(struct rte_eth_dev *dev,
>  			struct rte_eth_flex_filter *filter,
>  			bool add);
> -int igb_rss_conf_init(struct igb_rte_flow_rss_conf *out,
> +int igb_rss_conf_init(struct rte_eth_dev *dev,
> +		      struct igb_rte_flow_rss_conf *out,
>  		      const struct rte_flow_action_rss *in);  int
> igb_action_rss_same(const struct rte_flow_action_rss *comp,
>  			const struct rte_flow_action_rss *with); diff --git
> a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c index
> 0738529..3368349 100644
> --- a/drivers/net/e1000/igb_flow.c
> +++ b/drivers/net/e1000/igb_flow.c
> @@ -1307,6 +1307,7 @@ igb_parse_rss_filter(struct rte_eth_dev *dev,
>  			struct igb_rte_flow_rss_conf *rss_conf,
>  			struct rte_flow_error *error)
>  {
> +	struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
>  	const struct rte_flow_action *act;
>  	const struct rte_flow_action_rss *rss;
>  	uint16_t n, index;
> @@ -1357,11 +1358,14 @@ igb_parse_rss_filter(struct rte_eth_dev *dev,
>  		return rte_flow_error_set
>  			(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
> act,
>  			 "RSS hash key must be exactly 40 bytes");
> -	if (rss->queue_num > RTE_DIM(rss_conf->queue))
> +	if (((hw->mac.type == e1000_82576) &&
> +	     (rss->queue_num > IGB_MAX_RX_QUEUE_NUM_82576)) ||
> +	    ((hw->mac.type != e1000_82576) &&
> +	     (rss->queue_num > IGB_MAX_RX_QUEUE_NUM)))
>  		return rte_flow_error_set
>  			(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
> act,
>  			 "too many queues for RSS context");
> -	if (igb_rss_conf_init(rss_conf, rss))
> +	if (igb_rss_conf_init(dev, rss_conf, rss))
>  		return rte_flow_error_set
>  			(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
> act,
>  			 "RSS context initialization failure"); @@ -1574,7
> +1578,7 @@ igb_flow_create(struct rte_eth_dev *dev,
>  				PMD_DRV_LOG(ERR, "failed to allocate
> memory");
>  				goto out;
>  			}
> -			igb_rss_conf_init(&rss_filter_ptr->filter_info,
> +			igb_rss_conf_init(dev, &rss_filter_ptr->filter_info,
>  					  &rss_conf.conf);
>  			TAILQ_INSERT_TAIL(&igb_filter_rss_list,
>  				rss_filter_ptr, entries);
> diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
> index b955068..dce42e6 100644
> --- a/drivers/net/e1000/igb_rxtx.c
> +++ b/drivers/net/e1000/igb_rxtx.c
> @@ -2852,11 +2852,17 @@ igb_txq_info_get(struct rte_eth_dev *dev,
> uint16_t queue_id,  }
> 
>  int
> -igb_rss_conf_init(struct igb_rte_flow_rss_conf *out,
> +igb_rss_conf_init(struct rte_eth_dev *dev,
> +		  struct igb_rte_flow_rss_conf *out,
>  		  const struct rte_flow_action_rss *in)  {
> +	struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +
>  	if (in->key_len > RTE_DIM(out->key) ||
> -	    in->queue_num > RTE_DIM(out->queue))
> +	    ((hw->mac.type == e1000_82576) &&
> +	     (in->queue_num > IGB_MAX_RX_QUEUE_NUM_82576)) ||
> +	    ((hw->mac.type != e1000_82576) &&
> +	     (in->queue_num > IGB_MAX_RX_QUEUE_NUM)))
>  		return -EINVAL;
>  	out->conf = (struct rte_flow_action_rss){
>  		.func = in->func,
> @@ -2945,7 +2951,7 @@ igb_config_rss_filter(struct rte_eth_dev *dev,
>  		rss_conf.rss_key = rss_intel_key; /* Default hash key */
>  	igb_hw_rss_hash_set(hw, &rss_conf);
> 
> -	if (igb_rss_conf_init(&filter_info->rss_info, &conf->conf))
> +	if (igb_rss_conf_init(dev, &filter_info->rss_info, &conf->conf))
>  		return -EINVAL;
> 
>  	return 0;
> --
> 2.5.5

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

* Re: [dpdk-dev] [PATCH] net/e1000: correct queue number in RSS configuration
  2018-09-14  6:49 ` Zhao1, Wei
@ 2018-09-17  7:20   ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2018-09-17  7:20 UTC (permalink / raw)
  To: Zhao1, Wei, Xing, Beilei, Lu, Wenzhuo; +Cc: dev, stable



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhao1, Wei
> Sent: Friday, September 14, 2018 2:50 PM
> To: Xing, Beilei <beilei.xing@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/e1000: correct queue number in RSS
> configuration
> 
> > -----Original Message-----
> > From: Xing, Beilei
> > Sent: Thursday, September 13, 2018 3:06 PM
> > To: Zhao1, Wei <wei.zhao1@intel.com>; Lu, Wenzhuo
> > <wenzhuo.lu@intel.com>
> > Cc: dev@dpdk.org; stable@dpdk.org
> > Subject: [PATCH] net/e1000: correct queue number in RSS configuration
> >
> > RSS configuration works for all e1000 NICs except 82576.
> > This patch fixes this issue by correcting queue number in RSS configuration.
> >
> > Fixes: 424ae915baf0 ("net/e1000: move RSS to flow API")
> > Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> Acked-by: Wei Zhao <wei.zhao1@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

end of thread, other threads:[~2018-09-17  7:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-13  7:06 [dpdk-dev] [PATCH] net/e1000: correct queue number in RSS configuration Beilei Xing
2018-09-14  6:49 ` Zhao1, Wei
2018-09-17  7:20   ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).