[ofa-general] ibv_modify_port?
Scott Guthridge
guthridg at us.ibm.com
Tue May 15 15:46:36 PDT 2007
I'm working on implementing a DM agent at user-level for an experimental
I/O controller. Registering the DM agent via umad_register seems to work --
I can receive DM MAD's. But there doesn't appear to be a way to set the
IB_PORT_DEVICE_MGMT_SUP bit in the port's SA PortInfo.CapabilityMask, so
mask-match SA port queries do not find my device.
I noticed that the "ib_srpt" driver does an explicit ib_modify_port in
order to set this flag. If there were a user-level version of this
function, I could do the same.
But.... this leads to another point. Implementing the DMA in each target
driver, isn't a particularly general approach. The problem is that you
can't implement more than one target driver behind the same channel
adapter. For example, I can not register my DM agent if the ib_srpt module
happens to be loaded.
I would like to propose a better interface. What if there were a generic
DM agent in the kernel that provided an API for target devices (kernel and
user) to register IOC's with it? It might look something like this:
struct ib_dm_ioc {
...
u8 ioc_slot;
...
};..
struct ib_dm_ioc *ib_dm_register_ioc(struct ib_device *device,
u8 port_num, const struct ib_dm_ioc_profile *ioprof);
void ib_dm_unregister_ioc(struct ib_ioc *iocp);
/* returns service entry slot number */
int ib_dm_add_svcent(struct ib_dm_ioc *, const char *svc_name,
u64 service_id);
void ib_dm_del_svcent(struct ib_dm_ioc *, int svcent_slot);
/* additional registration fn's for diag support could be added later
if someone feels ambitious */
The generic DMA would set the IB_PORT_DEVICE_MGMT_SUP flag in
PortInfo.CapabilityMask whenever at least one IOC is registered.
This interface would allow the DMA functionality to be removed from target
drivers, simplifying them somewhat. And it would make it possible to
support more than one type of IOC within the same target CA.
Comments?
Scott
More information about the general
mailing list