* [PATCH V2] IB/mlx5: Unify CQ create flags check
@ 2015-12-29 11:34 Leon Romanovsky
[not found] ` <1451388884-11673-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Leon Romanovsky @ 2015-12-29 11:34 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky
From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
The create_cq() can receive creation flags which were used
differently by two following commits [1] and [2]. The current
code caused to not accept any flags at all.
This patch unifies the check into one function and one return
error code.
Fixes: 972ecb821379 ("IB/mlx5: Add create_cq extended command")
Fixes: 051f263098a9 ("IB/mlx5: Add driver cross-channel support")
[1] http://www.spinics.net/lists/linux-rdma/msg31430.html
[2] http://www.spinics.net/lists/linux-rdma/msg31658.html
Changes from v0:
* Add Fixes tag
Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/mlx5/cq.c | 9 +--------
drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 ++-
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
index b14316603e44..7ddc790b1819 100644
--- a/drivers/infiniband/hw/mlx5/cq.c
+++ b/drivers/infiniband/hw/mlx5/cq.c
@@ -757,10 +757,6 @@ static void destroy_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq)
mlx5_db_free(dev->mdev, &cq->db);
}
-enum {
- CQ_CREATE_FLAGS_SUPPORTED = IB_CQ_FLAGS_TIMESTAMP_COMPLETION
-};
-
struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
const struct ib_cq_init_attr *attr,
struct ib_ucontext *context,
@@ -778,13 +774,10 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
int eqn;
int err;
- if (check_cq_create_flags(attr->flags))
- return ERR_PTR(-EINVAL);
-
if (entries < 0)
return ERR_PTR(-EINVAL);
- if (attr->flags & ~CQ_CREATE_FLAGS_SUPPORTED)
+ if (check_cq_create_flags(attr->flags))
return ERR_PTR(-EOPNOTSUPP);
entries = roundup_pow_of_two(entries + 1);
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index d4b227126265..fbf14a768105 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -692,6 +692,7 @@ static inline u32 check_cq_create_flags(u32 flags)
* It returns non-zero value for unsupported CQ
* create flags, otherwise it returns zero.
*/
- return (flags & ~IB_CQ_FLAGS_IGNORE_OVERRUN);
+ return (flags & ~(IB_CQ_FLAGS_IGNORE_OVERRUN |
+ IB_CQ_FLAGS_TIMESTAMP_COMPLETION));
}
#endif /* MLX5_IB_H */
--
1.7.12.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] 6+ messages in thread
* Re: [PATCH V2] IB/mlx5: Unify CQ create flags check
[not found] ` <1451388884-11673-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
@ 2015-12-29 13:51 ` Sagi Grimberg
[not found] ` <56828FF3.7010904-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Sagi Grimberg @ 2015-12-29 13:51 UTC (permalink / raw)
To: Leon Romanovsky, dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky
> From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> The create_cq() can receive creation flags which were used
> differently by two following commits [1] and [2]. The current
> code caused to not accept any flags at all.
We can skip referencing the linux-rdma mailing list.
>
> This patch unifies the check into one function and one return
> error code.
>
> Fixes: 972ecb821379 ("IB/mlx5: Add create_cq extended command")
> Fixes: 051f263098a9 ("IB/mlx5: Add driver cross-channel support")
>
> [1] http://www.spinics.net/lists/linux-rdma/msg31430.html
> [2] http://www.spinics.net/lists/linux-rdma/msg31658.html
>
> Changes from v0:
> * Add Fixes tag
Umm, the above ([1], [2], Changes) usually go under the "---"
separator so we won't see them in git log forever.
>
> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> drivers/infiniband/hw/mlx5/cq.c | 9 +--------
> drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 ++-
> 2 files changed, 3 insertions(+), 9 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] 6+ messages in thread
* Re: [PATCH V2] IB/mlx5: Unify CQ create flags check
[not found] ` <56828FF3.7010904-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2015-12-29 14:03 ` Leon Romanovsky
[not found] ` <20151229140341.GE17694-2ukJVAZIZ/Y@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Leon Romanovsky @ 2015-12-29 14:03 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky
On Tue, Dec 29, 2015 at 03:51:47PM +0200, Sagi Grimberg wrote:
> >From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >
> >The create_cq() can receive creation flags which were used
> >differently by two following commits [1] and [2]. The current
> >code caused to not accept any flags at all.
>
> We can skip referencing the linux-rdma mailing list.
>
> >
> >This patch unifies the check into one function and one return
> >error code.
> >
> >Fixes: 972ecb821379 ("IB/mlx5: Add create_cq extended command")
> >Fixes: 051f263098a9 ("IB/mlx5: Add driver cross-channel support")
> >
> >[1] http://www.spinics.net/lists/linux-rdma/msg31430.html
> >[2] http://www.spinics.net/lists/linux-rdma/msg31658.html
> >
> >Changes from v0:
> > * Add Fixes tag
>
> Umm, the above ([1], [2], Changes) usually go under the "---"
> separator so we won't see them in git log forever.
Doug,
Do you want me resend the patch?
>
> >
> >Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >---
> > drivers/infiniband/hw/mlx5/cq.c | 9 +--------
> > drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 ++-
> > 2 files changed, 3 insertions(+), 9 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] 6+ messages in thread
* [PATCH V2] IB/mlx5: Unify CQ create flags check
@ 2015-12-29 14:41 Leon Romanovsky
[not found] ` <1451400097-17252-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Leon Romanovsky @ 2015-12-29 14:41 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky
From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
The create_cq() can receive creation flags which were used
differently by two commits which added create_cq extended
command and cross-channel. The merged code caused to not
accept any flags at all.
This patch unifies the check into one function and one return
error code.
Fixes: 972ecb821379 ("IB/mlx5: Add create_cq extended command")
Fixes: 051f263098a9 ("IB/mlx5: Add driver cross-channel support")
---
Changes from v1:
* Remove links to linux-rdma from commit message
* Placed change log under git comment section (---)
Changes from v0:
* Add Fixes tag
Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/mlx5/cq.c | 9 +--------
drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 ++-
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
index b14316603e44..7ddc790b1819 100644
--- a/drivers/infiniband/hw/mlx5/cq.c
+++ b/drivers/infiniband/hw/mlx5/cq.c
@@ -757,10 +757,6 @@ static void destroy_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq)
mlx5_db_free(dev->mdev, &cq->db);
}
-enum {
- CQ_CREATE_FLAGS_SUPPORTED = IB_CQ_FLAGS_TIMESTAMP_COMPLETION
-};
-
struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
const struct ib_cq_init_attr *attr,
struct ib_ucontext *context,
@@ -778,13 +774,10 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
int eqn;
int err;
- if (check_cq_create_flags(attr->flags))
- return ERR_PTR(-EINVAL);
-
if (entries < 0)
return ERR_PTR(-EINVAL);
- if (attr->flags & ~CQ_CREATE_FLAGS_SUPPORTED)
+ if (check_cq_create_flags(attr->flags))
return ERR_PTR(-EOPNOTSUPP);
entries = roundup_pow_of_two(entries + 1);
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index d4b227126265..fbf14a768105 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -692,6 +692,7 @@ static inline u32 check_cq_create_flags(u32 flags)
* It returns non-zero value for unsupported CQ
* create flags, otherwise it returns zero.
*/
- return (flags & ~IB_CQ_FLAGS_IGNORE_OVERRUN);
+ return (flags & ~(IB_CQ_FLAGS_IGNORE_OVERRUN |
+ IB_CQ_FLAGS_TIMESTAMP_COMPLETION));
}
#endif /* MLX5_IB_H */
--
1.7.12.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] 6+ messages in thread
* Re: [PATCH V2] IB/mlx5: Unify CQ create flags check
[not found] ` <20151229140341.GE17694-2ukJVAZIZ/Y@public.gmane.org>
@ 2015-12-29 14:42 ` Leon Romanovsky
0 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2015-12-29 14:42 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky
On Tue, Dec 29, 2015 at 04:03:41PM +0200, Leon Romanovsky wrote:
> On Tue, Dec 29, 2015 at 03:51:47PM +0200, Sagi Grimberg wrote:
> > >From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > >
> > >The create_cq() can receive creation flags which were used
> > >differently by two following commits [1] and [2]. The current
> > >code caused to not accept any flags at all.
> >
> > We can skip referencing the linux-rdma mailing list.
> >
> > >
> > >This patch unifies the check into one function and one return
> > >error code.
> > >
> > >Fixes: 972ecb821379 ("IB/mlx5: Add create_cq extended command")
> > >Fixes: 051f263098a9 ("IB/mlx5: Add driver cross-channel support")
> > >
> > >[1] http://www.spinics.net/lists/linux-rdma/msg31430.html
> > >[2] http://www.spinics.net/lists/linux-rdma/msg31658.html
> > >
> > >Changes from v0:
> > > * Add Fixes tag
> >
> > Umm, the above ([1], [2], Changes) usually go under the "---"
> > separator so we won't see them in git log forever.
>
> Doug,
> Do you want me resend the patch?
I sent new version.
Thanks.
>
> >
> > >
> > >Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > >---
> > > drivers/infiniband/hw/mlx5/cq.c | 9 +--------
> > > drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 ++-
> > > 2 files changed, 3 insertions(+), 9 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] 6+ messages in thread
* Re: [PATCH V2] IB/mlx5: Unify CQ create flags check
[not found] ` <1451400097-17252-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
@ 2015-12-29 14:47 ` Or Gerlitz
0 siblings, 0 replies; 6+ messages in thread
From: Or Gerlitz @ 2015-12-29 14:47 UTC (permalink / raw)
To: Leon Romanovsky
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky
On 12/29/2015 4:41 PM, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> The create_cq() can receive creation flags which were used
> differently by two commits which added create_cq extended
> command and cross-channel. The merged code caused to not
> accept any flags at all.
>
> This patch unifies the check into one function and one return
> error code.
>
> Fixes: 972ecb821379 ("IB/mlx5: Add create_cq extended command")
> Fixes: 051f263098a9 ("IB/mlx5: Add driver cross-channel support")
>
> ---
> Changes from v1:
> * Remove links to linux-rdma from commit message
> * Placed change log under git comment section (---)
> Changes from v0:
> * Add Fixes tag
>
> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
wrong placing. Needs to be before the 1st --- and w.o blank lines after
the Fixes: lines please
Please use dry runs to get this to run (...) correctly
> ---
> drivers/infiniband/hw/mlx5/cq.c | 9 +--------
> drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 ++-
> 2 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
> index b14316603e44..7ddc790b1819 100644
> --- a/drivers/infiniband/hw/mlx5/cq.c
> +++ b/drivers/infiniband/hw/mlx5/cq.c
> @@ -757,10 +757,6 @@ static void destroy_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq)
> mlx5_db_free(dev->mdev, &cq->db);
> }
>
> -enum {
> - CQ_CREATE_FLAGS_SUPPORTED = IB_CQ_FLAGS_TIMESTAMP_COMPLETION
> -};
> -
> struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
> const struct ib_cq_init_attr *attr,
> struct ib_ucontext *context,
> @@ -778,13 +774,10 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
> int eqn;
> int err;
>
> - if (check_cq_create_flags(attr->flags))
> - return ERR_PTR(-EINVAL);
> -
> if (entries < 0)
> return ERR_PTR(-EINVAL);
>
> - if (attr->flags & ~CQ_CREATE_FLAGS_SUPPORTED)
> + if (check_cq_create_flags(attr->flags))
> return ERR_PTR(-EOPNOTSUPP);
>
> entries = roundup_pow_of_two(entries + 1);
> diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> index d4b227126265..fbf14a768105 100644
> --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
> +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> @@ -692,6 +692,7 @@ static inline u32 check_cq_create_flags(u32 flags)
> * It returns non-zero value for unsupported CQ
> * create flags, otherwise it returns zero.
> */
> - return (flags & ~IB_CQ_FLAGS_IGNORE_OVERRUN);
> + return (flags & ~(IB_CQ_FLAGS_IGNORE_OVERRUN |
> + IB_CQ_FLAGS_TIMESTAMP_COMPLETION));
> }
> #endif /* MLX5_IB_H */
--
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] 6+ messages in thread
end of thread, other threads:[~2015-12-29 14:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-29 11:34 [PATCH V2] IB/mlx5: Unify CQ create flags check Leon Romanovsky
[not found] ` <1451388884-11673-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2015-12-29 13:51 ` Sagi Grimberg
[not found] ` <56828FF3.7010904-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-29 14:03 ` Leon Romanovsky
[not found] ` <20151229140341.GE17694-2ukJVAZIZ/Y@public.gmane.org>
2015-12-29 14:42 ` Leon Romanovsky
-- strict thread matches above, loose matches on Subject: below --
2015-12-29 14:41 Leon Romanovsky
[not found] ` <1451400097-17252-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2015-12-29 14:47 ` Or Gerlitz
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).