From: Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: 'Eli Cohen' <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>,
Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
Linux RDMA list
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCHv7 2/9] ib_core: RoCEE support only QP1
Date: Wed, 6 Jan 2010 17:55:34 +0200 [thread overview]
Message-ID: <20100106155534.GA21738@mtls03> (raw)
In-Reply-To: <3C9FA4CD26174188832FDD339D658C66-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
Sean, you're right. These conditionals are not required as RoCEE and
IB have the same node transport type. All that needs to be done is
remove them. I'll fix that.
On Tue, Jan 05, 2010 at 03:00:09PM -0800, Sean Hefty wrote:
> >@@ -2941,21 +2960,24 @@ static void ib_mad_init_device(struct ib_device
>
> This is at the top of ib_mad_init_device():
>
> if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
> return;
> ...
>
> >*device)
> > return;
> >
> > error_agent:
> >- if (ib_mad_port_close(device, i))
> >- printk(KERN_ERR PFX "Couldn't close %s port %d\n",
> >- device->name, i);
> >+ if (rdma_node_get_transport(device->node_type) == RDMA_TRANSPORT_IB)
>
> ... so this if statement will always be true. Using rdma_port_link_layer()
> doesn't seem quite right for QP 1 support, so I'm not sure that you want this
> check at all.
>
> >+ if (ib_mad_port_close(device, i))
> >+ printk(KERN_ERR PFX "Couldn't close %s port %d\n",
> >+ device->name, i);
> >
> > error:
> > i--;
> >
> > while (i >= start) {
> >- if (ib_agent_port_close(device, i))
> >- printk(KERN_ERR PFX "Couldn't close %s port %d "
> >- "for agents\n",
> >- device->name, i);
> >- if (ib_mad_port_close(device, i))
> >- printk(KERN_ERR PFX "Couldn't close %s port %d\n",
> >- device->name, i);
> >+ if (rdma_node_get_transport(device->node_type) ==
> >RDMA_TRANSPORT_IB) {
>
> Same here.
>
> >+ if (ib_agent_port_close(device, i))
> >+ printk(KERN_ERR PFX "Couldn't close %s port %d "
> >+ "for agents\n",
> >+ device->name, i);
> >+ if (ib_mad_port_close(device, i))
> >+ printk(KERN_ERR PFX "Couldn't close %s port
> %d\n",
> >+ device->name, i);
> >+ }
> > i--;
> > }
> > }
> >@@ -2972,13 +2994,15 @@ static void ib_mad_remove_device(struct ib_device
> >*device)
> > cur_port = 1;
> > }
> > for (i = 0; i < num_ports; i++, cur_port++) {
> >- if (ib_agent_port_close(device, cur_port))
> >- printk(KERN_ERR PFX "Couldn't close %s port %d "
> >- "for agents\n",
> >- device->name, cur_port);
> >- if (ib_mad_port_close(device, cur_port))
> >- printk(KERN_ERR PFX "Couldn't close %s port %d\n",
> >- device->name, cur_port);
> >+ if (rdma_node_get_transport(device->node_type) ==
> >RDMA_TRANSPORT_IB) {
>
> It would be more efficient to move this check outside of the for loop, similar
> to the check in ib_mad_init_device().
>
> >+ if (ib_agent_port_close(device, cur_port))
> >+ printk(KERN_ERR PFX "Couldn't close %s port %d "
> >+ "for agents\n",
> >+ device->name, cur_port);
> >+ if (ib_mad_port_close(device, cur_port))
> >+ printk(KERN_ERR PFX "Couldn't close %s port
> %d\n",
> >+ device->name, cur_port);
> >+ }
> > }
> > }
> >
>
> --
> 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
--
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
prev parent reply other threads:[~2010-01-06 15:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-05 10:32 [PATCHv7 2/9] ib_core: RoCEE support only QP1 Eli Cohen
2010-01-05 23:00 ` Sean Hefty
[not found] ` <3C9FA4CD26174188832FDD339D658C66-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2010-01-06 15:55 ` Eli Cohen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100106155534.GA21738@mtls03 \
--to=eli-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
--cc=eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox