From patchwork Thu Jan 25 15:27:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafal Kozik X-Patchwork-Id: 34478 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B790199B0; Thu, 25 Jan 2018 16:28:13 +0100 (CET) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by dpdk.org (Postfix) with ESMTP id AE3402C2E for ; Thu, 25 Jan 2018 16:28:11 +0100 (CET) Received: by mail-lf0-f67.google.com with SMTP id k19so10308366lfj.1 for ; Thu, 25 Jan 2018 07:28:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=QucUtsnIpf3JM/5VC7TuuCsijNYusW6oLRj2qoAcnCw=; b=bcvPt6AjCvebT81AcnhfKJiNP5dX/3RFshV8Ol1vovOA7X0kmgRLiLC9TbffCMUG8q L7wrUNurGnvH5UdTjx8gDbFXZHHqfFoYCH2r0Bb03xydY7Qjk7rq4LYFTWEUTqhS9hRh TnOBZYQbEJDFW08Vm5CATKQYmeZEJCzWK9GDaUs8K33K1B1rsSu1Ug3TelSczB3825Vo 64ziENPtg+4ouzlfBGmLtzC11zVM5RHNqMSNYt9M9z+kjlSqsNK1Q72TcCDhch17KmBE VvcPWV73em6OxjHIcEZ3ldLFV60VhMmC3u9KImyGv6LG9edYe9dfhErAVS7uUn+uE7hQ qCxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QucUtsnIpf3JM/5VC7TuuCsijNYusW6oLRj2qoAcnCw=; b=HRrS3ZR3cQnWKntOQU94lHozwi3U+x9nW5yVqQWugCAUBBtbLwKivmftTWYqtv8e6K d70mGH6241MCe8gDTarYUlJpwPtQiDFOA6ILf+pBHAH4ZTufBwJbh8k7Y9pi+6y1J9+F 5DGdmSaR5CXM0eKXnEuyUqVpNFAqo5kRTq6lq6e19fM5lj83GM0+KNtSlWdxKfR60UcY F9+gKRQsU945xi/XBbcY3IS0Pf98jPdOpxkrf/RlPcid4oEPN3oFQgXJybr7E1EbNSph RJb964lE1+YlOMg21UBIJccCwBZvNWGw40YNJKsoejuQwJOSBbGwLlxjtr2vH6TD+58m THgw== X-Gm-Message-State: AKwxytfG6fMBScFcWn/ateLpxIikYVf4ycxV1tsW7c64vEaaQso/nzSV PMJkEKXh9yXHUPUjOp/b9YF8vcnRKF83FA== X-Google-Smtp-Source: AH8x224mi6IusT6HBz98FPbJz9e38kFWkmrqOyc1SpbQpi/YR6sbbNou0TwKK3I6eKYbu3ChcInKUA== X-Received: by 10.46.64.7 with SMTP id n7mr5731435lja.9.1516894091127; Thu, 25 Jan 2018 07:28:11 -0800 (PST) Received: from rafalkozik.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id r67sm218486ljr.39.2018.01.25.07.28.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Jan 2018 07:28:09 -0800 (PST) From: Rafal Kozik To: dev@dpdk.org Cc: mw@semihalf.com, mk@semihalf.com, gtzalik@amazon.com, evgenys@amazon.com, matua@amazon.com, igorch@amazon.com, Rafal Kozik Date: Thu, 25 Jan 2018 16:27:43 +0100 Message-Id: <1516894063-8551-1-git-send-email-rk@semihalf.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] net/ena: TX L4 offloads should not be set in RX path X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Information about received packet type detected by NIC should be stored in packet_type field of rte_mbuf. TX L4 offload flags should not be set in RX path. Only fields that could be set in of_flags during packet receiving are information if L4 and L3 checksum is correct. Fixes: 1173fca25af9 ("ena: add polling-mode driver") Reported-by: Matthew Smith Signed-off-by: Rafal Kozik Signed-off-by: Michal Krawczyk --- drivers/net/ena/ena_ethdev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 83e0ae2..1e2af80 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -275,16 +275,17 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf, struct ena_com_rx_ctx *ena_rx_ctx) { uint64_t ol_flags = 0; + uint32_t packet_type = 0; if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP) - ol_flags |= PKT_TX_TCP_CKSUM; + packet_type |= RTE_PTYPE_L4_TCP; else if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP) - ol_flags |= PKT_TX_UDP_CKSUM; + packet_type |= RTE_PTYPE_L4_UDP; if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4) - ol_flags |= PKT_TX_IPV4; + packet_type |= RTE_PTYPE_L3_IPV4; else if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV6) - ol_flags |= PKT_TX_IPV6; + packet_type |= RTE_PTYPE_L3_IPV6; if (unlikely(ena_rx_ctx->l4_csum_err)) ol_flags |= PKT_RX_L4_CKSUM_BAD; @@ -292,6 +293,7 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf, ol_flags |= PKT_RX_IP_CKSUM_BAD; mbuf->ol_flags = ol_flags; + mbuf->packet_type = packet_type; } static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf,