diff options
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_rx.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index 9b18d8554071..9aec8b836fe3 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -404,10 +404,11 @@ void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv, | |||
404 | static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, | 404 | static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, |
405 | struct mlx4_en_rx_desc *rx_desc, | 405 | struct mlx4_en_rx_desc *rx_desc, |
406 | struct skb_frag_struct *skb_frags, | 406 | struct skb_frag_struct *skb_frags, |
407 | struct skb_frag_struct *skb_frags_rx, | 407 | struct sk_buff *skb, |
408 | struct mlx4_en_rx_alloc *page_alloc, | 408 | struct mlx4_en_rx_alloc *page_alloc, |
409 | int length) | 409 | int length) |
410 | { | 410 | { |
411 | struct skb_frag_struct *skb_frags_rx = skb_shinfo(skb)->frags; | ||
411 | struct mlx4_en_dev *mdev = priv->mdev; | 412 | struct mlx4_en_dev *mdev = priv->mdev; |
412 | struct mlx4_en_frag_info *frag_info; | 413 | struct mlx4_en_frag_info *frag_info; |
413 | int nr; | 414 | int nr; |
@@ -423,6 +424,7 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, | |||
423 | skb_frags_rx[nr].page = skb_frags[nr].page; | 424 | skb_frags_rx[nr].page = skb_frags[nr].page; |
424 | skb_frag_size_set(&skb_frags_rx[nr], skb_frag_size(&skb_frags[nr])); | 425 | skb_frag_size_set(&skb_frags_rx[nr], skb_frag_size(&skb_frags[nr])); |
425 | skb_frags_rx[nr].page_offset = skb_frags[nr].page_offset; | 426 | skb_frags_rx[nr].page_offset = skb_frags[nr].page_offset; |
427 | skb->truesize += frag_info->frag_stride; | ||
426 | dma = be64_to_cpu(rx_desc->data[nr].addr); | 428 | dma = be64_to_cpu(rx_desc->data[nr].addr); |
427 | 429 | ||
428 | /* Allocate a replacement page */ | 430 | /* Allocate a replacement page */ |
@@ -470,7 +472,6 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv, | |||
470 | skb->dev = priv->dev; | 472 | skb->dev = priv->dev; |
471 | skb_reserve(skb, NET_IP_ALIGN); | 473 | skb_reserve(skb, NET_IP_ALIGN); |
472 | skb->len = length; | 474 | skb->len = length; |
473 | skb->truesize = length + sizeof(struct sk_buff); | ||
474 | 475 | ||
475 | /* Get pointer to first fragment so we could copy the headers into the | 476 | /* Get pointer to first fragment so we could copy the headers into the |
476 | * (linear part of the) skb */ | 477 | * (linear part of the) skb */ |
@@ -490,8 +491,7 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv, | |||
490 | 491 | ||
491 | /* Move relevant fragments to skb */ | 492 | /* Move relevant fragments to skb */ |
492 | used_frags = mlx4_en_complete_rx_desc(priv, rx_desc, skb_frags, | 493 | used_frags = mlx4_en_complete_rx_desc(priv, rx_desc, skb_frags, |
493 | skb_shinfo(skb)->frags, | 494 | skb, page_alloc, length); |
494 | page_alloc, length); | ||
495 | if (unlikely(!used_frags)) { | 495 | if (unlikely(!used_frags)) { |
496 | kfree_skb(skb); | 496 | kfree_skb(skb); |
497 | return NULL; | 497 | return NULL; |
@@ -600,7 +600,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud | |||
600 | 600 | ||
601 | nr = mlx4_en_complete_rx_desc( | 601 | nr = mlx4_en_complete_rx_desc( |
602 | priv, rx_desc, | 602 | priv, rx_desc, |
603 | skb_frags, skb_shinfo(gro_skb)->frags, | 603 | skb_frags, gro_skb, |
604 | ring->page_alloc, length); | 604 | ring->page_alloc, length); |
605 | if (!nr) | 605 | if (!nr) |
606 | goto next; | 606 | goto next; |
@@ -608,7 +608,6 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud | |||
608 | skb_shinfo(gro_skb)->nr_frags = nr; | 608 | skb_shinfo(gro_skb)->nr_frags = nr; |
609 | gro_skb->len = length; | 609 | gro_skb->len = length; |
610 | gro_skb->data_len = length; | 610 | gro_skb->data_len = length; |
611 | gro_skb->truesize += length; | ||
612 | gro_skb->ip_summed = CHECKSUM_UNNECESSARY; | 611 | gro_skb->ip_summed = CHECKSUM_UNNECESSARY; |
613 | 612 | ||
614 | if (cqe->vlan_my_qpn & | 613 | if (cqe->vlan_my_qpn & |