diff options
author | John Lo <loj@cisco.com> | 2016-03-29 16:14:35 -0400 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2016-03-29 16:14:35 -0400 |
commit | 23650e6cada50246ba211cec168ddd6738a26f67 (patch) | |
tree | 0d3e05b84f1ded554d1bf70a60534092aaf63725 /dpdk/dpdk-2.2.0_patches/0015-enic-fix-crash-when-allocating-too-many-queues.patch | |
parent | 13f3c450ccd03ed00a6a114061faedd1fc553ddd (diff) |
Update ENIC driver patches for DPDK 2.2.0
This includes all patches in ENIC driver which are up-streamed to DPDK
to improve RX performance, fix buffer/error handling and interoperation
with link bonding PMD library.
Change-Id: Id4c71a350d5234834951f9261c69db5476ba396b
Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'dpdk/dpdk-2.2.0_patches/0015-enic-fix-crash-when-allocating-too-many-queues.patch')
-rw-r--r-- | dpdk/dpdk-2.2.0_patches/0015-enic-fix-crash-when-allocating-too-many-queues.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/dpdk/dpdk-2.2.0_patches/0015-enic-fix-crash-when-allocating-too-many-queues.patch b/dpdk/dpdk-2.2.0_patches/0015-enic-fix-crash-when-allocating-too-many-queues.patch new file mode 100644 index 00000000000..f8e661fc831 --- /dev/null +++ b/dpdk/dpdk-2.2.0_patches/0015-enic-fix-crash-when-allocating-too-many-queues.patch @@ -0,0 +1,46 @@ +commit ddf2da3ecec97a316838f40fe13e217afafc6252 +Author: Nelson Escobar <neescoba@cisco.com> +Date: Thu Mar 17 15:49:58 2016 -0700 + + enic: fix crash when allocating too many queues + + Add checks to make sure we don't try to allocate more tx or rx queues + than we support. + + Fixes: fefed3d1e62c ("enic: new driver") + + Signed-off-by: Nelson Escobar <neescoba@cisco.com> + Reviewed-by: John Daley <johndale@cisco.com> + +diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c +index bab0f7d..4969476 100644 +--- a/drivers/net/enic/enic_ethdev.c ++++ b/drivers/net/enic/enic_ethdev.c +@@ -174,6 +174,13 @@ static int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); ++ if (queue_idx >= ENIC_WQ_MAX) { ++ dev_err(enic, ++ "Max number of TX queues exceeded. Max is %d\n", ++ ENIC_WQ_MAX); ++ return -EINVAL; ++ } ++ + eth_dev->data->tx_queues[queue_idx] = (void *)&enic->wq[queue_idx]; + + ret = enic_alloc_wq(enic, queue_idx, socket_id, nb_desc); +@@ -262,6 +269,13 @@ static int enicpmd_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); ++ if (queue_idx >= ENIC_RQ_MAX) { ++ dev_err(enic, ++ "Max number of RX queues exceeded. Max is %d\n", ++ ENIC_RQ_MAX); ++ return -EINVAL; ++ } ++ + eth_dev->data->rx_queues[queue_idx] = (void *)&enic->rq[queue_idx]; + + ret = enic_alloc_rq(enic, queue_idx, socket_id, mp, nb_desc); |