diff mbox series

[net] vmxnet3: Fix missing reserved tailroom

Message ID 20240309183147.28222-1-witu@nvidia.com (mailing list archive)
State Accepted
Commit e127ce7699c1e05279ee5ee61f00893e7bfa9671
Delegated to: Netdev Maintainers
Headers show
Series [net] vmxnet3: Fix missing reserved tailroom | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 956 this patch: 956
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 2 blamed authors not CCed: alexanderduyck@fb.com alexandr.lobakin@intel.com; 12 maintainers not CCed: alexanderduyck@fb.com edumazet@google.com kuba@kernel.org hawk@kernel.org daniel@iogearbox.net alexandr.lobakin@intel.com bpf@vger.kernel.org pabeni@redhat.com john.fastabend@gmail.com pv-drivers@vmware.com ast@kernel.org doshir@vmware.com
netdev/build_clang success Errors and warnings before: 972 this patch: 972
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 972 this patch: 972
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-13--06-00 (tests: 906)

Commit Message

William Tu March 9, 2024, 6:31 p.m. UTC
Use rbi->len instead of rcd->len for non-dataring packet.

Found issue:
  XDP_WARN: xdp_update_frame_from_buff(line:278): Driver BUG: missing reserved tailroom
  WARNING: CPU: 0 PID: 0 at net/core/xdp.c:586 xdp_warn+0xf/0x20
  CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W  O       6.5.1 #1
  RIP: 0010:xdp_warn+0xf/0x20
  ...
  ? xdp_warn+0xf/0x20
  xdp_do_redirect+0x15f/0x1c0
  vmxnet3_run_xdp+0x17a/0x400 [vmxnet3]
  vmxnet3_process_xdp+0xe4/0x760 [vmxnet3]
  ? vmxnet3_tq_tx_complete.isra.0+0x21e/0x2c0 [vmxnet3]
  vmxnet3_rq_rx_complete+0x7ad/0x1120 [vmxnet3]
  vmxnet3_poll_rx_only+0x2d/0xa0 [vmxnet3]
  __napi_poll+0x20/0x180
  net_rx_action+0x177/0x390

Reported-by: Martin Zaharinov <micron10@gmail.com>
Tested-by: Martin Zaharinov <micron10@gmail.com>
Link: https://lore.kernel.org/netdev/74BF3CC8-2A3A-44FF-98C2-1E20F110A92E@gmail.com/
Fixes: 54f00cce1178 ("vmxnet3: Add XDP support.")
Signed-off-by: William Tu <witu@nvidia.com>
---
Note: this is a while ago in 2023, I forgot to send.
https://lore.kernel.org/netdev/74BF3CC8-2A3A-44FF-98C2-1E20F110A92E@gmail.com/
---
 drivers/net/vmxnet3/vmxnet3_xdp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Paolo Abeni March 12, 2024, 10:56 a.m. UTC | #1
On Sat, 2024-03-09 at 20:31 +0200, William Tu wrote:
> Use rbi->len instead of rcd->len for non-dataring packet.
> 
> Found issue:
>   XDP_WARN: xdp_update_frame_from_buff(line:278): Driver BUG: missing reserved tailroom
>   WARNING: CPU: 0 PID: 0 at net/core/xdp.c:586 xdp_warn+0xf/0x20
>   CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W  O       6.5.1 #1
>   RIP: 0010:xdp_warn+0xf/0x20
>   ...
>   ? xdp_warn+0xf/0x20
>   xdp_do_redirect+0x15f/0x1c0
>   vmxnet3_run_xdp+0x17a/0x400 [vmxnet3]
>   vmxnet3_process_xdp+0xe4/0x760 [vmxnet3]
>   ? vmxnet3_tq_tx_complete.isra.0+0x21e/0x2c0 [vmxnet3]
>   vmxnet3_rq_rx_complete+0x7ad/0x1120 [vmxnet3]
>   vmxnet3_poll_rx_only+0x2d/0xa0 [vmxnet3]
>   __napi_poll+0x20/0x180
>   net_rx_action+0x177/0x390
> 
> Reported-by: Martin Zaharinov <micron10@gmail.com>
> Tested-by: Martin Zaharinov <micron10@gmail.com>
> Link: https://lore.kernel.org/netdev/74BF3CC8-2A3A-44FF-98C2-1E20F110A92E@gmail.com/
> Fixes: 54f00cce1178 ("vmxnet3: Add XDP support.")
> Signed-off-by: William Tu <witu@nvidia.com>
> ---
> Note: this is a while ago in 2023, I forgot to send.
> https://lore.kernel.org/netdev/74BF3CC8-2A3A-44FF-98C2-1E20F110A92E@gmail.com/

The patch LGTM, but you omitted a quite long list of relevant
recipients, added now. Let's wait a bit more for some feedback.

Cheers,

Paolo
Martin Zaharinov March 12, 2024, 11:39 a.m. UTC | #2
Hi Paolo,

Patch tested and work fine without any error.
tested on latest 6.7.9 kernel 
m.

> On 12 Mar 2024, at 12:56, Paolo Abeni <pabeni@redhat.com> wrote:
> 
> On Sat, 2024-03-09 at 20:31 +0200, William Tu wrote:
>> Use rbi->len instead of rcd->len for non-dataring packet.
>> 
>> Found issue:
>>  XDP_WARN: xdp_update_frame_from_buff(line:278): Driver BUG: missing reserved tailroom
>>  WARNING: CPU: 0 PID: 0 at net/core/xdp.c:586 xdp_warn+0xf/0x20
>>  CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W  O       6.5.1 #1
>>  RIP: 0010:xdp_warn+0xf/0x20
>>  ...
>>  ? xdp_warn+0xf/0x20
>>  xdp_do_redirect+0x15f/0x1c0
>>  vmxnet3_run_xdp+0x17a/0x400 [vmxnet3]
>>  vmxnet3_process_xdp+0xe4/0x760 [vmxnet3]
>>  ? vmxnet3_tq_tx_complete.isra.0+0x21e/0x2c0 [vmxnet3]
>>  vmxnet3_rq_rx_complete+0x7ad/0x1120 [vmxnet3]
>>  vmxnet3_poll_rx_only+0x2d/0xa0 [vmxnet3]
>>  __napi_poll+0x20/0x180
>>  net_rx_action+0x177/0x390
>> 
>> Reported-by: Martin Zaharinov <micron10@gmail.com>
>> Tested-by: Martin Zaharinov <micron10@gmail.com>
>> Link: https://lore.kernel.org/netdev/74BF3CC8-2A3A-44FF-98C2-1E20F110A92E@gmail.com/
>> Fixes: 54f00cce1178 ("vmxnet3: Add XDP support.")
>> Signed-off-by: William Tu <witu@nvidia.com>
>> ---
>> Note: this is a while ago in 2023, I forgot to send.
>> https://lore.kernel.org/netdev/74BF3CC8-2A3A-44FF-98C2-1E20F110A92E@gmail.com/
> 
> The patch LGTM, but you omitted a quite long list of relevant
> recipients, added now. Let's wait a bit more for some feedback.
> 
> Cheers,
> 
> Paolo
patchwork-bot+netdevbpf@kernel.org March 14, 2024, 11:50 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Sat, 9 Mar 2024 20:31:47 +0200 you wrote:
> Use rbi->len instead of rcd->len for non-dataring packet.
> 
> Found issue:
>   XDP_WARN: xdp_update_frame_from_buff(line:278): Driver BUG: missing reserved tailroom
>   WARNING: CPU: 0 PID: 0 at net/core/xdp.c:586 xdp_warn+0xf/0x20
>   CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W  O       6.5.1 #1
>   RIP: 0010:xdp_warn+0xf/0x20
>   ...
>   ? xdp_warn+0xf/0x20
>   xdp_do_redirect+0x15f/0x1c0
>   vmxnet3_run_xdp+0x17a/0x400 [vmxnet3]
>   vmxnet3_process_xdp+0xe4/0x760 [vmxnet3]
>   ? vmxnet3_tq_tx_complete.isra.0+0x21e/0x2c0 [vmxnet3]
>   vmxnet3_rq_rx_complete+0x7ad/0x1120 [vmxnet3]
>   vmxnet3_poll_rx_only+0x2d/0xa0 [vmxnet3]
>   __napi_poll+0x20/0x180
>   net_rx_action+0x177/0x390
> 
> [...]

Here is the summary with links:
  - [net] vmxnet3: Fix missing reserved tailroom
    https://git.kernel.org/netdev/net/c/e127ce7699c1

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/vmxnet3/vmxnet3_xdp.c b/drivers/net/vmxnet3/vmxnet3_xdp.c
index 80ddaff759d4..a6c787454a1a 100644
--- a/drivers/net/vmxnet3/vmxnet3_xdp.c
+++ b/drivers/net/vmxnet3/vmxnet3_xdp.c
@@ -382,12 +382,12 @@  vmxnet3_process_xdp(struct vmxnet3_adapter *adapter,
 	page = rbi->page;
 	dma_sync_single_for_cpu(&adapter->pdev->dev,
 				page_pool_get_dma_addr(page) +
-				rq->page_pool->p.offset, rcd->len,
+				rq->page_pool->p.offset, rbi->len,
 				page_pool_get_dma_dir(rq->page_pool));
 
-	xdp_init_buff(&xdp, rbi->len, &rq->xdp_rxq);
+	xdp_init_buff(&xdp, PAGE_SIZE, &rq->xdp_rxq);
 	xdp_prepare_buff(&xdp, page_address(page), rq->page_pool->p.offset,
-			 rcd->len, false);
+			 rbi->len, false);
 	xdp_buff_clear_frags_flag(&xdp);
 
 	xdp_prog = rcu_dereference(rq->adapter->xdp_bpf_prog);