33 #include <linux/kernel.h>
55 rds_tcp_cork(tc->
t_sock, 1);
62 rds_tcp_cork(tc->
t_sock, 0);
66 static int rds_tcp_sendmsg(
struct socket *sock,
void *
data,
unsigned int len)
81 unsigned int hdr_off,
unsigned int sg,
unsigned int off)
95 be32_to_cpu(rm->m_inc.i_hdr.h_len) - 1;
100 rdsdebug(
"rm %p tcp nxt %u ack_seq %llu\n",
102 (
unsigned long long)rm->m_ack_seq);
109 ret = rds_tcp_sendmsg(tc->
t_sock,
110 (
void *)&rm->
m_inc.i_hdr + hdr_off,
111 sizeof(rm->
m_inc.i_hdr) - hdr_off);
115 if (hdr_off + done !=
sizeof(
struct rds_header))
119 while (sg < rm->
data.op_nents) {
121 sg_page(&rm->
data.op_sg[sg]),
122 rm->
data.op_sg[sg].offset + off,
123 rm->
data.op_sg[sg].length - off,
125 rdsdebug(
"tcp sendpage %p:%u:%u ret %d\n", (
void *)sg_page(&rm->
data.op_sg[sg]),
126 rm->
data.op_sg[sg].offset + off, rm->
data.op_sg[sg].length - off,
133 if (off == rm->
data.op_sg[sg].length) {
147 "returned %d, disconnecting and reconnecting\n",
173 void (*write_space)(
struct sock *
sk);
185 rdsdebug(
"write_space for tc %p\n", tc);