Skip to content

Commit e49bb33

Browse files
edumazetdavem330
authored andcommitted
inet: uninline inet_reqsk_alloc()
inet_reqsk_alloc() is becoming fat and should not be inlined. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 407640d commit e49bb33

2 files changed

Lines changed: 26 additions & 22 deletions

File tree

‎include/net/inet_sock.h‎

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -244,28 +244,8 @@ static inline unsigned int __inet_ehashfn(const __be32 laddr,
244244
initval);
245245
}
246246

247-
static inline struct request_sock *
248-
inet_reqsk_alloc(const struct request_sock_ops *ops, struct sock *sk_listener)
249-
{
250-
struct request_sock *req = reqsk_alloc(ops);
251-
252-
if (req) {
253-
struct inet_request_sock *ireq = inet_rsk(req);
254-
255-
kmemcheck_annotate_bitfield(ireq, flags);
256-
ireq->opt = NULL;
257-
atomic64_set(&ireq->ir_cookie, 0);
258-
ireq->ireq_state = TCP_NEW_SYN_RECV;
259-
write_pnet(&ireq->ireq_net, sock_net(sk_listener));
260-
261-
/* Following is temporary. It is coupled with debugging
262-
* helpers in reqsk_put() & reqsk_free()
263-
*/
264-
atomic_set(&ireq->ireq_refcnt, 0);
265-
}
266-
267-
return req;
268-
}
247+
struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
248+
struct sock *sk_listener);
269249

270250
static inline __u8 inet_sk_flowi_flags(const struct sock *sk)
271251
{

‎net/ipv4/tcp_input.c‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5967,6 +5967,30 @@ static void tcp_openreq_init(struct request_sock *req,
59675967
ireq->ir_mark = inet_request_mark(sk, skb);
59685968
}
59695969

5970+
struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
5971+
struct sock *sk_listener)
5972+
{
5973+
struct request_sock *req = reqsk_alloc(ops);
5974+
5975+
if (req) {
5976+
struct inet_request_sock *ireq = inet_rsk(req);
5977+
5978+
kmemcheck_annotate_bitfield(ireq, flags);
5979+
ireq->opt = NULL;
5980+
atomic64_set(&ireq->ir_cookie, 0);
5981+
ireq->ireq_state = TCP_NEW_SYN_RECV;
5982+
write_pnet(&ireq->ireq_net, sock_net(sk_listener));
5983+
5984+
/* Following is temporary. It is coupled with debugging
5985+
* helpers in reqsk_put() & reqsk_free()
5986+
*/
5987+
atomic_set(&ireq->ireq_refcnt, 0);
5988+
}
5989+
5990+
return req;
5991+
}
5992+
EXPORT_SYMBOL(inet_reqsk_alloc);
5993+
59705994
int tcp_conn_request(struct request_sock_ops *rsk_ops,
59715995
const struct tcp_request_sock_ops *af_ops,
59725996
struct sock *sk, struct sk_buff *skb)

0 commit comments

Comments
 (0)