[openib-general] [PATCH] ib_smi: Remove DR handling workaround in smi_send_smp
Hal Rosenstock
Tue Oct 12 09:15:14 PDT 2004
ib_smi: Remove DR handling workaround in smi_send_smp
Index: ib_smi.c
===================================================================
--- ib_smi.c (revision 973)
+++ ib_smi.c (working copy)
@@ -188,9 +188,12 @@
} else {
- /* C14-13:1 -- sender should have decremented hop_ptr */
- if (hop_cnt && hop_ptr == hop_cnt + 1)
- return 0;
+ /* C14-13:1 */
+ if (hop_cnt && hop_ptr == hop_cnt + 1) {
+ smp->hop_ptr--;
+ return (smp->return_path[smp->hop_ptr] ==
+ mad_agent->port_num);
+ }
/* C14-13:2 */
if (2 <= hop_ptr && hop_ptr <= hop_cnt) {
@@ -411,12 +414,11 @@
ret = smi_process_local(mad_agent, (struct ib_mad *)smp,
smp_response, slid);
if (ret & IB_MAD_RESULT_SUCCESS) {
- /* DR handling workaround !!! */
- if (smp_response->mad_hdr.mgmt_class ==
- IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) {
- if (((struct ib_smp *)smp_response)->hop_ptr) {
- ((struct ib_smp *)smp_response)->hop_ptr--;
- }
+ if (!smi_handle_smp_recv(mad_agent,
+ (struct ib_smp *)smp_response)) {
+ /* SMI failed receive */
+ kfree(smp_response);
+ return 0;
}
smp_send(mad_agent, smp_response, mad_recv_wc);
} else
More information about the openib-general mailing list