linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-next] RDMA/mlx5; Remove redundant allocation warning print
@ 2018-01-18 12:34 Leon Romanovsky
       [not found] ` <20180118123424.21062-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Leon Romanovsky @ 2018-01-18 12:34 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe; +Cc: Leon Romanovsky, RDMA mailing list

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

The kmalloc() failure to allocate memory generates enough information
and doesn't need to be accompanied by another driver print.

Fixes: d69a24e03659 ("IB/mlx5: Move IB event processing onto a workqueue")
Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/main.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index f282e281eff2..91688352b5d7 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -3345,19 +3345,17 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context,
 	struct mlx5_ib_event_work *work;

 	work = kmalloc(sizeof(*work), GFP_ATOMIC);
-	if (work) {
-		INIT_WORK(&work->work, mlx5_ib_handle_event);
-		work->dev = dev;
-		work->param = param;
-		work->context = context;
-		work->event = event;
-
-		queue_work(mlx5_ib_event_wq, &work->work);
+	if (!work)
 		return;
-	}

-	dev_warn(&dev->pdev->dev, "%s: mlx5_dev_event: %d, with param: %lu dropped, couldn't allocate memory.\n",
-		 __func__, event, param);
+	INIT_WORK(&work->work, mlx5_ib_handle_event);
+	work->dev = dev;
+	work->param = param;
+	work->context = context;
+	work->event = event;
+
+	queue_work(mlx5_ib_event_wq, &work->work);
+	return;
 }

 static int set_has_smi_cap(struct mlx5_ib_dev *dev)
--
2.15.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] 5+ messages in thread

* Re: [PATCH rdma-next] RDMA/mlx5; Remove redundant allocation warning print
       [not found] ` <20180118123424.21062-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2018-01-18 20:02   ` Yuval Shaia
  2018-01-19 10:58     ` Leon Romanovsky
  0 siblings, 1 reply; 5+ messages in thread
From: Yuval Shaia @ 2018-01-18 20:02 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Jason Gunthorpe, Leon Romanovsky, RDMA mailing list

On Thu, Jan 18, 2018 at 02:34:24PM +0200, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> The kmalloc() failure to allocate memory generates enough information
> and doesn't need to be accompanied by another driver print.
> 
> Fixes: d69a24e03659 ("IB/mlx5: Move IB event processing onto a workqueue")

Didn't found it in:
https://kernel.googlesource.com/pub/scm/linux/kernel/git/leon/linux-rdma/
branch rdma-next and didn't find it.
Where should i look?

> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx5/main.c | 20 +++++++++-----------
>  1 file changed, 9 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index f282e281eff2..91688352b5d7 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -3345,19 +3345,17 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context,
>  	struct mlx5_ib_event_work *work;
> 
>  	work = kmalloc(sizeof(*work), GFP_ATOMIC);
> -	if (work) {
> -		INIT_WORK(&work->work, mlx5_ib_handle_event);
> -		work->dev = dev;
> -		work->param = param;
> -		work->context = context;
> -		work->event = event;
> -
> -		queue_work(mlx5_ib_event_wq, &work->work);
> +	if (!work)
>  		return;
> -	}
> 
> -	dev_warn(&dev->pdev->dev, "%s: mlx5_dev_event: %d, with param: %lu dropped, couldn't allocate memory.\n",
> -		 __func__, event, param);
> +	INIT_WORK(&work->work, mlx5_ib_handle_event);
> +	work->dev = dev;
> +	work->param = param;
> +	work->context = context;
> +	work->event = event;
> +
> +	queue_work(mlx5_ib_event_wq, &work->work);
> +	return;

We don't really need this last "return", right?

>  }
> 
>  static int set_has_smi_cap(struct mlx5_ib_dev *dev)
> --
> 2.15.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
--
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

* Re: [PATCH rdma-next] RDMA/mlx5; Remove redundant allocation warning print
  2018-01-18 20:02   ` Yuval Shaia
@ 2018-01-19 10:58     ` Leon Romanovsky
       [not found]       ` <20180119105840.GA1393-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Leon Romanovsky @ 2018-01-19 10:58 UTC (permalink / raw)
  To: Yuval Shaia; +Cc: Doug Ledford, Jason Gunthorpe, RDMA mailing list

[-- Attachment #1: Type: text/plain, Size: 2432 bytes --]

On Thu, Jan 18, 2018 at 10:02:12PM +0200, Yuval Shaia wrote:
> On Thu, Jan 18, 2018 at 02:34:24PM +0200, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >
> > The kmalloc() failure to allocate memory generates enough information
> > and doesn't need to be accompanied by another driver print.
> >
> > Fixes: d69a24e03659 ("IB/mlx5: Move IB event processing onto a workqueue")
>
> Didn't found it in:
> https://kernel.googlesource.com/pub/scm/linux/kernel/git/leon/linux-rdma/
> branch rdma-next and didn't find it.
> Where should i look?

In official place:
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=for-next&id=d69a24e036596877ce08c25ab8e63a202412fd9e

>
> > Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > ---
> >  drivers/infiniband/hw/mlx5/main.c | 20 +++++++++-----------
> >  1 file changed, 9 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> > index f282e281eff2..91688352b5d7 100644
> > --- a/drivers/infiniband/hw/mlx5/main.c
> > +++ b/drivers/infiniband/hw/mlx5/main.c
> > @@ -3345,19 +3345,17 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context,
> >  	struct mlx5_ib_event_work *work;
> >
> >  	work = kmalloc(sizeof(*work), GFP_ATOMIC);
> > -	if (work) {
> > -		INIT_WORK(&work->work, mlx5_ib_handle_event);
> > -		work->dev = dev;
> > -		work->param = param;
> > -		work->context = context;
> > -		work->event = event;
> > -
> > -		queue_work(mlx5_ib_event_wq, &work->work);
> > +	if (!work)
> >  		return;
> > -	}
> >
> > -	dev_warn(&dev->pdev->dev, "%s: mlx5_dev_event: %d, with param: %lu dropped, couldn't allocate memory.\n",
> > -		 __func__, event, param);
> > +	INIT_WORK(&work->work, mlx5_ib_handle_event);
> > +	work->dev = dev;
> > +	work->param = param;
> > +	work->context = context;
> > +	work->event = event;
> > +
> > +	queue_work(mlx5_ib_event_wq, &work->work);
> > +	return;
>
> We don't really need this last "return", right?

Right, I'll remove it now.

Thanks

>
> >  }
> >
> >  static int set_has_smi_cap(struct mlx5_ib_dev *dev)
> > --
> > 2.15.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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH rdma-next] RDMA/mlx5; Remove redundant allocation warning print
       [not found]       ` <20180119105840.GA1393-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2018-01-19 18:54         ` Yuval Shaia
  2018-01-21 13:41           ` Leon Romanovsky
  0 siblings, 1 reply; 5+ messages in thread
From: Yuval Shaia @ 2018-01-19 18:54 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: Doug Ledford, Jason Gunthorpe, RDMA mailing list

> > >
> > > Fixes: d69a24e03659 ("IB/mlx5: Move IB event processing onto a workqueue")
> >
> > Didn't found it in:
> > https://kernel.googlesource.com/pub/scm/linux/kernel/git/leon/linux-rdma/
> > branch rdma-next and didn't find it.
> > Where should i look?
> 
> In official place:
> https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=for-next&id=d69a24e036596877ce08c25ab8e63a202412fd9e

I see,
I thought that "rdma-next" in subject stands for branch name, apparently
not. So saying rdma-next you actually refer to for-next, right?

> 
> >

--
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

* Re: [PATCH rdma-next] RDMA/mlx5; Remove redundant allocation warning print
  2018-01-19 18:54         ` Yuval Shaia
@ 2018-01-21 13:41           ` Leon Romanovsky
  0 siblings, 0 replies; 5+ messages in thread
From: Leon Romanovsky @ 2018-01-21 13:41 UTC (permalink / raw)
  To: Yuval Shaia; +Cc: Doug Ledford, Jason Gunthorpe, RDMA mailing list

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

On Fri, Jan 19, 2018 at 08:54:28PM +0200, Yuval Shaia wrote:
> > > >
> > > > Fixes: d69a24e03659 ("IB/mlx5: Move IB event processing onto a workqueue")
> > >
> > > Didn't found it in:
> > > https://kernel.googlesource.com/pub/scm/linux/kernel/git/leon/linux-rdma/
> > > branch rdma-next and didn't find it.
> > > Where should i look?
> >
> > In official place:
> > https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=for-next&id=d69a24e036596877ce08c25ab8e63a202412fd9e
>
> I see,
> I thought that "rdma-next" in subject stands for branch name, apparently
> not. So saying rdma-next you actually refer to for-next, right?

By writing "rdma-next", I mean "target", there is a need to distinguish between
different submissions (net/net-next/iproute2/iproute2-next/rdma-rc/rdma-next/rdma-core).

Thanks

>
> >
> > >
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-21 13:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-18 12:34 [PATCH rdma-next] RDMA/mlx5; Remove redundant allocation warning print Leon Romanovsky
     [not found] ` <20180118123424.21062-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-18 20:02   ` Yuval Shaia
2018-01-19 10:58     ` Leon Romanovsky
     [not found]       ` <20180119105840.GA1393-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-01-19 18:54         ` Yuval Shaia
2018-01-21 13:41           ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).