Skip to content
Snippets Groups Projects
Commit 1167f890 authored by Aastha Mehta's avatar Aastha Mehta
Browse files

intercept in retransmit_skb to increment profile slots

parent ea9f43c0
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,7 @@ struct ptcp_hook_heads ptcp_hook_heads = { ...@@ -48,6 +48,7 @@ struct ptcp_hook_heads ptcp_hook_heads = {
.rxtx_sync_shared_seq = LIST_HEAD_INIT(ptcp_hook_heads.rxtx_sync_shared_seq), .rxtx_sync_shared_seq = LIST_HEAD_INIT(ptcp_hook_heads.rxtx_sync_shared_seq),
.tx_adjust_urg = LIST_HEAD_INIT(ptcp_hook_heads.tx_adjust_urg), .tx_adjust_urg = LIST_HEAD_INIT(ptcp_hook_heads.tx_adjust_urg),
.tx_incr_tail = LIST_HEAD_INIT(ptcp_hook_heads.tx_incr_tail), .tx_incr_tail = LIST_HEAD_INIT(ptcp_hook_heads.tx_incr_tail),
.tx_incr_profile = LIST_HEAD_INIT(ptcp_hook_heads.tx_incr_profile),
.is_paced_flow = LIST_HEAD_INIT(ptcp_hook_heads.is_paced_flow), .is_paced_flow = LIST_HEAD_INIT(ptcp_hook_heads.is_paced_flow),
.get_retransmit_skb = LIST_HEAD_INIT(ptcp_hook_heads.get_retransmit_skb), .get_retransmit_skb = LIST_HEAD_INIT(ptcp_hook_heads.get_retransmit_skb),
}; };
...@@ -137,6 +138,12 @@ int ptcp_tx_incr_tail(struct sock *sk, struct sk_buff *skb) ...@@ -137,6 +138,12 @@ int ptcp_tx_incr_tail(struct sock *sk, struct sk_buff *skb)
} }
EXPORT_SYMBOL(ptcp_tx_incr_tail); EXPORT_SYMBOL(ptcp_tx_incr_tail);
int ptcp_tx_incr_profile(struct sock *sk, struct sk_buff *skb)
{
return call_ptcp_int_hook(tx_incr_profile, -1, sk, skb);
}
EXPORT_SYMBOL(ptcp_tx_incr_profile);
int ptcp_is_paced_flow(struct sock *sk) int ptcp_is_paced_flow(struct sock *sk)
{ {
return call_ptcp_int_hook(is_paced_flow, -1, sk); return call_ptcp_int_hook(is_paced_flow, -1, sk);
......
...@@ -33,6 +33,7 @@ int ptcp_tx_adjust_seq(struct sock *sk, struct sk_buff *skb, int copy, int copie ...@@ -33,6 +33,7 @@ int ptcp_tx_adjust_seq(struct sock *sk, struct sk_buff *skb, int copy, int copie
int ptcp_rxtx_sync_shared_seq(struct sock *sk, struct sk_buff *skb, int write); int ptcp_rxtx_sync_shared_seq(struct sock *sk, struct sk_buff *skb, int write);
int ptcp_tx_adjust_urg(struct sock *sk, struct sk_buff *skb); int ptcp_tx_adjust_urg(struct sock *sk, struct sk_buff *skb);
int ptcp_tx_incr_tail(struct sock *sk, struct sk_buff *skb); int ptcp_tx_incr_tail(struct sock *sk, struct sk_buff *skb);
int ptcp_tx_incr_profile(struct sock *sk, struct sk_buff *skb);
int ptcp_is_paced_flow(struct sock *sk); int ptcp_is_paced_flow(struct sock *sk);
int ptcp_get_retransmit_skb(struct sock *sk, struct sk_buff **skb_p); int ptcp_get_retransmit_skb(struct sock *sk, struct sk_buff **skb_p);
......
...@@ -178,6 +178,18 @@ ptcp_impl_tx_incr_tail(struct sock *sk, struct sk_buff *skb) ...@@ -178,6 +178,18 @@ ptcp_impl_tx_incr_tail(struct sock *sk, struct sk_buff *skb)
return -1; return -1;
} }
int (*lnk_tx_incr_profile) (struct sock *sk, struct sk_buff *skb) = 0;
EXPORT_SYMBOL(lnk_tx_incr_profile);
static int
ptcp_impl_tx_incr_profile(struct sock *sk, struct sk_buff *skb)
{
if (lnk_tx_incr_profile) {
return lnk_tx_incr_profile(sk, skb);
}
return -1;
}
int (*lnk_is_paced_flow) (struct sock *sk) = 0; int (*lnk_is_paced_flow) (struct sock *sk) = 0;
EXPORT_SYMBOL(lnk_is_paced_flow); EXPORT_SYMBOL(lnk_is_paced_flow);
static int static int
...@@ -216,6 +228,7 @@ struct ptcp_hook_list ptcp_hooks[NUM_PTCP_HOOKS] = { ...@@ -216,6 +228,7 @@ struct ptcp_hook_list ptcp_hooks[NUM_PTCP_HOOKS] = {
PTCP_HOOK_INIT(rxtx_sync_shared_seq, ptcp_impl_rxtx_sync_shared_seq), PTCP_HOOK_INIT(rxtx_sync_shared_seq, ptcp_impl_rxtx_sync_shared_seq),
PTCP_HOOK_INIT(tx_adjust_urg, ptcp_impl_tx_adjust_urg), PTCP_HOOK_INIT(tx_adjust_urg, ptcp_impl_tx_adjust_urg),
PTCP_HOOK_INIT(tx_incr_tail, ptcp_impl_tx_incr_tail), PTCP_HOOK_INIT(tx_incr_tail, ptcp_impl_tx_incr_tail),
PTCP_HOOK_INIT(tx_incr_profile, ptcp_impl_tx_incr_profile),
PTCP_HOOK_INIT(is_paced_flow, ptcp_impl_is_paced_flow), PTCP_HOOK_INIT(is_paced_flow, ptcp_impl_is_paced_flow),
PTCP_HOOK_INIT(get_retransmit_skb, ptcp_impl_get_retransmit_skb), PTCP_HOOK_INIT(get_retransmit_skb, ptcp_impl_get_retransmit_skb),
}; };
......
...@@ -41,6 +41,7 @@ union ptcp_list_options { ...@@ -41,6 +41,7 @@ union ptcp_list_options {
int (*rxtx_sync_shared_seq) (struct sock *sk, struct sk_buff *skb, int write); int (*rxtx_sync_shared_seq) (struct sock *sk, struct sk_buff *skb, int write);
int (*tx_adjust_urg) (struct sock *sk, struct sk_buff *skb); int (*tx_adjust_urg) (struct sock *sk, struct sk_buff *skb);
int (*tx_incr_tail) (struct sock *sk, struct sk_buff *skb); int (*tx_incr_tail) (struct sock *sk, struct sk_buff *skb);
int (*tx_incr_profile) (struct sock *sk, struct sk_buff *skb);
int (*is_paced_flow) (struct sock *sk); int (*is_paced_flow) (struct sock *sk);
int (*get_retransmit_skb) (struct sock *sk, struct sk_buff **skb_p); int (*get_retransmit_skb) (struct sock *sk, struct sk_buff **skb_p);
}; };
...@@ -59,6 +60,7 @@ struct ptcp_hook_heads { ...@@ -59,6 +60,7 @@ struct ptcp_hook_heads {
struct list_head rxtx_sync_shared_seq; struct list_head rxtx_sync_shared_seq;
struct list_head tx_adjust_urg; struct list_head tx_adjust_urg;
struct list_head tx_incr_tail; struct list_head tx_incr_tail;
struct list_head tx_incr_profile;
struct list_head is_paced_flow; struct list_head is_paced_flow;
struct list_head get_retransmit_skb; struct list_head get_retransmit_skb;
}; };
...@@ -73,7 +75,7 @@ struct ptcp_hook_list { ...@@ -73,7 +75,7 @@ struct ptcp_hook_list {
{ .head = &ptcp_hook_heads.HEAD, .hook = { . HEAD = HOOK } } { .head = &ptcp_hook_heads.HEAD, .hook = { . HEAD = HOOK } }
// increment this every time a new hook is added // increment this every time a new hook is added
#define NUM_PTCP_HOOKS 15 #define NUM_PTCP_HOOKS 16
extern struct ptcp_hook_heads ptcp_hook_heads; extern struct ptcp_hook_heads ptcp_hook_heads;
extern struct ptcp_hook_list ptcp_hooks[NUM_PTCP_HOOKS]; extern struct ptcp_hook_list ptcp_hooks[NUM_PTCP_HOOKS];
......
...@@ -2981,6 +2981,9 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs) ...@@ -2981,6 +2981,9 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs)
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)
__NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNRETRANS);
tp->total_retrans += segs; tp->total_retrans += segs;
#if defined(CONFIG_XEN_SME) && defined(CONFIG_PACER_TCP)
ptcp_tx_incr_profile(sk, skb);
#endif
} }
return err; return err;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment