Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77dd550e authored by Andy Grover's avatar Andy Grover
Browse files

RDS: Stop supporting old cong map sending method



We now ask the transport to give us a rm for the congestion
map, and then we handle it normally. Previously, the
transport defined a function that we would call to send
a congestion map.

Convert TCP and loop transports to new cong map method.

Signed-off-by: default avatarAndy Grover <andy.grover@oracle.com>
parent e32b4a70
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -265,7 +265,6 @@ struct rds_transport rds_ib_transport = {
	.laddr_check		= rds_ib_laddr_check,
	.xmit_complete		= rds_ib_xmit_complete,
	.xmit			= rds_ib_xmit,
	.xmit_cong_map		= NULL,
	.xmit_rdma		= rds_ib_xmit_rdma,
	.xmit_atomic		= rds_ib_xmit_atomic,
	.recv			= rds_ib_recv,
+0 −1
Original line number Diff line number Diff line
@@ -264,7 +264,6 @@ struct rds_transport rds_iw_transport = {
	.laddr_check		= rds_iw_laddr_check,
	.xmit_complete		= rds_iw_xmit_complete,
	.xmit			= rds_iw_xmit,
	.xmit_cong_map		= NULL,
	.xmit_rdma		= rds_iw_xmit_rdma,
	.recv			= rds_iw_recv,
	.conn_alloc		= rds_iw_conn_alloc,
+6 −13
Original line number Diff line number Diff line
@@ -61,6 +61,12 @@ static int rds_loop_xmit(struct rds_connection *conn, struct rds_message *rm,
			 unsigned int hdr_off, unsigned int sg,
			 unsigned int off)
{
	/* Do not send cong updates to loopback */
	if (rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) {
		rds_cong_map_updated(conn->c_fcong, ~(u64) 0);
		return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
	}

	BUG_ON(hdr_off || sg || off);

	rds_inc_init(&rm->m_inc, conn, conn->c_laddr);
@@ -88,18 +94,6 @@ static void rds_loop_inc_free(struct rds_incoming *inc)
        rds_message_put(rm);
}

static int rds_loop_xmit_cong_map(struct rds_connection *conn,
				  struct rds_cong_map *map,
				  unsigned long offset)
{
	BUG_ON(offset);
	BUG_ON(map != conn->c_lcong);

	rds_cong_map_updated(conn->c_fcong, ~(u64) 0);

	return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
}

/* we need to at least give the thread something to succeed */
static int rds_loop_recv(struct rds_connection *conn)
{
@@ -180,7 +174,6 @@ void rds_loop_exit(void)
 */
struct rds_transport rds_loop_transport = {
	.xmit			= rds_loop_xmit,
	.xmit_cong_map		= rds_loop_xmit_cong_map,
	.recv			= rds_loop_recv,
	.conn_alloc		= rds_loop_conn_alloc,
	.conn_free		= rds_loop_conn_free,
+0 −6
Original line number Diff line number Diff line
@@ -393,10 +393,6 @@ struct rds_notifier {
 *                 transport is responsible for other serialization, including
 *                 rds_recv_incoming().  This is called in process context but
 *                 should try hard not to block.
 *
 * @xmit_cong_map: This asks the transport to send the local bitmap down the
 * 		   given connection.  XXX get a better story about the bitmap
 * 		   flag and header.
 */

#define RDS_TRANS_IB	0
@@ -420,8 +416,6 @@ struct rds_transport {
	void (*xmit_complete)(struct rds_connection *conn);
	int (*xmit)(struct rds_connection *conn, struct rds_message *rm,
		    unsigned int hdr_off, unsigned int sg, unsigned int off);
	int (*xmit_cong_map)(struct rds_connection *conn,
			     struct rds_cong_map *map, unsigned long offset);
	int (*xmit_rdma)(struct rds_connection *conn, struct rm_rdma_op *op);
	int (*xmit_atomic)(struct rds_connection *conn, struct rm_atomic_op *op);
	int (*recv)(struct rds_connection *conn);
+7 −32
Original line number Diff line number Diff line
@@ -147,32 +147,8 @@ int rds_send_xmit(struct rds_connection *conn)
		/*
		 * If between sending messages, we can send a pending congestion
		 * map update.
		 *
		 * Transports either define a special xmit_cong_map function,
		 * or we allocate a cong_map message and treat it just like any
		 * other send.
		 */
		if (!rm && test_and_clear_bit(0, &conn->c_map_queued)) {
			if (conn->c_trans->xmit_cong_map) {
				unsigned long map_offset = 0;
				unsigned long map_bytes = sizeof(struct rds_header) +
					RDS_CONG_MAP_BYTES;

				while (map_bytes) {
					ret = conn->c_trans->xmit_cong_map(conn, conn->c_lcong,
									   map_offset);
					if (ret <= 0) {
						/* too far down the rabbithole! */
						mutex_unlock(&conn->c_send_lock);
						rds_conn_error(conn, "Cong map xmit failed\n");
						goto out;
					}

					map_offset += ret;
					map_bytes -= ret;
				}
			} else {
				/* send cong update like a normal rm */
			rm = rds_cong_update_alloc(conn);
			if (IS_ERR(rm)) {
				ret = PTR_ERR(rm);
@@ -182,7 +158,6 @@ int rds_send_xmit(struct rds_connection *conn)

			conn->c_xmit_rm = rm;
		}
		}

		/*
		 * If not already working on one, grab the next message.
Loading