mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf.kernel@gmail.com>
To: Mina Almasry <almasrymina@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	sdf@fomichev.me, bobbyeshleman@meta.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 1/3] net: devmem: replace gen_pool with freelist
Date: Wed, 16 Sep 2026 08:01:41 -0700	[thread overview]
Message-ID: <1f3eabf07c1692e419efece1dd54c9cc@gmail.com> (raw)
In-Reply-To: <CAHS8izPWsTh=XYvMfdGy1P+RS2p-nzA0cvNXU81awys4OJTW8g@mail.gmail.com>

> You're warning here that you can't destroy the dmabuf binding but
> you're destroying it anyway. Something is off here. Do we want an
> early return or something else?

I'm assuming we had an early return because gen_pool_destroy would
BUG_ON on non-empty pool. Let me just reword this warning.

> The LLM thinks this NULL store in unnecassary. IDK if it will help
> anything in practice to remove it :-)

No preference, let me remove it.

> We don't need freelists on tx right? We should probably not allocate
> them then?

Yeah, good point, will make it rx only.

> Do we really need a secondary for_each_sgtable_dma_sg loop just to
> calculate the total_niovs? In what edge case is the total_niovs not
> just dmabuf_len / niov_len? We do a bunch of alignment checks to make
> sure it all works out to that no?

Agreed, that should work!

> binding->total_niovs and binding->area.num_niovs seem the same thing
> always. please get rid of one, probably binding->total_niovs.

Will do, thanks!

> I wonder if now that both zcrx and devmem use a freelist if the
> freelist should be part of the net_iov_area. The point of that field
> was to hold the common stuff actually, but I'm guessing there are
> micro-implementation differences that will make converging annoying.
> I'm fine either way. :shrug:

Let me write it down too look separately. Agreed that it'd be nice
to generalize.

> len is referenced once now; not worth a local var.

SG!

> if feels somewhat simple to exclude freelist from TX. Something like:
>
> if (direction == dma_to_device)
>   <store into tx_vec>
> else
>   <store in freelist>

Will do, yeah. Thank you for the review!

  reply	other threads:[~2026-09-16 15:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 15:45 [PATCH net-next v2 0/3] net: devmem: remove gen_pool from dma-buf allocations Stanislav Fomichev
2026-09-11 15:45 ` [PATCH net-next v2 1/3] net: devmem: replace gen_pool with freelist Stanislav Fomichev
2026-09-14 21:46   ` Mina Almasry
2026-09-16 15:01     ` Stanislav Fomichev [this message]
2026-09-11 15:45 ` [PATCH net-next v2 2/3] net: devmem: embed net_iov_area in binding Stanislav Fomichev
2026-09-14 19:37   ` Stanislav Fomichev
2026-09-14 21:53   ` Mina Almasry
2026-09-16 15:01     ` Stanislav Fomichev
2026-09-11 15:45 ` [PATCH net-next v2 3/3] net: devmem: batch net_iov allocations into the page_pool cache Stanislav Fomichev
2026-09-14 21:58   ` Mina Almasry
2026-09-16 15:01     ` Stanislav Fomichev

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=1f3eabf07c1692e419efece1dd54c9cc@gmail.com \
    --to=sdf.kernel@gmail.com \
    --cc=almasrymina@google.com \
    --cc=bobbyeshleman@meta.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    /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

all inboxes | Powered by JetHome®