diff options
author | Andy Grover <andy.grover@oracle.com> | 2010-05-24 23:12:41 -0400 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-08 21:15:20 -0400 |
commit | 0b088e003ccf316a76c51be5dec2d70b93be3be8 (patch) | |
tree | 76fb8b9ab49729a97e137b73bbf4e12b65cde89d /net/rds/ib.h | |
parent | fc19de38be924728fea76026c0d1a6c4b6156084 (diff) |
RDS: Use page_remainder_alloc() for recv bufs
Instead of splitting up a page into RDS_FRAG_SIZE chunks
ourselves, ask rds_page_remainder_alloc() to do it. While it
is possible PAGE_SIZE > FRAG_SIZE, on x86en it isn't, so having
duplicate "carve up a page into buffers" code seems excessive.
The other modification this spawns is the use of a single
struct scatterlist in rds_page_frag instead of a bare page ptr.
This causes verbosity to increase in some places, and decrease
in others.
Finally, I decided to unify the lifetimes and alloc/free of
rds_page_frag and its page. This is a nice simplification in itself,
but will be extra-nice once we come to adding cmason's recycling
patch.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to 'net/rds/ib.h')
-rw-r--r-- | net/rds/ib.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/net/rds/ib.h b/net/rds/ib.h index 282ec69fe282..9bb7a7412a44 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h | |||
@@ -28,13 +28,9 @@ extern struct list_head rds_ib_devices; | |||
28 | * try and minimize the amount of memory tied up both the device and | 28 | * try and minimize the amount of memory tied up both the device and |
29 | * socket receive queues. | 29 | * socket receive queues. |
30 | */ | 30 | */ |
31 | /* page offset of the final full frag that fits in the page */ | ||
32 | #define RDS_PAGE_LAST_OFF (((PAGE_SIZE / RDS_FRAG_SIZE) - 1) * RDS_FRAG_SIZE) | ||
33 | struct rds_page_frag { | 31 | struct rds_page_frag { |
34 | struct list_head f_item; | 32 | struct list_head f_item; |
35 | struct page *f_page; | 33 | struct scatterlist f_sg; |
36 | unsigned long f_offset; | ||
37 | dma_addr_t f_mapped; | ||
38 | }; | 34 | }; |
39 | 35 | ||
40 | struct rds_ib_incoming { | 36 | struct rds_ib_incoming { |
@@ -107,7 +103,6 @@ struct rds_ib_connection { | |||
107 | struct rds_header *i_recv_hdrs; | 103 | struct rds_header *i_recv_hdrs; |
108 | u64 i_recv_hdrs_dma; | 104 | u64 i_recv_hdrs_dma; |
109 | struct rds_ib_recv_work *i_recvs; | 105 | struct rds_ib_recv_work *i_recvs; |
110 | struct rds_page_frag i_frag; | ||
111 | u64 i_ack_recv; /* last ACK received */ | 106 | u64 i_ack_recv; /* last ACK received */ |
112 | 107 | ||
113 | /* sending acks */ | 108 | /* sending acks */ |