// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved. * Copyright (c) 2015 System Fabric Works, Inc. All rights reserved. */ #include <linux/crc32.h> #include "rxe.h" #include "rxe_loc.h" /** * rxe_icrc_init() - Initialize crypto function for computing crc32 * @rxe: rdma_rxe device object * * Return: 0 on success else an error */ int rxe_icrc_init(struct rxe_dev *rxe) { … } /** * rxe_crc32() - Compute cumulative crc32 for a contiguous segment * @rxe: rdma_rxe device object * @crc: starting crc32 value from previous segments * @next: starting address of current segment * @len: length of current segment * * Return: the cumulative crc32 checksum */ static __be32 rxe_crc32(struct rxe_dev *rxe, __be32 crc, void *next, size_t len) { … } /** * rxe_icrc_hdr() - Compute the partial ICRC for the network and transport * headers of a packet. * @skb: packet buffer * @pkt: packet information * * Return: the partial ICRC */ static __be32 rxe_icrc_hdr(struct sk_buff *skb, struct rxe_pkt_info *pkt) { … } /** * rxe_icrc_check() - Compute ICRC for a packet and compare to the ICRC * delivered in the packet. * @skb: packet buffer * @pkt: packet information * * Return: 0 if the values match else an error */ int rxe_icrc_check(struct sk_buff *skb, struct rxe_pkt_info *pkt) { … } /** * rxe_icrc_generate() - compute ICRC for a packet. * @skb: packet buffer * @pkt: packet information */ void rxe_icrc_generate(struct sk_buff *skb, struct rxe_pkt_info *pkt) { … }