All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Stanislav Fomichev <sdf.kernel@gmail.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, hawk@kernel.org,
	ilias.apalodimas@linaro.org, axboe@kernel.dk, sdf@fomichev.me,
	bobbyeshleman@meta.com, almasrymina@google.com,
	kaiyuanz@google.com, linux-kernel@vger.kernel.org,
	io-uring@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] net: devmem: use memory provider helpers for net_iovs
Date: Sun, 27 Sep 2026 19:13:47 +0100	[thread overview]
Message-ID: <e6421d43-3388-4e02-aece-42fb7034746f@gmail.com> (raw)
In-Reply-To: <20260922204348.717198-3-sdf@fomichev.me>

On 9/22/26 21:43, Stanislav Fomichev wrote:
> Use public memory-provider helpers for DMA address storage and page-pool
> association instead of open-coding page_pool state and accounting.
> 
> Zero the net_iov array because net_mp_niov_set_page_pool() ORs
> PP_SIGNATURE into pp_magic. Reject DMA addresses that cannot be
> represented in net_iov metadata.

Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>

> @@ -247,7 +245,7 @@ net_devmem_bind_dmabuf(struct net_device *dev, void *vdev,
>   			goto err_unmap;
>   		}
>   	}
> -	binding->area.niovs = kvmalloc_objs(*binding->area.niovs,
> +	binding->area.niovs = kvzalloc_objs(*binding->area.niovs,
>   					    binding->area.num_niovs);
>   	if (!binding->area.niovs) {
>   		err = -ENOMEM;
> @@ -274,8 +272,12 @@ net_devmem_bind_dmabuf(struct net_device *dev, void *vdev,
>   		for (i = 0; i < nr_niovs; i++, niov_idx++) {
>   			niov = &binding->area.niovs[niov_idx];
>   			net_iov_init(niov, &binding->area, NET_IOV_DMABUF);
> -			page_pool_set_dma_addr_netmem(net_iov_to_netmem(niov),
> -						      dma_addr);
> +			if (net_mp_niov_set_dma_addr(niov, dma_addr)) {

I'd do this chunk as a separate patch with stable+fix tags to
keep it minimal and help backporting, e.g.

if (page_pool_set_dma_addr_netmem())
	// fail;

Looks like the bot was saying the same (with an extra wall of text),
but I guess it depends on whether you need it backported.

> +				err = -EFAULT;
> +				NL_SET_ERR_MSG(extack,
> +					       "dmabuf DMA address cannot be represented");
> +				goto err_free_niovs;
> +			}
>   			if (direction == DMA_TO_DEVICE)
>   				binding->tx_vec[niov_idx] = niov;
-- 
Pavel Begunkov


  parent reply	other threads:[~2026-09-27 18:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 20:43 [PATCH net-next 0/3] net: consolidate net_iov freelist and DMA handling Stanislav Fomichev
2026-09-22 20:43 ` [PATCH net-next 1/3] net: netmem: add net_iov_area freelist helpers Stanislav Fomichev
2026-09-23 23:46   ` netdev-bot+sashiko
2026-09-24 16:28     ` Stanislav Fomichev
2026-09-24 15:02   ` Mina Almasry
2026-09-24 15:41     ` Pavel Begunkov
2026-09-24 16:46       ` Mina Almasry
2026-09-25 11:11         ` Pavel Begunkov
2026-09-24 16:48       ` Stanislav Fomichev
2026-09-25 11:42         ` Pavel Begunkov
2026-09-25 15:49           ` Stanislav Fomichev
2026-09-24 16:45     ` Stanislav Fomichev
2026-09-22 20:43 ` [PATCH net-next 2/3] net: devmem: use memory provider helpers for net_iovs Stanislav Fomichev
2026-09-23 23:46   ` netdev-bot+sashiko
2026-09-24 16:25     ` Stanislav Fomichev
2026-09-24 15:15   ` Mina Almasry
2026-09-27 18:13   ` Pavel Begunkov [this message]
2026-09-22 20:43 ` [PATCH net-next 3/3] net: devmem: decode DMA addresses for TX Stanislav Fomichev
2026-09-24 19:26   ` Mina Almasry
2026-09-27 18:21   ` Pavel Begunkov

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=e6421d43-3388-4e02-aece-42fb7034746f@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=almasrymina@google.com \
    --cc=axboe@kernel.dk \
    --cc=bobbyeshleman@meta.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=io-uring@vger.kernel.org \
    --cc=kaiyuanz@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf.kernel@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.