From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2 5/6] net/mlx4: get back Rx checksum offloads Date: Tue, 3 Oct 2017 23:26:06 +0100 Message-ID: <319deb5a-c77f-340c-c05f-ff8bf056fbbd@intel.com> References: <1503590050-196143-1-git-send-email-motih@mellanox.com> <1507027711-879-1-git-send-email-matan@mellanox.com> <1507027711-879-6-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, Moti Haimovsky , Vasily Philipov To: Matan Azrad , Adrien Mazarguil Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 00E051B5DB for ; Wed, 4 Oct 2017 00:26:15 +0200 (CEST) In-Reply-To: <1507027711-879-6-git-send-email-matan@mellanox.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/3/2017 11:48 AM, Matan Azrad wrote: > From: Moti Haimovsky > > 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 <...> > +/** > + * 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; ^~~~~~ <...>