IB/hfi1: Keep SC_USER as the last send context type
authorJianxin Xiong <[email protected]>
Thu, 12 May 2016 17:23:47 +0000 (10:23 -0700)
committerDoug Ledford <[email protected]>
Fri, 13 May 2016 23:39:19 +0000 (19:39 -0400)
SC_USER needs to be the last send context type to ensure other
send context types get their allocation when num_user_contexts
is set to a large number.

This fixes a panic when the module parameter num_user_contexts
is set to 141 and larger.

Reviewed-by: Dean Luick <[email protected]>
Signed-off-by: Jianxin Xiong <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
drivers/staging/rdma/hfi1/pio.h

index 53a08edb7f642d454f9fbf2be88f01cd2ea3e357..464cbd27b9752c7fe434d87610332624be5167d5 100644 (file)
 
 /* send context types */
 #define SC_KERNEL 0
-#define SC_ACK    1
-#define SC_USER   2
-#define SC_VL15   3
-#define SC_MAX    4
+#define SC_VL15   1
+#define SC_ACK    2
+#define SC_USER   3    /* must be the last one: it may take all left */
+#define SC_MAX    4    /* count of send context types */
 
 /* invalid send context index */
 #define INVALID_SCI 0xff