lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191016083254.GA2638@localhost.localdomain>
Date:   Wed, 16 Oct 2019 10:32:54 +0200
From:   Lorenzo Bianconi <lorenzo@...nel.org>
To:     Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc:     netdev@...r.kernel.org, lorenzo.bianconi@...hat.com,
        davem@...emloft.net, thomas.petazzoni@...tlin.com,
        brouer@...hat.com, ilias.apalodimas@...aro.org,
        matteo.croce@...hat.com, mw@...ihalf.com
Subject: Re: [PATCH v3 net-next 2/8] net: mvneta: introduce page pool API for
 sw buffer manager

> On Mon, 14 Oct 2019 12:49:49 +0200, Lorenzo Bianconi wrote:
> > +static int mvneta_create_page_pool(struct mvneta_port *pp,
> > +				   struct mvneta_rx_queue *rxq, int size)
> > +{
> > +	struct page_pool_params pp_params = {
> > +		.order = 0,
> > +		.flags = PP_FLAG_DMA_MAP,
> > +		.pool_size = size,
> > +		.nid = cpu_to_node(0),
> > +		.dev = pp->dev->dev.parent,
> > +		.dma_dir = DMA_FROM_DEVICE,
> > +	};
> > +	int err;
> > +
> > +	rxq->page_pool = page_pool_create(&pp_params);
> > +	if (IS_ERR(rxq->page_pool)) {
> > +		err = PTR_ERR(rxq->page_pool);
> > +		rxq->page_pool = NULL;
> > +		return err;
> > +	}
> > +
> > +	err = xdp_rxq_info_reg(&rxq->xdp_rxq, pp->dev, 0);
> 
> The queue_index is always passed as 0, is there only a single queue?
> XDP programs can read this field.

Hi Jakub,

thx for the review. You are right, I will fix it in v4.

Regards,
Lorenzo

> 
> > +	if (err < 0)
> > +		goto err_free_pp;
> > +
> > +	err = xdp_rxq_info_reg_mem_model(&rxq->xdp_rxq, MEM_TYPE_PAGE_POOL,
> > +					 rxq->page_pool);
> > +	if (err)
> > +		goto err_unregister_rxq;
> > +
> > +	return 0;
> > +
> > +err_unregister_rxq:
> > +	xdp_rxq_info_unreg(&rxq->xdp_rxq);
> > +err_free_pp:
> > +	page_pool_destroy(rxq->page_pool);
> > +	return err;
> > +}

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ