aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2016-04-17 10:08:40 -0400
committerDoug Ledford <dledford@redhat.com>2016-05-18 10:45:49 -0400
commit94c6825e0ff75829207af6246782811b7c7af2c0 (patch)
tree695b147b15bbecbb234cbb06c6bd1fdab63c0abe /include/linux/mlx5
parente3b6d8cf8de6d07af9a27c86861edfa5b3290cb6 (diff)
net/mlx5_core: Use tasklet for user-space CQ completion events
Previously, we've fired all our completion callbacks straight from our ISR. Some of those callbacks were lightweight (for example, mlx5 Ethernet napi callbacks), but some of them did more work (for example, the user-space RDMA stack uverbs' completion handler). Besides that, doing more than the minimal work in ISR is generally considered wrong, it could even lead to a hard lockup of the system. Since when a lot of completion events are generated by the hardware, the loop over those events could be so long, that we'll get into a hard lockup by the system watchdog. In order to avoid that, add a new way of invoking completion events callbacks. In the interrupt itself, we add the CQs which receive completion event to a per-EQ list and schedule a tasklet. In the tasklet context we loop over all the CQs in the list and invoke the user callback. Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r--include/linux/mlx5/cq.h5
-rw-r--r--include/linux/mlx5/driver.h10
2 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/mlx5/cq.h b/include/linux/mlx5/cq.h
index b2c9fada8eac..2be976dd4966 100644
--- a/include/linux/mlx5/cq.h
+++ b/include/linux/mlx5/cq.h
@@ -53,6 +53,11 @@ struct mlx5_core_cq {
53 unsigned arm_sn; 53 unsigned arm_sn;
54 struct mlx5_rsc_debug *dbg; 54 struct mlx5_rsc_debug *dbg;
55 int pid; 55 int pid;
56 struct {
57 struct list_head list;
58 void (*comp)(struct mlx5_core_cq *);
59 void *priv;
60 } tasklet_ctx;
56}; 61};
57 62
58 63
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 369c837d40f5..5a41f9003941 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -41,6 +41,7 @@
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <linux/vmalloc.h> 42#include <linux/vmalloc.h>
43#include <linux/radix-tree.h> 43#include <linux/radix-tree.h>
44#include <linux/interrupt.h>
44 45
45#include <linux/mlx5/device.h> 46#include <linux/mlx5/device.h>
46#include <linux/mlx5/doorbell.h> 47#include <linux/mlx5/doorbell.h>
@@ -304,6 +305,14 @@ struct mlx5_buf {
304 u8 page_shift; 305 u8 page_shift;
305}; 306};
306 307
308struct mlx5_eq_tasklet {
309 struct list_head list;
310 struct list_head process_list;
311 struct tasklet_struct task;
312 /* lock on completion tasklet list */
313 spinlock_t lock;
314};
315
307struct mlx5_eq { 316struct mlx5_eq {
308 struct mlx5_core_dev *dev; 317 struct mlx5_core_dev *dev;
309 __be32 __iomem *doorbell; 318 __be32 __iomem *doorbell;
@@ -317,6 +326,7 @@ struct mlx5_eq {
317 struct list_head list; 326 struct list_head list;
318 int index; 327 int index;
319 struct mlx5_rsc_debug *dbg; 328 struct mlx5_rsc_debug *dbg;
329 struct mlx5_eq_tasklet tasklet_ctx;
320}; 330};
321 331
322struct mlx5_core_psv { 332struct mlx5_core_psv {