On Fri, Dec 11, 2020 at 11:50 PM Jonas Bonn <jo...@norrbonn.se> wrote: > > > > On 12/12/2020 06:31, Pravin Shelar wrote: > > On Fri, Dec 11, 2020 at 4:28 AM Jonas Bonn <jo...@norrbonn.se> wrote: > >> > >> Signed-off-by: Jonas Bonn <jo...@norrbonn.se> > >> --- > >> drivers/net/gtp.c | 8 +++++++- > >> 1 file changed, 7 insertions(+), 1 deletion(-) > >> > >> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c > >> index 236ebbcb37bf..7bbeec173113 100644 > >> --- a/drivers/net/gtp.c > >> +++ b/drivers/net/gtp.c > >> @@ -536,7 +536,11 @@ static int gtp_xmit_ip4(struct sk_buff *skb, struct > >> net_device *dev) > >> if (unlikely(r)) > >> goto err_rt; > >> > >> - skb_reset_inner_headers(skb); > >> + r = udp_tunnel_handle_offloads(skb, true); > >> + if (unlikely(r)) > >> + goto err_rt; > >> + > >> + skb_set_inner_protocol(skb, skb->protocol); > >> > > This should be skb_set_inner_ipproto(), since GTP is L3 protocol. > > I think you're right, but I barely see the point of this. It all ends > up in the same place, as far as I can tell. Is this supposed to be some > sort of safeguard against trying to offload tunnels-in-tunnels? >
In UDP offload this flag is used to process segments. With correct flag GTP offload handling can directly jump to L3 processing.