]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
rsocket: Reserve bits in rsocket message
authorSean Hefty <sean.hefty@intel.com>
Sat, 20 Oct 2012 16:19:22 +0000 (09:19 -0700)
committerSean Hefty <sean.hefty@intel.com>
Sat, 20 Oct 2012 16:19:22 +0000 (09:19 -0700)
rsockets includes the length of a data transfer in the
immediate data.  Currently 29 bits are reserved for the
length, but the maximum transfer is capped at 64K.
For future expansion, limit the length field
to 17 bits and reserve the other 12.

The interpretation of the 17 bits is modified as follows.
The lower 16 bits indicate a length, with the upper bit
indicating a scaling factor.  If the upper bit is
0, the scaling factor is 1.  The lower 16 bits indicate the
transfer size in bytes.  If the upper bit is 1, then a
scaling factor of 64K is applied.  The total transfer size is
calculated as (value carried in bits 0-15 + 1) * 64 KB.

This is backwards compatible with the current implementation.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/rsocket.c

index cc5effe1aba45a9b560cf786c5272055ee8e51d1..6bfbed673c3a2a02f986042e6e6eb9db15c62130 100644 (file)
@@ -54,6 +54,7 @@
 #include "indexer.h"
 
 #define RS_OLAP_START_SIZE 2048
+/* Data transfers over 64 KB not supported at this time */
 #define RS_MAX_TRANSFER 65536
 #define RS_QP_MAX_SIZE 0xFFFE
 #define RS_QP_CTRL_SIZE 4
@@ -76,9 +77,17 @@ static uint32_t polling_time = 10;
  * bit 29: more data, 0 - end of transfer, 1 - more data available
  *
  * for data transfers:
- * bits [28:0]: bytes transfered, 0 = 1 GB
+ * bits [28:17]: reserved
+ * bit  [16]: scaling factor for lower 16 bits
+ *            0 - no scaling factor applied
+ *            1 - value is scaled by 64K, transfer = (value + 1) x 64
+ * bits [15:0] length of transfer
  * for control messages:
- * bits [28-0]: receive credits granted
+ * bits [28-17]: reserved
+ * bit  [16]: scaling factor for lower 16 bits
+ *            0 - no scaling factor applied
+ *            1 - value is scaled by 64K, credits = (value + 1) x 64
+ * bits [15:0] receive credits granted
  */
 
 enum {