Skip to content

Commit be234ba

Browse files
committed
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 <[email protected]>
2 parents 052d41c + d1c61e6 commit be234ba

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

drivers/net/ethernet/mellanox/mlx5/core/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static void delayed_event_release(struct mlx5_device_context *dev_ctx,
9393
list_splice_init(&priv->waiting_events_list, &temp);
9494
if (!dev_ctx->context)
9595
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)
9797
dev_ctx->intf->event(dev, dev_ctx->context, de->event, de->param);
9898

9999
out:

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
#define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa
6868
#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xd
6969

70-
#define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE_MPW 0x1
70+
#define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE_MPW 0x2
7171
#define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE_MPW 0x3
7272
#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE_MPW 0x6
7373

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,22 +215,20 @@ static inline bool mlx5e_rx_cache_get(struct mlx5e_rq *rq,
215215
static inline int mlx5e_page_alloc_mapped(struct mlx5e_rq *rq,
216216
struct mlx5e_dma_info *dma_info)
217217
{
218-
struct page *page;
219-
220218
if (mlx5e_rx_cache_get(rq, dma_info))
221219
return 0;
222220

223-
page = dev_alloc_pages(rq->buff.page_order);
224-
if (unlikely(!page))
221+
dma_info->page = dev_alloc_pages(rq->buff.page_order);
222+
if (unlikely(!dma_info->page))
225223
return -ENOMEM;
226224

227-
dma_info->addr = dma_map_page(rq->pdev, page, 0,
225+
dma_info->addr = dma_map_page(rq->pdev, dma_info->page, 0,
228226
RQ_PAGE_SIZE(rq), rq->buff.map_dir);
229227
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;
231230
return -ENOMEM;
232231
}
233-
dma_info->page = page;
234232

235233
return 0;
236234
}

drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget)
4949
struct mlx5e_channel *c = container_of(napi, struct mlx5e_channel,
5050
napi);
5151
bool busy = false;
52-
int work_done;
52+
int work_done = 0;
5353
int i;
5454

5555
for (i = 0; i < c->num_tc; i++)
@@ -58,15 +58,17 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget)
5858
if (c->xdp)
5959
busy |= mlx5e_poll_xdpsq_cq(&c->rq.xdpsq.cq);
6060

61-
work_done = mlx5e_poll_rx_cq(&c->rq.cq, budget);
62-
busy |= work_done == budget;
61+
if (likely(budget)) { /* budget=0 means: don't poll rx rings */
62+
work_done = mlx5e_poll_rx_cq(&c->rq.cq, budget);
63+
busy |= work_done == budget;
64+
}
6365

6466
busy |= c->rq.post_wqes(&c->rq);
6567

6668
if (busy) {
6769
if (likely(mlx5e_channel_no_affinity_change(c)))
6870
return budget;
69-
if (work_done == budget)
71+
if (budget && work_done == budget)
7072
work_done--;
7173
}
7274

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,9 +1482,16 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev *dev)
14821482
return -EAGAIN;
14831483
}
14841484

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+
14851491
ret = mlx5_cmd_force_teardown_hca(dev);
14861492
if (ret) {
14871493
mlx5_core_dbg(dev, "Firmware couldn't do fast unload error: %d\n", ret);
1494+
mlx5_start_health_poll(dev);
14881495
return ret;
14891496
}
14901497

0 commit comments

Comments
 (0)