diff options
author | Jim Snow <jim.m.snow@intel.com> | 2016-01-11 18:32:21 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-03-10 20:37:04 -0500 |
commit | fb9036dd8cd85533456aec43d7892b707561eba8 (patch) | |
tree | 9b6a05c2b3f567618a513833d2f5b5c1dc12627f /drivers/staging/rdma/hfi1/hfi.h | |
parent | staging/hfi1: Fix Xmit Wait calculation (diff) | |
download | linux-dev-fb9036dd8cd85533456aec43d7892b707561eba8.tar.xz linux-dev-fb9036dd8cd85533456aec43d7892b707561eba8.zip |
staging/hfi1: check for ARMED->ACTIVE change in recv int
The link state will transition from ARMED to ACTIVE when a non-SC15
packet arrives, but the driver might not notice the change. With this
fix, if the slowpath receive interrupt handler sees a non-SC15 packet
while in the ARMED state, we queue work to call linkstate_active_work
from process context to promote it to ACTIVE.
Reviewed-by: Dean Luick <dean.luick@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jim Snow <jim.m.snow@intel.com>
Signed-off-by: Brendan Cunningham <brendan.cunningham@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/staging/rdma/hfi1/hfi.h')
-rw-r--r-- | drivers/staging/rdma/hfi1/hfi.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/staging/rdma/hfi1/hfi.h b/drivers/staging/rdma/hfi1/hfi.h index 5bc385a574c5..23d7e0249f32 100644 --- a/drivers/staging/rdma/hfi1/hfi.h +++ b/drivers/staging/rdma/hfi1/hfi.h @@ -729,6 +729,7 @@ struct hfi1_pportdata { u8 remote_link_down_reason; /* Error events that will cause a port bounce. */ u32 port_error_action; + struct work_struct linkstate_active_work; }; typedef int (*rhf_rcv_function_ptr)(struct hfi1_packet *packet); @@ -1177,6 +1178,7 @@ void hfi1_free_ctxtdata(struct hfi1_devdata *, struct hfi1_ctxtdata *); int handle_receive_interrupt(struct hfi1_ctxtdata *, int); int handle_receive_interrupt_nodma_rtail(struct hfi1_ctxtdata *, int); int handle_receive_interrupt_dma_rtail(struct hfi1_ctxtdata *, int); +void set_all_slowpath(struct hfi1_devdata *dd); /* receive packet handler dispositions */ #define RCV_PKT_OK 0x0 /* keep going */ @@ -1197,6 +1199,15 @@ static inline u32 driver_lstate(struct hfi1_pportdata *ppd) return ppd->lstate; /* use the cached value */ } +void receive_interrupt_work(struct work_struct *work); + +/* extract service channel from header and rhf */ +static inline int hdr2sc(struct hfi1_message_header *hdr, u64 rhf) +{ + return ((be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf) | + ((!!(rhf & RHF_DC_INFO_MASK)) << 4); +} + static inline u16 generate_jkey(kuid_t uid) { return from_kuid(current_user_ns(), uid) & 0xffff; |