Selecting the physical TX queue from the packet hash makes
netdev_pick_tx dissect every outer packet, although ovpn already holds
the outer flow in the flowi it routes with. On IPv6, the stack derives
the hash from that flowi only when it generates an automatic flow
label.

Set the hash from the outer flowi in both output paths, so that queue
selection depends neither on dissecting the packet nor on automatic
flow labels.

Signed-off-by: Ralf Lici <[email protected]>
---
 drivers/net/ovpn/udp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ovpn/udp.c b/drivers/net/ovpn/udp.c
index 892b33edaf8c..f9741fd86c20 100644
--- a/drivers/net/ovpn/udp.c
+++ b/drivers/net/ovpn/udp.c
@@ -288,6 +288,8 @@ static int ovpn_udp4_output(struct ovpn_peer *peer, struct 
ovpn_bind *bind,
        spin_unlock_bh(&peer->lock);
 
 transmit:
+       /* hash the outer flow for queue selection without dissecting it */
+       skb_get_hash_flowi4(skb, &fl);
        udp_tunnel_xmit_skb(rt, sk, skb, fl.saddr, fl.daddr, 0,
                            ip4_dst_hoplimit(&rt->dst), 0, fl.fl4_sport,
                            fl.fl4_dport, false, sk->sk_no_check_tx, 0);
@@ -388,6 +390,8 @@ static int ovpn_udp6_output(struct ovpn_peer *peer, struct 
ovpn_bind *bind,
         * udp_tunnel_xmit_skb()
         */
        skb->ignore_df = 1;
+       /* hash the outer flow for queue selection without dissecting it */
+       skb_get_hash_flowi6(skb, &fl);
        udp_tunnel6_xmit_skb(dst, sk, skb, skb->dev, &fl.saddr, &fl.daddr, 0,
                             ip6_dst_hoplimit(dst), 0, fl.fl6_sport,
                             fl.fl6_dport, udp_get_no_check6_tx(sk), 0);
-- 
2.56.0



_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to