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

function renaming and enable interception to handle urg pointer in rx

parent 6985aaa3
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@
struct ptcp_hook_heads ptcp_hook_heads = {
.print_sock_skb = LIST_HEAD_INIT(ptcp_hook_heads.print_sock_skb),
.handle_tcp_urg = LIST_HEAD_INIT(ptcp_hook_heads.handle_tcp_urg),
.rx_handle_tcp_urg = LIST_HEAD_INIT(ptcp_hook_heads.rx_handle_tcp_urg),
.rx_adjust_skb_size = LIST_HEAD_INIT(ptcp_hook_heads.rx_adjust_skb_size),
.rx_adjust_copied_seq = LIST_HEAD_INIT(ptcp_hook_heads.rx_adjust_copied_seq),
.tx_adjust_skb_size = LIST_HEAD_INIT(ptcp_hook_heads.tx_adjust_skb_size),
......@@ -50,11 +50,11 @@ void ptcp_print_sock_skb(struct sock *sk, struct sk_buff *skb)
}
EXPORT_SYMBOL(ptcp_print_sock_skb);
int ptcp_handle_tcp_urg(struct sock *sk, struct sk_buff *skb, struct tcphdr *th)
int ptcp_rx_handle_tcp_urg(struct sock *sk, struct sk_buff *skb, struct tcphdr *th)
{
return call_ptcp_int_hook(handle_tcp_urg, -1, sk, skb, th);
return call_ptcp_int_hook(rx_handle_tcp_urg, -1, sk, skb, th);
}
EXPORT_SYMBOL(ptcp_handle_tcp_urg);
EXPORT_SYMBOL(ptcp_rx_handle_tcp_urg);
int ptcp_rx_adjust_skb_size(struct sock *sk, struct sk_buff *skb, int req_len,
int offset, int chunk, int copied, int flags)
......
......@@ -16,7 +16,7 @@
#include <linux/tcp.h>
void ptcp_print_sock_skb(struct sock *sk, struct sk_buff *skb);
int ptcp_handle_tcp_urg(struct sock *sk, struct sk_buff *skb, struct tcphdr *th);
int ptcp_rx_handle_tcp_urg(struct sock *sk, struct sk_buff *skb, struct tcphdr *th);
int ptcp_rx_adjust_skb_size(struct sock *sk, struct sk_buff *skb, int req_len,
int offset, int chunk, int copied, int flags);
int ptcp_rx_adjust_copied_seq(struct sock *sk, struct sk_buff *skb, int old_skb_len);
......
......@@ -23,14 +23,14 @@ ptcp_impl_print_sock_skb(struct sock *sk, struct sk_buff *skb)
}
}
int (*lnk_handle_tcp_urg) (struct sock *sk, struct sk_buff *skb,
int (*lnk_rx_handle_tcp_urg) (struct sock *sk, struct sk_buff *skb,
struct tcphdr *th) = 0;
EXPORT_SYMBOL(lnk_handle_tcp_urg);
EXPORT_SYMBOL(lnk_rx_handle_tcp_urg);
static int
ptcp_impl_handle_tcp_urg(struct sock *sk, struct sk_buff *skb, struct tcphdr *th)
ptcp_impl_rx_handle_tcp_urg(struct sock *sk, struct sk_buff *skb, struct tcphdr *th)
{
if (lnk_handle_tcp_urg) {
return lnk_handle_tcp_urg(sk, skb, th);
if (lnk_rx_handle_tcp_urg) {
return lnk_rx_handle_tcp_urg(sk, skb, th);
}
return -1;
......@@ -105,7 +105,7 @@ ptcp_impl_tx_adjust_iphdr(struct sock *sk, struct sk_buff *skb)
struct ptcp_hook_list ptcp_hooks[NUM_PTCP_HOOKS] = {
PTCP_HOOK_INIT(print_sock_skb, ptcp_impl_print_sock_skb),
PTCP_HOOK_INIT(handle_tcp_urg, ptcp_impl_handle_tcp_urg),
PTCP_HOOK_INIT(rx_handle_tcp_urg, ptcp_impl_rx_handle_tcp_urg),
PTCP_HOOK_INIT(rx_adjust_skb_size, ptcp_impl_rx_adjust_skb_size),
PTCP_HOOK_INIT(rx_adjust_copied_seq, ptcp_impl_rx_adjust_copied_seq),
PTCP_HOOK_INIT(tx_adjust_skb_size, ptcp_impl_tx_adjust_skb_size),
......
......@@ -25,7 +25,7 @@
union ptcp_list_options {
void (*print_sock_skb) (struct sock *sk, struct sk_buff *skb);
int (*handle_tcp_urg) (struct sock *sk, struct sk_buff *skb, struct tcphdr *th);
int (*rx_handle_tcp_urg) (struct sock *sk, struct sk_buff *skb, struct tcphdr *th);
int (*rx_adjust_skb_size) (struct sock *sk, struct sk_buff *skb, int req_len,
int offset, int chunk, int copied, int flags);
int (*rx_adjust_copied_seq) (struct sock *sk, struct sk_buff *skb, int old_skb_len);
......@@ -37,7 +37,7 @@ union ptcp_list_options {
struct ptcp_hook_heads {
struct list_head print_sock_skb;
struct list_head handle_tcp_urg;
struct list_head rx_handle_tcp_urg;
struct list_head rx_adjust_skb_size;
struct list_head rx_adjust_copied_seq;
struct list_head tx_adjust_skb_size;
......
......@@ -66,6 +66,9 @@
#ifdef CONFIG_XEN_SME
#include "../../drivers/net/ethernet/broadcom/bnx2x/sme/xen_sme_hooks.h"
#endif
#ifdef CONFIG_PACER_TCP
#include "../../drivers/net/ethernet/broadcom/bnx2x/sme/ptcp_hooks.h"
#endif
#include <linux/mm.h>
#include <linux/slab.h>
......@@ -5287,6 +5290,12 @@ static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *t
{
struct tcp_sock *tp = tcp_sk(sk);
#if CONFIG_PACER_TCP
int ret = ptcp_rx_handle_tcp_urg(sk, skb, (struct tcphdr *) th);
if (ret >= 0)
return;
#endif
/* Check if we get a new urgent pointer - normally not. */
if (th->urg)
tcp_check_urg(sk, th);
......
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