All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next 0/3] Mellanox mlx4 IB driver fixes 29-Jan-2015
@ 2015-01-29  8:41 Or Gerlitz
       [not found] ` <1422520903-22007-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Or Gerlitz @ 2015-01-29  8:41 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Amir Vadai, Tal Alon, Or Gerlitz

Hi Roland,

This is small batch of mlx4 IB driver fixes, please apply for for 3.20

Note that there's another mlx4 IB driver fix I sent for 3.19 and you 
didn't pick yet, "IB/mlx4: Fix wrong usage of IPv4 protocol for multicast 
attach/detach" https://patchwork.kernel.org/patch/5507181 -- add it too.

Or.

Jack Morgenstein (1):
  IB/mlx4: In mlx4_ib_demux_cm, print out GUID in host-endian order

Majd Dibbiny (2):
  IB/mlx4: Fix memory leak in __mlx4_ib_modify_qp
  IB/mlx4: Bug fixes in mlx4_ib_resize_cq

 drivers/infiniband/hw/mlx4/cm.c |    2 +-
 drivers/infiniband/hw/mlx4/cq.c |    7 +++----
 drivers/infiniband/hw/mlx4/qp.c |    6 ++++--
 3 files changed, 8 insertions(+), 7 deletions(-)

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

* [PATCH for-next 1/3] IB/mlx4: Fix memory leak in __mlx4_ib_modify_qp
       [not found] ` <1422520903-22007-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-01-29  8:41   ` Or Gerlitz
  2015-01-29  8:41   ` [PATCH for-next 2/3] IB/mlx4: Bug fixes in mlx4_ib_resize_cq Or Gerlitz
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Or Gerlitz @ 2015-01-29  8:41 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Amir Vadai, Tal Alon,
	Majd Dibbiny, Or Gerlitz

From: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

In case handle_eth_ud_smac_index fails, we need to free the allocated resources.

Fixes: 2f5bb473 ('mlx4: Add ref counting to port MAC table for RoCE')
Signed-off-by: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/qp.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index cf000b7..c880329 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1674,8 +1674,10 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
 			    qp->mlx4_ib_qp_type == MLX4_IB_QPT_PROXY_GSI ||
 			    qp->mlx4_ib_qp_type == MLX4_IB_QPT_TUN_GSI) {
 				err = handle_eth_ud_smac_index(dev, qp, (u8 *)attr->smac, context);
-				if (err)
-					return -EINVAL;
+				if (err) {
+					err = -EINVAL;
+					goto out;
+				}
 				if (qp->mlx4_ib_qp_type == MLX4_IB_QPT_PROXY_GSI)
 					dev->qp1_proxy[qp->port - 1] = qp;
 			}
-- 
1.7.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

* [PATCH for-next 2/3] IB/mlx4: Bug fixes in mlx4_ib_resize_cq
       [not found] ` <1422520903-22007-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2015-01-29  8:41   ` [PATCH for-next 1/3] IB/mlx4: Fix memory leak in __mlx4_ib_modify_qp Or Gerlitz
@ 2015-01-29  8:41   ` Or Gerlitz
  2015-01-29  8:41   ` [PATCH for-next 3/3] IB/mlx4: In mlx4_ib_demux_cm, print out GUID in host-endian order Or Gerlitz
  2015-02-17 19:23   ` [PATCH for-next 0/3] Mellanox mlx4 IB driver fixes 29-Jan-2015 Or Gerlitz
  3 siblings, 0 replies; 5+ messages in thread
From: Or Gerlitz @ 2015-01-29  8:41 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Amir Vadai, Tal Alon,
	Majd Dibbiny, Or Gerlitz

From: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

1. Before the entries alignment, we need to check that the entries doesn't
exceed the device's max cqe.

2. After the alignment, we need to make sure that the aligned number doesn't
exceed the max cqes+1. The additional cqe is used to denote that the resizing
operation has completed.

3. If the users asks to resize the CQ with entries less than the oustanding cqes
we should fail instead of returning 0.

Signed-off-by: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/cq.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index a3b70f6..cb63ecd 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -367,8 +367,7 @@ int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
 	int err;
 
 	mutex_lock(&cq->resize_mutex);
-
-	if (entries < 1) {
+	if (entries < 1 || entries > dev->dev->caps.max_cqes) {
 		err = -EINVAL;
 		goto out;
 	}
@@ -379,7 +378,7 @@ int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
 		goto out;
 	}
 
-	if (entries > dev->dev->caps.max_cqes) {
+	if (entries > dev->dev->caps.max_cqes + 1) {
 		err = -EINVAL;
 		goto out;
 	}
@@ -392,7 +391,7 @@ int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
 		/* Can't be smaller than the number of outstanding CQEs */
 		outst_cqe = mlx4_ib_get_outstanding_cqes(cq);
 		if (entries < outst_cqe + 1) {
-			err = 0;
+			err = -EINVAL;
 			goto out;
 		}
 
-- 
1.7.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

* [PATCH for-next 3/3] IB/mlx4: In mlx4_ib_demux_cm, print out GUID in host-endian order
       [not found] ` <1422520903-22007-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2015-01-29  8:41   ` [PATCH for-next 1/3] IB/mlx4: Fix memory leak in __mlx4_ib_modify_qp Or Gerlitz
  2015-01-29  8:41   ` [PATCH for-next 2/3] IB/mlx4: Bug fixes in mlx4_ib_resize_cq Or Gerlitz
@ 2015-01-29  8:41   ` Or Gerlitz
  2015-02-17 19:23   ` [PATCH for-next 0/3] Mellanox mlx4 IB driver fixes 29-Jan-2015 Or Gerlitz
  3 siblings, 0 replies; 5+ messages in thread
From: Or Gerlitz @ 2015-01-29  8:41 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Amir Vadai, Tal Alon,
	Jack Morgenstein, Hal Rosenstock, Or Gerlitz

From: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

If a GUID is not found, the 64-bit GUID printed in the message log
warning should converted to host-endian order for printing.

Found by Doug Ledford and Hal Rosenstock. Fix suggested by Hal.


Signed-off-by: Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Signed-off-by: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/cm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/cm.c b/drivers/infiniband/hw/mlx4/cm.c
index 56a593e..39a4888 100644
--- a/drivers/infiniband/hw/mlx4/cm.c
+++ b/drivers/infiniband/hw/mlx4/cm.c
@@ -372,7 +372,7 @@ int mlx4_ib_demux_cm_handler(struct ib_device *ibdev, int port, int *slave,
 		*slave = mlx4_ib_find_real_gid(ibdev, port, gid.global.interface_id);
 		if (*slave < 0) {
 			mlx4_ib_warn(ibdev, "failed matching slave_id by gid (0x%llx)\n",
-					gid.global.interface_id);
+				     be64_to_cpu(gid.global.interface_id));
 			return -ENOENT;
 		}
 		return 0;
-- 
1.7.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 for-next 0/3] Mellanox mlx4 IB driver fixes 29-Jan-2015
       [not found] ` <1422520903-22007-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-01-29  8:41   ` [PATCH for-next 3/3] IB/mlx4: In mlx4_ib_demux_cm, print out GUID in host-endian order Or Gerlitz
@ 2015-02-17 19:23   ` Or Gerlitz
  3 siblings, 0 replies; 5+ messages in thread
From: Or Gerlitz @ 2015-02-17 19:23 UTC (permalink / raw)
  To: Or Gerlitz, Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Roland Dreier

On Thu, Jan 29, 2015 at 3:41 AM, Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
> Hi Roland,
>
> This is small batch of mlx4 IB driver fixes, please apply for for 3.20

Ditto here, these are for 3.20 and at your patchworks

>
> Note that there's another mlx4 IB driver fix I sent for 3.19 and you
> didn't pick yet, "IB/mlx4: Fix wrong usage of IPv4 protocol for multicast
> attach/detach" https://patchwork.kernel.org/patch/5507181 -- add it too.
>
> Or.
>
> Jack Morgenstein (1):
>   IB/mlx4: In mlx4_ib_demux_cm, print out GUID in host-endian order
>
> Majd Dibbiny (2):
>   IB/mlx4: Fix memory leak in __mlx4_ib_modify_qp
>   IB/mlx4: Bug fixes in mlx4_ib_resize_cq
>
>  drivers/infiniband/hw/mlx4/cm.c |    2 +-
>  drivers/infiniband/hw/mlx4/cq.c |    7 +++----
>  drivers/infiniband/hw/mlx4/qp.c |    6 ++++--
>  3 files changed, 8 insertions(+), 7 deletions(-)
>
> --
> 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

end of thread, other threads:[~2015-02-17 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29  8:41 [PATCH for-next 0/3] Mellanox mlx4 IB driver fixes 29-Jan-2015 Or Gerlitz
     [not found] ` <1422520903-22007-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-01-29  8:41   ` [PATCH for-next 1/3] IB/mlx4: Fix memory leak in __mlx4_ib_modify_qp Or Gerlitz
2015-01-29  8:41   ` [PATCH for-next 2/3] IB/mlx4: Bug fixes in mlx4_ib_resize_cq Or Gerlitz
2015-01-29  8:41   ` [PATCH for-next 3/3] IB/mlx4: In mlx4_ib_demux_cm, print out GUID in host-endian order Or Gerlitz
2015-02-17 19:23   ` [PATCH for-next 0/3] Mellanox mlx4 IB driver fixes 29-Jan-2015 Or Gerlitz

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.