rds: srq initialization and cleanup
RDS has the following two problem related to shared receive queues
1) srq initialization:
When a new IB dev is registered to device_list, the .add methods
of clients in client_list are called to do some initialization work.
For RDS, rds_ib_add_one() is called. srq related things should be
well initialized here since this is the last change before using srq.
However, code only allocates memory and seems hope rds_ib_srqs_init()
to initialize it later. But infact, rds_ib_srqs_init()
is not called if the call path is not insmod of rds_rdma.
2) srq cleanup:
When removing rds_rdma module, srqs for all rds_ib_device should
be cleaned up. However, code only frees the rds_ib_device.srq memory
and is not cleaning up memory pointed to by pointers embedded inside.
This lead to resource leak.
This patch fixes the above two problems.
Orabug:
21795815
Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Chien Yen <chien.yen@oracle.com>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>