1. 14 Aug, 2017 7 commits
    • David Ahern's avatar
      net: ipv4: remove unnecessary check on orig_oif · 9438c871
      David Ahern authored
      rt_iif is going to be set to either 0 or orig_oif. If orig_oif
      is 0 it amounts to the same end result so remove the check.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9438c871
    • Girish Moodalbail's avatar
      vxlan: change vxlan_[config_]validate() to use netlink_ext_ack for error reporting · 653ef6a3
      Girish Moodalbail authored
      The kernel log is not where users expect error messages for netlink
      requests; as we have extended acks now, we can replace pr_debug() with
      NL_SET_ERR_MSG_ATTR().
      Signed-off-by: default avatarMatthias Schiffer <mschiffer@universe-factory.net>
      Signed-off-by: default avatarGirish Moodalbail <girish.moodalbail@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      653ef6a3
    • David S. Miller's avatar
      Merge branch 'tap-XDP-support' · cc8f1a39
      David S. Miller authored
      Jason Wang says:
      
      ====================
      XDP support for tap
      
      This series tries to implement XDP support for tap. Two path were
      implemented:
      
      - fast path: small & non-gso packet, For performance reason we do it
        at page level and use build_skb() to create skb if necessary.
      - slow path: big or gso packet, we don't want to lose the capability
        compared to generic XDP, so we export some generic xdp helpers and
        do it after skb was created.
      
      xdp1 shows about 41% improvement, xdp_redirect shows about 60%
      improvement.
      
      Changes from V1:
      - fix the race between xdp set and free
      - don't hold extra refcount
      - add XDP_REDIRECT support
      
      Please review.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cc8f1a39
    • Jason Wang's avatar
      tap: XDP support · 761876c8
      Jason Wang authored
      This patch tries to implement XDP for tun. The implementation was
      split into two parts:
      
      - fast path: small and no gso packet. We try to do XDP at page level
        before build_skb(). For XDP_TX, since creating/destroying queues
        were completely under control of userspace, it was implemented
        through generic XDP helper after skb has been built. This could be
        optimized in the future.
      - slow path: big or gso packet. We try to do it after skb was created
        through generic XDP helpers.
      
      Test were done through pktgen with small packets.
      
      xdp1 test shows ~41.1% improvement:
      
      Before: ~1.7Mpps
      After:  ~2.3Mpps
      
      xdp_redirect to ixgbe shows ~60% improvement:
      
      Before: ~0.8Mpps
      After:  ~1.38Mpps
      Suggested-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      761876c8
    • Jason Wang's avatar
      net: export some generic xdp helpers · 7c497478
      Jason Wang authored
      This patch tries to export some generic xdp helpers to drivers. This
      can let driver to do XDP for a specific skb. This is useful for the
      case when the packet is hard to be processed at page level directly
      (e.g jumbo/GSO frame).
      
      With this patch, there's no need for driver to forbid the XDP set when
      configuration is not suitable. Instead, it can defer the XDP for
      packets that is hard to be processed directly after skb is created.
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c497478
    • Jason Wang's avatar
      tap: use build_skb() for small packet · 66ccbc9c
      Jason Wang authored
      We use tun_alloc_skb() which calls sock_alloc_send_pskb() to allocate
      skb in the past. This socket based method is not suitable for high
      speed userspace like virtualization which usually:
      
      - ignore sk_sndbuf (INT_MAX) and expect to receive the packet as fast as
        possible
      - don't want to be block at sendmsg()
      
      To eliminate the above overheads, this patch tries to use build_skb()
      for small packet. We will do this only when the following conditions
      are all met:
      
      - TAP instead of TUN
      - sk_sndbuf is INT_MAX
      - caller don't want to be blocked
      - zerocopy is not used
      - packet size is smaller enough to use build_skb()
      
      Pktgen from guest to host shows ~11% improvement for rx pps of tap:
      
      Before: ~1.70Mpps
      After : ~1.88Mpps
      
      What's more important, this makes it possible to implement XDP for tap
      before creating skbs.
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      66ccbc9c
    • Jakub Sitnicki's avatar
      rtnelink: Move link dump consistency check out of the loop · d0225784
      Jakub Sitnicki authored
      Calls to rtnl_dump_ifinfo() are protected by RTNL lock. So are the
      {list,unlist}_netdevice() calls where we bump the net->dev_base_seq
      number.
      
      For this reason net->dev_base_seq can't change under out feet while
      we're looping over links in rtnl_dump_ifinfo(). So move the check for
      net->dev_base_seq change (since the last time we were called) out of the
      loop.
      
      This way we avoid giving a wrong impression that there are concurrent
      updates to the link list going on while we're iterating over them.
      Signed-off-by: default avatarJakub Sitnicki <jkbs@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0225784
  2. 11 Aug, 2017 33 commits