From: Leon Romanovsky <leon@kernel.org>
To: Dennis Dalessandro
<dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: SF Markus Elfring
<elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Hal Rosenstock
<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] IB/mlx4: Use common error handling code in __mlx4_ib_create_flow()
Date: Fri, 27 Oct 2017 19:44:57 +0000 [thread overview]
Message-ID: <20171027194457.GK16127@mtr-leonro.local> (raw)
In-Reply-To: <70843f43-03c5-8295-643a-4f228ff2e907-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]
On Thu, Oct 26, 2017 at 08:33:39PM -0400, Dennis Dalessandro wrote:
> On 10/26/2017 12:12 PM, SF Markus Elfring wrote:
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Thu, 26 Oct 2017 17:54:15 +0200
> >
> > Add a jump target so that a bit of exception handling can be better reused
> > at the end of this function.
>
> I'm not sure this is that big of a win. I mean you aren't really making the
> code any smaller and it's not making it any easier to read really.
>
> > This issue was detected by using the Coccinelle software.
>
> Assuming there was no testing done for this?
>
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > ---
> > drivers/infiniband/hw/mlx4/main.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
> > index c636842c5be0..4a598c48ea1c 100644
> > --- a/drivers/infiniband/hw/mlx4/main.c
> > +++ b/drivers/infiniband/hw/mlx4/main.c
> > @@ -1691,8 +1691,8 @@ static int __mlx4_ib_create_flow(struct ib_qp *qp, struct ib_flow_attr *flow_att
> > mdev, qp, default_table + default_flow,
> > mailbox->buf + size);
> > if (ret < 0) {
> > - mlx4_free_cmd_mailbox(mdev->dev, mailbox);
> > - return -EINVAL;
> > + ret = -EINVAL;
> > + goto free_mailbox;
>
> This might be a good opportunity to bubble up the return value rather than
> just blindly returning -EINVAL. That's really a question for Mellanox
> though.
It is worth to check it, especially for parse_flow_attr() which can
return -ENOTSUPP (need to fix return -EOPNOTSUPP).
Thanks
>
> -Denny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Dennis Dalessandro
<dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: SF Markus Elfring
<elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Hal Rosenstock
<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] IB/mlx4: Use common error handling code in __mlx4_ib_create_flow()
Date: Fri, 27 Oct 2017 22:44:57 +0300 [thread overview]
Message-ID: <20171027194457.GK16127@mtr-leonro.local> (raw)
In-Reply-To: <70843f43-03c5-8295-643a-4f228ff2e907-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]
On Thu, Oct 26, 2017 at 08:33:39PM -0400, Dennis Dalessandro wrote:
> On 10/26/2017 12:12 PM, SF Markus Elfring wrote:
> > From: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
> > Date: Thu, 26 Oct 2017 17:54:15 +0200
> >
> > Add a jump target so that a bit of exception handling can be better reused
> > at the end of this function.
>
> I'm not sure this is that big of a win. I mean you aren't really making the
> code any smaller and it's not making it any easier to read really.
>
> > This issue was detected by using the Coccinelle software.
>
> Assuming there was no testing done for this?
>
> > Signed-off-by: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
> > ---
> > drivers/infiniband/hw/mlx4/main.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
> > index c636842c5be0..4a598c48ea1c 100644
> > --- a/drivers/infiniband/hw/mlx4/main.c
> > +++ b/drivers/infiniband/hw/mlx4/main.c
> > @@ -1691,8 +1691,8 @@ static int __mlx4_ib_create_flow(struct ib_qp *qp, struct ib_flow_attr *flow_att
> > mdev, qp, default_table + default_flow,
> > mailbox->buf + size);
> > if (ret < 0) {
> > - mlx4_free_cmd_mailbox(mdev->dev, mailbox);
> > - return -EINVAL;
> > + ret = -EINVAL;
> > + goto free_mailbox;
>
> This might be a good opportunity to bubble up the return value rather than
> just blindly returning -EINVAL. That's really a question for Mellanox
> though.
It is worth to check it, especially for parse_flow_attr() which can
return -ENOTSUPP (need to fix return -EOPNOTSUPP).
Thanks
>
> -Denny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky <leon@kernel.org>
To: Dennis Dalessandro <dennis.dalessandro@intel.com>
Cc: SF Markus Elfring <elfring@users.sourceforge.net>,
linux-rdma@vger.kernel.org, Doug Ledford <dledford@redhat.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
Sean Hefty <sean.hefty@intel.com>,
Yishai Hadas <yishaih@mellanox.com>,
Yuval Shaia <yuval.shaia@oracle.com>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] IB/mlx4: Use common error handling code in __mlx4_ib_create_flow()
Date: Fri, 27 Oct 2017 22:44:57 +0300 [thread overview]
Message-ID: <20171027194457.GK16127@mtr-leonro.local> (raw)
In-Reply-To: <70843f43-03c5-8295-643a-4f228ff2e907@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]
On Thu, Oct 26, 2017 at 08:33:39PM -0400, Dennis Dalessandro wrote:
> On 10/26/2017 12:12 PM, SF Markus Elfring wrote:
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Thu, 26 Oct 2017 17:54:15 +0200
> >
> > Add a jump target so that a bit of exception handling can be better reused
> > at the end of this function.
>
> I'm not sure this is that big of a win. I mean you aren't really making the
> code any smaller and it's not making it any easier to read really.
>
> > This issue was detected by using the Coccinelle software.
>
> Assuming there was no testing done for this?
>
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > ---
> > drivers/infiniband/hw/mlx4/main.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
> > index c636842c5be0..4a598c48ea1c 100644
> > --- a/drivers/infiniband/hw/mlx4/main.c
> > +++ b/drivers/infiniband/hw/mlx4/main.c
> > @@ -1691,8 +1691,8 @@ static int __mlx4_ib_create_flow(struct ib_qp *qp, struct ib_flow_attr *flow_att
> > mdev, qp, default_table + default_flow,
> > mailbox->buf + size);
> > if (ret < 0) {
> > - mlx4_free_cmd_mailbox(mdev->dev, mailbox);
> > - return -EINVAL;
> > + ret = -EINVAL;
> > + goto free_mailbox;
>
> This might be a good opportunity to bubble up the return value rather than
> just blindly returning -EINVAL. That's really a question for Mellanox
> though.
It is worth to check it, especially for parse_flow_attr() which can
return -ENOTSUPP (need to fix return -EOPNOTSUPP).
Thanks
>
> -Denny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-10-27 19:44 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 16:12 [PATCH] IB/mlx4: Use common error handling code in __mlx4_ib_create_flow() SF Markus Elfring
2017-10-26 16:12 ` SF Markus Elfring
2017-10-26 16:12 ` SF Markus Elfring
2017-10-27 0:33 ` Dennis Dalessandro
2017-10-27 0:33 ` Dennis Dalessandro
2017-10-27 7:34 ` SF Markus Elfring
2017-10-27 7:34 ` SF Markus Elfring
[not found] ` <0c92fc8e-ecb8-c7ed-0b4c-721752297222-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-10-27 19:36 ` Leon Romanovsky
2017-10-27 19:36 ` Leon Romanovsky
2017-10-27 19:36 ` Leon Romanovsky
[not found] ` <20171027193601.GI16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-30 8:04 ` SF Markus Elfring
2017-10-30 8:04 ` SF Markus Elfring
2017-10-30 8:04 ` SF Markus Elfring
[not found] ` <e2febce9-4b80-a40e-024e-5c24964301ac-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-10-30 8:34 ` Leon Romanovsky
2017-10-30 8:34 ` Leon Romanovsky
2017-10-30 8:34 ` Leon Romanovsky
2017-10-30 8:47 ` SF Markus Elfring
2017-10-30 8:47 ` SF Markus Elfring
[not found] ` <70843f43-03c5-8295-643a-4f228ff2e907-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-10-27 19:44 ` Leon Romanovsky [this message]
2017-10-27 19:44 ` [PATCH] " Leon Romanovsky
2017-10-27 19:44 ` Leon Romanovsky
2017-10-27 19:39 ` Leon Romanovsky
2017-10-27 19:39 ` Leon Romanovsky
2017-10-27 20:53 ` SF Markus Elfring
2017-10-27 20:53 ` SF Markus Elfring
2017-10-27 21:54 ` Dennis Dalessandro
2017-10-27 21:54 ` Dennis Dalessandro
2017-10-28 7:39 ` SF Markus Elfring
2017-10-28 7:39 ` SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171027194457.GK16127@mtr-leonro.local \
--to=leon@kernel.org \
--cc=dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.