[openib-general][PATCH][kdapltest]: DAT_MEM_TYPE_IA support and ref count
Guy German
guyg at voltaire.com
Thu Aug 4 08:03:00 PDT 2005
James,
Here are the kdapltest patches, resent.
changes conclude:
1. allow DAT_MEM_TYPE_IA support on server side
2. kdapltest module ref count fix from 2.4 API to 2.6 API
Signed-off-by: Guy German <guyg at voltaire.com>
Index: dapltest/test/dapl_server.c
===================================================================
--- dapltest/test/dapl_server.c (revision 2981)
+++ dapltest/test/dapl_server.c (working copy)
@@ -232,7 +232,12 @@ DT_cs_Server (Params_t * params_ptr)
* Create two buffers, large enough to hold ClientInfo and the largest
* command we'll use.
*/
- ps_ptr->bpool = DT_BpoolAlloc (NULL,
+ if (!(pt_ptr = DT_Alloc_Per_Test_Data (phead)))
+ goto server_exit;
+ DT_MemListInit (pt_ptr);
+ memcpy ((void *)(uintptr_t) &pt_ptr->Params,
+ (const void *) params_ptr, sizeof (Params_t));
+ ps_ptr->bpool = DT_BpoolAlloc (pt_ptr,
phead,
ps_ptr->ia,
ps_ptr->pz,
Index: dapltest/cmd/dapl_transaction_cmd.c
===================================================================
--- dapltest/cmd/dapl_transaction_cmd.c (revision 2981)
+++ dapltest/cmd/dapl_transaction_cmd.c (working copy)
@@ -243,8 +243,7 @@ DT_Transaction_Cmd_Usage (void)
DT_Mdep_printf ("USAGE: (EC == QOS_ECONOMY)\n");
DT_Mdep_printf ("USAGE: (PM == QOS_PREMIUM)\n");
DT_Mdep_printf ("USAGE: [-M <Memory type>]\n");
- DT_Mdep_printf ("USAGE: (VIR == DAT_MEM_TYPE_VIRTUAL - Default)\n");
- DT_Mdep_printf ("USAGE: (PHY == DAT_MEM_TYPE_PHYSICAL)\n");
+ DT_Mdep_printf ("USAGE: (PHY == DAT_MEM_TYPE_PHYSICAL - Default)\n");
DT_Mdep_printf ("USAGE: (IA == DAT_MEM_TYPE_IA)\n");
DT_Mdep_printf ("USAGE: (FMR == DAT_MEM_TYPE_PLATFORM)\n");
DT_Mdep_printf ("USAGE: (BP == DAT_MEM_TYPE_BYPASS)\n");
Index: dapltest/kdapl/kdapl_module.c
===================================================================
--- dapltest/kdapl/kdapl_module.c (revision 2981)
+++ dapltest/kdapl/kdapl_module.c (working copy)
@@ -53,17 +53,13 @@ int g_status;
static int kdapltest_open(struct inode *inode, struct file *file)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_INC_USE_COUNT;
-#endif
+ try_module_get(THIS_MODULE);
return 0;
}
static int kdapltest_release(struct inode *inode, struct file *file)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_DEC_USE_COUNT;
-#endif
+ module_put(THIS_MODULE);
return 0;
}
-------------- next part --------------
Index: dapltest/test/dapl_server.c
===================================================================
--- dapltest/test/dapl_server.c (revision 2981)
+++ dapltest/test/dapl_server.c (working copy)
@@ -232,7 +232,12 @@ DT_cs_Server (Params_t * params_ptr)
* Create two buffers, large enough to hold ClientInfo and the largest
* command we'll use.
*/
- ps_ptr->bpool = DT_BpoolAlloc (NULL,
+ if (!(pt_ptr = DT_Alloc_Per_Test_Data (phead)))
+ goto server_exit;
+ DT_MemListInit (pt_ptr);
+ memcpy ((void *)(uintptr_t) &pt_ptr->Params,
+ (const void *) params_ptr, sizeof (Params_t));
+ ps_ptr->bpool = DT_BpoolAlloc (pt_ptr,
phead,
ps_ptr->ia,
ps_ptr->pz,
Index: dapltest/cmd/dapl_transaction_cmd.c
===================================================================
--- dapltest/cmd/dapl_transaction_cmd.c (revision 2981)
+++ dapltest/cmd/dapl_transaction_cmd.c (working copy)
@@ -243,8 +243,7 @@ DT_Transaction_Cmd_Usage (void)
DT_Mdep_printf ("USAGE: (EC == QOS_ECONOMY)\n");
DT_Mdep_printf ("USAGE: (PM == QOS_PREMIUM)\n");
DT_Mdep_printf ("USAGE: [-M <Memory type>]\n");
- DT_Mdep_printf ("USAGE: (VIR == DAT_MEM_TYPE_VIRTUAL - Default)\n");
- DT_Mdep_printf ("USAGE: (PHY == DAT_MEM_TYPE_PHYSICAL)\n");
+ DT_Mdep_printf ("USAGE: (PHY == DAT_MEM_TYPE_PHYSICAL - Default)\n");
DT_Mdep_printf ("USAGE: (IA == DAT_MEM_TYPE_IA)\n");
DT_Mdep_printf ("USAGE: (FMR == DAT_MEM_TYPE_PLATFORM)\n");
DT_Mdep_printf ("USAGE: (BP == DAT_MEM_TYPE_BYPASS)\n");
Index: dapltest/kdapl/kdapl_module.c
===================================================================
--- dapltest/kdapl/kdapl_module.c (revision 2981)
+++ dapltest/kdapl/kdapl_module.c (working copy)
@@ -53,17 +53,13 @@ int g_status;
static int kdapltest_open(struct inode *inode, struct file *file)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_INC_USE_COUNT;
-#endif
+ try_module_get(THIS_MODULE);
return 0;
}
static int kdapltest_release(struct inode *inode, struct file *file)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_DEC_USE_COUNT;
-#endif
+ module_put(THIS_MODULE);
return 0;
}
More information about the general
mailing list