]> git.itanic.dy.fi Git - linux-stable/commit
sch_cake: Add NAT awareness to packet classifier
authorToke Høiland-Jørgensen <toke@toke.dk>
Fri, 6 Jul 2018 15:37:19 +0000 (17:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Jul 2018 03:06:34 +0000 (20:06 -0700)
commitea82511518f4f2e5fe83d2fe1884ef5fc6be6204
treeacc6b3fe693347a3f81a5932925c4d1e495c28b5
parentb60a60405fb95a688eb2ef4ef20f5fcaa7b64f68
sch_cake: Add NAT awareness to packet classifier

When CAKE is deployed on a gateway that also performs NAT (which is a
common deployment mode), the host fairness mechanism cannot distinguish
internal hosts from each other, and so fails to work correctly.

To fix this, we add an optional NAT awareness mode, which will query the
kernel conntrack mechanism to obtain the pre-NAT addresses for each packet
and use that in the flow and host hashing.

When the shaper is enabled and the host is already performing NAT, the cost
of this lookup is negligible. However, in unlimited mode with no NAT being
performed, there is a significant CPU cost at higher bandwidths. For this
reason, the feature is turned off by default.

Cc: netfilter-devel@vger.kernel.org
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_cake.c