10 Jul, 2016

1 commit

  • Extend the IPIP driver to support MPLS over IPv4. The implementation is an
    extension of existing support for IPv4 over IPv4 and is based of multiple
    inner-protocol support for the SIT driver.

    Signed-off-by: Simon Horman
    Reviewed-by: Dinan Gunawardena
    Signed-off-by: David S. Miller

    Simon Horman
     

21 May, 2016

1 commit

  • This patch defines two new GSO definitions SKB_GSO_IPXIP4 and
    SKB_GSO_IPXIP6 along with corresponding NETIF_F_GSO_IPXIP4 and
    NETIF_F_GSO_IPXIP6. These are used to described IP in IP
    tunnel and what the outer protocol is. The inner protocol
    can be deduced from other GSO types (e.g. SKB_GSO_TCPV4 and
    SKB_GSO_TCPV6). The GSO types of SKB_GSO_IPIP and SKB_GSO_SIT
    are removed (these are both instances of SKB_GSO_IPXIP4).
    SKB_GSO_IPXIP6 will be used when support for GSO with IP
    encapsulation over IPv6 is added.

    Signed-off-by: Tom Herbert
    Acked-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Tom Herbert
     

17 Apr, 2016

1 commit

  • This patch updates the IP tunnel core function iptunnel_handle_offloads so
    that we return an int and do not free the skb inside the function. This
    actually allows us to clean up several paths in several tunnels so that we
    can free the skb at one point in the path without having to have a
    secondary path if we are supporting tunnel offloads.

    In addition it should resolve some double-free issues I have found in the
    tunnels paths as I believe it is possible for us to end up triggering such
    an event in the case of fou or gue.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     

19 Feb, 2016

1 commit


12 Feb, 2016

1 commit


01 Jan, 2016

1 commit


19 Dec, 2015

1 commit


01 Dec, 2015

1 commit


11 Aug, 2015

1 commit


18 May, 2015

1 commit

  • make C=2 CF=-D__CHECK_ENDIAN__ net/ipv4/ipip.o
    CHECK net/ipv4/ipip.c
    net/ipv4/ipip.c:254:27: warning: incorrect type in assignment (different base types)
    net/ipv4/ipip.c:254:27: expected restricted __be32 [addressable] [usertype] o_key
    net/ipv4/ipip.c:254:27: got restricted __be16 [addressable] [usertype] i_flags

    Fixes: 3b7b514f44bf ("ipip: fix a regression in ioctl")
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

04 Apr, 2015

1 commit

  • The ipv4 code uses a mixture of coding styles. In some instances check
    for NULL pointer is done as x == NULL and sometimes as !x. !x is
    preferred according to checkpatch and this patch makes the code
    consistent by adopting the latter form.

    No changes detected by objdiff.

    Signed-off-by: Ian Morris
    Signed-off-by: David S. Miller

    Ian Morris
     

03 Apr, 2015

1 commit


01 Apr, 2015

2 commits


09 Feb, 2015

1 commit

  • encap.sport and encap.dport are __be16, use nla_{get,put}_be16 instead
    of nla_{get,put}_u16.

    Fixes the sparse warnings:

    warning: incorrect type in assignment (different base types)
    expected restricted __be32 [addressable] [usertype] o_key
    got restricted __be16 [addressable] [usertype] i_flags
    warning: incorrect type in assignment (different base types)
    expected restricted __be16 [usertype] sport
    got unsigned short
    warning: incorrect type in assignment (different base types)
    expected restricted __be16 [usertype] dport
    got unsigned short
    warning: incorrect type in argument 3 (different base types)
    expected unsigned short [unsigned] [usertype] value
    got restricted __be16 [usertype] sport
    warning: incorrect type in argument 3 (different base types)
    expected unsigned short [unsigned] [usertype] value
    got restricted __be16 [usertype] dport

    Signed-off-by: Sabrina Dubroca
    Signed-off-by: David S. Miller

    Sabrina Dubroca
     

20 Jan, 2015

1 commit


06 Nov, 2014

1 commit


08 Oct, 2014

1 commit

  • Testing xmit_more support with netperf and connected UDP sockets,
    I found strange dst refcount false sharing.

    Current handling of IFF_XMIT_DST_RELEASE is not optimal.

    Dropping dst in validate_xmit_skb() is certainly too late in case
    packet was queued by cpu X but dequeued by cpu Y

    The logical point to take care of drop/force is in __dev_queue_xmit()
    before even taking qdisc lock.

    As Julian Anastasov pointed out, need for skb_dst() might come from some
    packet schedulers or classifiers.

    This patch adds new helper to cleanly express needs of various drivers
    or qdiscs/classifiers.

    Drivers that need skb_dst() in their ndo_start_xmit() should call
    following helper in their setup instead of the prior :

    dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
    ->
    netif_keep_dst(dev);

    Instead of using a single bit, we use two bits, one being
    eventually rebuilt in bonding/team drivers.

    The other one, is permanent and blocks IFF_XMIT_DST_RELEASE being
    rebuilt in bonding/team. Eventually, we could add something
    smarter later.

    Signed-off-by: Eric Dumazet
    Cc: Julian Anastasov
    Signed-off-by: David S. Miller

    Eric Dumazet
     

02 Oct, 2014

1 commit


20 Sep, 2014

1 commit


12 Jun, 2014

1 commit


11 Jun, 2014

1 commit

  • ipv4_{update_pmtu,redirect} were called with tunnel's ifindex (t->dev is a
    tunnel netdevice). It caused wrong route lookup and failure of pmtu update or
    redirect. We should use the same ifindex that we use in ip_route_output_* in
    *tunnel_xmit code. It is t->parms.link .

    Signed-off-by: Dmitry Popov
    Signed-off-by: David S. Miller

    Dmitry Popov
     

22 May, 2014

1 commit

  • Enable the module alias hookup to allow tunnel modules to be autoloaded on demand.

    This is in line with how most other netdev kinds work, and will allow userspace
    to create tunnels without having CAP_SYS_MODULE.

    Signed-off-by: Tom Gundersen
    Signed-off-by: David S. Miller

    Tom Gundersen
     

19 Jan, 2014

1 commit


20 Oct, 2013

1 commit

  • Now inet_gso_segment() is stackable, its relatively easy to
    implement GSO/TSO support for IPIP

    Performance results, when segmentation is done after tunnel
    device (as no NIC is yet enabled for TSO IPIP support) :

    Before patch :

    lpq83:~# ./netperf -H 7.7.9.84 -Cc
    MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.9.84 () port 0 AF_INET
    Recv Send Send Utilization Service Demand
    Socket Socket Message Elapsed Send Recv Send Recv
    Size Size Size Time Throughput local remote local remote
    bytes bytes bytes secs. 10^6bits/s % S % S us/KB us/KB

    87380 16384 16384 10.00 3357.88 5.09 3.70 2.983 2.167

    After patch :

    lpq83:~# ./netperf -H 7.7.9.84 -Cc
    MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.9.84 () port 0 AF_INET
    Recv Send Send Utilization Service Demand
    Socket Socket Message Elapsed Send Recv Send Recv
    Size Size Size Time Throughput local remote local remote
    bytes bytes bytes secs. 10^6bits/s % S % S us/KB us/KB

    87380 16384 16384 10.00 7710.19 4.52 6.62 1.152 1.687

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

06 Sep, 2013

1 commit

  • Conflicts:
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    net/bridge/br_multicast.c
    net/ipv6/sit.c

    The conflicts were minor:

    1) sit.c changes overlap with change to ip_tunnel_xmit() signature.

    2) br_multicast.c had an overlap between computing max_delay using
    msecs_to_jiffies and turning MLDV2_MRC() into an inline function
    with a name using lowercase instead of uppercase letters.

    3) stmmac had two overlapping changes, one which conditionally allocated
    and hooked up a dma_cfg based upon the presence of the pbl OF property,
    and another one handling store-and-forward DMA made. The latter of
    which should not go into the new of_find_property() basic block.

    Signed-off-by: David S. Miller

    David S. Miller
     

31 Aug, 2013

1 commit

  • Since commit 3d7b46cd20e3 (ip_tunnel: push generic protocol handling to
    ip_tunnel module.), an Oops is triggered when an xfrm policy is configured on
    an IPv4 over IPv4 tunnel.

    xfrm4_policy_check() calls __xfrm_policy_check2(), which uses skb_dst(skb). But
    this field is NULL because iptunnel_pull_header() calls skb_dst_drop(skb).

    Signed-off-by: Li Hongjun
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Li Hongjun
     

15 Aug, 2013

1 commit

  • This patch allows to switch the netns when packet is encapsulated or
    decapsulated. In other word, the encapsulated packet is received in a netns,
    where the lookup is done to find the tunnel. Once the tunnel is found, the
    packet is decapsulated and injecting into the corresponding interface which
    stands to another netns.

    When one of the two netns is removed, the tunnel is destroyed.

    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     

02 Jul, 2013

1 commit

  • This is a regression introduced by
    commit fd58156e456d9f68fe0448 (IPIP: Use ip-tunneling code.)

    Similar to GRE tunnel, previously we only check the parameters
    for SIOCADDTUNNEL and SIOCCHGTUNNEL, after that commit, the
    check is moved for all commands.

    So, just check for SIOCADDTUNNEL and SIOCCHGTUNNEL.

    Also, the check for i_key, o_key etc. is suspicious too,
    which did not exist before, reset them before passing
    to ip_tunnel_ioctl().

    Cc: Pravin B Shelar
    Cc: "David S. Miller"
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

20 Jun, 2013

1 commit


01 Jun, 2013

1 commit


27 Mar, 2013

2 commits

  • Reuse common ip-tunneling code which is re-factored from GRE
    module.

    Signed-off-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Pravin B Shelar
     
  • Following patch refactors GRE code into ip tunneling code and GRE
    specific code. Common tunneling code is moved to ip_tunnel module.
    ip_tunnel module is written as generic library which can be used
    by different tunneling implementations.

    ip_tunnel module contains following components:
    - packet xmit and rcv generic code. xmit flow looks like
    (gre_xmit/ipip_xmit)->ip_tunnel_xmit->ip_local_out.
    - hash table of all devices.
    - lookup for tunnel devices.
    - control plane operations like device create, destroy, ioctl, netlink
    operations code.
    - registration for tunneling modules, like gre, ipip etc.
    - define single pcpu_tstats dev->tstats.
    - struct tnl_ptk_info added to pass parsed tunnel packet parameters.

    ipip.h header is renamed to ip_tunnel.h

    Signed-off-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Pravin B Shelar
     

10 Mar, 2013

3 commits


28 Jan, 2013

1 commit

  • Pravin Shelar mentioned that GSO could potentially generate
    wrong TX checksum if skb has fragments that are overwritten
    by the user between the checksum computation and transmit.

    He suggested to linearize skbs but this extra copy can be
    avoided for normal tcp skbs cooked by tcp_sendmsg().

    This patch introduces a new SKB_GSO_SHARED_FRAG flag, set
    in skb_shinfo(skb)->gso_type if at least one frag can be
    modified by the user.

    Typical sources of such possible overwrites are {vm}splice(),
    sendfile(), and macvtap/tun/virtio_net drivers.

    Tested:

    $ netperf -H 7.7.8.84
    MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
    7.7.8.84 () port 0 AF_INET
    Recv Send Send
    Socket Socket Message Elapsed
    Size Size Size Time Throughput
    bytes bytes bytes secs. 10^6bits/sec

    87380 16384 16384 10.00 3959.52

    $ netperf -H 7.7.8.84 -t TCP_SENDFILE
    TCP SENDFILE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.8.84 ()
    port 0 AF_INET
    Recv Send Send
    Socket Socket Message Elapsed
    Size Size Size Time Throughput
    bytes bytes bytes secs. 10^6bits/sec

    87380 16384 16384 10.00 3216.80

    Performance of the SENDFILE is impacted by the extra allocation and
    copy, and because we use order-0 pages, while the TCP_STREAM uses
    bigger pages.

    Reported-by: Pravin Shelar
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

19 Nov, 2012

1 commit

  • Allow an unpriviled user who has created a user namespace, and then
    created a network namespace to effectively use the new network
    namespace, by reducing capable(CAP_NET_ADMIN) and
    capable(CAP_NET_RAW) calls to be ns_capable(net->user_ns,
    CAP_NET_ADMIN), or capable(net->user_ns, CAP_NET_RAW) calls.

    Settings that merely control a single network device are allowed.
    Either the network device is a logical network device where
    restrictions make no difference or the network device is hardware NIC
    that has been explicity moved from the initial network namespace.

    In general policy and network stack state changes are allowed
    while resource control is left unchanged.

    Allow creating raw sockets.
    Allow the SIOCSARP ioctl to control the arp cache.
    Allow the SIOCSIFFLAG ioctl to allow setting network device flags.
    Allow the SIOCSIFADDR ioctl to allow setting a netdevice ipv4 address.
    Allow the SIOCSIFBRDADDR ioctl to allow setting a netdevice ipv4 broadcast address.
    Allow the SIOCSIFDSTADDR ioctl to allow setting a netdevice ipv4 destination address.
    Allow the SIOCSIFNETMASK ioctl to allow setting a netdevice ipv4 netmask.
    Allow the SIOCADDRT and SIOCDELRT ioctls to allow adding and deleting ipv4 routes.

    Allow the SIOCADDTUNNEL, SIOCCHGTUNNEL and SIOCDELTUNNEL ioctls for
    adding, changing and deleting gre tunnels.

    Allow the SIOCADDTUNNEL, SIOCCHGTUNNEL and SIOCDELTUNNEL ioctls for
    adding, changing and deleting ipip tunnels.

    Allow the SIOCADDTUNNEL, SIOCCHGTUNNEL and SIOCDELTUNNEL ioctls for
    adding, changing and deleting ipsec virtual tunnel interfaces.

    Allow setting the MRT_INIT, MRT_DONE, MRT_ADD_VIF, MRT_DEL_VIF, MRT_ADD_MFC,
    MRT_DEL_MFC, MRT_ASSERT, MRT_PIM, MRT_TABLE socket options on multicast routing
    sockets.

    Allow setting and receiving IPOPT_CIPSO, IP_OPT_SEC, IP_OPT_SID and
    arbitrary ip options.

    Allow setting IP_SEC_POLICY/IP_XFRM_POLICY ipv4 socket option.
    Allow setting the IP_TRANSPARENT ipv4 socket option.
    Allow setting the TCP_REPAIR socket option.
    Allow setting the TCP_CONGESTION socket option.

    Signed-off-by: "Eric W. Biederman"
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

16 Nov, 2012

1 commit


15 Nov, 2012

1 commit