01 Sep, 2015

1 commit


18 Sep, 2014

1 commit


15 Oct, 2013

1 commit

  • Improve the SH fallback realserver selection strategy.

    With sh and sh-fallback, if a realserver is down, this attempts to
    distribute the traffic that would have gone to that server evenly
    among the remaining servers.

    Signed-off-by: Alexander Frolkin
    Acked-by: Julian Anastasov
    Signed-off-by: Simon Horman

    Alexander Frolkin
     

07 Aug, 2013

1 commit


26 Jun, 2013

2 commits

  • By default the SH scheduler rejects connections that are hashed onto a
    realserver of weight 0. This patch adds a flag to make SH choose a
    different realserver in this case, instead of rejecting the connection.

    The patch also adds a flag to make SH include the source port (TCP, UDP,
    SCTP) in the hash as well as the source address. This basically allows
    for deterministic round-robin load balancing (i.e., where any director
    in a cluster of directors with identical config will send the same
    packet the same way).

    The flags are service flags (IP_VS_SVC_F_SCHED*) so that these options
    can be set per service. They are set using a new option to ipvsadm.

    Signed-off-by: Alexander Frolkin
    Acked-by: Julian Anastasov
    Signed-off-by: Simon Horman

    Alexander Frolkin
     
  • Before now the schedulers needed access only to IP
    addresses and it was easy to get them from skb by
    using ip_vs_fill_iph_addr_only.

    New changes for the SH scheduler will need the protocol
    and ports which is difficult to get from skb for the
    IPv6 case. As we have all the data in the iph structure,
    to avoid the same slow lookups provide the iph to schedulers.

    Signed-off-by: Julian Anastasov
    Acked-by: Hans Schillstrom
    Signed-off-by: Simon Horman

    Julian Anastasov
     

29 May, 2013

1 commit

  • kfree_rcu() requires offsetof(..., rcu_head) < 4096, which can
    get violated with a sufficiently high CONFIG_IP_VS_SH_TAB_BITS.

    Signed-off-by: Jan Beulich
    Signed-off-by: Simon Horman
    Signed-off-by: Pablo Neira Ayuso

    Jan Beulich
     

02 Apr, 2013

3 commits

  • This is the final step in RCU conversion.

    Things that are removed:

    - svc->usecnt: now svc is accessed under RCU read lock
    - svc->inc: and some unused code
    - ip_vs_bind_pe and ip_vs_unbind_pe: no ability to replace PE
    - __ip_vs_svc_lock: replaced with RCU
    - IP_VS_WAIT_WHILE: now readers lookup svcs and dests under
    RCU and work in parallel with configuration

    Other changes:

    - before now, a RCU read-side critical section included the
    calling of the schedule method, now it is extended to include
    service lookup
    - ip_vs_svc_table and ip_vs_svc_fwm_table are now using hlist
    - svc->pe and svc->scheduler remain to the end (of grace period),
    the schedulers are prepared for such RCU readers
    even after done_service is called but they need
    to use synchronize_rcu because last ip_vs_scheduler_put
    can happen while RCU read-side critical sections
    use an outdated svc->scheduler pointer
    - as planned, update_service is removed
    - empty services can be freed immediately after grace period.
    If dests were present, the services are freed from
    the dest trash code

    Signed-off-by: Julian Anastasov
    Signed-off-by: Simon Horman

    Julian Anastasov
     
  • This method releases the scheduler state,
    it can not fail. Such change will help to properly
    replace the scheduler in following patch.

    Signed-off-by: Julian Anastasov
    Signed-off-by: Simon Horman

    Julian Anastasov
     
  • Use the 3 new methods to reassign dests.

    Signed-off-by: Julian Anastasov
    Signed-off-by: Simon Horman

    Julian Anastasov
     

28 Sep, 2012

1 commit

  • IPv6 packets can contain extension headers, thus its wrong to assume
    that the transport/upper-layer header, starts right after (struct
    ipv6hdr) the IPv6 header. IPVS uses this false assumption, and will
    write SNAT & DNAT modifications at a fixed pos which will corrupt the
    message.

    To fix this, proper header position must be found before modifying
    packets. Introducing ip_vs_fill_iph_skb(), which uses ipv6_find_hdr()
    to skip the exthdrs. It finds (1) the transport header offset, (2) the
    protocol, and (3) detects if the packet is a fragment.

    Note, that fragments in IPv6 is represented via an exthdr. Thus, this
    is detected while skipping through the exthdrs.

    This patch depends on commit 84018f55a:
    "netfilter: ip6_tables: add flags parameter to ipv6_find_hdr()"
    This also adds a dependency to ip6_tables.

    Originally based on patch from: Hans Schillstrom

    kABI notes:
    Changing struct ip_vs_iphdr is a potential minor kABI breaker,
    because external modules can be compiled with another version of
    this struct. This should not matter, as they would most-likely
    be using a compiled-in version of ip_vs_fill_iphdr(). When
    recompiled, they will notice ip_vs_fill_iphdr() no longer exists,
    and they have to used ip_vs_fill_iph_skb() instead.

    Signed-off-by: Jesper Dangaard Brouer
    Acked-by: Julian Anastasov
    Signed-off-by: Simon Horman

    Jesper Dangaard Brouer
     

09 May, 2012

1 commit


16 Apr, 2012

1 commit


13 Dec, 2011

1 commit

  • Modify the algorithm to build the source hashing hash table to add
    extra slots for destinations with higher weight. This has the effect
    of allowing an IPVS SH user to give more connections to hosts that
    have been configured to have a higher weight.

    The reason for the Kconfig change is because the size of the hash table
    becomes more relevant/important if you decide to use the weights in the
    manner this patch lets you. It would be conceivable that someone might
    need to increase the size of that table to accommodate their
    configuration, so it will be handy to be able to do that through the
    regular configuration system instead of editing the source.

    Signed-off-by: Michael Maxim
    Signed-off-by: Simon Horman
    Signed-off-by: Pablo Neira Ayuso

    Michael Maxim
     

01 Nov, 2011

1 commit


16 Feb, 2011

1 commit

  • When IP_VS schedulers do not find a destination, they output a terse
    "WLC: no destination available" message through kernel syslog, which I
    can not only make sense of because syslog puts them in a logfile
    together with keepalived checker results.

    This patch makes the output a bit more informative, by telling you which
    virtual service failed to find a destination.

    Example output:

    kernel: [1539214.552233] IPVS: wlc: TCP 192.168.8.30:22 - no destination available
    kernel: [1539299.674418] IPVS: wlc: FWM 22 0x00000016 - no destination available

    I have tested the code for IPv4 and FWM services, as you can see from
    the example; I do not have an IPv6 setup to test the third code path
    with.

    To avoid code duplication, I put a new function ip_vs_scheduler_err()
    into ip_vs_sched.c, and use that from the schedulers instead of calling
    IP_VS_ERR_RL directly.

    Signed-off-by: Patrick Schaaf
    Signed-off-by: Simon Horman

    Patrick Schaaf
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

03 Aug, 2009

1 commit


31 Jul, 2009

1 commit


30 Dec, 2008

1 commit


04 Nov, 2008

1 commit


03 Nov, 2008

1 commit


31 Oct, 2008

1 commit


07 Oct, 2008

1 commit

  • Since IPVS now has partial IPv6 support, this patch moves IPVS from
    net/ipv4/ipvs to net/netfilter/ipvs. It's a result of:

    $ git mv net/ipv4/ipvs net/netfilter

    and adapting the relevant Kconfigs/Makefiles to the new path.

    Signed-off-by: Julius Volz
    Signed-off-by: Simon Horman

    Julius Volz