Thread (9 messages) 9 messages, 4 authors, 2025-09-28

Re: [PATCH net-next 3/4] batman-adv: keep skb crc32 helper local in BLA

From: Eric Biggers <ebiggers@kernel.org>
Date: 2025-09-27 20:55:55
Also in: batman

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help