From: "Jonathan Lemon" <jonathan.lemon@gmail.com>
To: "Jakub Kicinski" <jakub.kicinski@netronome.com>
Cc: netdev@vger.kernel.org, bjorn.topel@intel.com,
magnus.karlsson@intel.com, saeedm@mellanox.com,
maximmi@mellanox.com, brouer@redhat.com, kernel-team@fb.com
Subject: Re: [PATCH 2/6 bpf-next] Clean up xsk reuseq API
Date: Fri, 28 Jun 2019 14:08:19 -0700 [thread overview]
Message-ID: <8E655F8E-1896-4EB9-992A-F93C64F2B490@gmail.com> (raw)
In-Reply-To: <20190628134121.2f54c349@cakuba.netronome.com>
On 28 Jun 2019, at 13:41, Jakub Kicinski wrote:
> On Thu, 27 Jun 2019 19:31:26 -0700, Jonathan Lemon wrote:
>> On 27 Jun 2019, at 15:38, Jakub Kicinski wrote:
>>
>>> On Thu, 27 Jun 2019 15:08:32 -0700, Jonathan Lemon wrote:
>>>> The reuseq is actually a recycle stack, only accessed from the kernel
>>>> side.
>>>> Also, the implementation details of the stack should belong to the
>>>> umem
>>>> object, and not exposed to the caller.
>>>>
>>>> Clean up and rename for consistency in preparation for the next
>>>> patch.
>>>>
>>>> Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
>>>
>>> Prepare/swap is to cater to how drivers should be written - being able
>>> to allocate resources independently of those currently used. Allowing
>>> for changing ring sizes and counts on the fly. This patch makes it
>>> harder to write drivers in the way we are encouraging people to.
>>>
>>> IOW no, please don't do this.
>>
>> The main reason I rewrote this was to provide the same type
>> of functionality as realloc() - no need to allocate/initialize a new
>> array if the old one would still end up being used. This would seem
>> to be a win for the typical case of having the interface go up/down.
>>
>> Perhaps I should have named the function differently?
>
> Perhaps add a helper which calls both parts to help poorly architected
> drivers?
Still ends up taking more memory.
There are only 3 drivers in the tree which do AF_XDP: i40e, ixgbe, and mlx5.
All of these do the same thing:
reuseq = xsk_reuseq_prepare(n)
if (!reuseq)
error
xsk_reuseq_free(xsk_reuseq_swap(umem, reuseq));
I figured simplifying was a good thing.
But I do take your point that some future driver might want to allocate
everything up front before performing a commit of the resources.
--
Jonathan
next prev parent reply other threads:[~2019-06-28 21:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 22:08 [PATCH 0/6 bpf-next] xsk: reuseq cleanup Jonathan Lemon
2019-06-27 22:08 ` [PATCH 1/6 bpf-next] Have xsk_umem_peek_addr_rq() return chunk-aligned handles Jonathan Lemon
2019-06-27 22:08 ` [PATCH 2/6 bpf-next] Clean up xsk reuseq API Jonathan Lemon
2019-06-27 22:38 ` Jakub Kicinski
2019-06-28 2:31 ` Jonathan Lemon
2019-06-28 20:41 ` Jakub Kicinski
2019-06-28 21:08 ` Jonathan Lemon [this message]
2019-07-01 9:58 ` Magnus Karlsson
2019-06-27 22:08 ` [PATCH 3/6 bpf-next] Always check the recycle stack when using the umem fq Jonathan Lemon
2019-06-27 22:08 ` [PATCH 4/6 bfp-next] Simplify AF_XDP umem allocation path for Intel drivers Jonathan Lemon
2019-06-27 22:42 ` Jakub Kicinski
2019-06-28 2:36 ` Jonathan Lemon
2019-06-28 20:48 ` Jakub Kicinski
2019-06-28 21:06 ` Jonathan Lemon
2019-06-27 22:08 ` [PATCH 5/6 bpf-next] Remove use of umem _rq variants from Mellanox driver Jonathan Lemon
2019-07-01 10:04 ` [PATCH 0/6 bpf-next] xsk: reuseq cleanup Magnus Karlsson
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=8E655F8E-1896-4EB9-992A-F93C64F2B490@gmail.com \
--to=jonathan.lemon@gmail.com \
--cc=bjorn.topel@intel.com \
--cc=brouer@redhat.com \
--cc=jakub.kicinski@netronome.com \
--cc=kernel-team@fb.com \
--cc=magnus.karlsson@intel.com \
--cc=maximmi@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
/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).