Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-27 Thread Michael Wang
On 03/27/2015 04:55 PM, Jason Gunthorpe wrote: > On Fri, Mar 27, 2015 at 10:52:10AM +0100, Michael Wang wrote: >> [snip] > So, in principle, testing the device should almost make sense. The > device is the container for things like PD's MR's and QP's and those > things can migrate between the

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-27 Thread Jason Gunthorpe
On Fri, Mar 27, 2015 at 10:52:10AM +0100, Michael Wang wrote: > Basically I found there are three kind of check in current > implementation: > > 1. check transport type of device only > I'd like to use helper has_XX(device) > which means some port of the device has XX capability. > > 2.

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-27 Thread Michael Wang
Hi, Jason Thanks for the reply :-) On 03/26/2015 10:13 PM, Jason Gunthorpe wrote: > On Thu, Mar 26, 2015 at 05:58:20PM +0100, Michael Wang wrote: > >> The questions is just wondering how the transition method could be, but >> if we have to do the changes for vendor, that sounds like a tough

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-27 Thread Michael Wang
Hi, Jason Thanks for the reply :-) On 03/26/2015 10:13 PM, Jason Gunthorpe wrote: On Thu, Mar 26, 2015 at 05:58:20PM +0100, Michael Wang wrote: The questions is just wondering how the transition method could be, but if we have to do the changes for vendor, that sounds like a tough job... I

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-27 Thread Jason Gunthorpe
On Fri, Mar 27, 2015 at 10:52:10AM +0100, Michael Wang wrote: Basically I found there are three kind of check in current implementation: 1. check transport type of device only I'd like to use helper has_XX(device) which means some port of the device has XX capability. 2. check

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-27 Thread Michael Wang
On 03/27/2015 04:55 PM, Jason Gunthorpe wrote: On Fri, Mar 27, 2015 at 10:52:10AM +0100, Michael Wang wrote: [snip] So, in principle, testing the device should almost make sense. The device is the container for things like PD's MR's and QP's and those things can migrate between the ports

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-26 Thread Jason Gunthorpe
On Thu, Mar 26, 2015 at 05:58:20PM +0100, Michael Wang wrote: > The questions is just wondering how the transition method could be, but > if we have to do the changes for vendor, that sounds like a tough job... I would see changing how the information is represented in the struct as a follow on

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-26 Thread Michael Wang
On 03/26/2015 05:27 PM, Doug Ledford wrote: > On Thu, 2015-03-26 at 17:04 +0100, Michael Wang wrote: >> [snip] >> >> Few more questions here is: >> 1. when to setup? (maybe inside ib_register_device() before doing >> client->add() callback?) > I don't think "we" can set it up here. The driver's

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-26 Thread Doug Ledford
On Thu, 2015-03-26 at 17:04 +0100, Michael Wang wrote: > Hi, Doug > > Thanks for the excellent comments :-) > > On 03/26/2015 03:09 PM, Doug Ledford wrote: > > On Wed, 2015-03-25 at 16:09 +0100, Michael Wang wrote: > >> [snip] > >> > > [snip] > > > > So, I would suggest that we fix things up

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-26 Thread Michael Wang
Hi, Doug Thanks for the excellent comments :-) On 03/26/2015 03:09 PM, Doug Ledford wrote: > On Wed, 2015-03-25 at 16:09 +0100, Michael Wang wrote: >> [snip] >> > [snip] > > So, I would suggest that we fix things up thusly: > > enum transport { > TRANSPORT_IB=1, > TRANSPORT_IWARP=2,

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-26 Thread Doug Ledford
On Wed, 2015-03-25 at 16:09 +0100, Michael Wang wrote: > My sincerely apologies for the corrupted mails, and thanks for Dan's kindly > remind :-) > > There are too many lengthy code to check the transport type of IB device, > or the link layer type of it's port, this patch set try to use some

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-26 Thread Doug Ledford
On Thu, 2015-03-26 at 17:04 +0100, Michael Wang wrote: Hi, Doug Thanks for the excellent comments :-) On 03/26/2015 03:09 PM, Doug Ledford wrote: On Wed, 2015-03-25 at 16:09 +0100, Michael Wang wrote: [snip] [snip] So, I would suggest that we fix things up thusly: enum

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-26 Thread Michael Wang
On 03/26/2015 05:27 PM, Doug Ledford wrote: On Thu, 2015-03-26 at 17:04 +0100, Michael Wang wrote: [snip] Few more questions here is: 1. when to setup? (maybe inside ib_register_device() before doing client-add() callback?) I don't think we can set it up here. The driver's have to set it

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-26 Thread Michael Wang
Hi, Doug Thanks for the excellent comments :-) On 03/26/2015 03:09 PM, Doug Ledford wrote: On Wed, 2015-03-25 at 16:09 +0100, Michael Wang wrote: [snip] [snip] So, I would suggest that we fix things up thusly: enum transport { TRANSPORT_IB=1, TRANSPORT_IWARP=2,

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-26 Thread Jason Gunthorpe
On Thu, Mar 26, 2015 at 05:58:20PM +0100, Michael Wang wrote: The questions is just wondering how the transition method could be, but if we have to do the changes for vendor, that sounds like a tough job... I would see changing how the information is represented in the struct as a follow on

Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-26 Thread Doug Ledford
On Wed, 2015-03-25 at 16:09 +0100, Michael Wang wrote: My sincerely apologies for the corrupted mails, and thanks for Dan's kindly remind :-) There are too many lengthy code to check the transport type of IB device, or the link layer type of it's port, this patch set try to use some helper

[PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-25 Thread Michael Wang
My sincerely apologies for the corrupted mails, and thanks for Dan's kindly remind :-) There are too many lengthy code to check the transport type of IB device, or the link layer type of it's port, this patch set try to use some helper to refine and save us some code. TODO: Currently we

[PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer

2015-03-25 Thread Michael Wang
My sincerely apologies for the corrupted mails, and thanks for Dan's kindly remind :-) There are too many lengthy code to check the transport type of IB device, or the link layer type of it's port, this patch set try to use some helper to refine and save us some code. TODO: Currently we