From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id E875D2952 for ; Wed, 2 Nov 2016 11:40:18 +0100 (CET) Received: by mail-wm0-f51.google.com with SMTP id n67so27938293wme.1 for ; Wed, 02 Nov 2016 03:40:18 -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=2+PIUwnZoDzQc4yastvxMLUixgoKTu7Lvl/c5vLDZ3c=; b=1C5wzhPTWdcF7DT4rRWb3Tp7VOpUmL+vaeeql/FzXy9hkwaFVNbK6EduvWlQARhOnR eoWoGmsbEONJaIVdIsjxTijpWs8hNwaup7P0Qs8XYkOH5dm4v/V2QjAqxFl8VBKPYmPm 9pqFW52TddAshIR2m4a3QHIMNu0OIAfvoCuTkLFsz+ryTX6zqU83xFpELW+X1qddmIsB yjJ2SohNXLAEFCAckHQuwDhrDn8XtSdf4aFmOsi9Qs60dO23OMS4kd/VQ9NGu5Hl6pkt bOV1yDvPd0YOzE/2PZkmxX1/nYxawjUn9QKdVZtx8rLqhtlr1n5NYvflbSIrveYap58l nl1g== 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=2+PIUwnZoDzQc4yastvxMLUixgoKTu7Lvl/c5vLDZ3c=; b=Ri2EkwWglHEzS95dgW6SrsNr71hTIY2cRVv73UmBTpe0cZO8w+KMpE5HT+XUGMHjeF 6u7Bcekc4eGblAO74WGT0t1ao13PugQCN6PKrbIjq0I8v3C9kqpxASzk8V1kT4XBCI4N Vhj36Hycc2jdP+Y1nZIvDt5KoPrDHeJ6fEC8azKMmjkORJNTQRM6OoTyENGRQ4QyGLiL /2sP2ch5osuCuorZXnk/CJfY4ubAd0RtsPfAAL1ZVs3A+iUgfcgexrG765QSjBye5AqB Dqh+VmPVwmEya3mBdlvFw0fJszl2kRWIJIaRQfNwsV4YVvpRKjGIrWXEG6cY9upSMmwz XWbg== X-Gm-Message-State: ABUngvevwIG1v8ni0gHfUdBoKHZyJQbzpIzWnrlqIDsXXSejBbUuhuTaXWMTHb1y2fjsoB+6 X-Received: by 10.194.103.195 with SMTP id fy3mr2819734wjb.136.1478083218448; Wed, 02 Nov 2016 03:40:18 -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.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Nov 2016 03:40:18 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Date: Wed, 2 Nov 2016 11:39:37 +0100 Message-Id: <6911f305d5657741c238c173424c671333110d08.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 1/3] net/mlx5: fix Rx checksum macros 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:19 -0000 Add missing: - MLX5_CQE_RX_IPV4_PACKET - MLX5_CQE_RX_IPV6_PACKET - MLX5_CQE_RX_OUTER_IPV4_PACKET - MLX5_CQE_RX_OUTER_IPV6_PACKET - MLX5_CQE_RX_TUNNEL_PACKET - MLX5_CQE_RX_OUTER_IP_CSUM_OK - MLX5_CQE_RX_OUTER_TCP_UDP_CSUM_OK Fixes: 51a50a3d9b8f ("net/mlx5: add definitions for data path without Verbs") Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_prm.h | 21 +++++++++++++++++++++ drivers/net/mlx5/mlx5_rxtx.c | 16 ++++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h index 90b47f0..500f25a 100644 --- a/drivers/net/mlx5/mlx5_prm.h +++ b/drivers/net/mlx5/mlx5_prm.h @@ -84,6 +84,27 @@ #define MLX5_OPCODE_TSO MLX5_OPCODE_LSO_MPW /* Compat with OFED 3.3. */ #endif +/* IPv4 packet. */ +#define MLX5_CQE_RX_IPV4_PACKET (1u << 2) + +/* IPv6 packet. */ +#define MLX5_CQE_RX_IPV6_PACKET (1u << 3) + +/* Outer IPv4 packet. */ +#define MLX5_CQE_RX_OUTER_IPV4_PACKET (1u << 7) + +/* Outer IPv6 packet. */ +#define MLX5_CQE_RX_OUTER_IPV6_PACKET (1u << 8) + +/* Tunnel packet bit in the CQE. */ +#define MLX5_CQE_RX_TUNNEL_PACKET (1u << 4) + +/* Outer IP checksum OK. */ +#define MLX5_CQE_RX_OUTER_IP_CSUM_OK (1u << 5) + +/* Outer UDP header and checksum OK. */ +#define MLX5_CQE_RX_OUTER_TCP_UDP_CSUM_OK (1u << 6) + /* Subset of struct mlx5_wqe_eth_seg. */ struct mlx5_wqe_eth_seg_small { uint32_t rsvd0; diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index ba8e202..7ebe557 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -1096,19 +1096,19 @@ rxq_cq_to_pkt_type(volatile struct mlx5_cqe64 *cqe) uint8_t flags = cqe->l4_hdr_type_etc; uint8_t info = cqe->rsvd0[0]; - if (info & IBV_EXP_CQ_RX_TUNNEL_PACKET) + if (info & MLX5_CQE_RX_TUNNEL_PACKET) pkt_type = TRANSPOSE(flags, - IBV_EXP_CQ_RX_OUTER_IPV4_PACKET, + MLX5_CQE_RX_OUTER_IPV4_PACKET, RTE_PTYPE_L3_IPV4) | TRANSPOSE(flags, - IBV_EXP_CQ_RX_OUTER_IPV6_PACKET, + MLX5_CQE_RX_OUTER_IPV6_PACKET, RTE_PTYPE_L3_IPV6) | TRANSPOSE(flags, - IBV_EXP_CQ_RX_IPV4_PACKET, + MLX5_CQE_RX_IPV4_PACKET, RTE_PTYPE_INNER_L3_IPV4) | TRANSPOSE(flags, - IBV_EXP_CQ_RX_IPV6_PACKET, + MLX5_CQE_RX_IPV6_PACKET, RTE_PTYPE_INNER_L3_IPV6); else pkt_type = @@ -1256,13 +1256,13 @@ rxq_cq_to_ol_flags(struct rxq *rxq, volatile struct mlx5_cqe64 *cqe) * of PKT_RX_EIP_CKSUM_BAD because the latter is not functional * (its value is 0). */ - if ((info & IBV_EXP_CQ_RX_TUNNEL_PACKET) && (rxq->csum_l2tun)) + if ((info & MLX5_CQE_RX_TUNNEL_PACKET) && (rxq->csum_l2tun)) ol_flags |= TRANSPOSE(~cqe->l4_hdr_type_etc, - IBV_EXP_CQ_RX_OUTER_IP_CSUM_OK, + MLX5_CQE_RX_OUTER_IP_CSUM_OK, PKT_RX_IP_CKSUM_BAD) | TRANSPOSE(~cqe->l4_hdr_type_etc, - IBV_EXP_CQ_RX_OUTER_TCP_UDP_CSUM_OK, + MLX5_CQE_RX_OUTER_TCP_UDP_CSUM_OK, PKT_RX_L4_CKSUM_BAD); return ol_flags; } -- 2.1.4