aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_kernel.h
diff options
context:
space:
mode:
authorJohn Gregor <john.gregor@qlogic.com>2008-04-17 00:09:24 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-17 00:09:24 -0400
commit58411d1c012dca53ec9107bd98acb63f648e2435 (patch)
treed48edc5c3c64d91311bb4134b83bfe7b62b10ec4 /drivers/infiniband/hw/ipath/ipath_kernel.h
parent6be979d71a5e8720c8560cc58713407947e5f691 (diff)
IB/ipath: Head of Line blocking vs forward progress of user apps
There's a conflict between our need to quiesce PSM-based applications to avoid HoL blocking when the IB link goes down and the apps' desire to remain running so that their quiescence timout mechanism can keep running. The compromise is to STOP the processes for a fixed period of time and then alternate between CONT and STOP until the link is again active. If there are poor interactions with subnet manager configuration at a given site, the interval can be adjusted via a module paramter. Signed-off-by: John Gregor <john.gregor@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_kernel.h')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_kernel.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index 70c0a0dd693..caee731b670 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -427,6 +427,11 @@ struct ipath_devdata {
427 427
428 unsigned long ipath_ureg_align; /* user register alignment */ 428 unsigned long ipath_ureg_align; /* user register alignment */
429 429
430 /* HoL blocking / user app forward-progress state */
431 unsigned ipath_hol_state;
432 unsigned ipath_hol_next;
433 struct timer_list ipath_hol_timer;
434
430 /* 435 /*
431 * Shadow copies of registers; size indicates read access size. 436 * Shadow copies of registers; size indicates read access size.
432 * Most of them are readonly, but some are write-only register, 437 * Most of them are readonly, but some are write-only register,
@@ -706,6 +711,13 @@ struct ipath_devdata {
706 u16 ipath_jint_max_packets; /* max packets across all ports */ 711 u16 ipath_jint_max_packets; /* max packets across all ports */
707}; 712};
708 713
714/* ipath_hol_state values (stopping/starting user proc, send flushing) */
715#define IPATH_HOL_UP 0
716#define IPATH_HOL_DOWN 1
717/* ipath_hol_next toggle values, used when hol_state IPATH_HOL_DOWN */
718#define IPATH_HOL_DOWNSTOP 0
719#define IPATH_HOL_DOWNCONT 1
720
709/* Private data for file operations */ 721/* Private data for file operations */
710struct ipath_filedata { 722struct ipath_filedata {
711 struct ipath_portdata *pd; 723 struct ipath_portdata *pd;
@@ -775,6 +787,9 @@ int ipath_set_lid(struct ipath_devdata *, u32, u8);
775int ipath_set_rx_pol_inv(struct ipath_devdata *dd, u8 new_pol_inv); 787int ipath_set_rx_pol_inv(struct ipath_devdata *dd, u8 new_pol_inv);
776void ipath_enable_armlaunch(struct ipath_devdata *); 788void ipath_enable_armlaunch(struct ipath_devdata *);
777void ipath_disable_armlaunch(struct ipath_devdata *); 789void ipath_disable_armlaunch(struct ipath_devdata *);
790void ipath_hol_down(struct ipath_devdata *);
791void ipath_hol_up(struct ipath_devdata *);
792void ipath_hol_event(unsigned long);
778 793
779/* for use in system calls, where we want to know device type, etc. */ 794/* for use in system calls, where we want to know device type, etc. */
780#define port_fp(fp) ((struct ipath_filedata *)(fp)->private_data)->pd 795#define port_fp(fp) ((struct ipath_filedata *)(fp)->private_data)->pd
@@ -830,6 +845,7 @@ void ipath_disable_armlaunch(struct ipath_devdata *);
830 /* Suppress heartbeat, even if turning off loopback */ 845 /* Suppress heartbeat, even if turning off loopback */
831#define IPATH_NO_HRTBT 0x1000000 846#define IPATH_NO_HRTBT 0x1000000
832#define IPATH_HAS_MULT_IB_SPEED 0x8000000 847#define IPATH_HAS_MULT_IB_SPEED 0x8000000
848#define IPATH_IB_FORCE_NOTIFY 0x80000000 /* force notify on next ib change */
833 849
834/* Bits in GPIO for the added interrupts */ 850/* Bits in GPIO for the added interrupts */
835#define IPATH_GPIO_PORT0_BIT 2 851#define IPATH_GPIO_PORT0_BIT 2
@@ -1030,6 +1046,21 @@ static inline u32 ipath_ib_linktrstate(struct ipath_devdata *dd, u64 ibcs)
1030} 1046}
1031 1047
1032/* 1048/*
1049 * from contents of IBCStatus (or a saved copy), return logical link state
1050 * combination of link state and linktraining state (down, active, init,
1051 * arm, etc.
1052 */
1053static inline u32 ipath_ib_state(struct ipath_devdata *dd, u64 ibcs)
1054{
1055 u32 ibs;
1056 ibs = (u32)(ibcs >> INFINIPATH_IBCS_LINKTRAININGSTATE_SHIFT) &
1057 dd->ibcs_lts_mask;
1058 ibs |= (u32)(ibcs &
1059 (INFINIPATH_IBCS_LINKSTATE_MASK << dd->ibcs_ls_shift));
1060 return ibs;
1061}
1062
1063/*
1033 * sysfs interface. 1064 * sysfs interface.
1034 */ 1065 */
1035 1066