From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 549B42952 for ; Wed, 2 Nov 2016 11:40:20 +0100 (CET) Received: by mail-wm0-f44.google.com with SMTP id u144so22424786wmu.1 for ; Wed, 02 Nov 2016 03:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=8xbk4u4piGZa+CX6XcRX/kr2THGxeoCZux7pIYNMbag=; b=OH57srNej0muhTtDXpWtqutPt4Dc4RB90iswH6sQm8NYjOp/A2OPtL8hg6vjd9KnxM GNCgfbfMf5p5LdD/yjR1df/42nnYKRpgYu/Lx2s01td3ywYSw7H/CmwJRen/p1qpxO7M 6oUvw8TkMqpDI10n+JQfD76MgN9WJn3HYJ7vInwUNIPmbVDtQz/DpDCp6+e+HssMu7el l90R7iTqyTeCmvroOIr9CW2BTfWGEFT6sHO+K5a+B+9v/x6SSIYqyZoshSQ6fhnzqtzd ZzwNi2gkHvaqqifVM4JgA0lTTP3Y6L3hw4d8BRXebw4Sc/DsMKjV2ymBP7JreV5lnCiT yuYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=8xbk4u4piGZa+CX6XcRX/kr2THGxeoCZux7pIYNMbag=; b=G1r2PfKC+9u+f/YxsFzA1lQ8uygquy9IWQzTeSzpKKT1KhXKqnsCGt1FgQwGqsBdPx lk8eixc0too1BH4iz/RNqYn6Q2+KhZpio42vXTHxrypofR4HIkYWbFyK8dWRDzwGoxfe mDYJmDs7EJezT6oFmywE4xIca/sd3UYEScxY+pMitYKR5V+X1uLyYsQ+qqrw1Lh2ic/S 2Y2cuU/1euLCYcAeGX1qQht1MesVCinypPJSovzds/MdAlIG/h/1vR4y3tsEqcBRlpag Iq/xgSDsij10yGAwZZs0XboFl4JE2/fZT2B45IV9qEJ3knKjgRLapc/iQXMzJ6cNeZSG tRbA== X-Gm-Message-State: ABUngvemV01kBAVgnGPTlCmBmglBkezSy4XkdCvbqfRrhn7CSuBogHmyzpZTb/ryn19xkOuB X-Received: by 10.28.66.218 with SMTP id k87mr2329195wmi.79.1478083220066; Wed, 02 Nov 2016 03:40:20 -0700 (PDT) Received: from ping.vm.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id 63sm41155374wmv.1.2016.11.02.03.40.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Nov 2016 03:40:19 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Date: Wed, 2 Nov 2016 11:39:39 +0100 Message-Id: <2230ed349e0ae05ce88b46566df274e0eaf1b440.1478082521.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 3/3] net/mlx: fix support for new Rx checksum flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2016 10:40:20 -0000 Fixes: 5842289a546c ("mbuf: add new Rx checksum flags") Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx4/mlx4.c | 21 ++++++++------------- drivers/net/mlx5/mlx5_rxtx.c | 25 ++++++++++--------------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index faa9acd..da61a85 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -2995,25 +2995,20 @@ rxq_cq_to_ol_flags(const struct rxq *rxq, uint32_t flags) if (rxq->csum) ol_flags |= - TRANSPOSE(~flags, + TRANSPOSE(flags, IBV_EXP_CQ_RX_IP_CSUM_OK, - PKT_RX_IP_CKSUM_BAD) | - TRANSPOSE(~flags, + PKT_RX_IP_CKSUM_GOOD) | + TRANSPOSE(flags, IBV_EXP_CQ_RX_TCP_UDP_CSUM_OK, - PKT_RX_L4_CKSUM_BAD); - /* - * PKT_RX_IP_CKSUM_BAD and PKT_RX_L4_CKSUM_BAD are used in place - * of PKT_RX_EIP_CKSUM_BAD because the latter is not functional - * (its value is 0). - */ + PKT_RX_L4_CKSUM_GOOD); if ((flags & IBV_EXP_CQ_RX_TUNNEL_PACKET) && (rxq->csum_l2tun)) ol_flags |= - TRANSPOSE(~flags, + TRANSPOSE(flags, IBV_EXP_CQ_RX_OUTER_IP_CSUM_OK, - PKT_RX_IP_CKSUM_BAD) | - TRANSPOSE(~flags, + PKT_RX_IP_CKSUM_GOOD) | + TRANSPOSE(flags, IBV_EXP_CQ_RX_OUTER_TCP_UDP_CSUM_OK, - PKT_RX_L4_CKSUM_BAD); + PKT_RX_L4_CKSUM_GOOD); return ol_flags; } diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index b6e0d65..beff580 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -1239,29 +1239,24 @@ rxq_cq_to_ol_flags(struct rxq *rxq, volatile struct mlx5_cqe *cqe) if ((l3_hdr == MLX5_CQE_L3_HDR_TYPE_IPV4) || (l3_hdr == MLX5_CQE_L3_HDR_TYPE_IPV6)) - ol_flags |= - (!(cqe->hds_ip_ext & MLX5_CQE_L3_OK) * - PKT_RX_IP_CKSUM_BAD); + ol_flags |= TRANSPOSE(cqe->hds_ip_ext, + MLX5_CQE_L3_OK, + PKT_RX_IP_CKSUM_GOOD); if ((l4_hdr == MLX5_CQE_L4_HDR_TYPE_TCP) || (l4_hdr == MLX5_CQE_L4_HDR_TYPE_TCP_EMP_ACK) || (l4_hdr == MLX5_CQE_L4_HDR_TYPE_TCP_ACK) || (l4_hdr == MLX5_CQE_L4_HDR_TYPE_UDP)) - ol_flags |= - (!(cqe->hds_ip_ext & MLX5_CQE_L4_OK) * - PKT_RX_L4_CKSUM_BAD); - /* - * PKT_RX_IP_CKSUM_BAD and PKT_RX_L4_CKSUM_BAD are used in place - * of PKT_RX_EIP_CKSUM_BAD because the latter is not functional - * (its value is 0). - */ + ol_flags |= TRANSPOSE(cqe->hds_ip_ext, + MLX5_CQE_L4_OK, + PKT_RX_L4_CKSUM_GOOD); if ((cqe->pkt_info & MLX5_CQE_RX_TUNNEL_PACKET) && (rxq->csum_l2tun)) ol_flags |= - TRANSPOSE(~cqe->l4_hdr_type_etc, + TRANSPOSE(cqe->l4_hdr_type_etc, MLX5_CQE_RX_OUTER_IP_CSUM_OK, - PKT_RX_IP_CKSUM_BAD) | - TRANSPOSE(~cqe->l4_hdr_type_etc, + PKT_RX_IP_CKSUM_GOOD) | + TRANSPOSE(cqe->l4_hdr_type_etc, MLX5_CQE_RX_OUTER_TCP_UDP_CSUM_OK, - PKT_RX_L4_CKSUM_BAD); + PKT_RX_L4_CKSUM_GOOD); return ol_flags; } -- 2.1.4