diff options
author | Erez Shitrit <erezsh@mellanox.com> | 2017-04-27 10:59:00 -0400 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2017-05-23 09:23:31 -0400 |
commit | b57fe691961cc8f00541f9a435c70df45d41e514 (patch) | |
tree | 4bc5f424d7d3c86ad35f67ab28b42ba0eacd2dca | |
parent | e3ca4e0583a02a04503d9c827fb5c5d50abc4ff5 (diff) |
net/mlx5e: IPoIB, handle RX packet correctly
IPoIB packet contains the pseudo header area, we need to pull it prior
to reset_mac_header in order to let the GRO work well.
In more details:
GRO checks the mac address of the new coming packet, it does that by
comparing the hard_header_len size of the current packet to the previous
one in that session, the comparison is over hard_header_len size.
Now, the driver prepares that area in the skb by allocating area from the
reserved part and resetting the correct mac header to it.
Fixes: 9d6bd752c63c ("net/mlx5e: IPoIB, RX handler")
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 7b1566f0ae58..66b5fec15313 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | |||
@@ -1041,6 +1041,8 @@ void mlx5e_free_xdpsq_descs(struct mlx5e_xdpsq *sq) | |||
1041 | #define MLX5_IB_GRH_BYTES 40 | 1041 | #define MLX5_IB_GRH_BYTES 40 |
1042 | #define MLX5_IPOIB_ENCAP_LEN 4 | 1042 | #define MLX5_IPOIB_ENCAP_LEN 4 |
1043 | #define MLX5_GID_SIZE 16 | 1043 | #define MLX5_GID_SIZE 16 |
1044 | #define MLX5_IPOIB_PSEUDO_LEN 20 | ||
1045 | #define MLX5_IPOIB_HARD_LEN (MLX5_IPOIB_PSEUDO_LEN + MLX5_IPOIB_ENCAP_LEN) | ||
1044 | 1046 | ||
1045 | static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq, | 1047 | static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq, |
1046 | struct mlx5_cqe64 *cqe, | 1048 | struct mlx5_cqe64 *cqe, |
@@ -1048,6 +1050,7 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq, | |||
1048 | struct sk_buff *skb) | 1050 | struct sk_buff *skb) |
1049 | { | 1051 | { |
1050 | struct net_device *netdev = rq->netdev; | 1052 | struct net_device *netdev = rq->netdev; |
1053 | char *pseudo_header; | ||
1051 | u8 *dgid; | 1054 | u8 *dgid; |
1052 | u8 g; | 1055 | u8 g; |
1053 | 1056 | ||
@@ -1076,8 +1079,11 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq, | |||
1076 | if (likely(netdev->features & NETIF_F_RXHASH)) | 1079 | if (likely(netdev->features & NETIF_F_RXHASH)) |
1077 | mlx5e_skb_set_hash(cqe, skb); | 1080 | mlx5e_skb_set_hash(cqe, skb); |
1078 | 1081 | ||
1082 | /* 20 bytes of ipoib header and 4 for encap existing */ | ||
1083 | pseudo_header = skb_push(skb, MLX5_IPOIB_PSEUDO_LEN); | ||
1084 | memset(pseudo_header, 0, MLX5_IPOIB_PSEUDO_LEN); | ||
1079 | skb_reset_mac_header(skb); | 1085 | skb_reset_mac_header(skb); |
1080 | skb_pull(skb, MLX5_IPOIB_ENCAP_LEN); | 1086 | skb_pull(skb, MLX5_IPOIB_HARD_LEN); |
1081 | 1087 | ||
1082 | skb->dev = netdev; | 1088 | skb->dev = netdev; |
1083 | 1089 | ||