From patchwork Tue Feb 22 18:11:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Krawczyk X-Patchwork-Id: 108025 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 61D09A034E; Tue, 22 Feb 2022 19:14:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6528A426D2; Tue, 22 Feb 2022 19:12:39 +0100 (CET) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by mails.dpdk.org (Postfix) with ESMTP id 6D4444116A for ; Tue, 22 Feb 2022 19:12:36 +0100 (CET) Received: by mail-ed1-f45.google.com with SMTP id s1so5834249edd.13 for ; Tue, 22 Feb 2022 10:12:36 -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=x9xcxLG1wSp4t18lGzPse6yIqtfKR/m1IJcfcGlsOJH7ELYeZqfSsgGnk271CtRKli 4luznTLU4eZB+gFzsOJQbcFj2N1hgmqJOkm681feWGT6vWAzWrsoHK9ftoSLZdaT9qA1 oSL0S51+hmF+dLG51JuohZZ2xe76l77NYKr1Sq/LXrnIXX40HIbeVh7fzsIF7U9uU+o2 GoJurmpXcjfNhHvJCJoxM9Wsus75T5G9exLCyCfI+YONEtPcLUXNDJpqKZsBz2NSJeTI 6tK6Ix37VgCJnnzJyKCYHORJR8rCJ0W7JczGHmGXMhFOplnNdJ+HbolSO47wgoDKVhRt DXWw== 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=kZooCps2CA0nExNO1SPQAcydJuJqvSkB9fLTW++r/Qz/K1WpD5t7K9cd/RCb574fwX 3ddpj96RTu+PnFM6RZqh8KBV45zbyLeWqCm3QoQyhAWga7iR2jEb4Mcwb3j4rxZoGmCS 0Bc8hyeM9gY0hdI+HBm2OAbZPk6AvIcZErS9VxaBk1KFv0tJZzbjI4IKPJI3AzJWjs53 m9PWSBBX6exc+SSzFIurSRZ38ka8djv7Qp2OEoSks9s4PmQStwcB4udIB+sClTVq9UVU yIFqmMJmFJOCKHYVD0Dr3CeKJP+0TFcij8nuzq1M+9VDLqcrBO1mXBmcqxoEuu5QItLn pTRQ== X-Gm-Message-State: AOAM532iicKC2g3p68+z7OEmEmpsu/zwUR3G0KhlV7q70qF9eESzxC0R 3PO3llxOZrejUx7mWOArwFujNpHR81UmIQ== X-Google-Smtp-Source: ABdhPJxocTdCyQLDTfVF7qOJXg8Lzan40hf7lAN4wA6ThA68cRg1hB/A5FOUMJA1FUpSgtfWphg3LQ== X-Received: by 2002:aa7:cb8b:0:b0:410:9aaf:2974 with SMTP id r11-20020aa7cb8b000000b004109aaf2974mr27131223edt.173.1645553555903; Tue, 22 Feb 2022 10:12:35 -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 y21sm10610153eda.38.2022.02.22.10.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 10:12:35 -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 v2 17/21] net/ena: fix meta-desc DF flag setup Date: Tue, 22 Feb 2022 19:11:42 +0100 Message-Id: <20220222181146.28882-18-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220222181146.28882-1-mk@semihalf.com> References: <20220222160634.24489-1-mk@semihalf.com> <20220222181146.28882-1-mk@semihalf.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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 */