Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214442
b: refs/heads/master
c: 3324412
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason authored and Andy Grover committed Sep 9, 2010
1 parent c47b99e commit 768c2e8
Show file tree
Hide file tree
Showing 4 changed files with 298 additions and 53 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc24f78085e8771670af42f2b8929b16a0c98a22
refs/heads/master: 33244125871734ebc0d8d147680a0d7e99385e0b
19 changes: 19 additions & 0 deletions trunk/net/rds/ib.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#define RDS_IB_SUPPORTED_PROTOCOLS 0x00000003 /* minor versions supported */

#define RDS_IB_RECYCLE_BATCH_COUNT 32

extern struct list_head rds_ib_devices;

/*
Expand All @@ -30,14 +32,27 @@ extern struct list_head rds_ib_devices;
*/
struct rds_page_frag {
struct list_head f_item;
struct list_head f_cache_entry;
struct scatterlist f_sg;
};

struct rds_ib_incoming {
struct list_head ii_frags;
struct list_head ii_cache_entry;
struct rds_incoming ii_inc;
};

struct rds_ib_cache_head {
struct list_head *first;
unsigned long count;
};

struct rds_ib_refill_cache {
struct rds_ib_cache_head *percpu;
struct list_head *xfer;
struct list_head *ready;
};

struct rds_ib_connect_private {
/* Add new fields at the end, and don't permute existing fields. */
__be32 dp_saddr;
Expand Down Expand Up @@ -104,6 +119,8 @@ struct rds_ib_connection {
u64 i_recv_hdrs_dma;
struct rds_ib_recv_work *i_recvs;
u64 i_ack_recv; /* last ACK received */
struct rds_ib_refill_cache i_cache_incs;
struct rds_ib_refill_cache i_cache_frags;

/* sending acks */
unsigned long i_ack_flags;
Expand Down Expand Up @@ -304,6 +321,8 @@ void rds_ib_flush_mrs(void);
int __init rds_ib_recv_init(void);
void rds_ib_recv_exit(void);
int rds_ib_recv(struct rds_connection *conn);
int rds_ib_recv_alloc_caches(struct rds_ib_connection *ic);
void rds_ib_recv_free_caches(struct rds_ib_connection *ic);
int rds_ib_recv_refill(struct rds_connection *conn, int prefill);
void rds_ib_inc_free(struct rds_incoming *inc);
int rds_ib_inc_copy_to_user(struct rds_incoming *inc, struct iovec *iov,
Expand Down
9 changes: 9 additions & 0 deletions trunk/net/rds/ib_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,12 +709,19 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)
{
struct rds_ib_connection *ic;
unsigned long flags;
int ret;

/* XXX too lazy? */
ic = kzalloc(sizeof(struct rds_ib_connection), GFP_KERNEL);
if (!ic)
return -ENOMEM;

ret = rds_ib_recv_alloc_caches(ic);
if (ret) {
kfree(ic);
return ret;
}

INIT_LIST_HEAD(&ic->ib_node);
tasklet_init(&ic->i_recv_tasklet, rds_ib_recv_tasklet_fn,
(unsigned long) ic);
Expand Down Expand Up @@ -763,6 +770,8 @@ void rds_ib_conn_free(void *arg)
list_del(&ic->ib_node);
spin_unlock_irq(lock_ptr);

rds_ib_recv_free_caches(ic);

kfree(ic);
}

Expand Down
Loading

0 comments on commit 768c2e8

Please sign in to comment.