ib_types.h moving [was: Re: [ofa-general] [RFC] 3/5: IB ACM: libibacm]
Quoted 4 lines · Ira Weiny
Sasha, would you be willing to accept such a patch? First move
ib_types.hto umad and then move the long inline functions into the lib and separate out the remaining header.Or would you prefer a new library? I think there is enough code there but I leave it up to you.
Basically cleaning ib_types.h issue (which was raised repeatedly in the past too) and making some order here with libibmad duplications would be a nice thing.
However I still not understand clearly yet how things should be organized properly (assumig all histories, ibutils dependencies, etc.). And sure we can try to find an optimal model, so let's discuss:
libibumad is an option. However today this library only provides a layer to user_mad kernel API and actually is transparent to MAD's structure. Maybe complicating this with adding ib_types.h and some MAD fields access helpers is not a big deal, but sort of disadvantage anyway.
To place this stuff in separate library/package is another possibility, but perspective of adding new package doesn't make me happy.
In theory ib_types.h would be also merged with libibmad. However for me the current libibmad seems to be too much heavy for not using it for stuff other than infiniband-diags.
Another options?
Now I likely would agree with Ira that moving ib_types.h to libibumad is a least painful option. Do we have a better ideas?
Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 2 lines
Now I likely would agree with Ira that moving
ib_types.hto libibumad is a least painful option. Do we have a better ideas?
Just a random thought, but what about longer term adding a second set of interfaces to libibumad? Basically, something more like the kernel ib_sa. I don't know that we need a new library just to expand the interface.
For ib_types.h, I'd rather see it broken up into separate header files, at least some of which get distributed with libibumad.
- Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 14 lines · On Fri, 25 Sep 2009 16:09:08 +0300 Sasha Khapyorsky…
Quoted 4 lines · Ira Weiny
Sasha, would you be willing to accept such a patch? First move
ib_types.hto umad and then move the long inline functions into the lib and separate out the remaining header.Or would you prefer a new library? I think there is enough code there but I leave it up to you.
Basically cleaning
ib_types.hissue (which was raised repeatedly in the past too) and making some order here with libibmad duplications would be a nice thing.However I still not understand clearly yet how things should be organized properly (assumig all histories, ibutils dependencies, etc.). And sure we can try to find an optimal model, so let's discuss:
Quoted 5 lines
libibumad is an option. However today this library only provides a layer to
user_madkernel API and actually is transparent to MAD's structure. Maybe complicating this with addingib_types.hand some MAD fields access helpers is not a big deal, but sort of disadvantage anyway.
I think I agree. I have been looking over the headers and functionality of the librarys and libibumad is really just an interface to the kernel. It is just a data passing library. libibmad is the library which can marshal packets (mad packets anyway). Much of the functionality of ib_types.h is used in (de|en)codeing packets (mad and others). For example, there is functionality for other things such as ib_gid_is_multicast which is used for non-mad packets. Where does this functionality go? I think I agree with Sean that this header should be broken up but I fear there might be a number of items left homeless... :-/
Quoted 3 lines
To place this stuff in separate library/package is another possibility, but perspective of adding new package doesn't make me happy.
I think we need to look at libibverbs as well...
from ib_types.h
#define IB_PATH_RECORD_RATE_2_5_GBS 2
#define IB_PATH_RECORD_RATE_5_GBS 5
...
#define IB_MTU_LEN_256 1
#define IB_MTU_LEN_512 2
...
#define IB_LINK_DOWN 1
#define IB_LINK_INIT 2
Quoted 1 line
From
verbs.h
IBV_RATE_2_5_GBPS = 2, IBV_RATE_5_GBPS = 5, ... IBV_MTU_256 = 1, IBV_MTU_512 = 2, ... IBV_PORT_DOWN = 1, IBV_PORT_INIT = 2,
Furthermore, we have 3 functions to decode node type (and their associated #def/enums).
libibmad:mad_dump_node_type
ib_types.h:ib_get_node_type_str
libibverbs:ibv_node_type_str
I will admit mad_dump_node_type is somewhat special... But still, why all this reinvention?
Quoted 4 lines
In theory
ib_types.hwould be also merged with libibmad. However for me the current libibmad seems to be too much heavy for not using it for stuff other than infiniband-diags.
I am not quite sure what you mean here. Do you mean libibmad is already too complicated ("too much heavy")? And/Or that libibmad is not appropriate for users other than infiniband-diags?
Quoted 5 lines
Another options?
Now I likely would agree with Ira that moving
ib_types.hto libibumad is a least painful option. Do we have a better ideas?
So far I can only think of 2 "correct" options.
1) Make ib_types.h into a new library and have libibverbs, libibmad, opensm, and MPI's use the constants and helper functions there. This of course would force some dependencies.
2) split up and spread ib_types.h around to appropriate places. This will likely include libibmad and libibverbs (others?) I don't think libibumad is appropriate really. At first, I suggested this mainly out of convenience because WinOF uses it. However, I don't think it is architecturally correct. libibumad looks to have a sound interface and should not be messed with.
Ira
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Ira Weiny
Quoted 2 lines
Now I likely would agree with Ira that moving
ib_types.hto libibumad is a least painful option. Do we have a better ideas?So far I can only think of 2 "correct" options.
1) Make
ib_types.hinto a new library and have libibverbs, libibmad, opensm, and MPI's use the constants and helper functions there. This of course would force some dependencies.
You are going the wrong way.. libibverbs is the 'fundamental' lowest level library. Everything should build on it, not re-invent its stuff.
libibumad should not have device discovery and handling functions! It should use ibv_device and ibv_context identifiers from libibverbs.
It should not duplicate constants and functions from libibverbs.
Quoted 6 lines
2) split up and spread
ib_types.haround to appropriate places. This will likely include libibmad and libibverbs (others?) I don't think libibumad is appropriate really. At first, I suggested this mainly out of convenience because WinOF uses it. However, I don't think it is architecturally correct. libibumad looks to have a sound interface and should not be messed with.
It has a horrid interface, it should be destoyed :P
It needs exactly 4 functions:
1) open QP0/QP1 special FD based on ibv_device/ibv_context
2) read/write MADs from the special FD into user buffers. Maybe some higher level helper functions (ie send/recv with retry, timeout, etc)
3) Do some basic parsing and whatever of the user buffers (if necessary, probably not anymore)
4) Do any special control functions on the QP0/QP1/port
(ie set control bits, etc, etc)
libibmad should do all the hard core mad processing, structure definitions, parsing helpers, redirection and other special function logic, etc. It should be able to ride either on the QP0/QP1 special FD or directly on a UD QP from libibverbs.
Two libraries are probably not needed, one library containing both layers (with architectural purity), or putting the umad access layer in libibverbs would be best. We have too many libraries.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: ib_types.h moving
In reply to a message not in the archiveQuoted 6 lines
So far I can only think of 2 "correct" options.
1) Make
ib_types.hinto a new library and have libibverbs, libibmad, opensm, and MPI's use the constants and helper functions there. This of course would force some dependencies.
Quoted 6 lines
2) split up and spread
ib_types.haround to appropriate places. This will likely include libibmad and libibverbs (others?) I don't think libibumad is appropriate really. At first, I suggested this mainly out of convenience because WinOF uses it. However, I don't think it is architecturally correct. libibumad looks to have a sound interface and should not be messed with.
The only issue that was pointed out was that the IB ACM duplicated some network structure definitions (the SA MAD format, McMemberRecord, PathRecord). It seems perfectly natural to me to have the library that allows you to send and receive MADs to provide these definitions, especially considering how fundamental these specific attributes are to using IB. Even though umad_send and umad_recv are both defined to take a void * input buffer, they expect a specific format to that buffer.
libibverbs defines host structure definitions for McMemberRecord and PathRecord, but doesn't use them. This allows the rdma_cm and ib_cm to remain independent, but use the same definition.
IB ACM is coded to libibumad directly, mainly because I didn't see any benefit to coding to a higher level MAD interface that was more complex to use. Trying to keep the defines in a higher level library, which is what we have now, either results in duplicating them or forcing a dependency where there wouldn't be any.
And to be clear, I'm only referring to definitions in ib_types.h (and some in mad.h), and not any actual functionality.
- Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · On Wed, 30 Sep 2009 20:57:52 -0600 Jason Gunthorpe…
Quoted 3 lines · Ira Weiny
Quoted 2 lines
Now I likely would agree with Ira that moving
ib_types.hto libibumad is a least painful option. Do we have a better ideas?
Quoted 8 lines
Quoted 5 lines
So far I can only think of 2 "correct" options.
1) Make
ib_types.hinto a new library and have libibverbs, libibmad, opensm, and MPI's use the constants and helper functions there. This of course would force some dependencies.You are going the wrong way.. libibverbs is the 'fundamental' lowest level library. Everything should build on it, not re-invent its stuff.
I agree, however, I think others do not. In particular is Roland ready to accept a significant portion of ib_types.h? I don't have any problem requiring libibverbs for anything IB related. OTOH, I am not so against having many libraries as long as they are well defined and well known.
If the only solution is to have one massive libib library, so be it! I don't have a problem with that. But I think the maintainer of this lib is going to have a hard job. And perhaps some (switch vendors?) might want at least a little more break down of functionality to pick and choose what is required?
Quoted 3 lines
libibumad should not have device discovery and handling functions! It should use
ibv_deviceandibv_contextidentifiers from libibverbs.
I also agree, however, ib_types does not have any device discover functions. I was only speaking of where to put the ib_types functionality. Not about other problems which may exist. ;-)
Quoted 2 lines
It should not duplicate constants and functions from libibverbs.
Absolutely! Sasha are you ready to make OpenSM depend on libibverbs?
Quoted 10 lines
Quoted 7 lines
2) split up and spread
ib_types.haround to appropriate places. This will likely include libibmad and libibverbs (others?) I don't think libibumad is appropriate really. At first, I suggested this mainly out of convenience because WinOF uses it. However, I don't think it is architecturally correct. libibumad looks to have a sound interface and should not be messed with.It has a horrid interface, it should be destoyed :P
Quoted 8 lines
It needs exactly 4 functions:
1) open QP0/QP1 special FD based on ibv_device/ibv_context
2) read/write MADs from the special FD into user buffers. Maybe some higher level helper functions (ie send/recv with retry, timeout, etc)
3) Do some basic parsing and whatever of the user buffers (if necessary, probably not anymore)
4) Do any special control functions on the QP0/QP1/port
(ie set control bits, etc, etc)
Ok, ok. Once again I was only speaking of where to put the ib_types stuff. I think you would agree that adding ib_types stuff to libibumad is the wrong direction, right?
Quoted 6 lines
libibmad should do all the hard core mad processing, structure definitions, parsing helpers, redirection and other special function logic, etc. It should be able to ride either on the QP0/QP1 special FD or directly on a UD QP from libibverbs.
Yes, yes, and yes!
Quoted 4 lines
Two libraries are probably not needed, one library containing both layers (with architectural purity), or putting the umad access layer in libibverbs would be best. We have too many libraries.
Ok, as I said one massive libib library is fine with me. Are Roland and Sasha ready to accept this?
One final thought. Does WinOF use libibverbs as well? Would moving ib_types functionality in to libibverbs be a problem for them?
Ira
Signature · 9 lines
Ira Weiny Math Programmer/Computer Scientist Lawrence Livermore National Lab 925-423-8008 [email protected] -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 2 lines
One final thought. Does WinOF use libibverbs as well? Would moving
ib_typesfunctionality in to libibverbs be a problem for them?
Actually libibumad in WinOF uses libibverbs to get the device information.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 14 lines · Ira Weiny
Quoted 11 lines · On Wed, 30 Sep 2009 20:57:52 -0600 Jason Gunthorpe…
Quoted 8 lines · Ira Weiny
Quoted 2 lines
Now I likely would agree with Ira that moving
ib_types.hto libibumad is a least painful option. Do we have a better ideas?So far I can only think of 2 "correct" options.
1) Make
ib_types.hinto a new library and have libibverbs, libibmad, opensm, and MPI's use the constants and helper functions there. This of course would force some dependencies.
Quoted 7 lines
Quoted 2 lines
You are going the wrong way.. libibverbs is the 'fundamental' lowest level library. Everything should build on it, not re-invent its stuff.
I agree, however, I think others do not. In particular is Roland ready to accept a significant portion of
ib_types.h? I don't have any problem requiring libibverbs for anything IB related. OTOH, I am not so against having many libraries as long as they are well defined and well known.
Well, I'm not so sure a significant amount of ib_types.h belongs in ibverbs either, alot of that is just OSM junk, and it needs some cleanup to be part of a stable ABI library
Lets just browse here..
- RMPP stuff, libibumad, libibumad would also have the low level RMPP kernel/user interfacing
- QPN numbers, well known values, (PKEY, QKEY, LIDS, MCAST, SUBNET PERFIX) sounds like good ibverbs material if it isn't there since it is usable for some of the ibverbs calls
- ib_gid_t (alike, but different) is already in ibverbs, gid
processing functions belong in ibverbs ib_gid_is_multicast ib_mgid_get_scope ib_mgid_set_scope ib_gid_set_default ib_gid_get_subnet_prefix ib_gid_is_link_local ib_gid_is_site_local ib_gid_get_guid
- MTU constants duplicates ibverbs constants
- ib_path_rec_t is part of ibverbs, ib_path_* could be in ibverbs too
- Random IB MAD processing junk, random choosen things like:
IB_NODE_NUM_PORTS_MAX IB_SUBNET_PATH_HOPS_MAX IB_PKEY_MAX_BLOCKS IB_MCAST_BLOCK_ID_MASK_HO IB_PKEY_BASE_MASK IB_MCLASS_BM IB_MCLASS_VENDOR_HIGH_RANGE_MAX ib_class_is_vendor_specific_low IB_MAD_METHOD_RESP_MASK IB_MAD_METHOD_SET IB_MAD_ATTR_NOTICE IB_MAD_ATTR_P_KEY_TABLE IB_PR_COMPMASK_SERVICEID_MSB
general mad containers and related ib_class_port_info_t,ib_sm_info_t, ib_smp_t ib_port_info_t .. can go in libibmad ib mad decoding
Quoted 1 line
From about line 9175 to the end I'd say that duplicates ibverbs and
should refer to ibverbs versions, or go away entirely (dead code?)
Quoted 4 lines
If the only solution is to have one massive libib library, so be it! I don't have a problem with that. But I think the maintainer of this lib is going to have a hard job. And perhaps some (switch vendors?) might want at least a little more break down of functionality to pick and choose what is required?
The nice thing about libraries is you don't have to include everything in them in your embedded applications - there are multiple techniques for using only the subset of object files that you actually use. What is important is that the library has sensible .o file selection so that these schemes work. For instance a library with several orthogonal API groupings should at least put each grouping in a seperate .o file.
But ultimately this is all fairly static code, the IBA doesn't change very much and all the MAD processing goop is nice and constant.
Quoted 6 lines
Quoted 2 lines
libibumad should not have device discovery and handling functions! It should use
ibv_deviceandibv_contextidentifiers from libibverbs.I also agree, however,
ib_typesdoes not have any device discover functions. I was only speaking of where to put theib_typesfunctionality. Not about other problems which may exist. ;-)
It does have stuff like ib_ca_attr_t ib_port_attr_t which are part of a discovery thingy (dead code?) :)
Quoted 3 lines
Ok, ok. Once again I was only speaking of where to put the
ib_typesstuff. I think you would agree that addingib_typesstuff to libibumad is the wrong direction, right?
Well, I bring this all up because ib_types is a huge file and it needs to go into alot of different places. It is impossible to really judge where to put things without a clear vision of what the net result should look like.
Something like:
- ibverbs controls the device access, naming and base IB types for
LID, GID and PKEY addressing
- libumad provides a thin user layer for the kernel QP0 and QP1 special QPs, including access to the kernel RMPP engine.
- libibmad provides all the structure parsing and message processing code
libibmad provides a sane IB address resolution layer (think getaddrinfo but for IB)
- libibcm provides interfaces that are bolt together compatible with all the above libraries.
Now maybe some of those layers get smushed together, libibcm and libumad are both excessively small libraries :)
Quoted 6 lines
Quoted 3 lines
Two libraries are probably not needed, one library containing both layers (with architectural purity), or putting the umad access layer in libibverbs would be best. We have too many libraries.
Ok, as I said one massive libib library is fine with me. Are Roland and Sasha ready to accept this?
I think the stuff that would want to be added in libibverbs is pretty minor, mostly some addressing helpers and additional constants that are fairly static. There isn't really a long term churn there.
Next, I think strategies to get the libraries to the above kind of layered state need to be devised. Ie for libumad I'd say crank the SONAME and start again. It is small enough that is very easy, and the current API really has nothing worth keeping.
Not sure what approach works for libibmad..
Also like I said, I have some stuff that is a different approach than ib_types, that is much easier to use (bit fields, vs explicit bit bashing) if it ports properly to Windows MS VC it might be worth considering going that route instead.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: ib_types.h moving
In reply to a message not in the archiveQuoted 13 lines · On Thu, 1 Oct 2009 14:47:33 -0700 "Sean Hefty"…
Quoted 6 lines
So far I can only think of 2 "correct" options.
1) Make
ib_types.hinto a new library and have libibverbs, libibmad, opensm, and MPI's use the constants and helper functions there. This of course would force some dependencies.Quoted 6 lines
2) split up and spread
ib_types.haround to appropriate places. This will likely include libibmad and libibverbs (others?) I don't think libibumad is appropriate really. At first, I suggested this mainly out of convenience because WinOF uses it. However, I don't think it is architecturally correct. libibumad looks to have a sound interface and should not be messed with.
Quoted 7 lines
The only issue that was pointed out was that the IB ACM duplicated some network structure definitions (the SA MAD format, McMemberRecord, PathRecord). It seems perfectly natural to me to have the library that allows you to send and receive MADs to provide these definitions, especially considering how fundamental these specific attributes are to using IB. Even though
umad_sendandumad_recvare both defined to take a void * input buffer, they expect a specific format to that buffer.
Combine libibmad into libibumad? Or just the core structure definitions? I will admit that accepting void * seems wrong when you know it is supposed to be a mad packet. In fact both umad_send and umad_recv imediately cast the void * to struct ib_user_mad *! Why not specify that in the parameter type?
Quoted 4 lines
libibverbs defines host structure definitions for McMemberRecord and PathRecord, but doesn't use them. This allows the
rdma_cmandib_cmto remain independent, but use the same definition.
:-( I missed those. Is there a reason they must remain independent? (I assume you mean independent of the mad libs?)
Quoted 5 lines
IB ACM is coded to libibumad directly, mainly because I didn't see any benefit to coding to a higher level MAD interface that was more complex to use. Trying to keep the defines in a higher level library, which is what we have now, either results in duplicating them or forcing a dependency where there wouldn't be any.
I understand the desire to avoid using libibmad. Perhaps you are correct that there are some things which are "core" MAD functionality, structure definitions for example, which should be at a lower level. However, I think it is still appropriate to put some things from ib_types into libibverbs and to expect people to use those definitions when required.
Quoted 4 lines
And to be clear, I'm only referring to definitions in
ib_types.h(and some inmad.h), and not any actual functionality.
<sigh> yes this discussion has digressed. But I don't think we should dive into breaking up (or moving) ib_types just to move things around. I think Sasha is right we need to have a plan for where things _should_ end up. As I look for homes for all the items of ib_types I find that it is not just one place. :-/
Ira
Signature · 9 lines
Ira Weiny Math Programmer/Computer Scientist Lawrence Livermore National Lab 925-423-8008 [email protected] -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: ib_types.h moving
In reply to a message not in the archiveQuoted 5 lines
<sigh> yes this discussion has digressed. But I don't think we should dive into breaking up (or moving)
ib_typesjust to move things around. I think Sasha is right we need to have a plan for where things _should_ end up. As I look for homes for all the items ofib_typesI find that it is not just one place. :-/
I really don't think it's worth the effort to rework IB libraries and MAD layers. Most user space applications need simpler interfaces to use than communicating directly with the IB SA. For the few that want or need to, the existing libraries are sufficient. We only need a better place for some of the structure definitions than an opensm header file. Even the ib-diags shouldn't depend on opensm.
- Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 29 lines · On Thu, 1 Oct 2009 17:39:15 -0600 Jason Gunthorpe…
Quoted 14 lines · Ira Weiny
Quoted 11 lines · On Wed, 30 Sep 2009 20:57:52 -0600 Jason Gunthorpe…
Quoted 8 lines · Ira Weiny
Quoted 2 lines
Now I likely would agree with Ira that moving
ib_types.hto libibumad is a least painful option. Do we have a better ideas?So far I can only think of 2 "correct" options.
1) Make
ib_types.hinto a new library and have libibverbs, libibmad, opensm, and MPI's use the constants and helper functions there. This of course would force some dependencies.Quoted 7 lines
Quoted 2 lines
You are going the wrong way.. libibverbs is the 'fundamental' lowest level library. Everything should build on it, not re-invent its stuff.
I agree, however, I think others do not. In particular is Roland ready to accept a significant portion of
ib_types.h? I don't have any problem requiring libibverbs for anything IB related. OTOH, I am not so against having many libraries as long as they are well defined and well known.Well, I'm not so sure a significant amount of
ib_types.hbelongs in ibverbs either, alot of that is just OSM junk, and it needs some cleanup to be part of a stable ABI libraryLets just browse here..
Quoted 11 lines
- RMPP stuff, libibumad, libibumad would also have the low level RMPP kernel/user interfacing
- QPN numbers, well known values, (PKEY, QKEY, LIDS, MCAST, SUBNET PERFIX) sounds like good ibverbs material if it isn't there since it is usable for some of the ibverbs calls
-ib_gid_t(alike, but different) is already in ibverbs, gid
processing functions belong in ibverbsib_gid_is_multicastib_mgid_get_scopeib_mgid_set_scopeib_gid_set_defaultib_gid_get_subnet_prefixib_gid_is_link_localib_gid_is_site_localib_gid_get_guid
- MTU constants duplicates ibverbs constants
-ib_path_rec_tis part of ibverbs, ib_path_* could be in ibverbs too
Except for the RMPP stuff you list first, this is all moving to (or already duplicated by) ibverbs. I have not counted the lines of code but this seems like more than an insignificant change to ibverbs. Furthermore, it would mean significant build changes to OpenSM and the diags. Mind you, this is not insurmountable but I think there is some work to be done here.
Quoted 11 lines
- Random IB MAD processing junk, random choosen things like:
IB_NODE_NUM_PORTS_MAXIB_SUBNET_PATH_HOPS_MAXIB_PKEY_MAX_BLOCKSIB_MCAST_BLOCK_ID_MASK_HOIB_PKEY_BASE_MASKIB_MCLASS_BMIB_MCLASS_VENDOR_HIGH_RANGE_MAXib_class_is_vendor_specific_lowIB_MAD_METHOD_RESP_MASKIB_MAD_METHOD_SETIB_MAD_ATTR_NOTICEIB_MAD_ATTR_P_KEY_TABLEIB_PR_COMPMASK_SERVICEID_MSB
general mad containers and related ib_class_port_info_t,ib_sm_info_t,ib_smp_tib_port_info_t.. can go in libibmad ib mad decoding
Quoted 2 lines
From about line 9175 to the end I'd say that duplicates ibverbs and should refer to ibverbs versions, or go away entirely (dead code?)
Yep! I don't see anyone using it anyway. Perhaps a first step is to start removing dead code?
Quoted 14 lines
Quoted 5 lines
If the only solution is to have one massive libib library, so be it! I don't have a problem with that. But I think the maintainer of this lib is going to have a hard job. And perhaps some (switch vendors?) might want at least a little more break down of functionality to pick and choose what is required?
The nice thing about libraries is you don't have to include everything in them in your embedded applications - there are multiple techniques for using only the subset of object files that you actually use. What is important is that the library has sensible .o file selection so that these schemes work. For instance a library with several orthogonal API groupings should at least put each grouping in a seperate .o file.
Quoted 2 lines
But ultimately this is all fairly static code, the IBA doesn't change very much and all the MAD processing goop is nice and constant.
I get all that... I just did not want to rock the boat too much, lest I get thrown out... ;-) Perhaps I am past that point already?
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines
libibumad should not have device discovery and handling functions! It should use
ibv_deviceandibv_contextidentifiers from libibverbs.I also agree, however,
ib_typesdoes not have any device discover functions. I was only speaking of where to put theib_typesfunctionality. Not about other problems which may exist. ;-)It does have stuff like
ib_ca_attr_tib_port_attr_twhich are part of a discovery thingy (dead code?) :)
:-/ not dead... But specific to the vendor layer in opensm. So leave that in the OpenSM tree for now, until we can determine if the other vendor layers are used and by whom. I see some more work to be done in this area but I am unsure of the current use of the vendor layer. Hal often asks the list and no one replies to him... :-/ It seems that Windows is on board with using libibumad and I don't know of any other OpenSM user who does not. Furthermore, I don't know why OpenSM could not use libib[u]mad definitions internally even if the vendor layer is suppling wire packets from some other vendor defined structure. I don't care if vendors want to define their own proprietary versions of these definitions and structs. ;-) Well as long as they follow the spec, of course.
Quoted 9 lines
Quoted 4 lines
Ok, ok. Once again I was only speaking of where to put the
ib_typesstuff. I think you would agree that addingib_typesstuff to libibumad is the wrong direction, right?Well, I bring this all up because
ib_typesis a huge file and it needs to go into alot of different places. It is impossible to really judge where to put things without a clear vision of what the net result should look like.
Agreed.
Quoted 12 lines
Something like:
- ibverbs controls the device access, naming and base IB types for
LID, GID and PKEY addressing
- libumad provides a thin user layer for the kernel QP0 and QP1 special QPs, including access to the kernel RMPP engine.
- libibmad provides all the structure parsing and message processing code
libibmad provides a sane IB address resolution layer (think getaddrinfo but for IB)
- libibcm provides interfaces that are bolt together compatible with all the above libraries.
Quoted 2 lines
Now maybe some of those layers get smushed together, libibcm and libumad are both excessively small libraries :)
Agreed. I am more than willing to create patches and work through this. However, I want to agree on a plan first.[*] Then we can keep the thrashing of large and complex patches to a minimum.
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Two libraries are probably not needed, one library containing both layers (with architectural purity), or putting the umad access layer in libibverbs would be best. We have too many libraries.
Ok, as I said one massive libib library is fine with me. Are Roland and Sasha ready to accept this?
I think the stuff that would want to be added in libibverbs is pretty minor, mostly some addressing helpers and additional constants that are fairly static. There isn't really a long term churn there.
I hope not. And I tend to agree with you. But I fear things I don't understand like ibutils. I don't know what it needs or where it draws what from. We might seriously break them. Maintainers of other projects need to know this is happening and, at a minimum, understand why. I think things will go much easier if they do.
Quoted 7 lines
Next, I think strategies to get the libraries to the above kind of layered state need to be devised. Ie for libumad I'd say crank the SONAME and start again. It is small enough that is very easy, and the current API really has nothing worth keeping.
Not sure what approach works for libibmad..
[*]How about this for a plan:
1) remove dead and duplicated code from ib_types.h
2) combine libibmad and libibumad into new libibumad2
2a) leave dead/outdated code out of libibumad2
3) move verbs ib_types functionality into libibverbs
3a) adjust OpenSM and vendor layers as appropriate
4) Move MAD ib_types functionality into libibumad2
4a) convert upper vendor layer and OpenSM to use new MAD defines in
libibumad2
5) remove ib_types.h
I am probably missing something.
Quoted 5 lines
Also like I said, I have some stuff that is a different approach than
ib_types, that is much easier to use (bit fields, vs explicit bit bashing) if it ports properly to Windows MS VC it might be worth considering going that route instead.
That sounds interesting. I just don't want to see further duplication. It's just too confusing. I know that my brain is the smallest of the bunch here. So maybe that is why I am suffering the most with the current complexity... :-/ ???
Ira
Signature · 9 lines
Ira Weiny Math Programmer/Computer Scientist Lawrence Livermore National Lab 925-423-8008 [email protected] -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 61 lines · Ira Weiny
Quoted 29 lines · On Thu, 1 Oct 2009 17:39:15 -0600 Jason Gunthorpe…
Quoted 14 lines · Ira Weiny
Quoted 11 lines · On Wed, 30 Sep 2009 20:57:52 -0600 Jason Gunthorpe…
Quoted 8 lines · Ira Weiny
Quoted 2 lines
Now I likely would agree with Ira that moving
ib_types.hto libibumad is a least painful option. Do we have a better ideas?So far I can only think of 2 "correct" options.
1) Make
ib_types.hinto a new library and have libibverbs, libibmad, opensm, and MPI's use the constants and helper functions there. This of course would force some dependencies.Quoted 7 lines
Quoted 2 lines
You are going the wrong way.. libibverbs is the 'fundamental' lowest level library. Everything should build on it, not re-invent its stuff.
I agree, however, I think others do not. In particular is Roland ready to accept a significant portion of
ib_types.h? I don't have any problem requiring libibverbs for anything IB related. OTOH, I am not so against having many libraries as long as they are well defined and well known.Well, I'm not so sure a significant amount of
ib_types.hbelongs in ibverbs either, alot of that is just OSM junk, and it needs some cleanup to be part of a stable ABI libraryLets just browse here..
Quoted 11 lines
- RMPP stuff, libibumad, libibumad would also have the low level RMPP kernel/user interfacing
- QPN numbers, well known values, (PKEY, QKEY, LIDS, MCAST, SUBNET PERFIX) sounds like good ibverbs material if it isn't there since it is usable for some of the ibverbs calls
-ib_gid_t(alike, but different) is already in ibverbs, gid
processing functions belong in ibverbsib_gid_is_multicastib_mgid_get_scopeib_mgid_set_scopeib_gid_set_defaultib_gid_get_subnet_prefixib_gid_is_link_localib_gid_is_site_localib_gid_get_guid
- MTU constants duplicates ibverbs constants
-ib_path_rec_tis part of ibverbs, ib_path_* could be in ibverbs tooExcept for the RMPP stuff you list first, this is all moving to (or already duplicated by) ibverbs. I have not counted the lines of code but this seems like more than an insignificant change to ibverbs. Furthermore, it would mean significant build changes to OpenSM and the diags. Mind you, this is not insurmountable but I think there is some work to be done here.
Quoted 11 lines
- Random IB MAD processing junk, random choosen things like:
IB_NODE_NUM_PORTS_MAXIB_SUBNET_PATH_HOPS_MAXIB_PKEY_MAX_BLOCKSIB_MCAST_BLOCK_ID_MASK_HOIB_PKEY_BASE_MASKIB_MCLASS_BMIB_MCLASS_VENDOR_HIGH_RANGE_MAXib_class_is_vendor_specific_lowIB_MAD_METHOD_RESP_MASKIB_MAD_METHOD_SETIB_MAD_ATTR_NOTICEIB_MAD_ATTR_P_KEY_TABLEIB_PR_COMPMASK_SERVICEID_MSB
general mad containers and related ib_class_port_info_t,ib_sm_info_t,ib_smp_tib_port_info_t.. can go in libibmad ib mad decoding
Quoted 4 lines
Quoted 2 lines
From about line 9175 to the end I'd say that duplicates ibverbs and should refer to ibverbs versions, or go away entirely (dead code?)
Yep! I don't see anyone using it anyway.
I think this is used in Windows and may be used by out of tree users. I know this can move but it is a consideration (at least IMO).
Quoted 27 lines
Perhaps a first step is to start
removing dead code?Quoted 14 lines
Quoted 5 lines
If the only solution is to have one massive libib library, so be it! I don't have a problem with that. But I think the maintainer of this lib is going to have a hard job. And perhaps some (switch vendors?) might want at least a little more break down of functionality to pick and choose what is required?
The nice thing about libraries is you don't have to include everything in them in your embedded applications - there are multiple techniques for using only the subset of object files that you actually use. What is important is that the library has sensible .o file selection so that these schemes work. For instance a library with several orthogonal API groupings should at least put each grouping in a seperate .o file.
Quoted 2 lines
But ultimately this is all fairly static code, the IBA doesn't change very much and all the MAD processing goop is nice and constant.
I get all that... I just did not want to rock the boat too much, lest I get thrown out... ;-) Perhaps I am past that point already?
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
libibumad should not have device discovery and handling functions! It should use
ibv_deviceandibv_contextidentifiers from libibverbs.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
I also agree, however,
ib_typesdoes not have any device discover functions. I was only speaking of where to put theib_typesfunctionality. Not about other problems which may exist. ;-)It does have stuff like
ib_ca_attr_tib_port_attr_twhich are part of a discovery thingy (dead code?) :):-/ not dead... But specific to the vendor layer in opensm.
For at least umad vendor layer, the discovery code could be changed to use verbs rather than the current umad calls for this. It sounded like Sean already did this for Windows. I wonder whether those changes can readily be transferred to Linux.
Quoted 81 lines
So leave that
in the OpenSM tree for now, until we can determine if the other vendor layers are used and by whom. I see some more work to be done in this area but I am unsure of the current use of the vendor layer. Hal often asks the list and no one replies to him... :-/ It seems that Windows is on board with using libibumad and I don't know of any other OpenSM user who does not. Furthermore, I don't know why OpenSM could not use libib[u]mad definitions internally even if the vendor layer is suppling wire packets from some other vendor defined structure. I don't care if vendors want to define their own proprietary versions of these definitions and structs. ;-) Well as long as they follow the spec, of course.Quoted 9 lines
Quoted 4 lines
Ok, ok. Once again I was only speaking of where to put the
ib_typesstuff. I think you would agree that addingib_typesstuff to libibumad is the wrong direction, right?Well, I bring this all up because
ib_typesis a huge file and it needs to go into alot of different places. It is impossible to really judge where to put things without a clear vision of what the net result should look like.Agreed.
Quoted 12 lines
Something like:
- ibverbs controls the device access, naming and base IB types for
LID, GID and PKEY addressing
- libumad provides a thin user layer for the kernel QP0 and QP1 special QPs, including access to the kernel RMPP engine.
- libibmad provides all the structure parsing and message processing code
libibmad provides a sane IB address resolution layer (think getaddrinfo but for IB)
- libibcm provides interfaces that are bolt together compatible with all the above libraries.Quoted 2 lines
Now maybe some of those layers get smushed together, libibcm and libumad are both excessively small libraries :)
Agreed. I am more than willing to create patches and work through this. However, I want to agree on a plan first.[*] Then we can keep the thrashing of large and complex patches to a minimum.
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Two libraries are probably not needed, one library containing both layers (with architectural purity), or putting the umad access layer in libibverbs would be best. We have too many libraries.
Ok, as I said one massive libib library is fine with me. Are Roland and Sasha ready to accept this?
I think the stuff that would want to be added in libibverbs is pretty minor, mostly some addressing helpers and additional constants that are fairly static. There isn't really a long term churn there.
I hope not. And I tend to agree with you. But I fear things I don't understand like ibutils. I don't know what it needs or where it draws what from. We might seriously break them. Maintainers of other projects need to know this is happening and, at a minimum, understand why. I think things will go much easier if they do.
Quoted 7 lines
Next, I think strategies to get the libraries to the above kind of layered state need to be devised. Ie for libumad I'd say crank the SONAME and start again. It is small enough that is very easy, and the current API really has nothing worth keeping.
Not sure what approach works for libibmad..
[*]How about this for a plan:
1) remove dead and duplicated code from
ib_types.h
2) combine libibmad and libibumad into new libibumad2
2a) leave dead/outdated code out of libibumad2
3) move verbsib_typesfunctionality into libibverbs
3a) adjust OpenSM and vendor layers as appropriate
4) Move MADib_typesfunctionality into libibumad2
4a) convert upper vendor layer and OpenSM to use new MAD defines in libibumad2
5) removeib_types.h
Quoted 1 line
I am probably missing something.
What about ibsim for one ?
-- Hal
Quoted 11 lines
Quoted 5 lines
Also like I said, I have some stuff that is a different approach than
ib_types, that is much easier to use (bit fields, vs explicit bit bashing) if it ports properly to Windows MS VC it might be worth considering going that route instead.That sounds interesting. I just don't want to see further duplication. It's just too confusing. I know that my brain is the smallest of the bunch here. So maybe that is why I am suffering the most with the current complexity... :-/ ???
Quoted 9 lines
Ira
--
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html