Re: [PATCH 13/14] mlx4_en: Moving to work with GRO

Eric Dumazet
2010-08-28T10:56:20Z

Le mardi 24 août 2010 à 16:46 +0300, Yevgeny Petrilin a écrit :
> Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
> ---
> drivers/net/mlx4/en_ethtool.c | 58 +---------------------------------
> drivers/net/mlx4/en_main.c | 5 ---
> drivers/net/mlx4/en_netdev.c | 3 +-
> drivers/net/mlx4/en_rx.c | 68 ++++++++---------------------------------
> drivers/net/mlx4/en_tx.c | 1 +
> drivers/net/mlx4/mlx4_en.h | 6 ---
> 6 files changed, 17 insertions(+), 124 deletions(-)
>

> err_hwq:
> mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
> err_ring:
> @@ -412,7 +380,6 @@ void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv,
> {
> struct mlx4_en_dev *mdev = priv->mdev;
>
> - kfree(ring->lro.lro_arr);
> mlx4_en_unmap_buffer(&ring->wqres.buf);
> mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size + TXBB_SIZE);
> vfree(ring->rx_info);
> @@ -563,7 +530,6 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
> struct mlx4_cqe *cqe;
> struct mlx4_en_rx_ring *ring = &priv->rx_ring[cq->ring];
> struct skb_frag_struct *skb_frags;
> - struct skb_frag_struct lro_frags[MLX4_EN_MAX_RX_FRAGS];
> struct mlx4_en_rx_desc *rx_desc;
> struct sk_buff *skb;
> int index;
> @@ -623,37 +589,33 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
> * - TCP/IP (v4)
> * - without IP options
> * - not an IP fragment */
> - if (mlx4_en_can_lro(cqe->status) &&
> - dev->features & NETIF_F_LRO) {
> + if (dev->features & NETIF_F_GRO) {
> + struct sk_buff *gro_skb = napi_get_frags(&cq->napi);
>

napi_get_frags() can return NULL, please fix your driver.

> nr = mlx4_en_complete_rx_desc(
> priv, rx_desc,
> - skb_frags, lro_frags,
> + skb_frags, skb_shinfo(gro_skb)->frags,
> ring->page_alloc, length);
> if (!nr)
> goto next;
>

Thanks