* [PATCH rdma-core 1/3] srp_daemon/srp_daemon.c: Don't rely on attribute offset, in get_shared_pkeys
@ 2017-04-13 14:48 Hal Rosenstock
[not found] ` <b3cbb29e-25bf-1785-7a60-8e8d7cab74e3-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Hal Rosenstock @ 2017-04-13 14:48 UTC (permalink / raw)
To: Doug Ledford
Cc: Honggang LI, Bart Van Assche,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
get_shared_pkeys has been using SubAdmGet rather than SubAdmGetTable since
commit 2ad09524931dbf98d412e1912c1bdbf22f8ac81d
srp_daemon: Work around SM bug over non-default P_Key support
so RMPP is no longer used in response so it's not safe to
rely on AttributeOffset field. Good MAD status is sufficient
to say that valid PathRecord was returned.
Found-by: Honggang LI <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
using embedded subnet manager running on an Intel True Scale
Edge Switch 12300.
This has been broken since srptools-1.0.1 which was first
release containing commit mentioned above.
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
srp_daemon/srp_daemon.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index 71b5f07..9fb2ecc 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -1102,7 +1102,6 @@ static int get_shared_pkeys(struct resources *res,
struct umad_sa_packet *out_sa_mad, *in_sa_mad;
struct ib_path_rec *path_rec;
ssize_t len;
- int size;
int i, num_pkeys = 0;
uint16_t pkey;
uint16_t local_port_lid = get_port_lid(res->ud_res->ib_ctx,
@@ -1148,14 +1147,6 @@ static int get_shared_pkeys(struct resources *res,
if (len < 0)
goto err;
- size = ib_get_attr_size(in_sa_mad->attr_offset);
- if (!size) {
- if (config->verbose)
- printf("PathRec Query did not find any targets "
- "over P_Key %x\n", pkey);
- continue;
- }
-
path_rec = (struct ib_path_rec *)in_sa_mad->data;
pkeys[num_pkeys++] = be16toh(path_rec->pkey);
}
--
1.8.2.3
--
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] 3+ messages in thread[parent not found: <b3cbb29e-25bf-1785-7a60-8e8d7cab74e3-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>]
* Re: [PATCH rdma-core 1/3] srp_daemon/srp_daemon.c: Don't rely on attribute offset, in get_shared_pkeys [not found] ` <b3cbb29e-25bf-1785-7a60-8e8d7cab74e3-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> @ 2017-04-13 15:24 ` Bart Van Assche 2017-04-14 0:33 ` Honggang LI 1 sibling, 0 replies; 3+ messages in thread From: Bart Van Assche @ 2017-04-13 15:24 UTC (permalink / raw) To: hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org, dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org Cc: honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Thu, 2017-04-13 at 10:48 -0400, Hal Rosenstock wrote: > get_shared_pkeys has been using SubAdmGet rather than SubAdmGetTable since > commit 2ad09524931dbf98d412e1912c1bdbf22f8ac81d > srp_daemon: Work around SM bug over non-default P_Key support > > so RMPP is no longer used in response so it's not safe to > rely on AttributeOffset field. Good MAD status is sufficient > to say that valid PathRecord was returned. > > Found-by: Honggang LI <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > using embedded subnet manager running on an Intel True Scale > Edge Switch 12300. > > This has been broken since srptools-1.0.1 which was first > release containing commit mentioned above. Reviewed-by: Bart Van Assche <Bart.VanAssche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>-- 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] 3+ messages in thread
* Re: [PATCH rdma-core 1/3] srp_daemon/srp_daemon.c: Don't rely on attribute offset, in get_shared_pkeys [not found] ` <b3cbb29e-25bf-1785-7a60-8e8d7cab74e3-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> 2017-04-13 15:24 ` Bart Van Assche @ 2017-04-14 0:33 ` Honggang LI 1 sibling, 0 replies; 3+ messages in thread From: Honggang LI @ 2017-04-14 0:33 UTC (permalink / raw) To: Hal Rosenstock Cc: Doug Ledford, Bart Van Assche, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Thu, Apr 13, 2017 at 10:48:00AM -0400, Hal Rosenstock wrote: > > get_shared_pkeys has been using SubAdmGet rather than SubAdmGetTable since > commit 2ad09524931dbf98d412e1912c1bdbf22f8ac81d > srp_daemon: Work around SM bug over non-default P_Key support > > so RMPP is no longer used in response so it's not safe to > rely on AttributeOffset field. Good MAD status is sufficient > to say that valid PathRecord was returned. > > Found-by: Honggang LI <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > using embedded subnet manager running on an Intel True Scale > Edge Switch 12300. > > This has been broken since srptools-1.0.1 which was first > release containing commit mentioned above. > > Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > --- > srp_daemon/srp_daemon.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c > index 71b5f07..9fb2ecc 100644 > --- a/srp_daemon/srp_daemon.c > +++ b/srp_daemon/srp_daemon.c > @@ -1102,7 +1102,6 @@ static int get_shared_pkeys(struct resources *res, > struct umad_sa_packet *out_sa_mad, *in_sa_mad; > struct ib_path_rec *path_rec; > ssize_t len; > - int size; > int i, num_pkeys = 0; > uint16_t pkey; > uint16_t local_port_lid = get_port_lid(res->ud_res->ib_ctx, > @@ -1148,14 +1147,6 @@ static int get_shared_pkeys(struct resources *res, > if (len < 0) > goto err; > > - size = ib_get_attr_size(in_sa_mad->attr_offset); > - if (!size) { > - if (config->verbose) > - printf("PathRec Query did not find any targets " > - "over P_Key %x\n", pkey); > - continue; > - } > - > path_rec = (struct ib_path_rec *)in_sa_mad->data; > pkeys[num_pkeys++] = be16toh(path_rec->pkey); > } > -- Reviewed-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> -- 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] 3+ messages in thread
end of thread, other threads:[~2017-04-14 0:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-13 14:48 [PATCH rdma-core 1/3] srp_daemon/srp_daemon.c: Don't rely on attribute offset, in get_shared_pkeys Hal Rosenstock
[not found] ` <b3cbb29e-25bf-1785-7a60-8e8d7cab74e3-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-04-13 15:24 ` Bart Van Assche
2017-04-14 0:33 ` Honggang LI
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox