From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Denis Kirjanov <kda@linux-powerpc.org>
Cc: brouer@redhat.com, netdev@vger.kernel.org, jgross@suse.com,
wei.liu@kernel.org, paul@xen.org, ilias.apalodimas@linaro.org
Subject: Re: [PATCH net-next v7 1/2] xen networking: add basic XDP support for xen-netfront
Date: Tue, 5 May 2020 10:33:33 +0200 [thread overview]
Message-ID: <20200505103320.11d24a14@carbon> (raw)
In-Reply-To: <1588581474-18345-1-git-send-email-kda@linux-powerpc.org>
On Mon, 4 May 2020 11:37:53 +0300
Denis Kirjanov <kda@linux-powerpc.org> wrote:
> +static int xennet_create_page_pool(struct netfront_queue *queue)
> +{
> + int err;
> + struct page_pool_params pp_params = {
> + .order = 0,
> + .flags = 0,
> + .pool_size = NET_RX_RING_SIZE,
> + .nid = NUMA_NO_NODE,
> + .dev = &queue->info->netdev->dev,
> + .offset = XDP_PACKET_HEADROOM,
> + .max_len = XEN_PAGE_SIZE - XDP_PACKET_HEADROOM,
> + };
> +
> + queue->page_pool = page_pool_create(&pp_params);
> + if (IS_ERR(queue->page_pool)) {
> + err = PTR_ERR(queue->page_pool);
> + queue->page_pool = NULL;
> + return err;
> + }
> +
> + err = xdp_rxq_info_reg(&queue->xdp_rxq, queue->info->netdev,
> + queue->id);
> + if (err) {
> + netdev_err(queue->info->netdev, "xdp_rxq_info_reg failed\n");
> + goto err_free_pp;
> + }
> +
> + err = xdp_rxq_info_reg_mem_model(&queue->xdp_rxq,
> + MEM_TYPE_PAGE_ORDER0, NULL);
What!?! - You are creating a page_pool, but registering a MEM_TYPE_PAGE_ORDER0.
Have you even tested this? The page_pool in-flight accounting will be
completely off. This should show up when removing the page_pool again.
For driver developers do diagnose and catch stuff like this, we have
some bpftrace scripts that can help troubleshoot, here[1]:
[1] https://github.com/xdp-project/xdp-project/tree/master/areas/mem/bpftrace
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
prev parent reply other threads:[~2020-05-05 8:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-04 8:37 [PATCH net-next v7 1/2] xen networking: add basic XDP support for xen-netfront Denis Kirjanov
2020-05-04 8:37 ` [PATCH net-next v7 2/2] xen networking: add XDP offset adjustment to xen-netback Denis Kirjanov
2020-05-05 14:19 ` Paul Durrant
2020-05-05 15:57 ` Denis Kirjanov
2020-05-05 16:28 ` Paul Durrant
2020-05-06 17:45 ` Denis Kirjanov
2020-05-07 7:18 ` Paul Durrant
2020-05-07 11:30 ` Denis Kirjanov
2020-05-05 8:33 ` Jesper Dangaard Brouer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200505103320.11d24a14@carbon \
--to=brouer@redhat.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jgross@suse.com \
--cc=kda@linux-powerpc.org \
--cc=netdev@vger.kernel.org \
--cc=paul@xen.org \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).