From: Wei Lin Guay Date: Fri, 4 Dec 2015 15:50:13 +0000 (+0100) Subject: RDS: Add flow control in runtime debugging X-Git-Tag: v4.1.12-92~173^2~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3657a7131db19c13956ae8c38a7ed546940074ae;p=users%2Fjedix%2Flinux-maple.git RDS: Add flow control in runtime debugging Add RDS_RTD_FLOW_CNTRL feature flag in rds_rt_debug_bitmap. Orabug: 22306628 Reviewed-by: HÃ¥kon Bugge Reviewed-by: Santosh Shilimkar Signed-off-by: Wei Lin Guay --- diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 2e2820937f72..a17d5ccacf7f 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c @@ -414,8 +414,9 @@ try_again: posted = IB_GET_POST_CREDITS(oldval); avail = IB_GET_SEND_CREDITS(oldval); - rdsdebug("rds_ib_send_grab_credits(%u): credits=%u posted=%u\n", - wanted, avail, posted); + rds_rtd(RDS_RTD_FLOW_CNTRL, + "rds_ib_send_grab_credits(%u): credits=%u posted=%u\n", + wanted, avail, posted); /* The last credit must be used to send a credit update. */ if (avail && !posted) @@ -458,10 +459,12 @@ void rds_ib_send_add_credits(struct rds_connection *conn, unsigned int credits) if (credits == 0) return; - rdsdebug("rds_ib_send_add_credits(%u): current=%u%s\n", - credits, - IB_GET_SEND_CREDITS(atomic_read(&ic->i_credits)), - test_bit(RDS_LL_SEND_FULL, &conn->c_flags) ? ", ll_send_full" : ""); + rds_rtd(RDS_RTD_FLOW_CNTRL, + "rds_ib_send_add_credits(%u): current=%u%s\n", + credits, + IB_GET_SEND_CREDITS(atomic_read(&ic->i_credits)), + test_bit(RDS_LL_SEND_FULL, &conn->c_flags) ? + ", ll_send_full" : ""); atomic_add(IB_SET_SEND_CREDITS(credits), &ic->i_credits); if (test_and_clear_bit(RDS_LL_SEND_FULL, &conn->c_flags)) @@ -493,6 +496,8 @@ void rds_ib_advertise_credits(struct rds_connection *conn, unsigned int posted) * credits and has to throttle. * For the time being, 16 seems to be a good compromise. */ + rds_rtd(RDS_RTD_FLOW_CNTRL, "ic->i_credits %u\n", + IB_GET_POST_CREDITS(atomic_read(&ic->i_credits))); if (IB_GET_POST_CREDITS(atomic_read(&ic->i_credits)) >= 16) set_bit(IB_ACK_REQUESTED, &ic->i_ack_flags); } diff --git a/net/rds/rds_rt_debug.h b/net/rds/rds_rt_debug.h index 80afccd6bdd7..a4b7ef0b300a 100644 --- a/net/rds/rds_rt_debug.h +++ b/net/rds/rds_rt_debug.h @@ -20,6 +20,7 @@ enum { RDS_RTD_SND = 1 << 14, /* 0x4000 */ RDS_RTD_SND_EXT = 1 << 15, /* 0x8000 */ + RDS_RTD_FLOW_CNTRL = 1 << 16, /* 0x10000 */ /* bit 20 ~ 31 are module specific bits */ RDS_RTD_CORE = 1 << 20, /* 0x100000 */