All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Hunt <johunt@akamai.com>
To: netfilter-devel@vger.kernel.org, kadlec@blackhole.kfki.hu
Cc: Josh Hunt <johunt@akamai.com>
Subject: [PATCH 0/2] ipset: forceadd support
Date: Sat,  1 Feb 2014 05:30:50 -0800	[thread overview]
Message-ID: <1391261452-11266-1-git-send-email-johunt@akamai.com> (raw)

Forceadd is a property for hash set types and is passed in duration creation.
When sets with this property enabled are full each subsequent 'add' operation
will attempt to evict a random entry from the set. The implementation tries to
keep the overhead low by checking to see which bucket the new entry hashes to.
If that bucket has any entries it will evict the first one and add the new
entry.

Ex usage:
ipset create foo hash:ip forceadd

The intended usecase is for things like 'ban' lists where you may not be concerned
with possibly evicting something early, and more concerned with the size of
the hash itself.


Josh Hunt (2):
  ipset: add forceadd kernel support for hash set types
  ipset: add forceadd userspace support for hash set types

 include/libipset/data.h                            |    4 +-
 include/libipset/linux_ip_set.h                    |    1 +
 include/libipset/parse.h                           |    3 +
 kernel/include/uapi/linux/netfilter/ipset/ip_set.h |    1 +
 kernel/net/netfilter/ipset/ip_set_hash_gen.h       |   26 +++-
 kernel/net/netfilter/ipset/ip_set_hash_ip.c        |    4 +-
 kernel/net/netfilter/ipset/ip_set_hash_ipmark.c    |    3 +-
 kernel/net/netfilter/ipset/ip_set_hash_ipport.c    |    4 +-
 kernel/net/netfilter/ipset/ip_set_hash_ipportip.c  |    4 +-
 kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c |    4 +-
 kernel/net/netfilter/ipset/ip_set_hash_net.c       |    4 +-
 kernel/net/netfilter/ipset/ip_set_hash_netiface.c  |    4 +-
 kernel/net/netfilter/ipset/ip_set_hash_netnet.c    |    3 +-
 kernel/net/netfilter/ipset/ip_set_hash_netport.c   |    4 +-
 .../net/netfilter/ipset/ip_set_hash_netportnet.c   |    4 +-
 lib/data.c                                         |    8 +
 lib/debug.c                                        |    1 +
 lib/ipset_hash_ip.c                                |  123 ++++++++++++++
 lib/ipset_hash_ipmark.c                            |  142 ++++++++++++++++
 lib/ipset_hash_ipport.c                            |  147 +++++++++++++++++
 lib/ipset_hash_ipportip.c                          |  158 ++++++++++++++++++
 lib/ipset_hash_ipportnet.c                         |  169 ++++++++++++++++++++
 lib/ipset_hash_net.c                               |  119 ++++++++++++++
 lib/ipset_hash_netiface.c                          |  125 +++++++++++++++
 lib/ipset_hash_netnet.c                            |  125 +++++++++++++++
 lib/ipset_hash_netport.c                           |  132 +++++++++++++++
 lib/ipset_hash_netportnet.c                        |  149 +++++++++++++++++
 lib/parse.c                                        |   21 +++
 lib/print.c                                        |    4 +
 lib/session.c                                      |    4 +
 src/ipset.8                                        |    7 +
 31 files changed, 1494 insertions(+), 13 deletions(-)


             reply	other threads:[~2014-02-01 13:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-01 13:30 Josh Hunt [this message]
2014-02-01 13:30 ` [PATCH 1/2] ipset: add forceadd kernel support for hash set types Josh Hunt
2014-02-14 10:06   ` Jozsef Kadlecsik
2014-02-01 13:30 ` [PATCH 2/2] ipset: add forceadd userspace " Josh Hunt
2014-02-14 10:10   ` Jozsef Kadlecsik
2014-02-14 10:24     ` Jozsef Kadlecsik
2014-02-15 15:07 ` [PATCH 0/2] ipset: forceadd support Bourne Without
2014-02-15 15:09 ` Bourne Without

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391261452-11266-1-git-send-email-johunt@akamai.com \
    --to=johunt@akamai.com \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.