netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/mlx4: Handle return codes in mlx4_qp_attach_common
@ 2015-09-25 14:39 Robb Manes
  2015-09-27  4:31 ` Or Gerlitz
  2015-09-29  5:26 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Robb Manes @ 2015-09-25 14:39 UTC (permalink / raw)
  To: netdev; +Cc: Amir Vadai, Eyal Perry, ogerlitz

Both new_steering_entry() and existing_steering_entry() return values
based on their success or failure, but currently they fall through
silently.  This can make troubleshooting difficult, as we were unable
to tell which one of these two functions returned errors or
specifically what code was returned.  This patch remedies that
situation by passing the return codes to err, which is returned by
mlx4_qp_attach_common() itself.

This also addresses a leak in the call to mlx4_bitmap_free() as well.

Signed-off-by: Robb Manes <rmanes@redhat.com>
---
 drivers/net/ethernet/mellanox/mlx4/mcg.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c
b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index bd9ea0d..1d4e2e0 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -1184,10 +1184,11 @@ out:
     if (prot == MLX4_PROT_ETH) {
         /* manage the steering entry for promisc mode */
         if (new_entry)
-            new_steering_entry(dev, port, steer, index, qp->qpn);
+            err = new_steering_entry(dev, port, steer,
+                         index, qp->qpn);
         else
-            existing_steering_entry(dev, port, steer,
-                        index, qp->qpn);
+            err = existing_steering_entry(dev, port, steer,
+                              index, qp->qpn);
     }
     if (err && link && index != -1) {
         if (index < dev->caps.num_mgms)
-- 
2.4.3

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

* Re: [PATCH] net/mlx4: Handle return codes in mlx4_qp_attach_common
  2015-09-25 14:39 [PATCH] net/mlx4: Handle return codes in mlx4_qp_attach_common Robb Manes
@ 2015-09-27  4:31 ` Or Gerlitz
  2015-09-29  5:26 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: Or Gerlitz @ 2015-09-27  4:31 UTC (permalink / raw)
  To: Robb Manes; +Cc: netdev, Amir Vadai, Eugenia Emantayev

On Fri, Sep 25, 2015 at 5:39 PM, Robb Manes <rmanes@redhat.com> wrote:
> Both new_steering_entry() and existing_steering_entry() return values
> based on their success or failure, but currently they fall through
> silently.  This can make troubleshooting difficult, as we were unable
> to tell which one of these two functions returned errors or
> specifically what code was returned.  This patch remedies that
> situation by passing the return codes to err, which is returned by
> mlx4_qp_attach_common() itself.
>
> This also addresses a leak in the call to mlx4_bitmap_free() as well.
>
> Signed-off-by: Robb Manes <rmanes@redhat.com>

looks correct.

Acked-by: Or Gerlitz <ogerlitz@mellanox.com>

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

* Re: [PATCH] net/mlx4: Handle return codes in mlx4_qp_attach_common
  2015-09-25 14:39 [PATCH] net/mlx4: Handle return codes in mlx4_qp_attach_common Robb Manes
  2015-09-27  4:31 ` Or Gerlitz
@ 2015-09-29  5:26 ` David Miller
  2015-09-29 15:03   ` [PATCH v2] " Robb Manes
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2015-09-29  5:26 UTC (permalink / raw)
  To: rmanes; +Cc: netdev, amirv, eyalpe, ogerlitz

From: Robb Manes <rmanes@redhat.com>
Date: Fri, 25 Sep 2015 10:39:21 -0400

> @@ -1184,10 +1184,11 @@ out:
>      if (prot == MLX4_PROT_ETH) {
>          /* manage the steering entry for promisc mode */
>          if (new_entry)
> -            new_steering_entry(dev, port, steer, index, qp->qpn);
> +            err = new_steering_entry(dev, port, steer,
> +                         index, qp->qpn);
>          else
> -            existing_steering_entry(dev, port, steer,
> -                        index, qp->qpn);
> +            err = existing_steering_entry(dev, port, steer,
> +                              index, qp->qpn);

Please indent this properly.

When a function call spans multiple lines, the second and
subsequent lines must start precisely at the first column
after the openning parenthesis of the first line.  You must
use the appropriate number of TAB then SPACE characters
necessary to achieve this.

Thanks.

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

* [PATCH v2] net/mlx4: Handle return codes in mlx4_qp_attach_common
  2015-09-29  5:26 ` David Miller
@ 2015-09-29 15:03   ` Robb Manes
  2015-09-30  4:15     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Robb Manes @ 2015-09-29 15:03 UTC (permalink / raw)
  To: davem; +Cc: netdev, amirv, eyalpe, ogerlitz, Robb Manes

Both new_steering_entry() and existing_steering_entry() return values
based on their success or failure, but currently they fall through
silently.  This can make troubleshooting difficult, as we were unable
to tell which one of these two functions returned errors or
specifically what code was returned.  This patch remedies that
situation by passing the return codes to err, which is returned by
mlx4_qp_attach_common() itself.

This also addresses a leak in the call to mlx4_bitmap_free() as well.

Signed-off-by: Robb Manes <rmanes@redhat.com>
---
Sorry about the poor formatting; I should have used git-send properly.

 drivers/net/ethernet/mellanox/mlx4/mcg.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index bd9ea0d..1d4e2e0 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -1184,10 +1184,11 @@ out:
 	if (prot == MLX4_PROT_ETH) {
 		/* manage the steering entry for promisc mode */
 		if (new_entry)
-			new_steering_entry(dev, port, steer, index, qp->qpn);
+			err = new_steering_entry(dev, port, steer,
+						 index, qp->qpn);
 		else
-			existing_steering_entry(dev, port, steer,
-						index, qp->qpn);
+			err = existing_steering_entry(dev, port, steer,
+						      index, qp->qpn);
 	}
 	if (err && link && index != -1) {
 		if (index < dev->caps.num_mgms)
-- 
2.4.3

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

* Re: [PATCH v2] net/mlx4: Handle return codes in mlx4_qp_attach_common
  2015-09-29 15:03   ` [PATCH v2] " Robb Manes
@ 2015-09-30  4:15     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2015-09-30  4:15 UTC (permalink / raw)
  To: rmanes; +Cc: netdev, amirv, eyalpe, ogerlitz

From: Robb Manes <rmanes@redhat.com>
Date: Tue, 29 Sep 2015 11:03:37 -0400

> Both new_steering_entry() and existing_steering_entry() return values
> based on their success or failure, but currently they fall through
> silently.  This can make troubleshooting difficult, as we were unable
> to tell which one of these two functions returned errors or
> specifically what code was returned.  This patch remedies that
> situation by passing the return codes to err, which is returned by
> mlx4_qp_attach_common() itself.
> 
> This also addresses a leak in the call to mlx4_bitmap_free() as well.
> 
> Signed-off-by: Robb Manes <rmanes@redhat.com>

Applied, thank you.

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

end of thread, other threads:[~2015-09-30  4:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-25 14:39 [PATCH] net/mlx4: Handle return codes in mlx4_qp_attach_common Robb Manes
2015-09-27  4:31 ` Or Gerlitz
2015-09-29  5:26 ` David Miller
2015-09-29 15:03   ` [PATCH v2] " Robb Manes
2015-09-30  4:15     ` David Miller

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