Subject: Re: [PATCH 1/3, net-next] net: netsec: Use page_pool API

From: Jesper Dangaard Brouer <[email-masked]>
Date: Fri, 28 Jun 2019 15:03:17 +0200

On Fri, 28 Jun 2019 13:39:13 +0300
Ilias Apalodimas <[email-masked]> wrote:

> @@ -1079,11 +1095,22 @@ static int netsec_setup_rx_dring(struct netsec_priv *priv)
>  	}
>  
>  	netsec_rx_fill(priv, 0, DESC_NUM);
> +	err = xdp_rxq_info_reg(&dring->xdp_rxq, priv->ndev, 0);
> +	if (err)
> +		goto err_out;
> +
> +	err = xdp_rxq_info_reg_mem_model(&dring->xdp_rxq, MEM_TYPE_PAGE_POOL,
> +					 dring->page_pool);
> +	if (err) {
> +		page_pool_free(dring->page_pool);
> +		goto err_out;
> +	}
>  
>  	return 0;
>  
>  err_out:
> -	return -ENOMEM;
> +	netsec_uninit_pkt_dring(priv, NETSEC_RING_RX);
> +	return err;
>  }

I think you need to move page_pool_free(dring->page_pool) until after
netsec_uninit_pkt_dring() as it use dring->page_pool.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer