* [PATCH rc-fixes 0/2] mlx4 and ipoib Fixes for 4.2-rc1
@ 2015-07-01 11:31 Or Gerlitz
[not found] ` <1435750262-32210-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Or Gerlitz @ 2015-07-01 11:31 UTC (permalink / raw)
To: Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Amir Vadai, Or Gerlitz
Hi Doug,
The mlx4 bug (VF query_device fails) was introduced with the time-stamping changes,
the ipoib bug is something we stepped on while having the mlx4 issue, now fixed.
Or.
Amir Vadai (1):
IB/IPoIB: Fix bad error flow in ipoib_add_port()
Matan Barak (1):
IB/mlx4: Do not attemp to report HCA clock offset on VFs
drivers/infiniband/hw/mlx4/main.c | 11 ++++++-----
drivers/infiniband/ulp/ipoib/ipoib_main.c | 6 ++++--
2 files changed, 10 insertions(+), 7 deletions(-)
--
2.3.7
--
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] 4+ messages in thread[parent not found: <1435750262-32210-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>]
* [PATCH rc-fixes 1/2] IB/IPoIB: Fix bad error flow in ipoib_add_port() [not found] ` <1435750262-32210-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> @ 2015-07-01 11:31 ` Or Gerlitz [not found] ` <1435750262-32210-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> 2015-07-01 11:31 ` [PATCH rc-fixes 2/2] IB/mlx4: Do not attemp to report HCA clock offset on VFs Or Gerlitz 1 sibling, 1 reply; 4+ messages in thread From: Or Gerlitz @ 2015-07-01 11:31 UTC (permalink / raw) To: Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Amir Vadai, Or Gerlitz From: Amir Vadai <amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Error values of ib_query_port() and ib_query_device() weren't propagated correctly. Because of that, ipoib_add_port() could return NULL value, which escaped the IS_ERR() check in ipoib_add_one() and we crashed. Signed-off-by: Amir Vadai <amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index da149c2..55231bb 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1577,7 +1577,8 @@ static struct net_device *ipoib_add_port(const char *format, SET_NETDEV_DEV(priv->dev, hca->dma_device); priv->dev->dev_id = port - 1; - if (!ib_query_port(hca, port, &attr)) + result = ib_query_port(hca, port, &attr); + if (!result) priv->max_ib_mtu = ib_mtu_enum_to_int(attr.max_mtu); else { printk(KERN_WARNING "%s: ib_query_port %d failed\n", @@ -1598,7 +1599,8 @@ static struct net_device *ipoib_add_port(const char *format, goto device_init_failed; } - if (ipoib_set_dev_features(priv, hca)) + result = ipoib_set_dev_features(priv, hca); + if (result) goto device_init_failed; /* -- 2.3.7 -- 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] 4+ messages in thread
[parent not found: <1435750262-32210-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>]
* Re: [PATCH rc-fixes 1/2] IB/IPoIB: Fix bad error flow in ipoib_add_port() [not found] ` <1435750262-32210-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> @ 2015-07-01 19:29 ` ira.weiny 0 siblings, 0 replies; 4+ messages in thread From: ira.weiny @ 2015-07-01 19:29 UTC (permalink / raw) To: Or Gerlitz; +Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Amir Vadai On Wed, Jul 01, 2015 at 02:31:01PM +0300, Or Gerlitz wrote: > From: Amir Vadai <amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > > Error values of ib_query_port() and ib_query_device() weren't propagated > correctly. Because of that, ipoib_add_port() could return NULL value, > which escaped the IS_ERR() check in ipoib_add_one() and we crashed. > > Signed-off-by: Amir Vadai <amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > --- > drivers/infiniband/ulp/ipoib/ipoib_main.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c > index da149c2..55231bb 100644 > --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c > +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c > @@ -1577,7 +1577,8 @@ static struct net_device *ipoib_add_port(const char *format, > SET_NETDEV_DEV(priv->dev, hca->dma_device); > priv->dev->dev_id = port - 1; > > - if (!ib_query_port(hca, port, &attr)) > + result = ib_query_port(hca, port, &attr); > + if (!result) > priv->max_ib_mtu = ib_mtu_enum_to_int(attr.max_mtu); > else { > printk(KERN_WARNING "%s: ib_query_port %d failed\n", > @@ -1598,7 +1599,8 @@ static struct net_device *ipoib_add_port(const char *format, > goto device_init_failed; > } > > - if (ipoib_set_dev_features(priv, hca)) > + result = ipoib_set_dev_features(priv, hca); > + if (result) > goto device_init_failed; > > /* > -- > 2.3.7 > > -- > 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH rc-fixes 2/2] IB/mlx4: Do not attemp to report HCA clock offset on VFs [not found] ` <1435750262-32210-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> 2015-07-01 11:31 ` [PATCH rc-fixes 1/2] IB/IPoIB: Fix bad error flow in ipoib_add_port() Or Gerlitz @ 2015-07-01 11:31 ` Or Gerlitz 1 sibling, 0 replies; 4+ messages in thread From: Or Gerlitz @ 2015-07-01 11:31 UTC (permalink / raw) To: Doug Ledford Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Amir Vadai, Matan Barak, Or Gerlitz From: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> mlx4 VFs can provide CQE raw time-stamping services, but they don't have the hca core clock mapped to their PCI bars. As such, we should not attempt to query and report the clock offset to user space for VFs. Doing so causes query_device over VFs to fail with -ENOSUPP. Fixes: 4b664c4355b2 ('IB/mlx4: Add support for CQ time-stamping') Signed-off-by: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> --- drivers/infiniband/hw/mlx4/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 067a691..f419a72 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -253,14 +253,15 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, props->hca_core_clock = dev->dev->caps.hca_core_clock * 1000UL; props->timestamp_mask = 0xFFFFFFFFFFFFULL; - err = mlx4_get_internal_clock_params(dev->dev, &clock_params); - if (err) - goto out; + if (!mlx4_is_slave(dev->dev)) + err = mlx4_get_internal_clock_params(dev->dev, &clock_params); if (uhw->outlen >= resp.response_length + sizeof(resp.hca_core_clock_offset)) { - resp.hca_core_clock_offset = clock_params.offset % PAGE_SIZE; resp.response_length += sizeof(resp.hca_core_clock_offset); - resp.comp_mask |= QUERY_DEVICE_RESP_MASK_TIMESTAMP; + if (!err && !mlx4_is_slave(dev->dev)) { + resp.comp_mask |= QUERY_DEVICE_RESP_MASK_TIMESTAMP; + resp.hca_core_clock_offset = clock_params.offset % PAGE_SIZE; + } } if (uhw->outlen) { -- 2.3.7 -- 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] 4+ messages in thread
end of thread, other threads:[~2015-07-01 19:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-01 11:31 [PATCH rc-fixes 0/2] mlx4 and ipoib Fixes for 4.2-rc1 Or Gerlitz
[not found] ` <1435750262-32210-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-01 11:31 ` [PATCH rc-fixes 1/2] IB/IPoIB: Fix bad error flow in ipoib_add_port() Or Gerlitz
[not found] ` <1435750262-32210-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-01 19:29 ` ira.weiny
2015-07-01 11:31 ` [PATCH rc-fixes 2/2] IB/mlx4: Do not attemp to report HCA clock offset on VFs Or Gerlitz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox