[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-rdma
Subject:    Re: [PATCH] ofa_kernel/util madeye.c
From:       Hal Rosenstock <hal.rosenstock () gmail ! com>
Date:       2010-05-26 14:46:35
Message-ID: AANLkTikKroE3HGXAZtWgEEy6YojcKNtP6oWKbZEyt6iJ () mail ! gmail ! com
[Download RAW message or body]

On Wed, May 26, 2010 at 8:42 AM, Mike Heinz <michael.heinz@qlogic.com> wrote:
> I'm resending this - I sent it yesterday, but it doesn't seem to have appeared in \
> the list. 
> ----------
> 
> This is a simple fix. Several of the attribute filters in \
> ./drivers/infiniband/util/madeye.c don't switch the attribute id to host byte order \
> before checking it.

AFAIR there was discussion on this but the work to push madeye
upstream was never done so it is just an EWG patch right now. If there
are no objections (there weren't when the discussion last occurred),
it could also be pushed upstream.

-- Hal

> 
> Signed-off-by: Michael Heinz <michael.heinz@qlogic.com>
> 
> 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");
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic