From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>,
RDMA mailing list <linux-rdma@vger.kernel.org>,
Hadar Hen Zion <hadarh@mellanox.com>,
Matan Barak <matanb@mellanox.com>,
Michael J Ruhl <michael.j.ruhl@intel.com>,
Noa Osherovich <noaos@mellanox.com>,
Raed Salem <raeds@mellanox.com>,
Yishai Hadas <yishaih@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>,
linux-netdev <netdev@vger.kernel.org>
Subject: [PATCH rdma-next 04/12] RDMA/verbs: Drop kernel variant of destroy_flow
Date: Sun, 24 Jun 2018 11:23:45 +0300 [thread overview]
Message-ID: <20180624082353.16138-5-leon@kernel.org> (raw)
In-Reply-To: <20180624082353.16138-1-leon@kernel.org>
From: Leon Romanovsky <leonro@mellanox.com>
Following the removal of ib_create_flow(), adjust the code to get rid of
ib_destroy_flow() too.
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
drivers/infiniband/core/uverbs_cmd.c | 3 ++-
drivers/infiniband/core/uverbs_std_types.c | 9 ++++++---
drivers/infiniband/core/verbs.c | 12 ------------
include/rdma/ib_verbs.h | 2 --
4 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 6251d80db732..3aba63aa1779 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -3642,7 +3642,8 @@ int ib_uverbs_ex_create_flow(struct ib_uverbs_file *file,
kfree(kern_flow_attr);
return 0;
err_copy:
- ib_destroy_flow(flow_id);
+ if (!qp->device->destroy_flow(flow_id))
+ atomic_dec(&qp->usecnt);
err_free:
ib_uverbs_flow_resources_free(uflow_res);
err_free_flow_attr:
diff --git a/drivers/infiniband/core/uverbs_std_types.c b/drivers/infiniband/core/uverbs_std_types.c
index 6497263d13c8..9b4e1e53cd9c 100644
--- a/drivers/infiniband/core/uverbs_std_types.c
+++ b/drivers/infiniband/core/uverbs_std_types.c
@@ -48,14 +48,17 @@ static int uverbs_free_ah(struct ib_uobject *uobject,
static int uverbs_free_flow(struct ib_uobject *uobject,
enum rdma_remove_reason why)
{
- int ret;
struct ib_flow *flow = (struct ib_flow *)uobject->object;
struct ib_uflow_object *uflow =
container_of(uobject, struct ib_uflow_object, uobject);
+ struct ib_qp *qp = flow->qp;
+ int ret;
- ret = ib_destroy_flow(flow);
- if (!ret)
+ ret = qp->device->destroy_flow(flow);
+ if (!ret) {
+ atomic_dec(&qp->usecnt);
ib_uverbs_flow_resources_free(uflow->resources);
+ }
return ret;
}
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 5ada09f708f5..128d94988dd8 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -2275,18 +2275,6 @@ int ib_destroy_rwq_ind_table(struct ib_rwq_ind_table *rwq_ind_table)
}
EXPORT_SYMBOL(ib_destroy_rwq_ind_table);
-int ib_destroy_flow(struct ib_flow *flow_id)
-{
- int err;
- struct ib_qp *qp = flow_id->qp;
-
- err = qp->device->destroy_flow(flow_id);
- if (!err)
- atomic_dec(&qp->usecnt);
- return err;
-}
-EXPORT_SYMBOL(ib_destroy_flow);
-
int ib_check_mr_status(struct ib_mr *mr, u32 check_mask,
struct ib_mr_status *mr_status)
{
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index a55e1aa808a7..6c51190ae7a1 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -3832,8 +3832,6 @@ struct ib_xrcd *__ib_alloc_xrcd(struct ib_device *device, const char *caller);
*/
int ib_dealloc_xrcd(struct ib_xrcd *xrcd);
-int ib_destroy_flow(struct ib_flow *flow_id);
-
static inline int ib_check_mr_access(int flags)
{
/*
--
2.14.4
next prev parent reply other threads:[~2018-06-24 8:23 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-24 8:23 [PATCH rdma-next 00/12] RDMA fixes 2018-06-24 Leon Romanovsky
2018-06-24 8:23 ` [PATCH rdma-next 01/12] RDMA/uverbs: Protect from attempts to create flows on unsupported QP Leon Romanovsky
2018-06-25 21:14 ` Jason Gunthorpe
2018-06-24 8:23 ` [PATCH rdma-next 02/12] RDMA/uverbs: Check existence of create_flow callback Leon Romanovsky
2018-06-24 8:23 ` [PATCH rdma-next 03/12] RDMA/verbs: Drop kernel variant of create_flow Leon Romanovsky
2018-06-24 8:23 ` Leon Romanovsky [this message]
2018-06-24 8:23 ` [PATCH mlx5-next 05/12] net/mlx5: Rate limit errors in command interface Leon Romanovsky
2018-06-27 5:48 ` Leon Romanovsky
2018-06-24 8:23 ` [PATCH rdma-next 06/12] RDMA/uverbs: Don't overwrite NULL pointer with ZERO_SIZE_PTR Leon Romanovsky
2018-06-24 19:57 ` Jason Gunthorpe
2018-06-25 8:08 ` Leon Romanovsky
2018-06-24 8:23 ` [PATCH rdma-next 07/12] RDMA/umem: Don't check for negative return value of dma_map_sg_attrs() Leon Romanovsky
2018-06-24 8:23 ` [PATCH rdma-next 08/12] overflow.h: Add arithmetic shift helper Leon Romanovsky
[not found] ` <CAKwiHFhgsyWYD+q+JFb2HJEphnjiiOp=o4Airv3MW031q2jx8w@mail.gmail.com>
2018-06-25 17:11 ` Jason Gunthorpe
2018-06-26 4:16 ` Leon Romanovsky
[not found] ` <CAKwiHFiRYbyiJqDYCgKXKZYRr0KjCt8q9AwKwfqoCA1sT2KFyQ@mail.gmail.com>
2018-06-26 11:37 ` Leon Romanovsky
2018-06-26 17:54 ` Jason Gunthorpe
[not found] ` <CAKwiHFgchr+6HYOZ4e4e1vzL9cFabe6eonNNM8NTWZypazcuKA@mail.gmail.com>
2018-06-27 17:39 ` Leon Romanovsky
2018-06-27 18:10 ` Jason Gunthorpe
2018-06-27 18:22 ` Leon Romanovsky
2018-06-27 21:35 ` Rasmus Villemoes
2018-06-27 18:44 ` Kees Cook
2018-08-01 9:36 ` Peter Zijlstra
2018-08-01 16:14 ` Jason Gunthorpe
2018-06-26 4:24 ` Leon Romanovsky
2018-06-24 8:23 ` [PATCH rdma-next 09/12] RDMA/mlx5: Fix shift overflow in mlx5_ib_create_wq Leon Romanovsky
2018-06-24 19:56 ` Jason Gunthorpe
2018-06-25 8:10 ` Leon Romanovsky
2018-06-25 14:58 ` Jason Gunthorpe
2018-06-24 8:23 ` [PATCH rdma-next 10/12] RDMA/mlx5: Reuse existed shift_overlow helper Leon Romanovsky
2018-06-24 8:23 ` [PATCH rdma-next 11/12] RDMA/uverbs: Remove redundant check Leon Romanovsky
2018-06-24 8:23 ` [PATCH rdma-next 12/12] RDMA/uverbs: Fix slab-out-of-bounds in ib_uverbs_ex_create_flow Leon Romanovsky
2018-06-25 21:34 ` [PATCH rdma-next 00/12] RDMA fixes 2018-06-24 Jason Gunthorpe
2018-06-26 4:21 ` Leon Romanovsky
2018-06-26 20:39 ` Jason Gunthorpe
2018-06-27 5:47 ` Leon Romanovsky
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=20180624082353.16138-5-leon@kernel.org \
--to=leon@kernel.org \
--cc=dledford@redhat.com \
--cc=hadarh@mellanox.com \
--cc=jgg@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=matanb@mellanox.com \
--cc=michael.j.ruhl@intel.com \
--cc=netdev@vger.kernel.org \
--cc=noaos@mellanox.com \
--cc=raeds@mellanox.com \
--cc=saeedm@mellanox.com \
--cc=yishaih@mellanox.com \
/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.