aboutsummaryrefslogtreecommitdiffstats
path: root/dpdk/dpdk-16.04_patches/0022-net-enic-improve-out-of-resources-error-handling.patch
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-07-04 23:23:32 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2016-07-05 16:21:35 +0000
commit55bf5c938585f0cc91b848ec37a5abfaf01f9515 (patch)
treedb08c0efcf55a9d13905616af27a8f819c2dc1c2 /dpdk/dpdk-16.04_patches/0022-net-enic-improve-out-of-resources-error-handling.patch
parentf727db9e6fb50b2930aedf18bcdda55fe0b96889 (diff)
ENIC driver patches to address various issues
Also clear x-bit for old patch files 0013-xxx and 0014-xxx. Change-Id: I217fdbfb32cef1ae575c668270d3baf593e688c6 Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'dpdk/dpdk-16.04_patches/0022-net-enic-improve-out-of-resources-error-handling.patch')
-rw-r--r--dpdk/dpdk-16.04_patches/0022-net-enic-improve-out-of-resources-error-handling.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/dpdk/dpdk-16.04_patches/0022-net-enic-improve-out-of-resources-error-handling.patch b/dpdk/dpdk-16.04_patches/0022-net-enic-improve-out-of-resources-error-handling.patch
new file mode 100644
index 00000000000..bf6df8113fa
--- /dev/null
+++ b/dpdk/dpdk-16.04_patches/0022-net-enic-improve-out-of-resources-error-handling.patch
@@ -0,0 +1,67 @@
+From db0a30a2e61a3bf2f6cb8e74203dab84280b0419 Mon Sep 17 00:00:00 2001
+From: John Daley <johndale@cisco.com>
+Date: Sat, 11 Jun 2016 10:27:05 -0700
+Subject: [PATCH 22/25] net/enic: improve out of resources error handling
+
+If configuration fails due to lack of resources, be more specific
+about which resources are lacking - work queues, read queues or
+completion queues. Return -EINVAL instead of -1 if more queeues
+are requested than are available.
+
+Fixes: fefed3d1e62c ("enic: new driver")
+
+Signed-off-by: John Daley <johndale@cisco.com>
+---
+ drivers/net/enic/enic_main.c | 30 ++++++++++++++++++++----------
+ 1 file changed, 20 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
+index 4e5594f..43e4af1 100644
+--- a/drivers/net/enic/enic_main.c
++++ b/drivers/net/enic/enic_main.c
+@@ -970,22 +970,32 @@ static void enic_dev_deinit(struct enic *enic)
+ int enic_set_vnic_res(struct enic *enic)
+ {
+ struct rte_eth_dev *eth_dev = enic->rte_dev;
++ int rc = 0;
+
+- if ((enic->rq_count < eth_dev->data->nb_rx_queues) ||
+- (enic->wq_count < eth_dev->data->nb_tx_queues)) {
+- dev_err(dev, "Not enough resources configured, aborting\n");
+- return -1;
++ if (enic->rq_count < eth_dev->data->nb_rx_queues) {
++ dev_err(dev, "Not enough Receive queues. Requested:%u, Configured:%u\n",
++ eth_dev->data->nb_rx_queues, enic->rq_count);
++ rc = -EINVAL;
++ }
++ if (enic->wq_count < eth_dev->data->nb_tx_queues) {
++ dev_err(dev, "Not enough Transmit queues. Requested:%u, Configured:%u\n",
++ eth_dev->data->nb_tx_queues, enic->wq_count);
++ rc = -EINVAL;
+ }
+
+- enic->rq_count = eth_dev->data->nb_rx_queues;
+- enic->wq_count = eth_dev->data->nb_tx_queues;
+ if (enic->cq_count < (enic->rq_count + enic->wq_count)) {
+- dev_err(dev, "Not enough resources configured, aborting\n");
+- return -1;
++ dev_err(dev, "Not enough Completion queues. Required:%u, Configured:%u\n",
++ enic->rq_count + enic->wq_count, enic->cq_count);
++ rc = -EINVAL;
+ }
+
+- enic->cq_count = enic->rq_count + enic->wq_count;
+- return 0;
++ if (rc == 0) {
++ enic->rq_count = eth_dev->data->nb_rx_queues;
++ enic->wq_count = eth_dev->data->nb_tx_queues;
++ enic->cq_count = enic->rq_count + enic->wq_count;
++ }
++
++ return rc;
+ }
+
+ static int enic_dev_init(struct enic *enic)
+--
+2.7.0
+