Re: [openib-general] abi_version file not created on SLES9SP3 or RHEL4U4

2007-01-20 Thread Steve Wise
Your mailer garbled this patch.  Can you please email me this as an
attachment, or make sure your email client doesn't do line wrapping?

Thanks,

Steve.


On Fri, 2007-01-19 at 11:06 -0800, Woodruff, Robert J wrote:
> Steve wrote,
> >Sean,
> 
> >I'm testing the latest ofed_1_2 code on RHEL4U4 and SLES9SP3.  After
> >loading the rdma_ucm module, there isn't a abi_version file installed
> >in /sys/class/misc/rdma_cm.  There is no error logged from the ucma so
> I
> >_think_ it created the file ok in ucma_init(). 
> 
> >Have you seen this?  
> 
> I ran into the same problem when backporting Sean's latest
> multicast+sa_cache
> branches to EL4.
> 
> This backport patch can be applied to sean's latest code to
> allow it to work on EL4.
> I also had to make other fixes to get Sean latest code base to work on
> EL4
> My complete backport patch set is located in my directory on the open
> fabrics
> server under, 
> /home/woody/ofa_patches_and_backports/trunk/kernel/backports/EL4-U4
> 
> 
> diff -Naurp linux-2.6.9/drivers/infiniband/core/ucma.c
> linux-2.6.9-openib-drivers-git011107-fixups/drivers/infiniband/core/ucma
> .c
> --- linux-2.6.9/drivers/infiniband/core/ucma.c  2007-01-11
> 15:54:57.0 -0800
> +++
> linux-2.6.9-openib-drivers-git011107-fixups/drivers/infiniband/core/ucma
> .c  2007-01-12 13:19:15.0 -0800
> @@ -1034,13 +1034,13 @@ static struct miscdevice ucma_misc = {
> .fops   = &ucma_fops,
>  };
> 
> -static ssize_t show_abi_version(struct device *dev,
> -   struct device_attribute *attr,
> -   char *buf)
> +static struct class *ucma_class;
> +static ssize_t show_abi_version(struct class *class_dev, char *buf)
>  {
> -   return sprintf(buf, "%d\n", RDMA_USER_CM_ABI_VERSION);
> +return sprintf(buf, "%d\n", RDMA_USER_CM_ABI_VERSION);
>  }
> -static DEVICE_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
> +static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
> +
> 
>  static int __init ucma_init(void)
>  {
> @@ -1050,22 +1050,28 @@ static int __init ucma_init(void)
> if (ret)
> return ret;
> 
> -   ret = device_create_file(ucma_misc.this_device,
> &dev_attr_abi_version);
> -   if (ret) {
> -   printk(KERN_ERR "rdma_ucm: couldn't create abi_version
> attr\n");
> -   goto err;
> -   }
> -   return 0;
> +ucma_class = class_create(THIS_MODULE, "infiniband_ucma");
> +if (IS_ERR(ucma_class)) {
> +printk(KERN_ERR "rdma_ucm: couldn't create class
> infiniband_ucma\n");
> +goto err;
> +}
> +
> +ret = class_create_file(ucma_class, &class_attr_abi_version);
> +if (ret) {
> +printk(KERN_ERR "user_verbs: couldn't create
> abi_version attribute\n");
> +goto err;
> +}
> +
> +return 0;
>  err:
> -   misc_deregister(&ucma_misc);
> -   return ret;
> +misc_deregister(&ucma_misc);
> +return ret;
>  }
> 
> +
>  static void __exit ucma_cleanup(void)
>  {
> -   device_remove_file(ucma_misc.this_device,
> &dev_attr_abi_version);
> misc_deregister(&ucma_misc);
> -   idr_destroy(&ctx_idr);
>  }
> 
>  module_init(ucma_init); 


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] abi_version file not created on SLES9SP3 or RHEL4U4

2007-01-19 Thread Woodruff, Robert J
Steve wrote,
>Sean,

>I'm testing the latest ofed_1_2 code on RHEL4U4 and SLES9SP3.  After
>loading the rdma_ucm module, there isn't a abi_version file installed
>in /sys/class/misc/rdma_cm.  There is no error logged from the ucma so
I
>_think_ it created the file ok in ucma_init(). 

>Have you seen this?  

I ran into the same problem when backporting Sean's latest
multicast+sa_cache
branches to EL4.

This backport patch can be applied to sean's latest code to
allow it to work on EL4.
I also had to make other fixes to get Sean latest code base to work on
EL4
My complete backport patch set is located in my directory on the open
fabrics
server under, 
/home/woody/ofa_patches_and_backports/trunk/kernel/backports/EL4-U4


diff -Naurp linux-2.6.9/drivers/infiniband/core/ucma.c
linux-2.6.9-openib-drivers-git011107-fixups/drivers/infiniband/core/ucma
.c
--- linux-2.6.9/drivers/infiniband/core/ucma.c  2007-01-11
15:54:57.0 -0800
+++
linux-2.6.9-openib-drivers-git011107-fixups/drivers/infiniband/core/ucma
.c  2007-01-12 13:19:15.0 -0800
@@ -1034,13 +1034,13 @@ static struct miscdevice ucma_misc = {
.fops   = &ucma_fops,
 };

-static ssize_t show_abi_version(struct device *dev,
-   struct device_attribute *attr,
-   char *buf)
+static struct class *ucma_class;
+static ssize_t show_abi_version(struct class *class_dev, char *buf)
 {
-   return sprintf(buf, "%d\n", RDMA_USER_CM_ABI_VERSION);
+return sprintf(buf, "%d\n", RDMA_USER_CM_ABI_VERSION);
 }
-static DEVICE_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
+static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
+

 static int __init ucma_init(void)
 {
@@ -1050,22 +1050,28 @@ static int __init ucma_init(void)
if (ret)
return ret;

-   ret = device_create_file(ucma_misc.this_device,
&dev_attr_abi_version);
-   if (ret) {
-   printk(KERN_ERR "rdma_ucm: couldn't create abi_version
attr\n");
-   goto err;
-   }
-   return 0;
+ucma_class = class_create(THIS_MODULE, "infiniband_ucma");
+if (IS_ERR(ucma_class)) {
+printk(KERN_ERR "rdma_ucm: couldn't create class
infiniband_ucma\n");
+goto err;
+}
+
+ret = class_create_file(ucma_class, &class_attr_abi_version);
+if (ret) {
+printk(KERN_ERR "user_verbs: couldn't create
abi_version attribute\n");
+goto err;
+}
+
+return 0;
 err:
-   misc_deregister(&ucma_misc);
-   return ret;
+misc_deregister(&ucma_misc);
+return ret;
 }

+
 static void __exit ucma_cleanup(void)
 {
-   device_remove_file(ucma_misc.this_device,
&dev_attr_abi_version);
misc_deregister(&ucma_misc);
-   idr_destroy(&ctx_idr);
 }

 module_init(ucma_init); 

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] abi_version file not created on SLES9SP3 or RHEL4U4

2007-01-19 Thread Steve Wise
On Fri, 2007-01-19 at 10:48 -0800, Sean Hefty wrote:
> >I'm testing the latest ofed_1_2 code on RHEL4U4 and SLES9SP3.  After
> >loading the rdma_ucm module, there isn't a abi_version file installed
> >in /sys/class/misc/rdma_cm.  There is no error logged from the ucma so I
> >_think_ it created the file ok in ucma_init().
> >
> >Have you seen this?
> 
> I think the issue is that there's not a /sys/class/misc, but the kernels have
> been patched enough to appear that things work.  Woody likely has more details
> on this, as I know this is one of the areas that he has to modify as part of
> creating his backport patches.
> 
> The librdmacm works around this by looking in /sys/class/infiniband_ucma as
> well, and if that fails, just assumes the latest version of the ABI.  The
> backport patches create the abi file under infiniband_ucma.
> 
> - Sean

There's /sys/class/misc/rdma_cm/dev file but no abi_version, and there
is no /sys/class/infiniband_ucma directory.  I didn't see any backport
patches that affect this, but maybe I missed it.




___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] abi_version file not created on SLES9SP3 or RHEL4U4

2007-01-19 Thread Sean Hefty
>I'm testing the latest ofed_1_2 code on RHEL4U4 and SLES9SP3.  After
>loading the rdma_ucm module, there isn't a abi_version file installed
>in /sys/class/misc/rdma_cm.  There is no error logged from the ucma so I
>_think_ it created the file ok in ucma_init().
>
>Have you seen this?

I think the issue is that there's not a /sys/class/misc, but the kernels have
been patched enough to appear that things work.  Woody likely has more details
on this, as I know this is one of the areas that he has to modify as part of
creating his backport patches.

The librdmacm works around this by looking in /sys/class/infiniband_ucma as
well, and if that fails, just assumes the latest version of the ABI.  The
backport patches create the abi file under infiniband_ucma.

- Sean

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] abi_version file not created on SLES9SP3 or RHEL4U4

2007-01-19 Thread Steve Wise
Sean,

I'm testing the latest ofed_1_2 code on RHEL4U4 and SLES9SP3.  After
loading the rdma_ucm module, there isn't a abi_version file installed
in /sys/class/misc/rdma_cm.  There is no error logged from the ucma so I
_think_ it created the file ok in ucma_init(). 

Have you seen this?  


Steve.


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general