netfilter: flowtable: remove inline segmentation
Subsystems (3)
PATCH 1/1 netfilter: flowtable: remove inline segmentation
Now that PPPoE driver has proper GSO support, this is no longer needed.
Signed-off-by Qingfang Deng <[email protected]>
--- include/net/netfilter/nf_flow_table.h | 1 - net/netfilter/nf_flow_table_core.c | 1 - net/netfilter/nf_flow_table_ip.c | 34 --------------------------- net/netfilter/nf_flow_table_path.c | 3 --- 4 files changed, 39 deletions(-)
include/net/netfilter/nf_flow_table.h +0 -1
@@ -151,7 +151,6 @@ struct flow_offload_tuple { u16 dir:2, xmit_type:3, encap_num:2, - needs_gso_segment:1, tun_num:2, in_vlan_ingress:2;u16 mtu;
net/netfilter/nf_flow_table_core.c +0 -1
@@ -122,7 +122,6 @@ static int flow_offload_fill_route(struct flow_offload *flow, flow_tuple->tun = route->tuple[dir].in.tun; flow_tuple->encap_num = route->tuple[dir].in.num_encaps; - flow_tuple->needs_gso_segment = route->tuple[dir].out.needs_gso_segment; flow_tuple->tun_num = route->tuple[dir].in.num_tuns;switch (route->tuple[dir].xmit_type) {
net/netfilter/nf_flow_table_ip.c +0 -34
@@ -771,7 +771,6 @@ struct nf_flow_xmit {const void *source;struct net_device *outdev;struct flow_offload_tuple *tuple; -bool needs_gso_segment; }; static void __nf_flow_queue_xmit(struct net *net, struct sk_buff *skb,
@@ -792,41 +791,10 @@ static void __nf_flow_queue_xmit(struct net *net, struct sk_buff *skb,dev_queue_xmit (skb); } -static unsigned int nf_flow_encap_gso_xmit (struct net *net,struct sk_buff *skb, -struct nf_flow_xmit *xmit) -{ -struct sk_buff *segs, *nskb; - - segs =skb_gso_segment (skb,0 ); -if (IS_ERR (segs)) -return NF_DROP ; - -if (segs) -consume_skb (skb); -else - segs = skb; - - skb_list_walk_safe(segs, segs, nskb) { -skb_mark_not_on_list (segs); - -if (nf_flow_encap_push (segs, xmit->tuple, xmit->outdev) <0 ) { -kfree_skb (segs); -kfree_skb_list (nskb); -return NF_STOLEN ; - } -__nf_flow_queue_xmit (net, segs, xmit); - } - -return NF_STOLEN ; -} -static unsigned int nf_flow_queue_xmit (struct net *net,struct sk_buff *skb,struct nf_flow_xmit *xmit) {if (xmit->tuple->encap_num) { -if (skb_is_gso (skb) && xmit->needs_gso_segment) -return nf_flow_encap_gso_xmit (net, skb, xmit); -if (nf_flow_encap_push (skb, xmit->tuple, xmit->outdev) <0 )return NF_DROP ; }
@@ -910,7 +878,6 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,return NF_DROP ; } xmit.tuple = other_tuple; - xmit.needs_gso_segment = tuplehash->tuple.needs_gso_segment;return nf_flow_queue_xmit (state->net, skb, &xmit); }
@@ -1231,7 +1198,6 @@ nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb,return NF_DROP ; } xmit.tuple = other_tuple; - xmit.needs_gso_segment = tuplehash->tuple.needs_gso_segment;return nf_flow_queue_xmit (state->net, skb, &xmit); }
net/netfilter/nf_flow_table_path.c +0 -3
@@ -86,7 +86,6 @@ struct nft_forward_info {u8 ingress_vlans;u8 h_source[ETH_ALEN ];u8 h_dest[ETH_ALEN ]; -bool needs_gso_segment;enum flow_offload_xmit_type xmit_type; };
@@ -142,7 +141,6 @@ static void nft_dev_path_info(const struct net_device_path_stack *stack,if (path->type ==DEV_PATH_PPPOE ) {memcpy (info->h_dest, path->encap.h_dest,ETH_ALEN ); info->xmit_type =FLOW_OFFLOAD_XMIT_DIRECT ; - info->needs_gso_segment =1 ; }break ;case DEV_PATH_BRIDGE :
@@ -283,7 +281,6 @@ static void nft_dev_forward_path(const struct nft_pktinfo *pkt,memcpy (route->tuple[dir].out.h_dest, info.h_dest,ETH_ALEN ); route->tuple[dir].xmit_type = info.xmit_type; } - route->tuple[dir].out.needs_gso_segment = info.needs_gso_segment; } int nft_flow_route(const struct nft_pktinfo *pkt, const struct nf_conn *ct,
Signature · 1 line
2.43.0
Hi Pablo,
AI says this may pass GSO packets directly to underlying drivers (as we bypass the ppp interface) and corrupt their packet headers:
https://sashiko.dev/#/patchset/[email protected]
Do I need to set skb->encapsulation like you did earlier?
Regards,
Qingfang