All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH krping 0/2] krping fixes to work with latest kernels
@ 2013-09-11 14:20 Or Gerlitz
       [not found] ` <1378909224-27399-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Or Gerlitz @ 2013-09-11 14:20 UTC (permalink / raw)
  To: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	realrichardsharpe-Re5JQEeQqe8AvxtiuMwx3w,
	alext-VPRAkNaXOzVWk0Htik3J/w, Or Gerlitz

Hi Steve,

This little series from Alex makes krping from git://git.openfabrics.org/~swise/krping.git
usable for latest upstream kernels, something we find very useful for testing
the upstream RDMA stack when developing variuos features.

Or.

Alex Tabachnik (2):
  Fixes and changes to support latest kernels
  Update Makefile

 Makefile |   33 +++------------------------------
 krping.c |   33 +++++++++++++++++++--------------
 2 files changed, 22 insertions(+), 44 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH krping 1/2] Fixes and changes to support latest kernels
       [not found] ` <1378909224-27399-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2013-09-11 14:20   ` Or Gerlitz
  2013-09-11 14:20   ` [PATCH krping 2/2] Update Makefile Or Gerlitz
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Or Gerlitz @ 2013-09-11 14:20 UTC (permalink / raw)
  To: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	realrichardsharpe-Re5JQEeQqe8AvxtiuMwx3w,
	alext-VPRAkNaXOzVWk0Htik3J/w

From: Alex Tabachnik <alext-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Allow to build on latest upstream kernels

Signed-off-by: Alex Tabachnik <alext-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 krping.c |   33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/krping.c b/krping.c
index 67381af..59900ab 100644
--- a/krping.c
+++ b/krping.c
@@ -45,8 +45,9 @@
 #include <linux/device.h>
 #include <linux/pci.h>
 #include <linux/time.h>
+#include <linux/random.h>
 #include <linux/sched.h>
-#include <asm/system.h>
+#include <linux/proc_fs.h>
 
 #include <asm/atomic.h>
 #include <asm/pci.h>
@@ -542,7 +543,7 @@ static void krping_setup_wr(struct krping_cb *cb)
 	case MW:
 		cb->bind_attr.wr_id = 0xabbaabba;
 		cb->bind_attr.send_flags = 0; /* unsignaled */
-		cb->bind_attr.length = cb->size;
+		cb->bind_attr.bind_info.length = cb->size;
 		break;
 	default:
 		break;
@@ -644,7 +645,7 @@ static int krping_setup_buffers(struct krping_cb *cb)
 				cb->page_list, cb->page_list_len);
 			break;
 		case MW:
-			cb->mw = ib_alloc_mw(cb->pd);
+			cb->mw = ib_alloc_mw(cb->pd, 1);
 			if (IS_ERR(cb->mw)) {
 				DEBUG_LOG(PFX "recv_buf alloc_mw failed\n");
 				ret = PTR_ERR(cb->mw);
@@ -913,15 +914,15 @@ static u32 krping_rdma_rkey(struct krping_cb *cb, u64 buf, int post_inv)
 		 * Update the MW with new buf info.
 		 */
 		if (buf == (u64)cb->start_dma_addr) {
-			cb->bind_attr.mw_access_flags = IB_ACCESS_REMOTE_READ;
-			cb->bind_attr.mr = cb->start_mr;
+			cb->bind_attr.bind_info.mw_access_flags = IB_ACCESS_REMOTE_READ;
+			cb->bind_attr.bind_info.mr = cb->start_mr;
 		} else {
-			cb->bind_attr.mw_access_flags = IB_ACCESS_REMOTE_WRITE;
-			cb->bind_attr.mr = cb->rdma_mr;
+			cb->bind_attr.bind_info.mw_access_flags = IB_ACCESS_REMOTE_WRITE;
+			cb->bind_attr.bind_info.mr = cb->rdma_mr;
 		}
-		cb->bind_attr.addr = buf;
+		cb->bind_attr.bind_info.addr = buf;
 		DEBUG_LOG(PFX "binding mw rkey 0x%x to buf %llx mr rkey 0x%x\n",
-			cb->mw->rkey, buf, cb->bind_attr.mr->rkey);
+			cb->mw->rkey, buf, cb->bind_attr.bind_info.mr->rkey);
 		ret = ib_bind_mw(cb->qp, cb->mw, &cb->bind_attr);
 		if (ret) {
 			printk(KERN_ERR PFX "bind mw error %d\n", ret);
@@ -1962,7 +1963,7 @@ static void krping_fr_test(struct krping_cb *cb)
 			ib_update_fast_reg_key(mr, ++key);
 			fr.wr.fast_reg.rkey = mr->rkey;
 			inv.ex.invalidate_rkey = mr->rkey;
-			size = random32() % cb->size;
+			size = prandom_u32() % cb->size;
 			if (size == 0)
 				size = cb->size;
 			plen = (((size - 1) & PAGE_MASK) + PAGE_SIZE) >> PAGE_SHIFT;
@@ -2294,7 +2295,7 @@ int krping_doit(char *cmd)
 		goto out;
 	}
 
-	cb->cm_id = rdma_create_id(krping_cma_event_handler, cb, RDMA_PS_TCP);
+	cb->cm_id = rdma_create_id(krping_cma_event_handler, cb, RDMA_PS_TCP, IB_QPT_RC);
 	if (IS_ERR(cb->cm_id)) {
 		ret = PTR_ERR(cb->cm_id);
 		printk(KERN_ERR PFX "rdma_create_id error %d\n", ret);
@@ -2389,16 +2390,20 @@ static int krping_write_proc(struct file *file, const char *buffer,
 		return (int) count;
 }
 
+struct file_operations krping_ops = {
+	.owner = THIS_MODULE,
+	.read = krping_read_proc,
+	.write = krping_write_proc
+};
+
 static int __init krping_init(void)
 {
 	DEBUG_LOG("krping_init\n");
-	krping_proc = create_proc_entry("krping", 0666, NULL);
+	krping_proc = proc_create("krping", 0666, NULL, &krping_ops);
 	if (krping_proc == NULL) {
 		printk(KERN_ERR PFX "cannot create /proc/krping\n");
 		return -ENOMEM;
 	}
-	krping_proc->read_proc = krping_read_proc;
-	krping_proc->write_proc = krping_write_proc;
 	return 0;
 }
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH krping 2/2] Update Makefile
       [not found] ` <1378909224-27399-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2013-09-11 14:20   ` [PATCH krping 1/2] Fixes and changes to support " Or Gerlitz
@ 2013-09-11 14:20   ` Or Gerlitz
  2013-09-11 14:32   ` [PATCH krping 0/2] krping fixes to work with latest kernels Steve Wise
  2013-09-11 14:50   ` Steve Wise
  3 siblings, 0 replies; 7+ messages in thread
From: Or Gerlitz @ 2013-09-11 14:20 UTC (permalink / raw)
  To: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	realrichardsharpe-Re5JQEeQqe8AvxtiuMwx3w,
	alext-VPRAkNaXOzVWk0Htik3J/w

From: Alex Tabachnik <alext-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

To allow standalone compilation with latest 3.x kernels

Signed-off-by: Alex Tabachnik <alext-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 Makefile |   33 +++------------------------------
 1 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/Makefile b/Makefile
index abfaeb1..47fa0c0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,42 +1,15 @@
-KSRC=/lib/modules/`uname -r`/source
+KSRC=/lib/modules/`uname -r`/build
 KOBJ=/lib/modules/`uname -r`/build
 
-#
-# Use this if you're building on a OFED system.  Make sure you
-# configure the ofa_kernel-1.3 tree with the options from 
-# /etc/infiniband/info
-#
-OFA=/usr/src/ofa_kernel
-#
-# Use this if you're building against a kernel.org kernel with
-# rdma support enabled.
-# 
-#OFA=$(KSRC)
-#OFA=$(KOBJ)
-
-#
-# Set ARCH to x86 for both i386 and x86_64
-#
-ARCH=x86
-EXTRA_CFLAGS += -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall
-EXTRA_CFLAGS += -I$(OFA)/arch/$(ARCH)/include -I$(OFA)/include -I$(KOBJ)/include -I$(KOBJ)/include2 -I$(KSRC)/include -I.
-EXTRA_CFLAGS += $(shell [ -f $(KOBJ)/include/linux/modversions.h ] && \
-            echo "-DMODVERSIONS -DEXPORT_SYMTAB \
-                  -include $(KSRC)/include/linux/modversions.h")
-EXTRA_CFLAGS += $(shell [ -f $(KOBJ)/include/config/modversions.h ] && \
-            echo "-DMODVERSIONS -DEXPORT_SYMTAB \
-                  -include $(KSRC)/include/config/modversions.h")
 
 obj-m += rdma_krping.o
 rdma_krping-y			:= getopt.o krping.o
 
 default:
-	-cp -f $(OFA)/Module.markers `pwd`
-	-cp -f $(OFA)/Module.symvers `pwd`
-	make -C $(KSRC) O=$(KOBJ) SUBDIRS=$(shell pwd) LINUXINCLUDE='-I$(OFA)/include -Iinclude -include $(KOBJ)/include/linux/autoconf.h -include linux/autoconf.h' modules
+	make -C $(KSRC) M=`pwd` modules
 
 install:
-	make -C $(KSRC) O=$(KOBJ) SUBDIRS=$(shell pwd) modules_install
+	make -C $(KSRC) M=`pwd` modules_install
 	depmod -a
 
 clean:
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH krping 0/2] krping fixes to work with latest kernels
       [not found] ` <1378909224-27399-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2013-09-11 14:20   ` [PATCH krping 1/2] Fixes and changes to support " Or Gerlitz
  2013-09-11 14:20   ` [PATCH krping 2/2] Update Makefile Or Gerlitz
@ 2013-09-11 14:32   ` Steve Wise
       [not found]     ` <52307EED.9070008-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
  2013-09-11 14:50   ` Steve Wise
  3 siblings, 1 reply; 7+ messages in thread
From: Steve Wise @ 2013-09-11 14:32 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	realrichardsharpe-Re5JQEeQqe8AvxtiuMwx3w,
	alext-VPRAkNaXOzVWk0Htik3J/w

On 9/11/2013 9:20 AM, Or Gerlitz wrote:
> Hi Steve,
>
> This little series from Alex makes krping from git://git.openfabrics.org/~swise/krping.git
> usable for latest upstream kernels, something we find very useful for testing
> the upstream RDMA stack when developing variuos features.
>
> Or.
>
> Alex Tabachnik (2):
>    Fixes and changes to support latest kernels
>    Update Makefile
>
>   Makefile |   33 +++------------------------------
>   krping.c |   33 +++++++++++++++++++--------------
>   2 files changed, 22 insertions(+), 44 deletions(-)
>
>

Hey Or/Alex,

Thanks for these fixes.  What HW did you test on?

Steve.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH krping 0/2] krping fixes to work with latest kernels
       [not found] ` <1378909224-27399-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
                     ` (2 preceding siblings ...)
  2013-09-11 14:32   ` [PATCH krping 0/2] krping fixes to work with latest kernels Steve Wise
@ 2013-09-11 14:50   ` Steve Wise
       [not found]     ` <5230832F.6020502-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
  3 siblings, 1 reply; 7+ messages in thread
From: Steve Wise @ 2013-09-11 14:50 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	realrichardsharpe-Re5JQEeQqe8AvxtiuMwx3w,
	alext-VPRAkNaXOzVWk0Htik3J/w

On 9/11/2013 9:20 AM, Or Gerlitz wrote:
> Hi Steve,
>
> This little series from Alex makes krping from git://git.openfabrics.org/~swise/krping.git
> usable for latest upstream kernels, something we find very useful for testing
> the upstream RDMA stack when developing variuos features.
>
> Or.
>
> Alex Tabachnik (2):
>    Fixes and changes to support latest kernels
>    Update Makefile
>
>   Makefile |   33 +++------------------------------
>   krping.c |   33 +++++++++++++++++++--------------
>   2 files changed, 22 insertions(+), 44 deletions(-)

Applied, thanks!

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH krping 0/2] krping fixes to work with latest kernels
       [not found]     ` <5230832F.6020502-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
@ 2013-09-11 14:57       ` Alex Tabachnik
  0 siblings, 0 replies; 7+ messages in thread
From: Alex Tabachnik @ 2013-09-11 14:57 UTC (permalink / raw)
  To: Steve Wise, Or Gerlitz
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	realrichardsharpe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Roi Dayan, Oren Duer

Hi,
Also credit should be given to Roi Dayan (roid-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org) - it was our joint work.

Thank you,

Alex

-----Original Message-----
From: Steve Wise [mailto:swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org] 
Sent: Wednesday, September 11, 2013 5:50 PM
To: Or Gerlitz
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; realrichardsharpe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; Alex Tabachnik
Subject: Re: [PATCH krping 0/2] krping fixes to work with latest kernels

On 9/11/2013 9:20 AM, Or Gerlitz wrote:
> Hi Steve,
>
> This little series from Alex makes krping from 
> git://git.openfabrics.org/~swise/krping.git
> usable for latest upstream kernels, something we find very useful for 
> testing the upstream RDMA stack when developing variuos features.
>
> Or.
>
> Alex Tabachnik (2):
>    Fixes and changes to support latest kernels
>    Update Makefile
>
>   Makefile |   33 +++------------------------------
>   krping.c |   33 +++++++++++++++++++--------------
>   2 files changed, 22 insertions(+), 44 deletions(-)

Applied, thanks!

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH krping 0/2] krping fixes to work with latest kernels
       [not found]     ` <52307EED.9070008-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
@ 2013-09-11 14:59       ` Or Gerlitz
  0 siblings, 0 replies; 7+ messages in thread
From: Or Gerlitz @ 2013-09-11 14:59 UTC (permalink / raw)
  To: Steve Wise
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	realrichardsharpe-Re5JQEeQqe8AvxtiuMwx3w,
	alext-VPRAkNaXOzVWk0Htik3J/w

On 11/09/2013 17:32, Steve Wise wrote:
> What HW did you test on? 
Connect-IB HW, mlx5  driver
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-09-11 14:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11 14:20 [PATCH krping 0/2] krping fixes to work with latest kernels Or Gerlitz
     [not found] ` <1378909224-27399-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-09-11 14:20   ` [PATCH krping 1/2] Fixes and changes to support " Or Gerlitz
2013-09-11 14:20   ` [PATCH krping 2/2] Update Makefile Or Gerlitz
2013-09-11 14:32   ` [PATCH krping 0/2] krping fixes to work with latest kernels Steve Wise
     [not found]     ` <52307EED.9070008-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2013-09-11 14:59       ` Or Gerlitz
2013-09-11 14:50   ` Steve Wise
     [not found]     ` <5230832F.6020502-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2013-09-11 14:57       ` Alex Tabachnik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.