Commit 4190b4e9 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Doug Ledford

RDMA/core: Rename kernel modify_cq to better describe its usage

Current ib_modify_cq() is used to set CQ moderation parameters.

This patch renames ib_modify_cq() to be rdma_set_cq_moderation(),
because the kernel version of RDMA API doesn't need to follow already
exposed to user's API pattern (create_XXX/modify_XXX/query_XXX/destroy_XXX)
and better to have more accurate name which describes the actual usage.
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 87ab3f52
...@@ -3901,7 +3901,7 @@ int ib_uverbs_ex_modify_cq(struct ib_uverbs_file *file, ...@@ -3901,7 +3901,7 @@ int ib_uverbs_ex_modify_cq(struct ib_uverbs_file *file,
if (!cq) if (!cq)
return -EINVAL; return -EINVAL;
ret = ib_modify_cq(cq, cmd.attr.cq_count, cmd.attr.cq_period); ret = rdma_set_cq_moderation(cq, cmd.attr.cq_count, cmd.attr.cq_period);
uobj_put_obj_read(cq); uobj_put_obj_read(cq);
......
...@@ -1550,12 +1550,12 @@ struct ib_cq *ib_create_cq(struct ib_device *device, ...@@ -1550,12 +1550,12 @@ struct ib_cq *ib_create_cq(struct ib_device *device,
} }
EXPORT_SYMBOL(ib_create_cq); EXPORT_SYMBOL(ib_create_cq);
int ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period) int rdma_set_cq_moderation(struct ib_cq *cq, u16 cq_count, u16 cq_period)
{ {
return cq->device->modify_cq ? return cq->device->modify_cq ?
cq->device->modify_cq(cq, cq_count, cq_period) : -ENOSYS; cq->device->modify_cq(cq, cq_count, cq_period) : -ENOSYS;
} }
EXPORT_SYMBOL(ib_modify_cq); EXPORT_SYMBOL(rdma_set_cq_moderation);
int ib_destroy_cq(struct ib_cq *cq) int ib_destroy_cq(struct ib_cq *cq)
{ {
......
...@@ -99,8 +99,9 @@ static int ipoib_set_coalesce(struct net_device *dev, ...@@ -99,8 +99,9 @@ static int ipoib_set_coalesce(struct net_device *dev,
coal->rx_max_coalesced_frames > 0xffff) coal->rx_max_coalesced_frames > 0xffff)
return -EINVAL; return -EINVAL;
ret = ib_modify_cq(priv->recv_cq, coal->rx_max_coalesced_frames, ret = rdma_set_cq_moderation(priv->recv_cq,
coal->rx_coalesce_usecs); coal->rx_max_coalesced_frames,
coal->rx_coalesce_usecs);
if (ret && ret != -ENOSYS) { if (ret && ret != -ENOSYS) {
ipoib_warn(priv, "failed modifying CQ (%d)\n", ret); ipoib_warn(priv, "failed modifying CQ (%d)\n", ret);
return ret; return ret;
......
...@@ -3169,13 +3169,13 @@ struct ib_cq *ib_create_cq(struct ib_device *device, ...@@ -3169,13 +3169,13 @@ struct ib_cq *ib_create_cq(struct ib_device *device,
int ib_resize_cq(struct ib_cq *cq, int cqe); int ib_resize_cq(struct ib_cq *cq, int cqe);
/** /**
* ib_modify_cq - Modifies moderation params of the CQ * rdma_set_cq_moderation - Modifies moderation params of the CQ
* @cq: The CQ to modify. * @cq: The CQ to modify.
* @cq_count: number of CQEs that will trigger an event * @cq_count: number of CQEs that will trigger an event
* @cq_period: max period of time in usec before triggering an event * @cq_period: max period of time in usec before triggering an event
* *
*/ */
int ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period); int rdma_set_cq_moderation(struct ib_cq *cq, u16 cq_count, u16 cq_period);
/** /**
* ib_destroy_cq - Destroys the specified CQ. * ib_destroy_cq - Destroys the specified CQ.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment