[openib-general] [PATCH] ib_smi: DR SMI switch port number handling

Hal Rosenstock
Mon Oct 18 11:10:57 PDT 2004


ib_smi: DR SMI switch port number handling

Index: ib_smi.c
===================================================================
--- ib_smi.c    (revision 1019)
+++ ib_smi.c    (working copy)
@@ -481,12 +481,18 @@
                   struct ib_mad_recv_wc *mad_recv_wc,
                   int phys_port_cnt)
 {
+       int port_num;
+
        /* SM Directed Route or LID Routed class */
        if (mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE ||
            mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED) {
+               if (mad_agent->device->node_type != IB_NODE_SWITCH)
+                       port_num = mad_agent->port_num;
+               else
+                       port_num = mad_recv_wc->wc->port_num;
                if (!smi_handle_smp_recv((struct ib_smp *)mad,
                                         mad_agent->device->node_type,
-                                        mad_agent->port_num, phys_port_cnt)) {
+                                        port_num, phys_port_cnt)) {
                        /* SMI failed receive */
                        return 0;
                }





More information about the openib-general mailing list