diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2017-03-20 11:19:45 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-22 11:19:48 -0700 |
commit | a9ec54d1b0cdfd94eda44c7d5d1ce9e8ede1e402 (patch) | |
tree | d5985ab9bbad96500a8a8cf3bd51741f67c03b6c /net | |
parent | dcdd43c41e60d7618ad54369d77ee39f122d41e4 (diff) | |
download | linux-a9ec54d1b0cdfd94eda44c7d5d1ce9e8ede1e402.tar.bz2 |
net: vrf: performance improvements for IPv6
The VRF driver allows users to implement device based features for an
entire domain. For example, a qdisc or netfilter rules can be attached
to a VRF device or tcpdump can be used to view packets for all devices
in the L3 domain.
The device-based features come with a performance penalty, most
notably in the Tx path. The VRF driver uses the l3mdev_l3_out hook
to switch the dst on an skb to its private dst. This allows the skb
to traverse the xmit stack with the device set to the VRF device
which in turn enables the netfilter and qdisc features. The VRF
driver then performs the FIB lookup again and reinserts the packet.
This patch avoids the redirect for IPv6 packets if a qdisc has not
been attached to a VRF device which is the default config. In this
case the netfilter hooks and network taps are directly traversed in
the l3mdev_l3_out handler. If a qdisc is attached to a VRF device,
then the redirect using the vrf dst is done.
Additional overhead is removed by only checking packet taps if a
socket is open on the device (vrf_dev->ptype_all list is not empty).
Packet sockets bound to any device will still get a copy of the
packet via the real ingress or egress interface.
The end result of this change is a decrease in the overhead of VRF
for the default, baseline case (ie., no netfilter rules, no packet
sockets, no qdisc) from a +3% improvement for UDP which has a lookup
per packet (VRF being better than no l3mdev) to ~2% loss for TCP_CRR
which connects a socket for each request-response.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions