From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B59BEA0352 for ; Tue, 22 Feb 2022 17:07:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD194426D2; Tue, 22 Feb 2022 17:07:16 +0100 (CET) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mails.dpdk.org (Postfix) with ESMTP id 22384411DB for ; Tue, 22 Feb 2022 17:07:14 +0100 (CET) Received: by mail-ej1-f47.google.com with SMTP id qk11so44469797ejb.2 for ; Tue, 22 Feb 2022 08:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=znSlkHpQNYP232kLsAZdHOWoyjBMjyEFlRi8W+WIbLM=; b=VGklU7ca+OwOg1J+Hq7CJpl3+9MutUfwjWEUYqmnQrRf2JcTEEdUnkKElk21ZZhjM0 l4KjaNNf2muxaYna5N22Mbwa0GC9JbCzHNt+QT5KxoPYGvkKWc1moKgR4CQ+zzIrqGLH WsSjE8xrVavSqPE9+TGbxox7jlBmsq+yMuIpD25Cjuaxj2kUzpvmRsAKhgelfJ0giexN xT1xrkJG40HNd+tW+GL4/KwQlqkGsJmbiKXTPJ39g82nfY3WB+cQ6W6t8dN/IKUOD69/ A3zCcA8gBWAbfGBUnPaPCqfJANz/THeUAOSanJl2WWRY3P0F9RozbhDmt0LF45F3wORX JP7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=znSlkHpQNYP232kLsAZdHOWoyjBMjyEFlRi8W+WIbLM=; b=DBeKKtp2DyFdA3JSDPf0K3B5hBsUNcMHbR+ByMAsZE1cfVRTtN/ZPUUotZQ6uIK5g7 jn7QjZC/SIIo6MHcn5weYXZ31yCSmY1zrP0mn3Afej73VXxLNUN0ZoTwLq6EMNG8UtD3 P3MPGMQr9rDzwGntJK6Rl9xAsKP1d0yKTElJr50nDcBwRhKcS0cP+pE/Drn7yQP4W9wA Vn8cfgiFokaOG4sBfVIn7ipfvvKBGqSDy1Ef0VuA3EXVE2PSv6thCnj0rWF8ZCQPXr8f 8QgApJrwLtCkVuy1eVpSd/pn7JanMn/0FZrX8Vmhh7Fh0hEqnEN6ai2GZTrLdRD0rZx+ a9Xw== X-Gm-Message-State: AOAM530ZRstaYPuZZqzr1WWHJk52WWnlumEqJSSztdXTR2I3Q7rDHcfC WwfsE/LlAionYmpljAwz9REGvw== X-Google-Smtp-Source: ABdhPJymCZsUV+yHTf/rT9K/NJGeg/AXjU7Ysv6IIHVrm5rIDXHkytCjudZdM1UddeEwLXDm9XGrnw== X-Received: by 2002:a17:906:a85:b0:6d0:827a:89d0 with SMTP id y5-20020a1709060a8500b006d0827a89d0mr18872677ejf.230.1645546033784; Tue, 22 Feb 2022 08:07:13 -0800 (PST) Received: from DESKTOP-U5LNN3J.localdomain (89-79-181-52.dynamic.chello.pl. [89.79.181.52]) by smtp.gmail.com with ESMTPSA id x6sm10013477edv.109.2022.02.22.08.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 08:07:13 -0800 (PST) From: Michal Krawczyk To: dev@dpdk.org Cc: shaibran@amazon.com, upstream@semihalf.com, Michal Krawczyk , stable@dpdk.org, Dawid Gorecki Subject: [PATCH 17/21] net/ena: fix meta-desc DF flag setup Date: Tue, 22 Feb 2022 17:06:30 +0100 Message-Id: <20220222160634.24489-18-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220222160634.24489-1-mk@semihalf.com> References: <20220222160634.24489-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Whenever Tx checksum offload is being used, the meta descriptor content is taken into consideration. Setting DF field properly in the meta descriptor may have huge impact on the performance both for the IPv4 and IPv6 packets. The requirements for the df field are as below: * No offload used - value doesn't matter * IPv4 - 0 or 1, depending on the DF flag in the IPv4 header * IPv6 - 1 Setting DF to 0 causes the packet to enter the slow-path in the HW and as a result can noticeable impact the performance. Moreover, as 'true' may not always be mapped to 1 depending on it's definition for the given platform/compiler, for safety DF field is being set explicitly to 1. Fixes: 1173fca25af9 ("ena: add polling-mode driver") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk Reviewed-by: Dawid Gorecki Reviewed-by: Shai Brandes --- drivers/net/ena/ena_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 4bb2b195b1..02b4144388 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -624,6 +624,8 @@ static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf, if (mbuf->ol_flags & RTE_MBUF_F_TX_IPV6) { ena_tx_ctx->l3_proto = ENA_ETH_IO_L3_PROTO_IPV6; + /* For the IPv6 packets, DF always needs to be true. */ + ena_tx_ctx->df = 1; } else { ena_tx_ctx->l3_proto = ENA_ETH_IO_L3_PROTO_IPV4; @@ -631,7 +633,7 @@ static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf, if (mbuf->packet_type & (RTE_PTYPE_L4_NONFRAG | RTE_PTYPE_INNER_L4_NONFRAG)) - ena_tx_ctx->df = true; + ena_tx_ctx->df = 1; } /* check if L4 checksum is needed */ -- 2.25.1