I'm resending this, because it seems to have been overlooked.

The linux-rdma group does not feel madeye should be added to the upstream 
kernel, but there are still bugs in the version of madeye that we include in 
OFED. This patch should be applied to the OFED version of madeye.c.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Mike Heinz
Sent: Wednesday, May 26, 2010 4:01 PM
To: [email protected]
Subject: [ewg] [PATCH] ofa_kernel madeye.c

This is a simple fix. Several of the snoop filters in 
./drivers/infiniband/util/madeye.c don't switch the attribute id to host byte 
order before checking it. 

Signed-off-by: Michael Heinz <[email protected]>

diff --git a/drivers/infiniband/util/madeye.c b/drivers/infiniband/util/madeye.c
index 0cda06c..2c650a3 100644
--- a/drivers/infiniband/util/madeye.c
+++ b/drivers/infiniband/util/madeye.c
@@ -401,7 +401,7 @@ static void snoop_smi_handler(struct ib_mad_agent 
*mad_agent,
 
        if (!smp && hdr->mgmt_class != mgmt_class)
                return;
-       if (attr_id && hdr->attr_id != attr_id)
+       if (attr_id && be16_to_cpu(hdr->attr_id) != attr_id)
                return;
 
        printk("Madeye:sent SMP\n");
@@ -413,7 +413,7 @@ static void recv_smi_handler(struct ib_mad_agent *mad_agent,
 {
        if (!smp && mad_recv_wc->recv_buf.mad->mad_hdr.mgmt_class != mgmt_class)
                return;
-       if (attr_id && mad_recv_wc->recv_buf.mad->mad_hdr.attr_id != attr_id)
+       if (attr_id && be16_to_cpu(mad_recv_wc->recv_buf.mad->mad_hdr.attr_id) 
!= attr_id)
                return;
 
        printk("Madeye:recv SMP\n");
@@ -446,7 +446,7 @@ static void snoop_gsi_handler(struct ib_mad_agent 
*mad_agent,
 
        if (!gmp && hdr->mgmt_class != mgmt_class)
                return;
-       if (attr_id && hdr->attr_id != attr_id)
+       if (attr_id && be16_to_cpu(hdr->attr_id) != attr_id)
                return;
 
        printk("Madeye:sent GMP\n");
@@ -468,7 +468,7 @@ static void recv_gsi_handler(struct ib_mad_agent *mad_agent,
 
        if (!gmp && hdr->mgmt_class != mgmt_class)
                return;
-       if (attr_id && mad_recv_wc->recv_buf.mad->mad_hdr.attr_id != attr_id)
+       if (attr_id && be16_to_cpu(mad_recv_wc->recv_buf.mad->mad_hdr.attr_id) 
!= attr_id)
                return;
 
        printk("Madeye:recv GMP\n");
_______________________________________________
ewg mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg
_______________________________________________
ewg mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg

Reply via email to