[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250927205552.GD9798@quark>
Date: Sat, 27 Sep 2025 13:55:52 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Simon Wunderlich <sw@...onwunderlich.de>
Cc: kuba@...nel.org, davem@...emloft.net, netdev@...r.kernel.org,
b.a.t.m.a.n@...ts.open-mesh.org,
Sven Eckelmann <sven@...fation.org>
Subject: Re: [PATCH net-next 3/4] batman-adv: keep skb crc32 helper local in
BLA
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
Powered by blists - more mailing lists