From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by dpdk.org (Postfix) with ESMTP id DF12DA56E for ; Thu, 25 Jan 2018 17:13:59 +0100 (CET) Received: by mail-qt0-f193.google.com with SMTP id f4so20484500qtj.6 for ; Thu, 25 Jan 2018 08:13:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wLlEnOWm6Go06j/rn0xTDbbqXfiGAFCoymYoasPZOqI=; b=FPIGpkqlWVRBelFiFuCK0ty8wFqhLI4lhPG6g+6o79x90JQLKPk80q3B6zPGY8h72m ROELCoWcwQMS1c8pF43Tr+aEtw13mFgQxNSQGGCpoR1QBOGkzxeNcTgOWgj0HYLp5qoj PGE5lLKdq7ksyaxkC7XQpo4VKo+5+rwDYm8G33KazwVR7Yzs/lorQAL7i6P8T8aN85JS xYyLi77VMia9aEzTROuOKOnjPbyYwF9GXM1mQmy1RxEL6VF3egN4Cz7rNc5z0rttSLuu axLRZ0CpL2n94IVnXgPfXNyMS3KkpTiHe3qVR/Geodp77r1Grxa6W40OFNUksyb4cUUg jFHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wLlEnOWm6Go06j/rn0xTDbbqXfiGAFCoymYoasPZOqI=; b=a4RS6K4s+kDgWjCtEVg5R9cAhfL//wodCw8hSW23YvQLgEiMO4ZW9g8JUEUrdHTu+G yJmFOiGVt9cAV9EStPc1y1vFLShUtE7ct4mksu+PPaeXXoSO8cVHAmBRC+rX0h/gfNSz 3gbG9YPFZkh9jdPPAvW77XtZ5RAZY7A6vwwxfKiNCrRh/FiV6rqmHUUCfnDpF/Sh5vsR tNccxZpgOPFCaklwI5Ngpix/btoPt/U6HA9pKVGIOOY2Jeuff7HQPbVBIJoBRxFwJLX3 E/qkkNQwoRdbCrnARBFGT+7R4zL55iDAIfgkLWcVyLmjNziK77JlyhcdYX9Vp4/UlfjN TKJA== X-Gm-Message-State: AKwxytfYK/ul0j3BEn68Dw9N212mlpKENDOtkaWlRxYmBu5ABeZKQuEO Lsrv4A+ZiPf/b9GH4Rklk+uQnmVzRJl/BCgEDE0JYw== X-Google-Smtp-Source: AH8x227wk63lKZzT3Dx8SwwpZnVfDoxIFxRFOgv+tV4pgswNDhJZbvRWVCjXmGSY16Wgfw6YVkIwdsMgHw9d1K2fqBA= X-Received: by 10.55.89.67 with SMTP id n64mr14708848qkb.178.1516896839235; Thu, 25 Jan 2018 08:13:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.164.101 with HTTP; Thu, 25 Jan 2018 08:13:58 -0800 (PST) In-Reply-To: <1516894063-8551-1-git-send-email-rk@semihalf.com> References: <1516894063-8551-1-git-send-email-rk@semihalf.com> From: =?UTF-8?Q?Micha=C5=82_Krawczyk?= Date: Thu, 25 Jan 2018 17:13:58 +0100 Message-ID: To: Rafal Kozik Cc: dev@dpdk.org, Marcin Wojtas , "Tzalik, Guy" , "Schmeilin, Evgeny" , "Matushevsky, Alexander" , "Chauskin, Igor" Content-Type: text/plain; charset="UTF-8" Subject: Re: [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: , X-List-Received-Date: Thu, 25 Jan 2018 16:14:00 -0000 2018-01-25 16:27 GMT+01:00 Rafal Kozik : > > 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, > -- > 2.7.4 >