1. 02 9月, 2014 2 次提交
    • C
      xfrm: configure policy hash table thresholds by netlink · 880a6fab
      Christophe Gouault 提交于
      Enable to specify local and remote prefix length thresholds for the
      policy hash table via a netlink XFRM_MSG_NEWSPDINFO message.
      
      prefix length thresholds are specified by XFRMA_SPD_IPV4_HTHRESH and
      XFRMA_SPD_IPV6_HTHRESH optional attributes (struct xfrmu_spdhthresh).
      
      example:
      
          struct xfrmu_spdhthresh thresh4 = {
              .lbits = 0;
              .rbits = 24;
          };
          struct xfrmu_spdhthresh thresh6 = {
              .lbits = 0;
              .rbits = 56;
          };
          struct nlmsghdr *hdr;
          struct nl_msg *msg;
      
          msg = nlmsg_alloc();
          hdr = nlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, XFRMA_SPD_IPV4_HTHRESH, sizeof(__u32), NLM_F_REQUEST);
          nla_put(msg, XFRMA_SPD_IPV4_HTHRESH, sizeof(thresh4), &thresh4);
          nla_put(msg, XFRMA_SPD_IPV6_HTHRESH, sizeof(thresh6), &thresh6);
          nla_send_auto(sk, msg);
      
      The numbers are the policy selector minimum prefix lengths to put a
      policy in the hash table.
      
      - lbits is the local threshold (source address for out policies,
        destination address for in and fwd policies).
      
      - rbits is the remote threshold (destination address for out
        policies, source address for in and fwd policies).
      
      The default values are:
      
      XFRMA_SPD_IPV4_HTHRESH: 32 32
      XFRMA_SPD_IPV6_HTHRESH: 128 128
      
      Dynamic re-building of the SPD is performed when the thresholds values
      are changed.
      
      The current thresholds can be read via a XFRM_MSG_GETSPDINFO request:
      the kernel replies to XFRM_MSG_GETSPDINFO requests by an
      XFRM_MSG_NEWSPDINFO message, with both attributes
      XFRMA_SPD_IPV4_HTHRESH and XFRMA_SPD_IPV6_HTHRESH.
      Signed-off-by: NChristophe Gouault <christophe.gouault@6wind.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      880a6fab
    • C
      xfrm: hash prefixed policies based on preflen thresholds · b58555f1
      Christophe Gouault 提交于
      The idea is an extension of the current policy hashing.
      
      Today only non-prefixed policies are stored in a hash table. This
      patch relaxes the constraints, and hashes policies whose prefix
      lengths are greater or equal to a configurable threshold.
      
      Each hash table (one per direction) maintains its own set of IPv4 and
      IPv6 thresholds (dbits4, sbits4, dbits6, sbits6), by default (32, 32,
      128, 128).
      
      Example, if the output hash table is configured with values (16, 24,
      56, 64):
      
      ip xfrm policy add dir out src 10.22.0.0/20 dst 10.24.1.0/24 ... => hashed
      ip xfrm policy add dir out src 10.22.0.0/16 dst 10.24.1.1/32 ... => hashed
      ip xfrm policy add dir out src 10.22.0.0/16 dst 10.24.0.0/16 ... => unhashed
      
      ip xfrm policy add dir out \
          src 3ffe:304:124:2200::/60 dst 3ffe:304:124:2401::/64 ...    => hashed
      ip xfrm policy add dir out \
          src 3ffe:304:124:2200::/56 dst 3ffe:304:124:2401::2/128 ...  => hashed
      ip xfrm policy add dir out \
          src 3ffe:304:124:2200::/56 dst 3ffe:304:124:2400::/56 ...    => unhashed
      
      The high order bits of the addresses (up to the threshold) are used to
      compute the hash key.
      Signed-off-by: NChristophe Gouault <christophe.gouault@6wind.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      b58555f1
  2. 11 3月, 2014 1 次提交
  3. 19 2月, 2014 1 次提交
  4. 12 2月, 2014 1 次提交
    • F
      flowcache: Make flow cache name space aware · ca925cf1
      Fan Du 提交于
      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: NFan Du <fan.du@windriver.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      ca925cf1
  5. 06 12月, 2013 2 次提交
    • S
      xfrm: Remove ancient sleeping when the SA is in acquire state · 5b8ef341
      Steffen Klassert 提交于
      We now queue packets to the policy if the states are not yet resolved,
      this replaces the ancient sleeping code. Also the sleeping can cause
      indefinite task hangs if the needed state does not get resolved.
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      5b8ef341
    • F
      xfrm: Namespacify xfrm state/policy locks · 283bc9f3
      Fan Du 提交于
      By semantics, xfrm layer is fully name space aware,
      so will the locks, e.g. xfrm_state/pocliy_lock.
      Ensure exclusive access into state/policy link list
      for different name space with one global lock is not
      right in terms of semantics aspect at first place,
      as they are indeed mutually independent with each
      other, but also more seriously causes scalability
      problem.
      
      One practical scenario is on a Open Network Stack,
      more than hundreds of lxc tenants acts as routers
      within one host, a global xfrm_state/policy_lock
      becomes the bottleneck. But onces those locks are
      decoupled in a per-namespace fashion, locks contend
      is just with in specific name space scope, without
      causing additional SPD/SAD access delay for other
      name space.
      
      Also this patch improve scalability while as without
      changing original xfrm behavior.
      Signed-off-by: NFan Du <fan.du@windriver.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      283bc9f3
  6. 12 12月, 2011 1 次提交
  7. 18 10月, 2010 1 次提交
    • E
      netns: reorder fields in struct net · 8e602ce2
      Eric Dumazet 提交于
      In a network bench, I noticed an unfortunate false sharing between
      'loopback_dev' and 'count' fields in "struct net".
      
      'count' is written each time a socket is created or destroyed, while
      loopback_dev might be often read in routing code.
      
      Move loopback_dev in a read mostly section of "struct net"
      
      Note: struct netns_xfrm is cache line aligned on SMP.
      (It contains a "struct dst_ops")
      Move it at the end to avoid holes, and reduce sizeof(struct net) by 128
      bytes on ia32.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8e602ce2
  8. 25 1月, 2010 1 次提交
  9. 04 12月, 2009 1 次提交
  10. 26 11月, 2008 20 次提交