* [PATCH] IB/rxe: Convert pr_info to pr_warn
@ 2017-07-18 20:35 Yuval Shaia
[not found] ` <20170718203539.6777-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Yuval Shaia @ 2017-07-18 20:35 UTC (permalink / raw)
To: monis-VPRAkNaXOzVWk0Htik3J/w, dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Yuval Shaia
These messages are warning so let's print them accordingly.
Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
drivers/infiniband/sw/rxe/rxe_av.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_av.c b/drivers/infiniband/sw/rxe/rxe_av.c
index 5bddf469361b..272db3792c50 100644
--- a/drivers/infiniband/sw/rxe/rxe_av.c
+++ b/drivers/infiniband/sw/rxe/rxe_av.c
@@ -39,7 +39,7 @@ int rxe_av_chk_attr(struct rxe_dev *rxe, struct rdma_ah_attr *attr)
struct rxe_port *port;
if (rdma_ah_get_port_num(attr) != 1) {
- pr_info("invalid port_num = %d\n", rdma_ah_get_port_num(attr));
+ pr_warn("invalid port_num = %d\n", rdma_ah_get_port_num(attr));
return -EINVAL;
}
@@ -49,7 +49,7 @@ int rxe_av_chk_attr(struct rxe_dev *rxe, struct rdma_ah_attr *attr)
u8 sgid_index = rdma_ah_read_grh(attr)->sgid_index;
if (sgid_index > port->attr.gid_tbl_len) {
- pr_info("invalid sgid index = %d\n", sgid_index);
+ pr_warn("invalid sgid index = %d\n", sgid_index);
return -EINVAL;
}
}
--
2.13.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] 7+ messages in thread[parent not found: <20170718203539.6777-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] IB/rxe: Convert pr_info to pr_warn [not found] ` <20170718203539.6777-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> @ 2017-07-19 6:09 ` Leon Romanovsky [not found] ` <20170719060908.GN3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Leon Romanovsky @ 2017-07-19 6:09 UTC (permalink / raw) To: Yuval Shaia Cc: monis-VPRAkNaXOzVWk0Htik3J/w, dledford-H+wXaHxf7aLQT0dZR+AlfA, sean.hefty-ral2JQCrhuEAvxtiuMwx3w, hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w, linux-rdma-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 1543 bytes --] On Tue, Jul 18, 2017 at 11:35:39PM +0300, Yuval Shaia wrote: > These messages are warning so let's print them accordingly. > > Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> > --- > drivers/infiniband/sw/rxe/rxe_av.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/sw/rxe/rxe_av.c b/drivers/infiniband/sw/rxe/rxe_av.c > index 5bddf469361b..272db3792c50 100644 > --- a/drivers/infiniband/sw/rxe/rxe_av.c > +++ b/drivers/infiniband/sw/rxe/rxe_av.c > @@ -39,7 +39,7 @@ int rxe_av_chk_attr(struct rxe_dev *rxe, struct rdma_ah_attr *attr) > struct rxe_port *port; > > if (rdma_ah_get_port_num(attr) != 1) { > - pr_info("invalid port_num = %d\n", rdma_ah_get_port_num(attr)); > + pr_warn("invalid port_num = %d\n", rdma_ah_get_port_num(attr)); > return -EINVAL; > } How this code can be executed? IB/core ensures that port_num is in range. You can remove this check. > > @@ -49,7 +49,7 @@ int rxe_av_chk_attr(struct rxe_dev *rxe, struct rdma_ah_attr *attr) > u8 sgid_index = rdma_ah_read_grh(attr)->sgid_index; > > if (sgid_index > port->attr.gid_tbl_len) { > - pr_info("invalid sgid index = %d\n", sgid_index); > + pr_warn("invalid sgid index = %d\n", sgid_index); > return -EINVAL; > } > } > -- > 2.13.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 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20170719060908.GN3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>]
* Re: [PATCH] IB/rxe: Convert pr_info to pr_warn [not found] ` <20170719060908.GN3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> @ 2017-07-19 7:11 ` Moni Shoua [not found] ` <CAG9sBKNXfndf8Lxa97Z8Cc=Ntg+=NoZ9-35CbY0X=0f2aXRx8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Moni Shoua @ 2017-07-19 7:11 UTC (permalink / raw) To: Leon Romanovsky Cc: Yuval Shaia, Doug Ledford, Sean Hefty, Hal Rosenstock, linux-rdma > How this code can be executed? IB/core ensures that port_num is in range. > You can remove this check. > In this case ah_attr can come from the application and a validity check is necessary. -- 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] 7+ messages in thread
[parent not found: <CAG9sBKNXfndf8Lxa97Z8Cc=Ntg+=NoZ9-35CbY0X=0f2aXRx8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] IB/rxe: Convert pr_info to pr_warn [not found] ` <CAG9sBKNXfndf8Lxa97Z8Cc=Ntg+=NoZ9-35CbY0X=0f2aXRx8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2017-07-19 7:51 ` Leon Romanovsky [not found] ` <20170719075119.GO3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Leon Romanovsky @ 2017-07-19 7:51 UTC (permalink / raw) To: Moni Shoua Cc: Yuval Shaia, Doug Ledford, Sean Hefty, Hal Rosenstock, linux-rdma [-- Attachment #1: Type: text/plain, Size: 464 bytes --] On Wed, Jul 19, 2017 at 10:11:50AM +0300, Moni Shoua wrote: > > How this code can be executed? IB/core ensures that port_num is in range. > > You can remove this check. > > > In this case ah_attr can come from the application and a validity > check is necessary. It is a bug if it comes directly without rdma_is_port_valid() check in the IB/core. Currently modify_qp and create_ah are checking it and ensuring that user won't provide illegal port number. Thanks [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20170719075119.GO3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>]
* Re: [PATCH] IB/rxe: Convert pr_info to pr_warn [not found] ` <20170719075119.GO3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> @ 2017-07-19 11:04 ` Yuval Shaia 2017-07-19 17:26 ` Leon Romanovsky 0 siblings, 1 reply; 7+ messages in thread From: Yuval Shaia @ 2017-07-19 11:04 UTC (permalink / raw) To: Leon Romanovsky Cc: Moni Shoua, Doug Ledford, Sean Hefty, Hal Rosenstock, linux-rdma On Wed, Jul 19, 2017 at 10:51:19AM +0300, Leon Romanovsky wrote: > On Wed, Jul 19, 2017 at 10:11:50AM +0300, Moni Shoua wrote: > > > How this code can be executed? IB/core ensures that port_num is in range. > > > You can remove this check. > > > > > In this case ah_attr can come from the application and a validity > > check is necessary. > > It is a bug if it comes directly without rdma_is_port_valid() check in the > IB/core. Currently modify_qp and create_ah are checking it and ensuring that > user won't provide illegal port number. Not sure i see the whole picture but something does not fit, will appreciate a guidance here. 1. Application calls ibv_modify_qp which in turn fills out a cmd object and "calls" ib_uverbs.ib_uverbs_modify_qp. 2. ib_uverbs_modify_qp copy the cmd from userspace and calls modify_qp. 3. modify_qp, among some other stuff, verifies port validity (which prove your point) and calls driver's modify_qp hook (in our case rxe_modify_qp). Is the above correct? What i do not understand is the check that is done in step #2 since port_num is not set when moving from state INIT to state RTR. RXE on the other hands validate port_num only when needed (mask & IB_QP_AV). Looks like the check in step #2 is wrong. What am i missing here? Yuval > > Thanks -- 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] 7+ messages in thread
* Re: [PATCH] IB/rxe: Convert pr_info to pr_warn 2017-07-19 11:04 ` Yuval Shaia @ 2017-07-19 17:26 ` Leon Romanovsky [not found] ` <20170719172613.GS3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Leon Romanovsky @ 2017-07-19 17:26 UTC (permalink / raw) To: Yuval Shaia Cc: Moni Shoua, Doug Ledford, Sean Hefty, Hal Rosenstock, linux-rdma [-- Attachment #1: Type: text/plain, Size: 1510 bytes --] On Wed, Jul 19, 2017 at 02:04:42PM +0300, Yuval Shaia wrote: > On Wed, Jul 19, 2017 at 10:51:19AM +0300, Leon Romanovsky wrote: > > On Wed, Jul 19, 2017 at 10:11:50AM +0300, Moni Shoua wrote: > > > > How this code can be executed? IB/core ensures that port_num is in range. > > > > You can remove this check. > > > > > > > In this case ah_attr can come from the application and a validity > > > check is necessary. > > > > It is a bug if it comes directly without rdma_is_port_valid() check in the > > IB/core. Currently modify_qp and create_ah are checking it and ensuring that > > user won't provide illegal port number. > > Not sure i see the whole picture but something does not fit, will > appreciate a guidance here. > > 1. Application calls ibv_modify_qp which in turn fills out a cmd object and > "calls" ib_uverbs.ib_uverbs_modify_qp. > 2. ib_uverbs_modify_qp copy the cmd from userspace and calls modify_qp. > 3. modify_qp, among some other stuff, verifies port validity (which prove > your point) and calls driver's modify_qp hook (in our case rxe_modify_qp). > > Is the above correct? > > What i do not understand is the check that is done in step #2 since > port_num is not set when moving from state INIT to state RTR. > RXE on the other hands validate port_num only when needed (mask & > IB_QP_AV). > > Looks like the check in step #2 is wrong. > What am i missing here? Maybe you missing the Mustafa's patch? https://patchwork.kernel.org/patch/9841241/ Thanks > > Yuval > > > > > Thanks > > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20170719172613.GS3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>]
* Re: [PATCH] IB/rxe: Convert pr_info to pr_warn [not found] ` <20170719172613.GS3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> @ 2017-07-19 19:54 ` Yuval Shaia 0 siblings, 0 replies; 7+ messages in thread From: Yuval Shaia @ 2017-07-19 19:54 UTC (permalink / raw) To: Leon Romanovsky Cc: Moni Shoua, Doug Ledford, Sean Hefty, Hal Rosenstock, linux-rdma On Wed, Jul 19, 2017 at 08:26:13PM +0300, Leon Romanovsky wrote: > On Wed, Jul 19, 2017 at 02:04:42PM +0300, Yuval Shaia wrote: > > On Wed, Jul 19, 2017 at 10:51:19AM +0300, Leon Romanovsky wrote: > > > On Wed, Jul 19, 2017 at 10:11:50AM +0300, Moni Shoua wrote: > > > > > How this code can be executed? IB/core ensures that port_num is in range. > > > > > You can remove this check. > > > > > > > > > In this case ah_attr can come from the application and a validity > > > > check is necessary. > > > > > > It is a bug if it comes directly without rdma_is_port_valid() check in the > > > IB/core. Currently modify_qp and create_ah are checking it and ensuring that > > > user won't provide illegal port number. > > > > Not sure i see the whole picture but something does not fit, will > > appreciate a guidance here. > > > > 1. Application calls ibv_modify_qp which in turn fills out a cmd object and > > "calls" ib_uverbs.ib_uverbs_modify_qp. > > 2. ib_uverbs_modify_qp copy the cmd from userspace and calls modify_qp. > > 3. modify_qp, among some other stuff, verifies port validity (which prove > > your point) and calls driver's modify_qp hook (in our case rxe_modify_qp). > > > > Is the above correct? > > > > What i do not understand is the check that is done in step #2 since > > port_num is not set when moving from state INIT to state RTR. > > RXE on the other hands validate port_num only when needed (mask & > > IB_QP_AV). > > > > Looks like the check in step #2 is wrong. > > What am i missing here? > > Maybe you missing the Mustafa's patch? > https://patchwork.kernel.org/patch/9841241/ Exactly!! :) Thanks, So, will post v1 of this patch with the removal of the redundant check. > > Thanks > > > > > Yuval > > > > > > > > Thanks > > > > -- 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] 7+ messages in thread
end of thread, other threads:[~2017-07-19 19:54 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18 20:35 [PATCH] IB/rxe: Convert pr_info to pr_warn Yuval Shaia
[not found] ` <20170718203539.6777-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-07-19 6:09 ` Leon Romanovsky
[not found] ` <20170719060908.GN3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-07-19 7:11 ` Moni Shoua
[not found] ` <CAG9sBKNXfndf8Lxa97Z8Cc=Ntg+=NoZ9-35CbY0X=0f2aXRx8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-19 7:51 ` Leon Romanovsky
[not found] ` <20170719075119.GO3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-07-19 11:04 ` Yuval Shaia
2017-07-19 17:26 ` Leon Romanovsky
[not found] ` <20170719172613.GS3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-07-19 19:54 ` Yuval Shaia
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox