multiple local nodes (patch)

To: lvs-devel@xxxxxxxxxxxxxxx
Subject: multiple local nodes (patch)
From: Daniel Drown <dan-lvs@xxxxxxxxx>
Date: Mon, 8 Dec 2008 21:40:12 +0000
I have a need for multiple local nodes in LVS.  I started from the patch from

I found three problems with it:
1. packet checksums were not calculated correctly
2. having stats enabled would deadlock the kernel in the stats update function
3. the kernel would deadlock in the packet recieve function (ip_vs_in)

For #1, I believe this was because the existing code assumes the TCP/UDP
checksums are correct (which is not true for locally generated packets with
hardware checksum).  I just used the same code that the tcp and udp functions

For #2 and #3, the problem was that the majority of the code runs as a bottom
handler.  Locally generated packets are run as a normal kernel context.  If a
network interrupt happens while the kernel is holding a IPVS lock for sending
a local packet, it can schedule the bottom handler.  The bottom handler can
then try to acquire the same lock, and this is a deadlock.  To prevent this
from happening, I've disabled bottom handlers (local_bh_disable) in the local
packet output function I created (ip_vs_out_nobh).

I've tested this and it works on a RH5/CentOS5 kernel:

I've ported it to a stock kernel, but I haven't had time to test it
out yet:

I welcome any comments or criticism on the code.
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

<Prev in Thread] Current Thread [Next in Thread>