librdmacm: set private_data_len
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 29 Jan 2010 05:04:08 +0000 (05:04 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 29 Jan 2010 05:04:08 +0000 (05:04 +0000)
From: Sean Hefty <sean.hefty@intel.com>

Set the private_data_len for reported events.  This allows
DAPL to use the value when copying private data.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2686 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/librdmacm/include/rdma/rdma_cma.h
ulp/librdmacm/src/cma.cpp

index c3b9ad1..7b9a6e0 100644 (file)
@@ -44,6 +44,8 @@ extern "C" {
  * Interfaces based on librdmacm 1.0.8.\r
  */\r
 \r
+#define RDMA_MAX_PRIVATE_DATA  56\r
+\r
 /*\r
  * Upon receiving a device removal event, users must destroy the associated\r
  * RDMA identifier and release all resources allocated with the device.\r
index 2727d88..cde309b 100644 (file)
@@ -84,7 +84,7 @@ struct cma_device
 \r
 struct cma_event {\r
        struct rdma_cm_event    event;\r
-       uint8_t                                 private_data[56];\r
+       uint8_t                                 private_data[RDMA_MAX_PRIVATE_DATA];\r
        struct cma_id_private   *id_priv;\r
 };\r
 \r
@@ -1029,6 +1029,8 @@ int rdma_get_cm_event(struct rdma_event_channel *channel,
                evt->id_priv = CONTAINING_RECORD(id, struct cma_id_private, id);\r
                evt->event.id = id;\r
                evt->event.param.conn.private_data = evt->private_data;\r
+               evt->event.param.conn.private_data_len = RDMA_MAX_PRIVATE_DATA;\r
+\r
                evt->event.status = id->ep.connect->\r
                                                        GetOverlappedResult(&entry->Overlap, &bytes, FALSE);\r
 \r