netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Simon Wunderlich <sw@simonwunderlich.de>
Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
	b.a.t.m.a.n@lists.open-mesh.org,
	Sven Eckelmann <sven@narfation.org>
Subject: Re: [PATCH net-next 3/4] batman-adv: keep skb crc32 helper local in BLA
Date: Sat, 27 Sep 2025 13:55:52 -0700	[thread overview]
Message-ID: <20250927205552.GD9798@quark> (raw)
In-Reply-To: <20250916122441.89246-4-sw@simonwunderlich.de>

Hi,

On Tue, Sep 16, 2025 at 02:24:40PM +0200, Simon Wunderlich wrote:
> +static __be32 batadv_skb_crc32(struct sk_buff *skb, u8 *payload_ptr)
> +{
> +	unsigned int to = skb->len;
> +	unsigned int consumed = 0;
> +	struct skb_seq_state st;
> +	unsigned int from;
> +	unsigned int len;
> +	const u8 *data;
> +	u32 crc = 0;
> +
> +	from = (unsigned int)(payload_ptr - skb->data);
> +
> +	skb_prepare_seq_read(skb, from, to, &st);
> +	while ((len = skb_seq_read(consumed, &data, &st)) != 0) {
> +		crc = crc32c(crc, data, len);
> +		consumed += len;
> +	}
> +
> +	return htonl(crc);
> +}

Has using skb_crc32c() been considered here?

- Eric

  reply	other threads:[~2025-09-27 20:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16 12:24 [PATCH net-next 0/4] pull request for net-next: batman-adv 2025-09-16 Simon Wunderlich
2025-09-16 12:24 ` [PATCH net-next 1/4] batman-adv: Start new development cycle Simon Wunderlich
2025-09-17  0:40   ` patchwork-bot+netdevbpf
2025-09-16 12:24 ` [PATCH net-next 2/4] batman-adv: remove network coding support Simon Wunderlich
2025-09-16 12:24 ` [PATCH net-next 3/4] batman-adv: keep skb crc32 helper local in BLA Simon Wunderlich
2025-09-27 20:55   ` Eric Biggers [this message]
2025-09-28  8:45     ` Sven Eckelmann
2025-09-28 17:17       ` Eric Biggers
2025-09-16 12:24 ` [PATCH net-next 4/4] batman-adv: remove includes for extern declarations Simon Wunderlich

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=20250927205552.GD9798@quark \
    --to=ebiggers@kernel.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sven@narfation.org \
    --cc=sw@simonwunderlich.de \
    /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).