[ofa-general] Re: [PATCH] ibsim: Add better end port simulation support

Sasha Khapyorsky sashak at voltaire.com
Tue Feb 17 13:55:40 PST 2009


On 16:28 Tue 17 Feb     , Hal Rosenstock wrote:
> Sasha,
> 
> On Tue, Feb 17, 2009 at 4:18 PM, Sasha Khapyorsky <sashak at voltaire.com> wrote:
> > Hi Hal,
> >
> > On 15:37 Sat 14 Feb     , hnrose at comcast.net wrote:
> >>
> >> Add SIM_PORT environment variable to allow for end port selection
> >
> > How this would handle case when SIM_PORT=N, but program tries to work
> > via another port (for example: SIM_PORT=2 and ibnetdiscover -P 1)?
> 
> That's a configuration error. SIM_PORT needs to be set to same port as
> program intends to use.

This is different things - program doesn't have to know about simulator
at all. so dependency between '-C' and SIM_PORT is not a good idea.
Actually I think that SIM_PORT is not needed at all - see below.

> > IOW should port number selection be initiated natively by program rather
> > than by using environment variables?
> 
> That would've been nice but AFAIT the simulation layer needs the port
> number earlier than the program can supply it.

This is using the current implementation only where sysfs tree is
generated (simulated) only for one port. Now if you are going to fetch
all PortInfo(s) anyway, then application can choose port number just by
using it's regular mechanisms - no needs for any SIM_PORT variables.
(Likely you will need additional sim_ctl() call which will be triggered
by umad open() to set a port number on ibsim's client side).

> Maybe that could be
> changed but I didn't dig into that.
> 
> >> Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>

[snip...]

> >> +
> >> +     // although pkeys also per port, current config same on all end ports
> >
> > Which is not correct really.
> 
> What are you referring to ? Is there some config for end port pkeys in
> the simulator ?

Each port on ibsim side has each own pkey table (it has some default
preset value and can be configured using OpenSM and maybe ibutils, so
special "out-of-bound" config is not needed). And we need to display it
properly for each port.

Sasha



More information about the general mailing list