From 907209e3111dd62a553a19319b422ff8aba5b9c0 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 23 May 2023 11:43:27 +0900 Subject: igb: Implement Rx SCTP CSO Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman Signed-off-by: Jason Wang --- util/crc32c.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'util') diff --git a/util/crc32c.c b/util/crc32c.c index 762657d..ea7f345 100644 --- a/util/crc32c.c +++ b/util/crc32c.c @@ -113,3 +113,11 @@ uint32_t crc32c(uint32_t crc, const uint8_t *data, unsigned int length) return crc^0xffffffff; } +uint32_t iov_crc32c(uint32_t crc, const struct iovec *iov, size_t iov_cnt) +{ + while (iov_cnt--) { + crc = crc32c(crc, iov->iov_base, iov->iov_len) ^ 0xffffffff; + iov++; + } + return crc ^ 0xffffffff; +} -- cgit v1.1