Re: [PATCH] IB/core: export struct ib_port

Ralph Campbell
2009-11-11T20:07:30Z

On Wed, 2009-11-11 at 11:19 -0800, Roland Dreier wrote:
> > This patch moves the definition of struct ib_port from
> > sysfs.c to ib_verbs.h so that HCAs can create files in
> > /sys/class/infiniband/<hca>/ports/<N>/
>
> um, maybe, but we need to see how it gets used first. How do you get
> the to struct ib_port in driver code? Maybe it would make more sense to
> add a way for low-level drivers to pass in port attributes that get
> added when the port structure gets created?

It is used by the new ib_qib driver to expose the SL to VL table
since the user level MPI library (libpsm) constructs packets including
the IB header. After the driver calls ib_register_device(),
it calls device_create_file() to create the files in
/sys/class/infiniband/qib0/. Then it uses struct ib_device->port_list
to get the pointer to ib_port to add a directory similar to "gids"
and "pkeys" for each SL.

> By the way, any plans to resume working on the upstream driver for
> qlogic HCAs? Do you still plan to deprecate ib_ipath and add a new
> driver for new devices?

Yes, this is what I'm working on.
The patch is the only change outside of the hw/qib/ directory.
Do you want to see a preview of the sysfs code?