* [PATCH] ibsim: Do not return allportselect for non-switches
@ 2013-06-19 0:51 Albert Chu
[not found] ` <1371603068.19017.95.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Albert Chu @ 2013-06-19 0:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
ibsim only supports allportselect (i.e. port 0xff) for switches
but not HCAs. However the allportselect flag would be returned
for all classportinfo requests, leading to unexpected results
when running some infiniband-diag tools against ibsim.
Signed-off-by: Albert L. Chu <chu11-i2BcT+NCU+M@public.gmane.org>
---
ibsim/sim_mad.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ibsim/sim_mad.c b/ibsim/sim_mad.c
index 0b52c52..223d507 100644
--- a/ibsim/sim_mad.c
+++ b/ibsim/sim_mad.c
@@ -235,6 +235,7 @@ static int reply_MAD(void *buf, ib_rpc_t * rpc, ib_dr_path_t * path,
static int do_cpi(Port * port, unsigned op, uint32_t mod, uint8_t * data)
{
+ Node *node = port->node;
int status = 0;
if (op != IB_MAD_METHOD_GET)
@@ -242,7 +243,10 @@ static int do_cpi(Port * port, unsigned op, uint32_t mod, uint8_t * data)
memset(data, 0, IB_SMP_DATA_SIZE);
mad_set_field(data, 0, IB_CPI_BASEVER_F, 1);
mad_set_field(data, 0, IB_CPI_CLASSVER_F, 1);
- mad_set_field(data, 0, IB_CPI_CAPMASK_F, 0x300);
+ if (node->type != SWITCH_NODE)
+ mad_set_field(data, 0, IB_CPI_CAPMASK_F, 0x200);
+ else
+ mad_set_field(data, 0, IB_CPI_CAPMASK_F, 0x300);
mad_set_field(data, 0, IB_CPI_RESP_TIME_VALUE_F, 0x12);
return status;
}
--
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] 2+ messages in thread
* Re: [PATCH] ibsim: Do not return allportselect for non-switches
[not found] ` <1371603068.19017.95.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
@ 2013-06-19 18:12 ` Hal Rosenstock
0 siblings, 0 replies; 2+ messages in thread
From: Hal Rosenstock @ 2013-06-19 18:12 UTC (permalink / raw)
To: Albert Chu; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
On 6/18/2013 8:51 PM, Albert Chu wrote:
> ibsim only supports allportselect (i.e. port 0xff) for switches
> but not HCAs. However the allportselect flag would be returned
> for all classportinfo requests, leading to unexpected results
> when running some infiniband-diag tools against ibsim.
>
> Signed-off-by: Albert L. Chu <chu11-i2BcT+NCU+M@public.gmane.org>
Thanks. Applied.
-- Hal
--
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] 2+ messages in thread
end of thread, other threads:[~2013-06-19 18:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-19 0:51 [PATCH] ibsim: Do not return allportselect for non-switches Albert Chu
[not found] ` <1371603068.19017.95.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
2013-06-19 18:12 ` Hal Rosenstock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox