aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2023-05-23 11:43:27 +0900
committerJason Wang <jasowang@redhat.com>2023-05-23 15:20:15 +0800
commit907209e3111dd62a553a19319b422ff8aba5b9c0 (patch)
tree2ad72298ff2422d15b7ab46eddd324998e8f6ad0 /util
parentabc9a29d6bccb2886f86f6242fc228b7eaf5cd87 (diff)
igb: Implement Rx SCTP CSO
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/crc32c.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/crc32c.c b/util/crc32c.c
index 762657d853..ea7f345de8 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;
+}