diff options
author | Andy Grover <andy.grover@oracle.com> | 2009-07-17 09:13:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-20 11:03:03 -0400 |
commit | 02a6a2592e41d27644d647f3bce23598649961bc (patch) | |
tree | 7455566e6f3ff13279bb5949f06e398dbb8cff1a /net/rds/ib.h | |
parent | 9ddbcfa098bae757d3760dd1dbf2847a0bd5a525 (diff) |
RDS/IB: Handle connections using RDS 3.0 wire protocol
The big differences between RDS 3.0 and 3.1 are protocol-level
flow control, and with 3.1 the header is in front of the data. The header
always ends up in the header buffer, and the data goes in the data page.
In 3.0 our "header" is a trailer, and will end up either in the data
page, the header buffer, or split across the two. Since 3.1 is backwards-
compatible with 3.0, we need to continue to support these cases. This
patch does that -- if using RDS 3.0 wire protocol, it will copy the header
from wherever it ended up into the header buffer.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/ib.h')
-rw-r--r-- | net/rds/ib.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/rds/ib.h b/net/rds/ib.h index 420afb95ca1a..c0de7af6cf60 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h | |||
@@ -358,17 +358,25 @@ extern ctl_table rds_ib_sysctl_table[]; | |||
358 | /* | 358 | /* |
359 | * Helper functions for getting/setting the header and data SGEs in | 359 | * Helper functions for getting/setting the header and data SGEs in |
360 | * RDS packets (not RDMA) | 360 | * RDS packets (not RDMA) |
361 | * | ||
362 | * From version 3.1 onwards, header is in front of data in the sge. | ||
361 | */ | 363 | */ |
362 | static inline struct ib_sge * | 364 | static inline struct ib_sge * |
363 | rds_ib_header_sge(struct rds_ib_connection *ic, struct ib_sge *sge) | 365 | rds_ib_header_sge(struct rds_ib_connection *ic, struct ib_sge *sge) |
364 | { | 366 | { |
365 | return &sge[0]; | 367 | if (ic->conn->c_version > RDS_PROTOCOL_3_0) |
368 | return &sge[0]; | ||
369 | else | ||
370 | return &sge[1]; | ||
366 | } | 371 | } |
367 | 372 | ||
368 | static inline struct ib_sge * | 373 | static inline struct ib_sge * |
369 | rds_ib_data_sge(struct rds_ib_connection *ic, struct ib_sge *sge) | 374 | rds_ib_data_sge(struct rds_ib_connection *ic, struct ib_sge *sge) |
370 | { | 375 | { |
371 | return &sge[1]; | 376 | if (ic->conn->c_version > RDS_PROTOCOL_3_0) |
377 | return &sge[1]; | ||
378 | else | ||
379 | return &sge[0]; | ||
372 | } | 380 | } |
373 | 381 | ||
374 | #endif | 382 | #endif |