33 #include <linux/kernel.h>
34 #include <linux/slab.h>
40 static struct kmem_cache *rds_tcp_incoming_slab;
46 rdsdebug(
"purging tinc %p inc %p\n", tinc, inc);
54 rds_tcp_inc_purge(inc);
55 rdsdebug(
"freeing tinc %p inc %p\n", tinc, inc);
68 unsigned long to_copy, skb_off;
80 while (skb_off < skb->
len) {
87 to_copy =
min(to_copy, skb->
len - skb_off);
89 rdsdebug(
"ret %d size %zu skb %p skb_off %lu "
90 "skblen %d iov_base %p iov_len %zu cpy %lu\n",
91 ret, size, skb, skb_off, skb->
len,
129 unsigned int to_copy, skb_off;
130 unsigned int map_off;
132 struct rds_cong_map *
map;
145 while (skb_off < skb->len) {
149 BUG_ON(map_page >= RDS_CONG_MAP_PAGES);
153 (
void *)map->m_page_addrs[map_page] + map_off,
175 unsigned int offset,
size_t len)
184 rdsdebug(
"tcp data tc %p skb %p offset %u len %zu\n", tc, skb, offset,
200 rdsdebug(
"alloced tinc %p\n", tinc);
211 rdsdebug(
"copying %zu header from skb %p\n", to_copy,
214 (
char *)&tinc->
ti_inc.i_hdr +
237 pskb_pull(clone, offset);
238 pskb_trim(clone, to_copy);
241 rdsdebug(
"skb %p data %p len %d off %u to_copy %zu -> "
242 "clone %p data %p len %d\n",
243 skb, skb->
data, skb->
len, offset, to_copy,
244 clone, clone->
data, clone->
len);
253 rds_tcp_cong_recv(conn, tinc);
267 rdsdebug(
"returning len %zu left %zu skb len %d rx queue depth %d\n",
269 skb_queue_len(&tc->
t_sock->sk->sk_receive_queue));
289 rdsdebug(
"tcp_read_sock for tc %p gfp 0x%x returned %d\n", tc, gfp,
308 rdsdebug(
"recv worker conn %p tc %p sock %p\n", conn, tc, sock);
323 rdsdebug(
"data ready sk %p bytes %d\n", sk, bytes);
348 if (!rds_tcp_incoming_slab)