11 Sep, 2016

1 commit


21 Mar, 2016

1 commit

  • flowi6_tos of struct flowi6 is unused in IPv6, therefore dumping tos on
    that tracepoint will also give incorrect information wrt traffic class.

    If we want to fix it, we need to extract it via ip6_tclass(flp->flowlabel).
    While for the same test case I get a count of 0 non-zero tos values before
    the change, they now start to show up after the change:

    # ./perf record -e fib6:fib6_table_lookup -a sleep 10
    # ./perf script | grep -v "tos 0" | wc -l
    60

    Since there's no user in the kernel tree anymore of flowi6_tos, remove the
    define to avoid any future confusion on this.

    Fixes: b811580d91e9 ("net: IPv6 fib lookup tracepoint")
    Signed-off-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

07 Oct, 2015

1 commit


18 Sep, 2015

1 commit

  • Steffen reported that the recent change to add oif to dst lookups breaks
    the VTI use case. The problem is that with the oif set in the flow struct
    the comparison to the nh_oif is triggered. Fix by splitting the
    FLOWI_FLAG_VRFSRC into 2 flags -- one that triggers the vrf device cache
    bypass (FLOWI_FLAG_VRFSRC) and another telling the lookup to not compare
    nh oif (FLOWI_FLAG_SKIP_NH_OIF).

    Fixes: 42a7b32b73d6 ("xfrm: Add oif to dst lookups")

    Signed-off-by: David Ahern
    Acked-by: Steffen Klassert
    Signed-off-by: David S. Miller

    David Ahern
     

02 Sep, 2015

2 commits


21 Aug, 2015

1 commit


14 Aug, 2015

1 commit

  • As with ingress use the index of VRF master device for route lookups on
    egress. However, the oif should only be used to direct the lookups to a
    specific table. Routes in the table are not based on the VRF device but
    rather interfaces that are part of the VRF so do not consider the oif for
    lookups within the table. The FLOWI_FLAG_VRFSRC is used to control this
    latter part.

    Signed-off-by: Shrijeet Mukherjee
    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     

22 Jul, 2015

1 commit

  • Add a new flowi_tunnel structure which is a subset of ip_tunnel_key to
    allow routes to match on tunnel metadata. For now, the tunnel id is
    added to flowi_tunnel which allows for routes to be bound to specific
    virtual tunnels.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     

17 Apr, 2014

1 commit

  • As suggested by Julian:

    Simply, flowi4_iif must not contain 0, it does not
    look logical to ignore all ip rules with specified iif.

    because in fib_rule_match() we do:

    if (rule->iifindex && (rule->iifindex != fl->flowi_iif))
    goto out;

    flowi4_iif should be LOOPBACK_IFINDEX by default.

    We need to move LOOPBACK_IFINDEX to include/net/flow.h:

    1) It is mostly used by flowi_iif

    2) Fix the following compile error if we use it in flow.h
    by the patches latter:

    In file included from include/linux/netfilter.h:277:0,
    from include/net/netns/netfilter.h:5,
    from include/net/net_namespace.h:21,
    from include/linux/netdevice.h:43,
    from include/linux/icmpv6.h:12,
    from include/linux/ipv6.h:61,
    from include/net/ipv6.h:16,
    from include/linux/sunrpc/clnt.h:27,
    from include/linux/nfs_fs.h:30,
    from init/do_mounts.c:32:
    include/net/flow.h: In function ‘flowi4_init_output’:
    include/net/flow.h:84:32: error: ‘LOOPBACK_IFINDEX’ undeclared (first use in this function)

    Cc: Eric Biederman
    Cc: Julian Anastasov
    Cc: David S. Miller
    Signed-off-by: Cong Wang
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

13 Mar, 2014

1 commit

  • We leak an active timer, the hotcpu notifier and all allocated
    resources when we exit a namespace. Fix this by introducing a
    flow_cache_fini() function where we release the resources before
    we exit.

    Fixes: ca925cf1534e ("flowcache: Make flow cache name space aware")
    Reported-by: Jakub Kicinski
    Tested-by: Jakub Kicinski
    Cc: Eric Dumazet
    Cc: Fan Du
    Signed-off-by: Steffen Klassert
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Steffen Klassert
     

12 Feb, 2014

1 commit

  • Inserting a entry into flowcache, or flushing flowcache should be based
    on per net scope. The reason to do so is flushing operation from fat
    netns crammed with flow entries will also making the slim netns with only
    a few flow cache entries go away in original implementation.

    Since flowcache is tightly coupled with IPsec, so it would be easier to
    put flow cache global parameters into xfrm namespace part. And one last
    thing needs to do is bumping flow cache genid, and flush flow cache should
    also be made in per net style.

    Signed-off-by: Fan Du
    Signed-off-by: Steffen Klassert

    Fan Du
     

06 Dec, 2013

1 commit


21 Sep, 2013

1 commit

  • There are a mix of function prototypes with and without extern
    in the kernel sources. Standardize on not using extern for
    function prototypes.

    Function prototypes don't need to be written with extern.
    extern is assumed by the compiler. Its use is as unnecessary as
    using auto to declare automatic/local variables in a block.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

09 Oct, 2012

1 commit

  • Add flag to request that output route should be
    returned with known rt_gateway, in case we want to use
    it as nexthop for neighbour resolving.

    The returned route can be cached as follows:

    - in NH exception: because the cached routes are not shared
    with other destinations
    - in FIB NH: when using gateway because all destinations for
    NH share same gateway

    As last option, to return rt_gateway!=0 we have to
    set DST_NOCACHE.

    Signed-off-by: Julian Anastasov
    Signed-off-by: David S. Miller

    Julian Anastasov
     

21 Jul, 2012

1 commit


11 Jul, 2012

1 commit


23 Jun, 2012

1 commit


05 Feb, 2012

1 commit

  • Eric Dumazet found that commit 813b3b5db83
    (ipv4: Use caller's on-stack flowi as-is in output
    route lookups.) that comes in 3.0 added a regression.
    The problem appears to be that resulting flowi4_oif is
    used incorrectly as input parameter to some routing lookups.
    The result is that when connecting to local port without
    listener if the IP address that is used is not on a loopback
    interface we incorrectly assign RTN_UNICAST to the output
    route because no route is matched by oif=lo. The RST packet
    can not be sent immediately by tcp_v4_send_reset because
    it expects RTN_LOCAL.

    So, change ip_route_connect and ip_route_newports to
    update the flowi4 fields that are input parameters because
    we do not want unnecessary binding to oif.

    To make it clear what are the input parameters that
    can be modified during lookup and to show which fields of
    floiw4 are reused add a new function to update the flowi4
    structure: flowi4_update_output.

    Thanks to Yurij M. Plotnikov for providing a bug report including a
    program to reproduce the problem.

    Thanks to Eric Dumazet for tracking the problem down to
    tcp_v4_send_reset and providing initial fix.

    Reported-by: Yurij M. Plotnikov
    Signed-off-by: Julian Anastasov
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Julian Anastasov
     

17 Jan, 2012

1 commit


24 Dec, 2011

1 commit


22 Dec, 2011

1 commit

  • flow_cach_flush() might sleep but can be called from
    atomic context via the xfrm garbage collector. So add
    a flow_cache_flush_deferred() function and use this if
    the xfrm garbage colector is invoked from within the
    packet path.

    Signed-off-by: Steffen Klassert
    Acked-by: Timo Teräs
    Signed-off-by: David S. Miller

    Steffen Klassert
     

02 Dec, 2011

1 commit

  • gcc compiler is smart enough to use a single load/store if we
    memcpy(dptr, sptr, 8) on x86_64, regardless of
    CONFIG_CC_OPTIMIZE_FOR_SIZE

    In IP header, daddr immediately follows saddr, this wont change in the
    future. We only need to make sure our flowi4 (saddr,daddr) fields wont
    break the rule.

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

    Eric Dumazet
     

17 Sep, 2011

2 commits


27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

01 Apr, 2011

1 commit


31 Mar, 2011

1 commit

  • On-stack initialization via assignment of flow structures are
    expensive because GCC emits a memset() to clear the entire
    structure out no matter what.

    Add a helper for ipv4 output flow key setup which we can use to avoid
    the memset.

    Signed-off-by: David S. Miller

    David S. Miller
     

13 Mar, 2011

12 commits