patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 16.11] net/enic: do not overwrite admin Tx queue limit
@ 2018-08-03  4:33 Hyong Youb Kim
  2018-08-03  9:05 ` Luca Boccassi
  0 siblings, 1 reply; 2+ messages in thread
From: Hyong Youb Kim @ 2018-08-03  4:33 UTC (permalink / raw)
  To: stable; +Cc: luca.boccassi, johndale, Hyong Youb Kim

[ backported from upstream commit 2a7e3d54659cd12d337ad816dcf202eec1af1367 ]

Currently, enic_alloc_wq (via rte_eth_tx_queue_setup) may overwrite
the admin limit with a lower value. This is wrong as seen in the
following sequence.

1. UCS admin-set Tx queue limit (config.wq_desc_count) = 4096
2. Set up tx queue with 512 descriptors
   The admin limit (config.wq_desc_count) becomes 512.
3. Stop ports and now set up Tx queue with 1024 descriptors.
   This fails because 1024 is greater than the admin limit (512).

Do not modify the admin limit, and when queried, report the current
number of descriptors instead of the admin limit. The rx queue setup
(enic_alloc_rq) does not this problem.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_main.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index ef5ecd44e..17606238f 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -787,25 +787,23 @@ int enic_alloc_wq(struct enic *enic, uint16_t queue_idx,
 	static int instance;
 
 	wq->socket_id = socket_id;
-	if (nb_desc) {
-		if (nb_desc > enic->config.wq_desc_count) {
-			dev_warning(enic,
-				"WQ %d - number of tx desc in cmd line (%d)"\
-				"is greater than that in the UCSM/CIMC adapter"\
-				"policy.  Applying the value in the adapter "\
-				"policy (%d)\n",
-				queue_idx, nb_desc, enic->config.wq_desc_count);
-		} else if (nb_desc != enic->config.wq_desc_count) {
-			enic->config.wq_desc_count = nb_desc;
-			dev_info(enic,
-				"TX Queues - effective number of descs:%d\n",
-				nb_desc);
-		}
+	if (nb_desc > enic->config.wq_desc_count) {
+		dev_warning(enic,
+			    "WQ %d - number of tx desc in cmd line (%d) "
+			    "is greater than that in the UCSM/CIMC adapter "
+			    "policy.  Applying the value in the adapter "
+			    "policy (%d)\n",
+			    queue_idx, nb_desc, enic->config.wq_desc_count);
+		nb_desc = enic->config.wq_desc_count;
+	} else if (nb_desc != enic->config.wq_desc_count) {
+		dev_info(enic,
+			 "TX Queues - effective number of descs:%d\n",
+			 nb_desc);
 	}
 
 	/* Allocate queue resources */
 	err = vnic_wq_alloc(enic->vdev, &enic->wq[queue_idx], queue_idx,
-		enic->config.wq_desc_count,
+		nb_desc,
 		sizeof(struct wq_enet_desc));
 	if (err) {
 		dev_err(enic, "error in allocation of wq\n");
@@ -813,7 +811,7 @@ int enic_alloc_wq(struct enic *enic, uint16_t queue_idx,
 	}
 
 	err = vnic_cq_alloc(enic->vdev, &enic->cq[cq_index], cq_index,
-		socket_id, enic->config.wq_desc_count,
+		socket_id, nb_desc,
 		sizeof(struct cq_enet_wq_desc));
 	if (err) {
 		vnic_wq_free(wq);
-- 
2.16.2

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

* Re: [dpdk-stable] [PATCH 16.11] net/enic: do not overwrite admin Tx queue limit
  2018-08-03  4:33 [dpdk-stable] [PATCH 16.11] net/enic: do not overwrite admin Tx queue limit Hyong Youb Kim
@ 2018-08-03  9:05 ` Luca Boccassi
  0 siblings, 0 replies; 2+ messages in thread
From: Luca Boccassi @ 2018-08-03  9:05 UTC (permalink / raw)
  To: Hyong Youb Kim, stable; +Cc: johndale

On Thu, 2018-08-02 at 21:33 -0700, Hyong Youb Kim wrote:
> [ backported from upstream commit
> 2a7e3d54659cd12d337ad816dcf202eec1af1367 ]
> 
> Currently, enic_alloc_wq (via rte_eth_tx_queue_setup) may overwrite
> the admin limit with a lower value. This is wrong as seen in the
> following sequence.
> 
> 1. UCS admin-set Tx queue limit (config.wq_desc_count) = 4096
> 2. Set up tx queue with 512 descriptors
>    The admin limit (config.wq_desc_count) becomes 512.
> 3. Stop ports and now set up Tx queue with 1024 descriptors.
>    This fails because 1024 is greater than the admin limit (512).
> 
> Do not modify the admin limit, and when queried, report the current
> number of descriptors instead of the admin limit. The rx queue setup
> (enic_alloc_rq) does not this problem.
> 
> Fixes: fefed3d1e62c ("enic: new driver")
> 
> Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
> Reviewed-by: John Daley <johndale@cisco.com>
> ---
>  drivers/net/enic/enic_main.c | 30 ++++++++++++++----------------
>  1 file changed, 14 insertions(+), 16 deletions(-)

Thanks, applied and pushed to dpdk-stable/16.11.

-- 
Kind regards,
Luca Boccassi

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

end of thread, other threads:[~2018-08-03  9:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-03  4:33 [dpdk-stable] [PATCH 16.11] net/enic: do not overwrite admin Tx queue limit Hyong Youb Kim
2018-08-03  9:05 ` Luca Boccassi

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).