Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149713
b: refs/heads/master
c: 7b70d03
h: refs/heads/master
i:
  149711: f8deddc
v: v3
  • Loading branch information
Steve Wise authored and David S. Miller committed Apr 10, 2009
1 parent ab5d8fc commit 8c2c3e2
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 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: d39e0602bb987133321d358d9b837d67c27b223d
refs/heads/master: 7b70d0336da777c00395cc7a503497c2cdabd1a8
2 changes: 1 addition & 1 deletion trunk/net/rds/ib.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ int rds_ib_xmit_rdma(struct rds_connection *conn, struct rds_rdma_op *op);
void rds_ib_send_add_credits(struct rds_connection *conn, unsigned int credits);
void rds_ib_advertise_credits(struct rds_connection *conn, unsigned int posted);
int rds_ib_send_grab_credits(struct rds_ib_connection *ic, u32 wanted,
u32 *adv_credits, int need_posted);
u32 *adv_credits, int need_posted, int max_posted);

/* ib_stats.c */
DECLARE_PER_CPU(struct rds_ib_statistics, rds_ib_stats);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/rds/ib_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ void rds_ib_attempt_ack(struct rds_ib_connection *ic)
}

/* Can we get a send credit? */
if (!rds_ib_send_grab_credits(ic, 1, &adv_credits, 0)) {
if (!rds_ib_send_grab_credits(ic, 1, &adv_credits, 0, RDS_MAX_ADV_CREDIT)) {
rds_ib_stats_inc(s_ib_tx_throttle);
clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
return;
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/rds/ib_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void rds_ib_send_cq_comp_handler(struct ib_cq *cq, void *context)
* and using atomic_cmpxchg when updating the two counters.
*/
int rds_ib_send_grab_credits(struct rds_ib_connection *ic,
u32 wanted, u32 *adv_credits, int need_posted)
u32 wanted, u32 *adv_credits, int need_posted, int max_posted)
{
unsigned int avail, posted, got = 0, advertise;
long oldval, newval;
Expand Down Expand Up @@ -351,7 +351,7 @@ int rds_ib_send_grab_credits(struct rds_ib_connection *ic,
* available.
*/
if (posted && (got || need_posted)) {
advertise = min_t(unsigned int, posted, RDS_MAX_ADV_CREDIT);
advertise = min_t(unsigned int, posted, max_posted);
newval -= IB_SET_POST_CREDITS(advertise);
}

Expand Down Expand Up @@ -498,7 +498,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,

credit_alloc = work_alloc;
if (ic->i_flowctl) {
credit_alloc = rds_ib_send_grab_credits(ic, work_alloc, &posted, 0);
credit_alloc = rds_ib_send_grab_credits(ic, work_alloc, &posted, 0, RDS_MAX_ADV_CREDIT);
adv_credits += posted;
if (credit_alloc < work_alloc) {
rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc - credit_alloc);
Expand Down Expand Up @@ -571,7 +571,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
/*
* Update adv_credits since we reset the ACK_REQUIRED bit.
*/
rds_ib_send_grab_credits(ic, 0, &posted, 1);
rds_ib_send_grab_credits(ic, 0, &posted, 1, RDS_MAX_ADV_CREDIT - adv_credits);
adv_credits += posted;
BUG_ON(adv_credits > 255);
} else if (ic->i_rm != rm)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/rds/iw.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ int rds_iw_xmit_rdma(struct rds_connection *conn, struct rds_rdma_op *op);
void rds_iw_send_add_credits(struct rds_connection *conn, unsigned int credits);
void rds_iw_advertise_credits(struct rds_connection *conn, unsigned int posted);
int rds_iw_send_grab_credits(struct rds_iw_connection *ic, u32 wanted,
u32 *adv_credits, int need_posted);
u32 *adv_credits, int need_posted, int max_posted);

/* ib_stats.c */
DECLARE_PER_CPU(struct rds_iw_statistics, rds_iw_stats);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/rds/iw_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ void rds_iw_attempt_ack(struct rds_iw_connection *ic)
}

/* Can we get a send credit? */
if (!rds_iw_send_grab_credits(ic, 1, &adv_credits, 0)) {
if (!rds_iw_send_grab_credits(ic, 1, &adv_credits, 0, RDS_MAX_ADV_CREDIT)) {
rds_iw_stats_inc(s_iw_tx_throttle);
clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
return;
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/rds/iw_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void rds_iw_send_cq_comp_handler(struct ib_cq *cq, void *context)
* and using atomic_cmpxchg when updating the two counters.
*/
int rds_iw_send_grab_credits(struct rds_iw_connection *ic,
u32 wanted, u32 *adv_credits, int need_posted)
u32 wanted, u32 *adv_credits, int need_posted, int max_posted)
{
unsigned int avail, posted, got = 0, advertise;
long oldval, newval;
Expand Down Expand Up @@ -387,7 +387,7 @@ int rds_iw_send_grab_credits(struct rds_iw_connection *ic,
* available.
*/
if (posted && (got || need_posted)) {
advertise = min_t(unsigned int, posted, RDS_MAX_ADV_CREDIT);
advertise = min_t(unsigned int, posted, max_posted);
newval -= IB_SET_POST_CREDITS(advertise);
}

Expand Down Expand Up @@ -541,7 +541,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,

credit_alloc = work_alloc;
if (ic->i_flowctl) {
credit_alloc = rds_iw_send_grab_credits(ic, work_alloc, &posted, 0);
credit_alloc = rds_iw_send_grab_credits(ic, work_alloc, &posted, 0, RDS_MAX_ADV_CREDIT);
adv_credits += posted;
if (credit_alloc < work_alloc) {
rds_iw_ring_unalloc(&ic->i_send_ring, work_alloc - credit_alloc);
Expand Down Expand Up @@ -614,7 +614,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
/*
* Update adv_credits since we reset the ACK_REQUIRED bit.
*/
rds_iw_send_grab_credits(ic, 0, &posted, 1);
rds_iw_send_grab_credits(ic, 0, &posted, 1, RDS_MAX_ADV_CREDIT - adv_credits);
adv_credits += posted;
BUG_ON(adv_credits > 255);
} else if (ic->i_rm != rm)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/rds/rds.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct rds_connection {
#define RDS_FLAG_CONG_BITMAP 0x01
#define RDS_FLAG_ACK_REQUIRED 0x02
#define RDS_FLAG_RETRANSMITTED 0x04
#define RDS_MAX_ADV_CREDIT 127
#define RDS_MAX_ADV_CREDIT 255

/*
* Maximum space available for extension headers.
Expand Down

0 comments on commit 8c2c3e2

Please sign in to comment.