Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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/20191212093830.316934-46-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

authored by

Leon Romanovsky and committed by
Jason Gunthorpe
ad9efa05 017d8ead

-100
-66
drivers/infiniband/core/cm.c
··· 3163 3163 return -EINVAL; 3164 3164 } 3165 3165 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 - 3232 3166 static int cm_apr_handler(struct cm_work *work) 3233 3167 { 3234 3168 struct cm_id_private *cm_id_priv;
-34
include/rdma/ib_cm.h
··· 500 500 u8 private_data_len); 501 501 502 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 - 517 - /** 518 503 * ib_cm_init_qp_attr - Initializes the QP attributes for use in transitioning 519 504 * to a specified QP state. 520 505 * @cm_id: Communication identifier associated with the QP attributes to ··· 518 533 int ib_cm_init_qp_attr(struct ib_cm_id *cm_id, 519 534 struct ib_qp_attr *qp_attr, 520 535 int *qp_attr_mask); 521 - 522 - /** 523 - * ib_send_cm_apr - Sends an alternate path response message in response to 524 - * a load alternate path request. 525 - * @cm_id: Connection identifier associated with the alternate path response. 526 - * @status: Reply status sent with the alternate path response. 527 - * @info: Optional additional information sent with the alternate path 528 - * response. 529 - * @info_length: Size of the additional information, in bytes. 530 - * @private_data: Optional user-defined private data sent with the 531 - * alternate path response message. 532 - * @private_data_len: Size of the private data buffer, in bytes. 533 - */ 534 - int ib_send_cm_apr(struct ib_cm_id *cm_id, 535 - enum ib_cm_apr_status status, 536 - void *info, 537 - u8 info_length, 538 - const void *private_data, 539 - u8 private_data_len); 540 536 541 537 struct ib_cm_sidr_req_param { 542 538 struct sa_path_rec *path;