netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@google.com>
To: Daniele Salvatore Albano <d.albano@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [mlx5_core] kernel NULL pointer dereference when sending packets with AF_XDP using the hw checksum
Date: Fri, 15 Mar 2024 21:11:50 -0700	[thread overview]
Message-ID: <ZfUcBnDCepuryS3f@google.com> (raw)
In-Reply-To: <CAKq9yRgO3akVUoz=H_vKgMjoDowq=owq5snPhmKLi4c=taLTnA@mail.gmail.com>

On 03/16, Daniele Salvatore Albano wrote:
> Hey there,
> 
> Hope this is the right ml, if not sorry in advance.
> 
> I have been facing a reproducible kernel panic with 6.8.0 and 6.8.1
> when sending packets and enabling the HW checksum calculation with
> AF_XDP on my mellanox connect 5.
> 
> Running xskgen ( https://github.com/fomichev/xskgen ), which I saw
> mentioned in some patches related to AF_XDP and the hw checksum
> support. In addition to the minimum parameters to make it work, adding
> the -m option is enough to trigger the kernel panic.

Now I wonder if I ever tested only -m (without passing a flag to request
tx timestamp). Maybe you can try to confirm that `xskgen -mC` works?

If you can test custom patches, I think the following should fix it:

diff --git a/include/net/xdp_sock.h b/include/net/xdp_sock.h
index 3cb4dc9bd70e..3d54de168a6d 100644
--- a/include/net/xdp_sock.h
+++ b/include/net/xdp_sock.h
@@ -188,6 +188,8 @@ static inline void xsk_tx_metadata_complete(struct xsk_tx_metadata_compl *compl,
 {
 	if (!compl)
 		return;
+	if (!compl->tx_timestamp)
+		return;
 
 	*compl->tx_timestamp = ops->tmo_fill_timestamp(priv);
 }

If not, I can try to get my mlx5 setup back in shape sometime next week.

  reply	other threads:[~2024-03-16  4:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-16  0:39 [mlx5_core] kernel NULL pointer dereference when sending packets with AF_XDP using the hw checksum Daniele Salvatore Albano
2024-03-16  4:11 ` Stanislav Fomichev [this message]
2024-03-16 15:26   ` Daniele Salvatore Albano
2024-03-18 16:16     ` 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=ZfUcBnDCepuryS3f@google.com \
    --to=sdf@google.com \
    --cc=d.albano@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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).