Exemplo n.º 1
0
    def get_umad_for_target(self, path=False, gmp=False):
        """Return a UMAD suitable for use to talk to *path*. *path* is an
        :class:`rdma.path.IBPath`. If *path* is `None` then a loopback path is
        resolved, if *path* is `False` then no path is resolved.
        """
        if path:
            assert (path.end_port == self.end_port)
        umad = rdma.get_umad(self.end_port)
        try:
            if self.debug >= 1:
                umad.trace_func = rdma.madtransactor.simple_tracer
            if self.debug >= 2:
                umad.trace_func = rdma.madtransactor.dumper_tracer

            if self.args.use_sa:
                __import__("rdma.satransactor")
                import sys
                umad = sys.modules["rdma.satransactor"].SATransactor(umad)

            if path is False:
                self.path = None
            elif gmp:
                self.path = self.get_gmp_path(path, umad)
            else:
                self.path = self.get_smp_path(path, umad)
            return umad
        except:
            umad.close()
            raise
Exemplo n.º 2
0
    def get_umad_for_target(self,path=False,gmp=False,local_sa=False):
        """Return a UMAD suitable for use to talk to *path*. *path* is an
        :class:`rdma.path.IBPath`. If *path* is `None` then a loopback path is
        resolved, if *path* is `False` then no path is resolved.
        """
        if path:
            assert(path.end_port == self.end_port);
        umad = rdma.get_umad(self.end_port);
        try:
            if self.debug >= 1:
                umad.trace_func = rdma.madtransactor.simple_tracer;
            if self.debug >= 2:
                umad.trace_func = rdma.madtransactor.dumper_tracer;

            if self.args.use_sa:
                __import__("rdma.satransactor");
                import sys;
                if local_sa or self.args.sa_path is None:
                    sa_path = self.end_port.sa_path
                else:
                    sa_path = self.args.sa_path
                    rdma.path.resolve_path(umad, sa_path)
                umad = sys.modules["rdma.satransactor"].SATransactor(umad,sa_path);

            if path is False:
                self.path = None;
            elif gmp:
                self.path = self.get_gmp_path(path,umad);
            else:
                self.path = self.get_smp_path(path,umad);
            return umad;
        except:
            umad.close();
            raise
Exemplo n.º 3
0
    def setUp(self):
        self.extra_opts = None;
        if self.cmd_mod is None:
            fn = os.path.join(os.path.dirname(sys.modules[__name__].__file__),
                              os.path.pardir,
                              "ibtool");
            self.cmd_mod = imp.load_source("__ibtool__",fn);
            self.get_cmd_func = self.cmd_mod.get_cmd_func;

            self.end_port = rdma.get_end_port();

            self.peer_dr = "0,%u"%(self.end_port.port_id);
            with rdma.get_umad(self.end_port) as umad:
                dr = rdma.path.IBDRPath(self.end_port,drPath="\0" +
                                        chr(self.end_port.port_id));
                self.peer_pinf = umad.SubnGet(IBA.SMPPortInfo,dr);
                self.peer_ninf = umad.SubnGet(IBA.SMPNodeInfo,dr);
Exemplo n.º 4
0
    def setUp(self):
        self.extra_opts = None
        if self.cmd_mod is None:
            fn = os.path.join(os.path.dirname(sys.modules[__name__].__file__),
                              os.path.pardir, "ibtool")
            self.cmd_mod = imp.load_source("__ibtool__", fn)
            self.get_cmd_func = self.cmd_mod.get_cmd_func

            self.end_port = rdma.get_end_port()

            self.peer_dr = "0,%u" % (self.end_port.port_id)
            with rdma.get_umad(self.end_port) as umad:
                dr = rdma.path.IBDRPath(self.end_port,
                                        drPath="\0" +
                                        chr(self.end_port.port_id))
                self.peer_pinf = umad.SubnGet(IBA.SMPPortInfo, dr)
                self.peer_ninf = umad.SubnGet(IBA.SMPNodeInfo, dr)
Exemplo n.º 5
0
 def setUp(self):
     self.end_port = rdma.get_end_port();
     self.umad = rdma.get_umad(self.end_port);
     self.local_path = rdma.path.IBDRPath(self.end_port);
Exemplo n.º 6
0
 def test_get(self):
     for I in rdma.get_devices():
         for Q in I.end_ports:
             with rdma.get_umad(Q) as X:
                 print X
Exemplo n.º 7
0
 def setUp(self):
     self.end_port = rdma.get_end_port()
     self.umad = rdma.get_umad(self.end_port)
     self.local_path = rdma.path.IBDRPath(self.end_port)
Exemplo n.º 8
0
 def test_get(self):
     for I in rdma.get_devices():
         for Q in I.end_ports:
             with rdma.get_umad(Q) as X:
                 print X;