Skip to content

Commit 30edf80

Browse files
inju-songhorms
authored andcommitted
netfilter: ipvs: Add configurations of Maglev hashing
To build the maglev hashing scheduler, add some configuration to Kconfig and Makefile. - The compile configurations of MH are added to the Kconfig. - The MH build rule is added to the Makefile. Signed-off-by: Inju Song <[email protected]> Signed-off-by: Julian Anastasov <[email protected]> Signed-off-by: Simon Horman <[email protected]>
1 parent 039f32e commit 30edf80

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

net/netfilter/ipvs/Kconfig

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,25 @@ config IP_VS_SH
225225
If you want to compile it in kernel, say Y. To compile it as a
226226
module, choose M here. If unsure, say N.
227227

228+
config IP_VS_MH
229+
tristate "maglev hashing scheduling"
230+
---help---
231+
The maglev consistent hashing scheduling algorithm provides the
232+
Google's Maglev hashing algorithm as a IPVS scheduler. It assigns
233+
network connections to the servers through looking up a statically
234+
assigned special hash table called the lookup table. Maglev hashing
235+
is to assign a preference list of all the lookup table positions
236+
to each destination.
237+
238+
Through this operation, The maglev hashing gives an almost equal
239+
share of the lookup table to each of the destinations and provides
240+
minimal disruption by using the lookup table. When the set of
241+
destinations changes, a connection will likely be sent to the same
242+
destination as it was before.
243+
244+
If you want to compile it in kernel, say Y. To compile it as a
245+
module, choose M here. If unsure, say N.
246+
228247
config IP_VS_SED
229248
tristate "shortest expected delay scheduling"
230249
---help---
@@ -266,6 +285,24 @@ config IP_VS_SH_TAB_BITS
266285
needs to be large enough to effectively fit all the destinations
267286
multiplied by their respective weights.
268287

288+
comment 'IPVS MH scheduler'
289+
290+
config IP_VS_MH_TAB_INDEX
291+
int "IPVS maglev hashing table index of size (the prime numbers)"
292+
range 8 17
293+
default 12
294+
---help---
295+
The maglev hashing scheduler maps source IPs to destinations
296+
stored in a hash table. This table is assigned by a preference
297+
list of the positions to each destination until all slots in
298+
the table are filled. The index determines the prime for size of
299+
the table as�251, 509, 1021, 2039, 4093, 8191, 16381, 32749,
300+
65521 or 131071.�When using weights to allow destinations to
301+
receive more connections,�the table is assigned an amount
302+
proportional to the weights specified.�The table needs to be large
303+
enough to effectively fit all the destinations multiplied by their
304+
respective weights.
305+
269306
comment 'IPVS application helper'
270307

271308
config IP_VS_FTP

net/netfilter/ipvs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ obj-$(CONFIG_IP_VS_LBLC) += ip_vs_lblc.o
3333
obj-$(CONFIG_IP_VS_LBLCR) += ip_vs_lblcr.o
3434
obj-$(CONFIG_IP_VS_DH) += ip_vs_dh.o
3535
obj-$(CONFIG_IP_VS_SH) += ip_vs_sh.o
36+
obj-$(CONFIG_IP_VS_MH) += ip_vs_mh.o
3637
obj-$(CONFIG_IP_VS_SED) += ip_vs_sed.o
3738
obj-$(CONFIG_IP_VS_NQ) += ip_vs_nq.o
3839

0 commit comments

Comments
 (0)