diff options
author | Leonid Arsh <leonida@voltaire.com> | 2006-06-17 23:37:36 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-06-17 23:37:36 -0400 |
commit | 12bbb2b7be7f5564952ebe0196623e97464b8ac5 (patch) | |
tree | 2c2aed2ffd043a145ba0369a799d9e8a1bd29ede /drivers/infiniband/hw/mthca/mthca_mad.c | |
parent | da2ab62ab5e430e6ffafc2d0e6046dcd2780f570 (diff) |
IB/mthca: Add client reregister event generation
Change the mthca snoop of MADs that set PortInfo to check if the SM
has set the client reregister bit, and if it has, generate a client
reregister event. If the bit is not set, just generate a LID change
event as usual.
Signed-off-by: Leonid Arsh <leonida@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_mad.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_mad.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_mad.c b/drivers/infiniband/hw/mthca/mthca_mad.c index 4730863ece9a..d9bc030bcccc 100644 --- a/drivers/infiniband/hw/mthca/mthca_mad.c +++ b/drivers/infiniband/hw/mthca/mthca_mad.c | |||
@@ -114,14 +114,22 @@ static void smp_snoop(struct ib_device *ibdev, | |||
114 | mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) && | 114 | mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) && |
115 | mad->mad_hdr.method == IB_MGMT_METHOD_SET) { | 115 | mad->mad_hdr.method == IB_MGMT_METHOD_SET) { |
116 | if (mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO) { | 116 | if (mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO) { |
117 | struct ib_port_info *pinfo = | ||
118 | (struct ib_port_info *) ((struct ib_smp *) mad)->data; | ||
119 | |||
117 | mthca_update_rate(to_mdev(ibdev), port_num); | 120 | mthca_update_rate(to_mdev(ibdev), port_num); |
118 | update_sm_ah(to_mdev(ibdev), port_num, | 121 | update_sm_ah(to_mdev(ibdev), port_num, |
119 | be16_to_cpup((__be16 *) (mad->data + 58)), | 122 | be16_to_cpu(pinfo->lid), |
120 | (*(u8 *) (mad->data + 76)) & 0xf); | 123 | pinfo->neighbormtu_mastersmsl & 0xf); |
121 | 124 | ||
122 | event.device = ibdev; | 125 | event.device = ibdev; |
123 | event.event = IB_EVENT_LID_CHANGE; | ||
124 | event.element.port_num = port_num; | 126 | event.element.port_num = port_num; |
127 | |||
128 | if(pinfo->clientrereg_resv_subnetto & 0x80) | ||
129 | event.event = IB_EVENT_CLIENT_REREGISTER; | ||
130 | else | ||
131 | event.event = IB_EVENT_LID_CHANGE; | ||
132 | |||
125 | ib_dispatch_event(&event); | 133 | ib_dispatch_event(&event); |
126 | } | 134 | } |
127 | 135 | ||