• Ido Schimmel's avatar
    ipv4: Add a sysctl to control multipath hash fields · ce5c9c20
    Ido Schimmel authored
    A subsequent patch will add a new multipath hash policy where the packet
    fields used for multipath hash calculation are determined by user space.
    This patch adds a sysctl that allows user space to set these fields.
    
    The packet fields are represented using a bitmask and are common between
    IPv4 and IPv6 to allow user space to use the same numbering across both
    protocols. For example, to hash based on standard 5-tuple:
    
     # sysctl -w net.ipv4.fib_multipath_hash_fields=0x0037
     net.ipv4.fib_multipath_hash_fields = 0x0037
    
    The kernel rejects unknown fields, for example:
    
     # sysctl -w net.ipv4.fib_multipath_hash_fields=0x1000
     sysctl: setting key "net.ipv4.fib_multipath_hash_fields": Invalid argument
    
    More fields can be added in the future, if needed.
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ce5c9c20
fib_frontend.c 38.7 KB