[dpdk-dev] [PATCH v2 5/6] net/mlx4: get back Rx checksum offloads
Ferruh Yigit
ferruh.yigit at intel.com
Wed Oct 4 00:26:06 CEST 2017
On 10/3/2017 11:48 AM, Matan Azrad wrote:
> From: Moti Haimovsky <motih at mellanox.com>
>
> This patch adds hardware offloading support for IPV4, UDP and TCP
> checksum verification.
> This commit also includes support for offloading IPV4, UDP and TCP tunnel
> checksum verification to the hardware.
>
> Signed-off-by: Vasily Philipov <vasilyf at mellanox.com>
<...>
> +/**
> + * Get Rx checksum CQE flags.
> + *
> + * @param cqe
> + * Pointer to cqe structure.
> + * @param csum
> + * Rx checksum enable flag
> + * @param csum_l2tun
> + * RX L2-tun checksum enable flag
> + *
> + * @return
> + * CQE's flags.
> + */
> +static inline uint32_t
> +mlx4_cqe_flags(struct mlx4_cqe *cqe,
> + int csum, unsigned int csum_l2tun)
> +{
> + uint32_t flags = 0;
> +
> + /*
> + * The relevant bits are in different locations on their
> + * CQE fields therefore we can join them in one 32bit
> + * variable.
> + */
> + if (csum)
> + flags = rte_be_to_cpu_32(cqe->status) &
> + MLX4_CQE_STATUS_IPV4_CSUM_OK;
> + if (csum_l2tun)
> + flags |= rte_be_to_cpu_32(cqe->vlan_my_qpn) &
> + (MLX4_CQE_L2_TUNNEL |
> + MLX4_CQE_L2_TUNNEL_IPOK |
> + MLX4_CQE_L2_TUNNEL_L4_CSUM |
> + MLX4_CQE_L2_TUNNEL_IPV4);
> + return flags;
Wrong indentation is triggering a compiler warning here:
.../dpdk/drivers/net/mlx4/mlx4_rxtx.c: In function ‘mlx4_cqe_flags’:
.../dpdk/drivers/net/mlx4/mlx4_rxtx.c:673:2: error: this ‘if’ clause
does not guard... [-Werror=misleading-indentation]
if (csum_l2tun)
^~
.../dpdk/drivers/net/mlx4/mlx4_rxtx.c:679:3: note: ...this statement,
but the latter is misleadingly indented as if it were guarded by the ‘if’
return flags;
^~~~~~
<...>
More information about the dev
mailing list