Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx4_en: call gro handler for encapsulated frames

In order to use the native GRO handling of encapsulated protocols on
mlx4, we need to call napi_gro_receive() instead of netif_receive_skb()
unless busy polling is in action.

While we are at it, rename mlx4_en_cq_ll_polling() to
mlx4_en_cq_busy_polling()

Tested with GRE tunnel : GRO aggregation is now performed on the
ethernet device instead of being done later on gre device.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Amir Vadai <amirv@mellanox.com>
Cc: Jerry Chu <hkchu@google.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Acked-By: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
e6a76758 d10dbad2

+7 -5
+5 -3
drivers/net/ethernet/mellanox/mlx4/en_rx.c
··· 724 724 * - not an IP fragment 725 725 * - no LLS polling in progress 726 726 */ 727 - if (!mlx4_en_cq_ll_polling(cq) && 727 + if (!mlx4_en_cq_busy_polling(cq) && 728 728 (dev->features & NETIF_F_GRO)) { 729 729 struct sk_buff *gro_skb = napi_get_frags(&cq->napi); 730 730 if (!gro_skb) ··· 816 816 817 817 skb_mark_napi_id(skb, &cq->napi); 818 818 819 - /* Push it up the stack */ 820 - netif_receive_skb(skb); 819 + if (!mlx4_en_cq_busy_polling(cq)) 820 + napi_gro_receive(&cq->napi, skb); 821 + else 822 + netif_receive_skb(skb); 821 823 822 824 next: 823 825 for (nr = 0; nr < priv->num_frags; nr++)
+2 -2
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
··· 661 661 } 662 662 663 663 /* true if a socket is polling, even if it did not get the lock */ 664 - static inline bool mlx4_en_cq_ll_polling(struct mlx4_en_cq *cq) 664 + static inline bool mlx4_en_cq_busy_polling(struct mlx4_en_cq *cq) 665 665 { 666 666 WARN_ON(!(cq->state & MLX4_CQ_LOCKED)); 667 667 return cq->state & CQ_USER_PEND; ··· 691 691 return false; 692 692 } 693 693 694 - static inline bool mlx4_en_cq_ll_polling(struct mlx4_en_cq *cq) 694 + static inline bool mlx4_en_cq_busy_polling(struct mlx4_en_cq *cq) 695 695 { 696 696 return false; 697 697 }