[ofa-general] struct ib_sge, how to dump buffer from kernel
Thierry
chocapiiic.tiery at gmail.com
Thu May 7 06:58:54 PDT 2009
Hi,
I am trying to make a kernel module in order to monitor communication
threw infiniband device: my goal is to monitor as many things as I can
from kernel space.
I have implemented a simple module which can send data from kernel
space to user space using netlink socket.
I think the best palce to extract information is inside the
ib_post_send function in driver/infiniband/hw/mlx4/qp.c were there is
a ib_send_wr structure.
But I have some trouble to read data from kernel :
I have already made a trap in libibverbs (cmd_post_send function), and
I have been able to read struct ibv_send_wr and also
ibv_send_wr->ibv_sge->addr
But in kernel space, I can't read data in ib_send_wr->ib_sge->addr and
I don't understand why :
I made a memcpy of addr, using the length in ib_sge->length, and then
print it with printk %s.
Does ibv_send_wr structure is a copy of ibv_send_wr but in kernel_space?*
How does a memory adress looks like?
Do you have any references I can read in order to understand memorry adressing ?
Regards,
Thierry
---
char foo[wr->sg_list->length];
memcpy(foo, wr->sg_list->addr, wr->sg_list->length);
printk(KERN_INFO "buffer: %s\n", foo);
More information about the general
mailing list