Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1265280

Re: GSO with udp_tunnel_xmit_skb

From "Jason A. Donenfeld" <Jason@zx2c4.com>
Newsgroups linux.kernel
Subject Re: GSO with udp_tunnel_xmit_skb
Date 2015-11-09 03:30 +0100
Message-ID <qsKnv-7m-1@gated-at.bofh.it> (permalink)
References (5 earlier) <qslp7-vP-3@gated-at.bofh.it> <qsvy9-7nD-7@gated-at.bofh.it> <qsvRw-7vV-9@gated-at.bofh.it> <qszBL-1qU-1@gated-at.bofh.it> <qsJKO-84X-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Nov 9, 2015 at 2:40 AM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> You're right.  I don't think the ordering matters.

Cool, so we're on the same page then.

In that case, any ideas about constructing UDP super-packets for GSO?
As Maciej pointed out, UFO is actually just IP fragmentation and UDP
checksums, but doesn't actually add on new UDP headers as we'd wish.
But I was digging a bit deeper and I found this gem:
skb_udp_tunnel_segment. This is the segmentation function called for
SKB_GSO_UDP_TUNNEL. For this, it does something sort of neat.

If the skb's inner_protocol_type is ENCAP_TYPE_IPPROTO, then it looks
up an "gso_inner_segment" function based on the skb->inner_ipproto
field. The lookup happens on a list of functions (called
inet6_offloads and inet_offloads) that has some nice setter/getter
methods for various modules to call.

Once it figures out which gso_inner_segment to use, it calls
__skb_udp_tunnel_segment with it, which then does some curious header
calculations on various lengths (that I need to read carefully), and
then proceeds to split the segments using our gso_inner_segment
function of choice, and then adds the length and checksum header
fields. Unfortunately, it doesn't add the UDP source and destination
port header fields. That means I might as well be building the UDP
headers ahead of time myself, which is a bit of a bummer.

Anyway, the idea would be to [ab]use SKB_GSO_UDP_TUNNEL with a
scintillating gso_inner_segment function for a custom inner_ipproto
field, in order to make a superpacket.

How's this looking as a strategy (and an outline of the "niggly bits"
as you put it)?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

GSO with udp_tunnel_xmit_skb "Jason A. Donenfeld" <Jason@zx2c4.com> - 2015-11-05 12:00 +0100
  Re: GSO with udp_tunnel_xmit_skb Tom Herbert <tom@herbertland.com> - 2015-11-06 08:20 +0100
    Re: GSO with udp_tunnel_xmit_skb "Jason A. Donenfeld" <Jason@zx2c4.com> - 2015-11-06 12:50 +0100
      Re: GSO with udp_tunnel_xmit_skb Maciej Żenczykowski <zenczykowski@gmail.com> - 2015-11-07 18:20 +0100
        Re: GSO with udp_tunnel_xmit_skb "Jason A. Donenfeld" <Jason@zx2c4.com> - 2015-11-07 23:50 +0100
          Re: GSO with udp_tunnel_xmit_skb Maciej Żenczykowski <zenczykowski@gmail.com> - 2015-11-08 00:50 +0100
            Re: GSO with udp_tunnel_xmit_skb "Jason A. Donenfeld" <Jason@zx2c4.com> - 2015-11-08 11:40 +0100
              Re: GSO with udp_tunnel_xmit_skb Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-08 12:00 +0100
                Re: GSO with udp_tunnel_xmit_skb "Jason A. Donenfeld" <Jason@zx2c4.com> - 2015-11-08 16:00 +0100
                Re: GSO with udp_tunnel_xmit_skb Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-09 02:50 +0100
                Re: GSO with udp_tunnel_xmit_skb "Jason A. Donenfeld" <Jason@zx2c4.com> - 2015-11-09 03:30 +0100
                Re: GSO with udp_tunnel_xmit_skb Maciej Żenczykowski <zenczykowski@gmail.com> - 2015-11-09 04:20 +0100

csiph-web