aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/smi.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core/smi.h')
-rw-r--r--drivers/infiniband/core/smi.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/infiniband/core/smi.h b/drivers/infiniband/core/smi.h
index 1cfc2984434f..aff96bac49b4 100644
--- a/drivers/infiniband/core/smi.h
+++ b/drivers/infiniband/core/smi.h
@@ -59,7 +59,8 @@ extern enum smi_action smi_handle_dr_smp_send(struct ib_smp *smp,
59 u8 node_type, int port_num); 59 u8 node_type, int port_num);
60 60
61/* 61/*
62 * Return 1 if the SMP should be handled by the local SMA/SM via process_mad 62 * Return IB_SMI_HANDLE if the SMP should be handled by the local SMA/SM
63 * via process_mad
63 */ 64 */
64static inline enum smi_action smi_check_local_smp(struct ib_smp *smp, 65static inline enum smi_action smi_check_local_smp(struct ib_smp *smp,
65 struct ib_device *device) 66 struct ib_device *device)
@@ -71,4 +72,19 @@ static inline enum smi_action smi_check_local_smp(struct ib_smp *smp,
71 (smp->hop_ptr == smp->hop_cnt + 1)) ? 72 (smp->hop_ptr == smp->hop_cnt + 1)) ?
72 IB_SMI_HANDLE : IB_SMI_DISCARD); 73 IB_SMI_HANDLE : IB_SMI_DISCARD);
73} 74}
75
76/*
77 * Return IB_SMI_HANDLE if the SMP should be handled by the local SMA/SM
78 * via process_mad
79 */
80static inline enum smi_action smi_check_local_returning_smp(struct ib_smp *smp,
81 struct ib_device *device)
82{
83 /* C14-13:3 -- We're at the end of the DR segment of path */
84 /* C14-13:4 -- Hop Pointer == 0 -> give to SM */
85 return ((device->process_mad &&
86 ib_get_smp_direction(smp) &&
87 !smp->hop_ptr) ? IB_SMI_HANDLE : IB_SMI_DISCARD);
88}
89
74#endif /* __SMI_H_ */ 90#endif /* __SMI_H_ */