]> git.ipfire.org Git - thirdparty/iproute2.git/commit
xfrm: add command for configuring SPD hash table
authorChristophe Gouault <christophe.gouault@6wind.com>
Thu, 9 Apr 2015 15:39:32 +0000 (17:39 +0200)
committerStephen Hemminger <shemming@brocade.com>
Fri, 10 Apr 2015 20:21:27 +0000 (13:21 -0700)
commit025fa9dc7a4fee971c7040aeb84b4dac2ae08b3b
tree4d0a2248d1f28b39c41ea5bda5e17046f060ee2a
parente46efaed0ff49b475d50ee8ffba2984e65076ba7
xfrm: add command for configuring SPD hash table

add a new command to configure the SPD hash table:
   ip xfrm policy set [ hthresh4 LBITS RBITS ] [ hthresh6 LBITS RBITS ]

and code to display the SPD hash configuration:
  ip -s -s xfrm policy count

hthresh4: defines minimum local and remote IPv4 prefix lengths of
selectors to hash a policy. If prefix lengths are greater or equal
to the thresholds, then the policy is hashed, otherwise it falls back
in the policy_inexact chained list.

hthresh6: defines minimum local and remote IPv6 prefix lengths of
selectors to hash a policy, otherwise it falls back
in the policy_inexact chained list.

Example:

% ip -s -s xfrm policy count
         SPD IN  0 OUT 0 FWD 0 (Sock: IN 0 OUT 0 FWD 0)
         SPD buckets: count 7 Max 1048576
         SPD IPv4 thresholds: local 32 remote 32
         SPD IPv6 thresholds: local 128 remote 128

% ip xfrm pol set hthresh4 24 16 hthresh6 64 56

% ip -s -s xfrm policy count
         SPD IN  0 OUT 0 FWD 0 (Sock: IN 0 OUT 0 FWD 0)
         SPD buckets: count 7 Max 1048576
         SPD IPv4 thresholds: local 24 remote 16
         SPD IPv6 thresholds: local 64 remote 56

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
ip/xfrm_policy.c