aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-11-11 05:40:05 -0500
committerDavid S. Miller <davem@davemloft.net>2017-11-11 05:40:05 -0500
commitbe234ba93c61927fd881e7c033a1cf31237d2742 (patch)
tree9fe8e79d29c29698c61ebc3c1d4dc22bddf4243b
parent052d41c01b3a2e3371d66de569717353af489d63 (diff)
parentd1c61e6d79ea0d4d53dc18bcd2db30ef2d99cfa7 (diff)
Merge tag 'mlx5-fixes-2017-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed says: ==================== Mellanox, mlx5 fixes 2017-11-08 The following series includes some fixes for mlx5 core and etherent driver. Sorry for the late submission but as you can see i have some very critical fixes below that i would like them merged into this RC. Please pull and let me know if there is any problem. For -stable: ('net/mlx5e: Set page to null in case dma mapping fails') kernels >= 4.13 ('net/mlx5: FPGA, return -EINVAL if size is zero') kernels >= 4.13 ('net/mlx5: Cancel health poll before sending panic teardown command') kernels >= 4.13 V1->V2: - Fix Reviewed-by tag of the 2nd patch. - Drop the FPGA 0 size fix, it needs some more change log info. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/dev.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en.h2
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_rx.c12
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c10
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/main.c7
5 files changed, 20 insertions, 13 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/dev.c
index fc281712869b..17b723218b0c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/dev.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/dev.c
@@ -93,7 +93,7 @@ static void delayed_event_release(struct mlx5_device_context *dev_ctx,
93 list_splice_init(&priv->waiting_events_list, &temp); 93 list_splice_init(&priv->waiting_events_list, &temp);
94 if (!dev_ctx->context) 94 if (!dev_ctx->context)
95 goto out; 95 goto out;
96 list_for_each_entry_safe(de, n, &priv->waiting_events_list, list) 96 list_for_each_entry_safe(de, n, &temp, list)
97 dev_ctx->intf->event(dev, dev_ctx->context, de->event, de->param); 97 dev_ctx->intf->event(dev, dev_ctx->context, de->event, de->param);
98 98
99out: 99out:
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index cc13d3dbd366..13b5ef9d8703 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -67,7 +67,7 @@
67#define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa 67#define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa
68#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xd 68#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xd
69 69
70#define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE_MPW 0x1 70#define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE_MPW 0x2
71#define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE_MPW 0x3 71#define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE_MPW 0x3
72#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE_MPW 0x6 72#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE_MPW 0x6
73 73
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 15a1687483cc..91b1b0938931 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -215,22 +215,20 @@ static inline bool mlx5e_rx_cache_get(struct mlx5e_rq *rq,
215static inline int mlx5e_page_alloc_mapped(struct mlx5e_rq *rq, 215static inline int mlx5e_page_alloc_mapped(struct mlx5e_rq *rq,
216 struct mlx5e_dma_info *dma_info) 216 struct mlx5e_dma_info *dma_info)
217{ 217{
218 struct page *page;
219
220 if (mlx5e_rx_cache_get(rq, dma_info)) 218 if (mlx5e_rx_cache_get(rq, dma_info))
221 return 0; 219 return 0;
222 220
223 page = dev_alloc_pages(rq->buff.page_order); 221 dma_info->page = dev_alloc_pages(rq->buff.page_order);
224 if (unlikely(!page)) 222 if (unlikely(!dma_info->page))
225 return -ENOMEM; 223 return -ENOMEM;
226 224
227 dma_info->addr = dma_map_page(rq->pdev, page, 0, 225 dma_info->addr = dma_map_page(rq->pdev, dma_info->page, 0,
228 RQ_PAGE_SIZE(rq), rq->buff.map_dir); 226 RQ_PAGE_SIZE(rq), rq->buff.map_dir);
229 if (unlikely(dma_mapping_error(rq->pdev, dma_info->addr))) { 227 if (unlikely(dma_mapping_error(rq->pdev, dma_info->addr))) {
230 put_page(page); 228 put_page(dma_info->page);
229 dma_info->page = NULL;
231 return -ENOMEM; 230 return -ENOMEM;
232 } 231 }
233 dma_info->page = page;
234 232
235 return 0; 233 return 0;
236} 234}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
index e906b754415c..ab92298eafc3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
@@ -49,7 +49,7 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget)
49 struct mlx5e_channel *c = container_of(napi, struct mlx5e_channel, 49 struct mlx5e_channel *c = container_of(napi, struct mlx5e_channel,
50 napi); 50 napi);
51 bool busy = false; 51 bool busy = false;
52 int work_done; 52 int work_done = 0;
53 int i; 53 int i;
54 54
55 for (i = 0; i < c->num_tc; i++) 55 for (i = 0; i < c->num_tc; i++)
@@ -58,15 +58,17 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget)
58 if (c->xdp) 58 if (c->xdp)
59 busy |= mlx5e_poll_xdpsq_cq(&c->rq.xdpsq.cq); 59 busy |= mlx5e_poll_xdpsq_cq(&c->rq.xdpsq.cq);
60 60
61 work_done = mlx5e_poll_rx_cq(&c->rq.cq, budget); 61 if (likely(budget)) { /* budget=0 means: don't poll rx rings */
62 busy |= work_done == budget; 62 work_done = mlx5e_poll_rx_cq(&c->rq.cq, budget);
63 busy |= work_done == budget;
64 }
63 65
64 busy |= c->rq.post_wqes(&c->rq); 66 busy |= c->rq.post_wqes(&c->rq);
65 67
66 if (busy) { 68 if (busy) {
67 if (likely(mlx5e_channel_no_affinity_change(c))) 69 if (likely(mlx5e_channel_no_affinity_change(c)))
68 return budget; 70 return budget;
69 if (work_done == budget) 71 if (budget && work_done == budget)
70 work_done--; 72 work_done--;
71 } 73 }
72 74
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 0d2c8dcd6eae..06562c9a6b9c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1482,9 +1482,16 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev *dev)
1482 return -EAGAIN; 1482 return -EAGAIN;
1483 } 1483 }
1484 1484
1485 /* Panic tear down fw command will stop the PCI bus communication
1486 * with the HCA, so the health polll is no longer needed.
1487 */
1488 mlx5_drain_health_wq(dev);
1489 mlx5_stop_health_poll(dev);
1490
1485 ret = mlx5_cmd_force_teardown_hca(dev); 1491 ret = mlx5_cmd_force_teardown_hca(dev);
1486 if (ret) { 1492 if (ret) {
1487 mlx5_core_dbg(dev, "Firmware couldn't do fast unload error: %d\n", ret); 1493 mlx5_core_dbg(dev, "Firmware couldn't do fast unload error: %d\n", ret);
1494 mlx5_start_health_poll(dev);
1488 return ret; 1495 return ret;
1489 } 1496 }
1490 1497