1. 26 Mar, 2020 3 commits
    • Xin Long's avatar
      xfrm: add prep for esp beet mode offload · 30849175
      Xin Long authored
      Like __xfrm_transport/mode_tunnel_prep(), this patch is to add
      __xfrm_mode_beet_prep() to fix the transport_header for gso
      segments, and reset skb mac_len, and pull skb data to the
      proto inside esp.
      
      This patch also fixes a panic, reported by ltp:
      
        # modprobe esp4_offload
        # runltp -f net_stress.ipsec_tcp
      
        [ 2452.780511] kernel BUG at net/core/skbuff.c:109!
        [ 2452.799851] Call Trace:
        [ 2452.800298]  <IRQ>
        [ 2452.800705]  skb_push.cold.98+0x14/0x20
        [ 2452.801396]  esp_xmit+0x17b/0x270 [esp4_offload]
        [ 2452.802799]  validate_xmit_xfrm+0x22f/0x2e0
        [ 2452.804285]  __dev_queue_xmit+0x589/0x910
        [ 2452.806264]  __neigh_update+0x3d7/0xa50
        [ 2452.806958]  arp_process+0x259/0x810
        [ 2452.807589]  arp_rcv+0x18a/0x1c
      
      It was caused by the skb going to esp_xmit with a wrong transport
      header.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      30849175
    • Xin Long's avatar
      esp6: add gso_segment for esp6 beet mode · 7f9e40eb
      Xin Long authored
      Similar to xfrm6_tunnel/transport_gso_segment(), _gso_segment()
      is added to do gso_segment for esp6 beet mode. Before calling
      inet6_offloads[proto]->callbacks.gso_segment, it needs to do:
      
        - Get the upper proto from ph header to get its gso_segment
          when xo->proto is IPPROTO_BEETPH.
      
        - Add SKB_GSO_TCPV6 to gso_type if x->sel.family != AF_INET6
          and the proto == IPPROTO_TCP, so that the current tcp ipv6
          packet can be segmented.
      
        - Calculate a right value for skb->transport_header and move
          skb->data to the transport header position.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      7f9e40eb
    • Xin Long's avatar
      esp4: add gso_segment for esp4 beet mode · 384a46ea
      Xin Long authored
      Similar to xfrm4_tunnel/transport_gso_segment(), _gso_segment()
      is added to do gso_segment for esp4 beet mode. Before calling
      inet_offloads[proto]->callbacks.gso_segment, it needs to do:
      
        - Get the upper proto from ph header to get its gso_segment
          when xo->proto is IPPROTO_BEETPH.
      
        - Add SKB_GSO_TCPV4 to gso_type if x->sel.family == AF_INET6
          and the proto == IPPROTO_TCP, so that the current tcp ipv4
          packet can be segmented.
      
        - Calculate a right value for skb->transport_header and move
          skb->data to the transport header position.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      384a46ea
  2. 19 Feb, 2020 2 commits
  3. 17 Feb, 2020 35 commits