Message ID | 5534BBC2.4010902@profitbricks.com (mailing list archive) |
---|---|
State | Rejected |
Headers | show |
On Mon, Apr 20, 2015 at 10:41:38AM +0200, Michael Wang wrote: > > Introduce helper cap_ipoib() to help us check if the port of an > IB device support IP over Infiniband. > > Cc: Hal Rosenstock <hal@dev.mellanox.co.il> > Cc: Steve Wise <swise@opengridcomputing.com> > Cc: Tom Talpey <tom@talpey.com> > Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> > Cc: Doug Ledford <dledford@redhat.com> > Cc: Ira Weiny <ira.weiny@intel.com> > Cc: Sean Hefty <sean.hefty@intel.com> > Signed-off-by: Michael Wang <yun.wang@profitbricks.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> > --- > drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- > include/rdma/ib_verbs.h | 15 +++++++++++++++ > 2 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c > index 60b379d..a9812df 100644 > --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c > +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c > @@ -1671,7 +1671,7 @@ static void ipoib_add_one(struct ib_device *device) > } > > for (p = s; p <= e; ++p) { > - if (!rdma_tech_ib(device, p)) > + if (!cap_ipoib(device, p)) > continue; > dev = ipoib_add_port("ib%d", device, p); > if (!IS_ERR(dev)) { > diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h > index 6e354df..d0ae08e 100644 > --- a/include/rdma/ib_verbs.h > +++ b/include/rdma/ib_verbs.h > @@ -1863,6 +1863,21 @@ static inline int cap_ib_mcast(struct ib_device *device, u8 port_num) > return cap_ib_sa(device, port_num); > } > > +/** > + * cap_ipoib - Check if the port of device has the capability > + * IP over Infiniband. > + * > + * @device: Device to be checked > + * @port_num: Port number of the device > + * > + * Return 0 when port of the device don't support > + * IP over Infiniband. > + */ > +static inline int cap_ipoib(struct ib_device *device, u8 port_num) > +{ > + return rdma_tech_ib(device, port_num); > +} > + > int ib_query_gid(struct ib_device *device, > u8 port_num, int index, union ib_gid *gid); > > -- > 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Apr 20, 2015 at 10:41:38AM +0200, Michael Wang wrote: > Introduce helper cap_ipoib() to help us check if the port of an > IB device support IP over Infiniband. I thought we were dropping this in favor of listing the actual features the ULP required unconditionally? One of my messages had the start of a list.. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 04/22/2015 07:40 AM, Jason Gunthorpe wrote: > On Mon, Apr 20, 2015 at 10:41:38AM +0200, Michael Wang wrote: > >> Introduce helper cap_ipoib() to help us check if the port of an >> IB device support IP over Infiniband. > > I thought we were dropping this in favor of listing the actual > features the ULP required unconditionally? One of my messages had the > start of a list.. Shall we drop it now or wait until the mechanism introduced? Just wondering the requirement of ULP could be similar to the requirement of management, isn't it? if the device can tell which ULP it support, then may be a cap_XX() make sense in here? Regards, Michael Wang > > Jason > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Apr 22, 2015 at 10:49:44AM +0200, Michael Wang wrote: > > On 04/22/2015 07:40 AM, Jason Gunthorpe wrote: > > On Mon, Apr 20, 2015 at 10:41:38AM +0200, Michael Wang wrote: > > > >> Introduce helper cap_ipoib() to help us check if the port of an > >> IB device support IP over Infiniband. > > > > I thought we were dropping this in favor of listing the actual > > features the ULP required unconditionally? One of my messages had the > > start of a list.. ??? I forget. I was arguing that we should not have it. But I thought others disagreed with me so it was left in. V4 of this patch had no responses. https://www.mail-archive.com/linux-rdma@vger.kernel.org/msg24040.html Jason, I can't find the email where you mentioned a list? Ira -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> > > I thought we were dropping this in favor of listing the actual > > > features the ULP required unconditionally? One of my messages had the > > > start of a list.. > > ??? I forget. I was arguing that we should not have it. But I thought > others > disagreed with me so it was left in. I don't remember, but I agree with Jason. The ULPs should check for the features that they need. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Apr 22, 2015 at 10:49:44AM +0200, Michael Wang wrote: > > On 04/22/2015 07:40 AM, Jason Gunthorpe wrote: > > On Mon, Apr 20, 2015 at 10:41:38AM +0200, Michael Wang wrote: > > > >> Introduce helper cap_ipoib() to help us check if the port of an > >> IB device support IP over Infiniband. > > > > I thought we were dropping this in favor of listing the actual > > features the ULP required unconditionally? One of my messages had the > > start of a list.. > > Shall we drop it now or wait until the mechanism introduced? > > Just wondering the requirement of ULP could be similar to the > requirement of management, isn't it? if the device can tell > which ULP it support, then may be a cap_XX() make sense in here? You have to audit the ipoib dirver and see what core functions it calls that have cap requirements themselves. At least SA, multicast and CM. It also requires cap_ib_ah() or whatever we called that. JAson -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 04/22/2015 07:24 PM, Jason Gunthorpe wrote: > On Wed, Apr 22, 2015 at 10:49:44AM +0200, Michael Wang wrote: >> >> On 04/22/2015 07:40 AM, Jason Gunthorpe wrote: >>> On Mon, Apr 20, 2015 at 10:41:38AM +0200, Michael Wang wrote: >>> >>>> Introduce helper cap_ipoib() to help us check if the port of an >>>> IB device support IP over Infiniband. >>> >>> I thought we were dropping this in favor of listing the actual >>> features the ULP required unconditionally? One of my messages had the >>> start of a list.. >> >> Shall we drop it now or wait until the mechanism introduced? >> >> Just wondering the requirement of ULP could be similar to the >> requirement of management, isn't it? if the device can tell >> which ULP it support, then may be a cap_XX() make sense in here? > > You have to audit the ipoib dirver and see what core functions it > calls that have cap requirements themselves. > > At least SA, multicast and CM. It also requires cap_ib_ah() or > whatever we called that. I get your point :-) I'd like to suggest we put these in different threads: 1. bitmask reform 2. ulp check mechanism 3. naming (i think it'll be a really big discussion :-P) Separate them can help us focus on a particular topic at once, and the purpose of patches will be more clear ;-) Regards, Michael Wang > > JAson > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 04/22/2015 06:45 PM, ira.weiny wrote: > On Wed, Apr 22, 2015 at 10:49:44AM +0200, Michael Wang wrote: >> >> On 04/22/2015 07:40 AM, Jason Gunthorpe wrote: >>> On Mon, Apr 20, 2015 at 10:41:38AM +0200, Michael Wang wrote: >>> >>>> Introduce helper cap_ipoib() to help us check if the port of an >>>> IB device support IP over Infiniband. >>> >>> I thought we were dropping this in favor of listing the actual >>> features the ULP required unconditionally? One of my messages had the >>> start of a list.. > > ??? I forget. I was arguing that we should not have it. But I thought others > disagreed with me so it was left in. > > V4 of this patch had no responses. > > https://www.mail-archive.com/linux-rdma@vger.kernel.org/msg24040.html > > Jason, I can't find the email where you mentioned a list? I don't see a list too :-P but agreed the ULP reform idea, the check should be ipoib_init() { if (device don't suport SA or IB CM or...) return error; ... } So I'll put the reform to that series. Regards, Michael Wang > > Ira > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 60b379d..a9812df 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1671,7 +1671,7 @@ static void ipoib_add_one(struct ib_device *device) } for (p = s; p <= e; ++p) { - if (!rdma_tech_ib(device, p)) + if (!cap_ipoib(device, p)) continue; dev = ipoib_add_port("ib%d", device, p); if (!IS_ERR(dev)) { diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 6e354df..d0ae08e 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1863,6 +1863,21 @@ static inline int cap_ib_mcast(struct ib_device *device, u8 port_num) return cap_ib_sa(device, port_num); } +/** + * cap_ipoib - Check if the port of device has the capability + * IP over Infiniband. + * + * @device: Device to be checked + * @port_num: Port number of the device + * + * Return 0 when port of the device don't support + * IP over Infiniband. + */ +static inline int cap_ipoib(struct ib_device *device, u8 port_num) +{ + return rdma_tech_ib(device, port_num); +} + int ib_query_gid(struct ib_device *device, u8 port_num, int index, union ib_gid *gid);
Introduce helper cap_ipoib() to help us check if the port of an IB device support IP over Infiniband. Cc: Hal Rosenstock <hal@dev.mellanox.co.il> Cc: Steve Wise <swise@opengridcomputing.com> Cc: Tom Talpey <tom@talpey.com> Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Cc: Doug Ledford <dledford@redhat.com> Cc: Ira Weiny <ira.weiny@intel.com> Cc: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Michael Wang <yun.wang@profitbricks.com> --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- include/rdma/ib_verbs.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)