]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
vxlan: GRO support at tunnel layer
authorTom Herbert <tom@herbertland.com>
Thu, 20 Aug 2015 00:07:33 +0000 (17:07 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 15 Sep 2017 03:39:09 +0000 (20:39 -0700)
Add calls to gro_cells infrastructure to do GRO when receiving on a tunnel.

Testing:

Ran 200 netperf TCP_STREAM instance

  - With fix (GRO enabled on VXLAN interface)

    Verify GRO is happening.

    9084 MBps tput
    3.44% CPU utilization

  - Without fix (GRO disabled on VXLAN interface)

    Verified no GRO is happening.

    9084 MBps tput
    5.54% CPU utilization

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25879842
(cherry picked from commit 58ce31cca1ffe057f4744c3f671e3e84606d3d4a)
Signed-off-by: Cathy Zhou <Cathy.Zhou@Oracle.COM>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
drivers/net/vxlan.c

index 7bc7188cc8611bdbb2623a782ff35fb9d82ff1aa..33530c17f41ed198c6a494b373a67dd39e83e1c7 100644 (file)
@@ -132,6 +132,7 @@ struct vxlan_dev {
        spinlock_t        hash_lock;
        unsigned int      addrcnt;
        unsigned int      addrmax;
+       struct gro_cells  gro_cells;
 
        struct hlist_head fdb_head[FDB_HASH_SIZE];
 };
@@ -1321,7 +1322,7 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb,
        stats->rx_bytes += skb->len;
        u64_stats_update_end(&stats->syncp);
 
-       netif_rx(skb);
+       gro_cells_receive(&vxlan->gro_cells, skb);
 
        return;
 drop:
@@ -2377,6 +2378,8 @@ static void vxlan_setup(struct net_device *dev)
 
        vxlan->dev = dev;
 
+       gro_cells_init(&vxlan->gro_cells, dev);
+
        for (h = 0; h < FDB_HASH_SIZE; ++h)
                INIT_HLIST_HEAD(&vxlan->fdb_head[h]);
 }
@@ -2757,6 +2760,7 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head)
                hlist_del_rcu(&vxlan->hlist);
        spin_unlock(&vn->sock_lock);
 
+       gro_cells_destroy(&vxlan->gro_cells);
        list_del(&vxlan->next);
        unregister_netdevice_queue(dev, head);
 }
@@ -2962,8 +2966,10 @@ static void __net_exit vxlan_exit_net(struct net *net)
                /* If vxlan->dev is in the same netns, it has already been added
                 * to the list by the previous loop.
                 */
-               if (!net_eq(dev_net(vxlan->dev), net))
+               if (!net_eq(dev_net(vxlan->dev), net)) {
+                       gro_cells_destroy(&vxlan->gro_cells);
                        unregister_netdevice_queue(vxlan->dev, &list);
+               }
        }
 
        unregister_netdevice_many(&list);