* [PATCH rdma-rc] IB/ipoib: print only once when doesn't support IB_QP_CREATE_USE_GFP_NOIO
@ 2016-11-01 12:34 Leon Romanovsky
[not found] ` <1478003653-16248-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Leon Romanovsky @ 2016-11-01 12:34 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Erez Shitrit
From: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Currently when the card doesn't support IB_QP_CREATE_USE_GFP_NOIO it warns
on every QP creation, It becomes worse when driver works in connected mode
we will see one print on each new connection, instead do it once.
Fixes: 09b93088d7 ('Add a QP creation flag to use GFP_NOIO allocations')
Signed-off-by: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 4ad297d..917393b 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1053,8 +1053,8 @@ static struct ib_qp *ipoib_cm_create_tx_qp(struct net_device *dev, struct ipoib_
tx_qp = ib_create_qp(priv->pd, &attr);
if (PTR_ERR(tx_qp) == -EINVAL) {
- ipoib_warn(priv, "can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n",
- priv->ca->name);
+ pr_warn_once("can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n",
+ priv->ca->name);
attr.create_flags &= ~IB_QP_CREATE_USE_GFP_NOIO;
tx_qp = ib_create_qp(priv->pd, &attr);
}
--
2.7.4
--
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] 5+ messages in thread[parent not found: <1478003653-16248-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>]
* Re: [PATCH rdma-rc] IB/ipoib: print only once when doesn't support IB_QP_CREATE_USE_GFP_NOIO [not found] ` <1478003653-16248-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> @ 2016-11-01 13:48 ` Yuval Shaia [not found] ` <20161101134823.GA6681-Hxa29pjIrERMGUUWBy6pNA@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Yuval Shaia @ 2016-11-01 13:48 UTC (permalink / raw) To: Leon Romanovsky Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Erez Shitrit On Tue, Nov 01, 2016 at 02:34:13PM +0200, Leon Romanovsky wrote: > From: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > > Currently when the card doesn't support IB_QP_CREATE_USE_GFP_NOIO it warns > on every QP creation, It becomes worse when driver works in connected mode > we will see one print on each new connection, instead do it once. > > Fixes: 09b93088d7 ('Add a QP creation flag to use GFP_NOIO allocations') > Signed-off-by: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > --- > drivers/infiniband/ulp/ipoib/ipoib_cm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > index 4ad297d..917393b 100644 > --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c > +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > @@ -1053,8 +1053,8 @@ static struct ib_qp *ipoib_cm_create_tx_qp(struct net_device *dev, struct ipoib_ > > tx_qp = ib_create_qp(priv->pd, &attr); > if (PTR_ERR(tx_qp) == -EINVAL) { > - ipoib_warn(priv, "can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n", > - priv->ca->name); > + pr_warn_once("can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n", > + priv->ca->name); But it will still re-print it for different device, right? > attr.create_flags &= ~IB_QP_CREATE_USE_GFP_NOIO; > tx_qp = ib_create_qp(priv->pd, &attr); > } > -- > 2.7.4 > > -- > 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] 5+ messages in thread
[parent not found: <20161101134823.GA6681-Hxa29pjIrERMGUUWBy6pNA@public.gmane.org>]
* Re: [PATCH rdma-rc] IB/ipoib: print only once when doesn't support IB_QP_CREATE_USE_GFP_NOIO [not found] ` <20161101134823.GA6681-Hxa29pjIrERMGUUWBy6pNA@public.gmane.org> @ 2016-11-01 14:14 ` Leon Romanovsky [not found] ` <20161101141454.GD3617-2ukJVAZIZ/Y@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Leon Romanovsky @ 2016-11-01 14:14 UTC (permalink / raw) To: Yuval Shaia Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Erez Shitrit [-- Attachment #1: Type: text/plain, Size: 2176 bytes --] On Tue, Nov 01, 2016 at 03:48:24PM +0200, Yuval Shaia wrote: > On Tue, Nov 01, 2016 at 02:34:13PM +0200, Leon Romanovsky wrote: > > From: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > > > > Currently when the card doesn't support IB_QP_CREATE_USE_GFP_NOIO it warns > > on every QP creation, It becomes worse when driver works in connected mode > > we will see one print on each new connection, instead do it once. > > > > Fixes: 09b93088d7 ('Add a QP creation flag to use GFP_NOIO allocations') > > Signed-off-by: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > > --- > > drivers/infiniband/ulp/ipoib/ipoib_cm.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > index 4ad297d..917393b 100644 > > --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > @@ -1053,8 +1053,8 @@ static struct ib_qp *ipoib_cm_create_tx_qp(struct net_device *dev, struct ipoib_ > > > > tx_qp = ib_create_qp(priv->pd, &attr); > > if (PTR_ERR(tx_qp) == -EINVAL) { > > - ipoib_warn(priv, "can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n", > > - priv->ca->name); > > + pr_warn_once("can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n", > > + priv->ca->name); > > But it will still re-print it for different device, right? Good question, pr_warn_once is defined as alias to printk_once [1]. That printk_once is macro too [2] which will define local static read_once variable. [1] http://lxr.free-electrons.com/source/include/linux/printk.h#L359 [2] http://lxr.free-electrons.com/source/include/linux/printk.h#L322 > > > attr.create_flags &= ~IB_QP_CREATE_USE_GFP_NOIO; > > tx_qp = ib_create_qp(priv->pd, &attr); > > } > > -- > > 2.7.4 > > > > -- > > 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: 819 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20161101141454.GD3617-2ukJVAZIZ/Y@public.gmane.org>]
* Re: [PATCH rdma-rc] IB/ipoib: print only once when doesn't support IB_QP_CREATE_USE_GFP_NOIO [not found] ` <20161101141454.GD3617-2ukJVAZIZ/Y@public.gmane.org> @ 2016-11-01 14:34 ` Yuval Shaia [not found] ` <20161101143429.GA10771-Hxa29pjIrERMGUUWBy6pNA@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Yuval Shaia @ 2016-11-01 14:34 UTC (permalink / raw) To: Leon Romanovsky Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Erez Shitrit On Tue, Nov 01, 2016 at 04:14:54PM +0200, Leon Romanovsky wrote: > On Tue, Nov 01, 2016 at 03:48:24PM +0200, Yuval Shaia wrote: > > On Tue, Nov 01, 2016 at 02:34:13PM +0200, Leon Romanovsky wrote: > > > From: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > > > > > > Currently when the card doesn't support IB_QP_CREATE_USE_GFP_NOIO it warns > > > on every QP creation, It becomes worse when driver works in connected mode > > > we will see one print on each new connection, instead do it once. > > > > > > Fixes: 09b93088d7 ('Add a QP creation flag to use GFP_NOIO allocations') > > > Signed-off-by: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > > > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > > > --- > > > drivers/infiniband/ulp/ipoib/ipoib_cm.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > > index 4ad297d..917393b 100644 > > > --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > > +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > > @@ -1053,8 +1053,8 @@ static struct ib_qp *ipoib_cm_create_tx_qp(struct net_device *dev, struct ipoib_ > > > > > > tx_qp = ib_create_qp(priv->pd, &attr); > > > if (PTR_ERR(tx_qp) == -EINVAL) { > > > - ipoib_warn(priv, "can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n", > > > - priv->ca->name); > > > + pr_warn_once("can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n", > > > + priv->ca->name); > > > > But it will still re-print it for different device, right? > > Good question, > > pr_warn_once is defined as alias to printk_once [1]. That printk_once is > macro too [2] which will define local static read_once variable. > > [1] http://lxr.free-electrons.com/source/include/linux/printk.h#L359 > [2] http://lxr.free-electrons.com/source/include/linux/printk.h#L322 If only one HCA model is installed on the system then it should be fine, but wonder if more then one, would we like to see the warning again? i think yes. > > > > > > attr.create_flags &= ~IB_QP_CREATE_USE_GFP_NOIO; > > > tx_qp = ib_create_qp(priv->pd, &attr); > > > } > > > -- > > > 2.7.4 > > > > > > -- > > > 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] 5+ messages in thread
[parent not found: <20161101143429.GA10771-Hxa29pjIrERMGUUWBy6pNA@public.gmane.org>]
* Re: [PATCH rdma-rc] IB/ipoib: print only once when doesn't support IB_QP_CREATE_USE_GFP_NOIO [not found] ` <20161101143429.GA10771-Hxa29pjIrERMGUUWBy6pNA@public.gmane.org> @ 2016-11-02 0:44 ` Leon Romanovsky 0 siblings, 0 replies; 5+ messages in thread From: Leon Romanovsky @ 2016-11-02 0:44 UTC (permalink / raw) To: Yuval Shaia Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Erez Shitrit [-- Attachment #1: Type: text/plain, Size: 2991 bytes --] On Tue, Nov 01, 2016 at 04:34:31PM +0200, Yuval Shaia wrote: > On Tue, Nov 01, 2016 at 04:14:54PM +0200, Leon Romanovsky wrote: > > On Tue, Nov 01, 2016 at 03:48:24PM +0200, Yuval Shaia wrote: > > > On Tue, Nov 01, 2016 at 02:34:13PM +0200, Leon Romanovsky wrote: > > > > From: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > > > > > > > > Currently when the card doesn't support IB_QP_CREATE_USE_GFP_NOIO it warns > > > > on every QP creation, It becomes worse when driver works in connected mode > > > > we will see one print on each new connection, instead do it once. > > > > > > > > Fixes: 09b93088d7 ('Add a QP creation flag to use GFP_NOIO allocations') > > > > Signed-off-by: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > > > > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > > > > --- > > > > drivers/infiniband/ulp/ipoib/ipoib_cm.c | 4 ++-- > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > > > index 4ad297d..917393b 100644 > > > > --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > > > +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > > > @@ -1053,8 +1053,8 @@ static struct ib_qp *ipoib_cm_create_tx_qp(struct net_device *dev, struct ipoib_ > > > > > > > > tx_qp = ib_create_qp(priv->pd, &attr); > > > > if (PTR_ERR(tx_qp) == -EINVAL) { > > > > - ipoib_warn(priv, "can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n", > > > > - priv->ca->name); > > > > + pr_warn_once("can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n", > > > > + priv->ca->name); > > > > > > But it will still re-print it for different device, right? > > > > Good question, > > > > pr_warn_once is defined as alias to printk_once [1]. That printk_once is > > macro too [2] which will define local static read_once variable. > > > > [1] http://lxr.free-electrons.com/source/include/linux/printk.h#L359 > > [2] http://lxr.free-electrons.com/source/include/linux/printk.h#L322 > > If only one HCA model is installed on the system then it should be fine, > but wonder if more then one, would we like to see the warning again? i think > yes. It is correct and valid question and not for the multiple devices only. Additional thing which was missed in such a trivial patch is the lost of context which is printed by ipoib_warn and doesn't print in the case of pr_warn. Thanks for pointing and investing time in the review. Doug, Please drop it. We will respin it. > > > > > > > > > > attr.create_flags &= ~IB_QP_CREATE_USE_GFP_NOIO; > > > > tx_qp = ib_create_qp(priv->pd, &attr); > > > > } > > > > -- > > > > 2.7.4 > > > > > > > > -- > > > > 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: 819 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-11-02 0:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-01 12:34 [PATCH rdma-rc] IB/ipoib: print only once when doesn't support IB_QP_CREATE_USE_GFP_NOIO Leon Romanovsky
[not found] ` <1478003653-16248-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-11-01 13:48 ` Yuval Shaia
[not found] ` <20161101134823.GA6681-Hxa29pjIrERMGUUWBy6pNA@public.gmane.org>
2016-11-01 14:14 ` Leon Romanovsky
[not found] ` <20161101141454.GD3617-2ukJVAZIZ/Y@public.gmane.org>
2016-11-01 14:34 ` Yuval Shaia
[not found] ` <20161101143429.GA10771-Hxa29pjIrERMGUUWBy6pNA@public.gmane.org>
2016-11-02 0:44 ` Leon Romanovsky
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.