IB/qib: Optimize CQ callbacks
[linux.git] / drivers / infiniband / hw / qib / qib.h
index 4d11575c2010aad700ef81acd4e2ff4581d091a6..3a78b92cbd4effacdf31158ca4b73c7af18f3a8e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _QIB_KERNEL_H
 #define _QIB_KERNEL_H
 /*
- * Copyright (c) 2012 Intel Corporation.  All rights reserved.
+ * Copyright (c) 2012, 2013 Intel Corporation.  All rights reserved.
  * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
@@ -51,6 +51,7 @@
 #include <linux/completion.h>
 #include <linux/kref.h>
 #include <linux/sched.h>
+#include <linux/kthread.h>
 
 #include "qib_common.h"
 #include "qib_verbs.h"
@@ -154,6 +155,8 @@ struct qib_ctxtdata {
         */
        /* instead of calculating it */
        unsigned ctxt;
+       /* local node of context */
+       int node_id;
        /* non-zero if ctxt is being shared. */
        u16 subctxt_cnt;
        /* non-zero if ctxt is being shared. */
@@ -428,9 +431,19 @@ struct qib_verbs_txreq {
 #define ACTIVITY_TIMER 5
 
 #define MAX_NAME_SIZE 64
+
+#ifdef CONFIG_INFINIBAND_QIB_DCA
+struct qib_irq_notify;
+#endif
+
 struct qib_msix_entry {
        struct msix_entry msix;
        void *arg;
+#ifdef CONFIG_INFINIBAND_QIB_DCA
+       int dca;
+       int rcv;
+       struct qib_irq_notify *notifier;
+#endif
        char name[MAX_NAME_SIZE];
        cpumask_var_t mask;
 };
@@ -828,6 +841,9 @@ struct qib_devdata {
                struct qib_ctxtdata *);
        void (*f_writescratch)(struct qib_devdata *, u32);
        int (*f_tempsense_rd)(struct qib_devdata *, int regnum);
+#ifdef CONFIG_INFINIBAND_QIB_DCA
+       int (*f_notify_dca)(struct qib_devdata *, unsigned long event);
+#endif
 
        char *boardname; /* human readable board info */
 
@@ -1075,6 +1091,10 @@ struct qib_devdata {
        u16 psxmitwait_check_rate;
        /* high volume overflow errors defered to tasklet */
        struct tasklet_struct error_tasklet;
+       /* per device cq worker */
+       struct kthread_worker *worker;
+
+       int assigned_node_id; /* NUMA node closest to HCA */
 };
 
 /* hol_state values */
@@ -1154,7 +1174,7 @@ int qib_create_rcvhdrq(struct qib_devdata *, struct qib_ctxtdata *);
 int qib_setup_eagerbufs(struct qib_ctxtdata *);
 void qib_set_ctxtcnt(struct qib_devdata *);
 int qib_create_ctxts(struct qib_devdata *dd);
-struct qib_ctxtdata *qib_create_ctxtdata(struct qib_pportdata *, u32);
+struct qib_ctxtdata *qib_create_ctxtdata(struct qib_pportdata *, u32, int);
 void qib_init_pportdata(struct qib_pportdata *, struct qib_devdata *, u8, u8);
 void qib_free_ctxtdata(struct qib_devdata *, struct qib_ctxtdata *);
 
@@ -1445,6 +1465,7 @@ extern unsigned qib_n_krcv_queues;
 extern unsigned qib_sdma_fetch_arb;
 extern unsigned qib_compat_ddr_negotiate;
 extern int qib_special_trigger;
+extern unsigned qib_numa_aware;
 
 extern struct mutex qib_mutex;