summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rdmavt/mad.c
diff options
context:
space:
mode:
authorDennis Dalessandro2016-02-14 21:10:29 +0100
committerDoug Ledford2016-03-11 02:38:08 +0100
commit90793f7179478df19ac4b2244cfd9764b28e4b38 (patch)
treecdbad7af7b4899bade80236891d381e8fd310c47 /drivers/infiniband/sw/rdmavt/mad.c
parentstaging/rdma/hfi1: Put QPs into error state after SL->SC table changes (diff)
downloadkernel-qcow2-linux-90793f7179478df19ac4b2244cfd9764b28e4b38.tar.gz
kernel-qcow2-linux-90793f7179478df19ac4b2244cfd9764b28e4b38.tar.xz
kernel-qcow2-linux-90793f7179478df19ac4b2244cfd9764b28e4b38.zip
IB/rdmavt: Clean up comments and add more documentation
Add, remove, and otherwise clean up existing comments that are leftover from the initial code postings of rdmavt. Many of the comments were added to provide an idea on the direction we were thinking of going. Now that the design is solidified make a pass over and clean everything up. Also add details where lacking. Ensure all non static functions have nano comments. Reviewed-by: Jubin John <jubin.john@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw/rdmavt/mad.c')
-rw-r--r--drivers/infiniband/sw/rdmavt/mad.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/infiniband/sw/rdmavt/mad.c b/drivers/infiniband/sw/rdmavt/mad.c
index 2feae47492df..f6e99778d7ca 100644
--- a/drivers/infiniband/sw/rdmavt/mad.c
+++ b/drivers/infiniband/sw/rdmavt/mad.c
@@ -59,14 +59,13 @@
* @in_mad: the incoming MAD
* @out_mad: any outgoing MAD reply
*
- * Returns IB_MAD_RESULT_SUCCESS if this is a MAD that we are not
- * interested in processing.
- *
* Note that the verbs framework has already done the MAD sanity checks,
* and hop count/pointer updating for IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE
* MADs.
*
* This is called by the ib_mad module.
+ *
+ * Return: IB_MAD_RESULT_SUCCESS or error
*/
int rvt_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
const struct ib_wc *in_wc, const struct ib_grh *in_grh,
@@ -75,13 +74,10 @@ int rvt_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
u16 *out_mad_pkey_index)
{
/*
- * Drivers will need to provide a number of things. For exmaple counters
- * will need to be maintained by the driver but shoud live in the rvt
- * structure. More study will be needed to finalize the interface
- * between drivers and rvt for mad packets.
- *
- *VT-DRIVER-API: ????
- *
+ * MAD processing is quite different between hfi1 and qib. Therfore this
+ * is expected to be provided by the driver. Other drivers in the future
+ * may chose to implement this but it should not be made into a
+ * requirement.
*/
if (ibport_num_to_idx(ibdev, port_num) < 0)
return -EINVAL;
@@ -95,6 +91,14 @@ static void rvt_send_mad_handler(struct ib_mad_agent *agent,
ib_free_send_mad(mad_send_wc->send_buf);
}
+/**
+ * rvt_create_mad_agents - create mad agents
+ * @rdi: rvt dev struct
+ *
+ * If driver needs to be notified of mad agent creation then call back
+ *
+ * Return 0 on success
+ */
int rvt_create_mad_agents(struct rvt_dev_info *rdi)
{
struct ib_mad_agent *agent;
@@ -136,6 +140,12 @@ err:
return ret;
}
+/**
+ * rvt_free_mad_agents - free up mad agents
+ * @rdi: rvt dev struct
+ *
+ * If driver needs notification of mad agent removal make the call back
+ */
void rvt_free_mad_agents(struct rvt_dev_info *rdi)
{
struct ib_mad_agent *agent;