linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2] xsk: Return error code if force_zc is set
@ 2020-12-04 10:21 Zhang Changzhong
  2020-12-04 10:37 ` Magnus Karlsson
  2020-12-04 16:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Zhang Changzhong @ 2020-12-04 10:21 UTC (permalink / raw)
  To: Björn Töpel, Magnus Karlsson, Jonathan Lemon,
	David S. Miller, Jakub Kicinski, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend
  Cc: Zhang Changzhong, netdev, bpf, linux-kernel

If force_zc is set, we should exit out with an error, not fall back to
copy mode.

Fixes: 921b68692abb ("xsk: Enable sharing of dma mappings")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
 net/xdp/xsk_buff_pool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c
index 9287edd..d5adeee 100644
--- a/net/xdp/xsk_buff_pool.c
+++ b/net/xdp/xsk_buff_pool.c
@@ -175,6 +175,7 @@ static int __xp_assign_dev(struct xsk_buff_pool *pool,
 
 	if (!pool->dma_pages) {
 		WARN(1, "Driver did not DMA map zero-copy buffers");
+		err = -EINVAL;
 		goto err_unreg_xsk;
 	}
 	pool->umem->zc = true;
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2] xsk: Return error code if force_zc is set
  2020-12-04 10:21 [PATCH net v2] xsk: Return error code if force_zc is set Zhang Changzhong
@ 2020-12-04 10:37 ` Magnus Karlsson
  2020-12-04 16:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Magnus Karlsson @ 2020-12-04 10:37 UTC (permalink / raw)
  To: Zhang Changzhong
  Cc: Björn Töpel, Magnus Karlsson, Jonathan Lemon,
	David S. Miller, Jakub Kicinski, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
	Network Development, bpf, open list

On Fri, Dec 4, 2020 at 11:18 AM Zhang Changzhong
<zhangchangzhong@huawei.com> wrote:
>
> If force_zc is set, we should exit out with an error, not fall back to
> copy mode.
>
> Fixes: 921b68692abb ("xsk: Enable sharing of dma mappings")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
> ---
>  net/xdp/xsk_buff_pool.c | 1 +
>  1 file changed, 1 insertion(+)

Thank you Changzhong!

Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>

> diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c
> index 9287edd..d5adeee 100644
> --- a/net/xdp/xsk_buff_pool.c
> +++ b/net/xdp/xsk_buff_pool.c
> @@ -175,6 +175,7 @@ static int __xp_assign_dev(struct xsk_buff_pool *pool,
>
>         if (!pool->dma_pages) {
>                 WARN(1, "Driver did not DMA map zero-copy buffers");
> +               err = -EINVAL;
>                 goto err_unreg_xsk;
>         }
>         pool->umem->zc = true;
> --
> 2.9.5
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2] xsk: Return error code if force_zc is set
  2020-12-04 10:21 [PATCH net v2] xsk: Return error code if force_zc is set Zhang Changzhong
  2020-12-04 10:37 ` Magnus Karlsson
@ 2020-12-04 16:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-12-04 16:00 UTC (permalink / raw)
  To: Zhang Changzhong
  Cc: bjorn.topel, magnus.karlsson, jonathan.lemon, davem, kuba, ast,
	daniel, hawk, john.fastabend, netdev, bpf, linux-kernel

Hello:

This patch was applied to bpf/bpf.git (refs/heads/master):

On Fri, 4 Dec 2020 18:21:16 +0800 you wrote:
> If force_zc is set, we should exit out with an error, not fall back to
> copy mode.
> 
> Fixes: 921b68692abb ("xsk: Enable sharing of dma mappings")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
> 
> [...]

Here is the summary with links:
  - [net,v2] xsk: Return error code if force_zc is set
    https://git.kernel.org/bpf/bpf/c/12c8a8ca117f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-04 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 10:21 [PATCH net v2] xsk: Return error code if force_zc is set Zhang Changzhong
2020-12-04 10:37 ` Magnus Karlsson
2020-12-04 16:00 ` patchwork-bot+netdevbpf

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).