Skip to content

Commit 58ce31c

Browse files
tomratbertdavem330
authored andcommitted
vxlan: GRO support at tunnel layer
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b7fe10e commit 58ce31c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

drivers/net/vxlan.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb,
12081208
stats->rx_bytes += skb->len;
12091209
u64_stats_update_end(&stats->syncp);
12101210

1211-
netif_rx(skb);
1211+
gro_cells_receive(&vxlan->gro_cells, skb);
12121212

12131213
return;
12141214
drop:
@@ -2446,6 +2446,8 @@ static void vxlan_setup(struct net_device *dev)
24462446

24472447
vxlan->dev = dev;
24482448

2449+
gro_cells_init(&vxlan->gro_cells, dev);
2450+
24492451
for (h = 0; h < FDB_HASH_SIZE; ++h)
24502452
INIT_HLIST_HEAD(&vxlan->fdb_head[h]);
24512453
}
@@ -2885,6 +2887,7 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head)
28852887
hlist_del_rcu(&vxlan->hlist);
28862888
spin_unlock(&vn->sock_lock);
28872889

2890+
gro_cells_destroy(&vxlan->gro_cells);
28882891
list_del(&vxlan->next);
28892892
unregister_netdevice_queue(dev, head);
28902893
}
@@ -3093,8 +3096,10 @@ static void __net_exit vxlan_exit_net(struct net *net)
30933096
/* If vxlan->dev is in the same netns, it has already been added
30943097
* to the list by the previous loop.
30953098
*/
3096-
if (!net_eq(dev_net(vxlan->dev), net))
3099+
if (!net_eq(dev_net(vxlan->dev), net)) {
3100+
gro_cells_destroy(&vxlan->gro_cells);
30973101
unregister_netdevice_queue(vxlan->dev, &list);
3102+
}
30983103
}
30993104

31003105
unregister_netdevice_many(&list);

include/net/vxlan.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ struct vxlan_dev {
161161
struct timer_list age_timer;
162162
spinlock_t hash_lock;
163163
unsigned int addrcnt;
164+
struct gro_cells gro_cells;
164165

165166
struct vxlan_config cfg;
166167

0 commit comments

Comments
 (0)