Skip to content

Commit df9f9ea

Browse files
Hal RosenstockLinus Torvalds
authored andcommitted
[PATCH] IB: Add ib_coalesce_recv_mad to MAD
Add implementation for ib_coalesce_recv_mad. Also, clear allocated MAD data buffer in ib_create_send_mad. Signed-off-by: Sean Hefty <[email protected]> Signed-off-by: Hal Rosenstock <[email protected]> Cc: Roland Dreier <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f68bcc2 commit df9f9ea

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

drivers/infiniband/core/mad.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,9 @@ struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent,
796796
buf = kmalloc(sizeof *send_buf + buf_size, gfp_mask);
797797
if (!buf)
798798
return ERR_PTR(-ENOMEM);
799+
memset(buf, 0, sizeof *send_buf + buf_size);
799800

800801
send_buf = buf + buf_size;
801-
memset(send_buf, 0, sizeof *send_buf);
802802
send_buf->mad = buf;
803803

804804
send_buf->sge.addr = dma_map_single(mad_agent->device->dma_device,
@@ -1021,13 +1021,6 @@ void ib_free_recv_mad(struct ib_mad_recv_wc *mad_recv_wc)
10211021
}
10221022
EXPORT_SYMBOL(ib_free_recv_mad);
10231023

1024-
void ib_coalesce_recv_mad(struct ib_mad_recv_wc *mad_recv_wc,
1025-
void *buf)
1026-
{
1027-
printk(KERN_ERR PFX "ib_coalesce_recv_mad() not implemented yet\n");
1028-
}
1029-
EXPORT_SYMBOL(ib_coalesce_recv_mad);
1030-
10311024
struct ib_mad_agent *ib_redirect_mad_qp(struct ib_qp *qp,
10321025
u8 rmpp_version,
10331026
ib_mad_send_handler send_handler,

drivers/infiniband/include/ib_mad.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,7 @@ int ib_post_send_mad(struct ib_mad_agent *mad_agent,
365365
* This call copies a chain of received RMPP MADs into a single data buffer,
366366
* removing duplicated headers.
367367
*/
368-
void ib_coalesce_recv_mad(struct ib_mad_recv_wc *mad_recv_wc,
369-
void *buf);
368+
void ib_coalesce_recv_mad(struct ib_mad_recv_wc *mad_recv_wc, void *buf);
370369

371370
/**
372371
* ib_free_recv_mad - Returns data buffers used to receive a MAD to the

0 commit comments

Comments
 (0)