Skip to content

Commit ad9efa0

Browse files
Leon Romanovskyjgunthorpe
authored andcommitted
RDMA/cm: Delete unused CM ARP functions
Clean the code by deleting ARP functions, which are not called anyway. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 017d8ea commit ad9efa0

File tree

2 files changed

+0
-100
lines changed

2 files changed

+0
-100
lines changed

drivers/infiniband/core/cm.c

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3163,72 +3163,6 @@ deref: cm_deref_id(cm_id_priv);
31633163
return -EINVAL;
31643164
}
31653165

3166-
static void cm_format_apr(struct cm_apr_msg *apr_msg,
3167-
struct cm_id_private *cm_id_priv,
3168-
enum ib_cm_apr_status status,
3169-
void *info,
3170-
u8 info_length,
3171-
const void *private_data,
3172-
u8 private_data_len)
3173-
{
3174-
cm_format_mad_hdr(&apr_msg->hdr, CM_APR_ATTR_ID, cm_id_priv->tid);
3175-
apr_msg->local_comm_id = cm_id_priv->id.local_id;
3176-
apr_msg->remote_comm_id = cm_id_priv->id.remote_id;
3177-
apr_msg->ap_status = (u8) status;
3178-
3179-
if (info && info_length) {
3180-
apr_msg->info_length = info_length;
3181-
memcpy(apr_msg->info, info, info_length);
3182-
}
3183-
3184-
if (private_data && private_data_len)
3185-
memcpy(apr_msg->private_data, private_data, private_data_len);
3186-
}
3187-
3188-
int ib_send_cm_apr(struct ib_cm_id *cm_id,
3189-
enum ib_cm_apr_status status,
3190-
void *info,
3191-
u8 info_length,
3192-
const void *private_data,
3193-
u8 private_data_len)
3194-
{
3195-
struct cm_id_private *cm_id_priv;
3196-
struct ib_mad_send_buf *msg;
3197-
unsigned long flags;
3198-
int ret;
3199-
3200-
if ((private_data && private_data_len > IB_CM_APR_PRIVATE_DATA_SIZE) ||
3201-
(info && info_length > IB_CM_APR_INFO_LENGTH))
3202-
return -EINVAL;
3203-
3204-
cm_id_priv = container_of(cm_id, struct cm_id_private, id);
3205-
spin_lock_irqsave(&cm_id_priv->lock, flags);
3206-
if (cm_id->state != IB_CM_ESTABLISHED ||
3207-
(cm_id->lap_state != IB_CM_LAP_RCVD &&
3208-
cm_id->lap_state != IB_CM_MRA_LAP_SENT)) {
3209-
ret = -EINVAL;
3210-
goto out;
3211-
}
3212-
3213-
ret = cm_alloc_msg(cm_id_priv, &msg);
3214-
if (ret)
3215-
goto out;
3216-
3217-
cm_format_apr((struct cm_apr_msg *) msg->mad, cm_id_priv, status,
3218-
info, info_length, private_data, private_data_len);
3219-
ret = ib_post_send_mad(msg, NULL);
3220-
if (ret) {
3221-
spin_unlock_irqrestore(&cm_id_priv->lock, flags);
3222-
cm_free_msg(msg);
3223-
return ret;
3224-
}
3225-
3226-
cm_id->lap_state = IB_CM_LAP_IDLE;
3227-
out: spin_unlock_irqrestore(&cm_id_priv->lock, flags);
3228-
return ret;
3229-
}
3230-
EXPORT_SYMBOL(ib_send_cm_apr);
3231-
32323166
static int cm_apr_handler(struct cm_work *work)
32333167
{
32343168
struct cm_id_private *cm_id_priv;

include/rdma/ib_cm.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -499,21 +499,6 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id,
499499
const void *private_data,
500500
u8 private_data_len);
501501

502-
/**
503-
* ib_send_cm_lap - Sends a load alternate path request.
504-
* @cm_id: Connection identifier associated with the load alternate path
505-
* message.
506-
* @alternate_path: A path record that identifies the alternate path to
507-
* load.
508-
* @private_data: Optional user-defined private data sent with the
509-
* load alternate path message.
510-
* @private_data_len: Size of the private data buffer, in bytes.
511-
*/
512-
int ib_send_cm_lap(struct ib_cm_id *cm_id,
513-
struct sa_path_rec *alternate_path,
514-
const void *private_data,
515-
u8 private_data_len);
516-
517502
/**
518503
* ib_cm_init_qp_attr - Initializes the QP attributes for use in transitioning
519504
* to a specified QP state.
@@ -534,25 +519,6 @@ int ib_cm_init_qp_attr(struct ib_cm_id *cm_id,
534519
struct ib_qp_attr *qp_attr,
535520
int *qp_attr_mask);
536521

537-
/**
538-
* ib_send_cm_apr - Sends an alternate path response message in response to
539-
* a load alternate path request.
540-
* @cm_id: Connection identifier associated with the alternate path response.
541-
* @status: Reply status sent with the alternate path response.
542-
* @info: Optional additional information sent with the alternate path
543-
* response.
544-
* @info_length: Size of the additional information, in bytes.
545-
* @private_data: Optional user-defined private data sent with the
546-
* alternate path response message.
547-
* @private_data_len: Size of the private data buffer, in bytes.
548-
*/
549-
int ib_send_cm_apr(struct ib_cm_id *cm_id,
550-
enum ib_cm_apr_status status,
551-
void *info,
552-
u8 info_length,
553-
const void *private_data,
554-
u8 private_data_len);
555-
556522
struct ib_cm_sidr_req_param {
557523
struct sa_path_rec *path;
558524
const struct ib_gid_attr *sgid_attr;

0 commit comments

Comments
 (0)