From patchwork Wed Feb 23 12:19:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Krawczyk X-Patchwork-Id: 108161 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 091F7A034C; Wed, 23 Feb 2022 13:22:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 161074273E; Wed, 23 Feb 2022 13:20:55 +0100 (CET) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by mails.dpdk.org (Postfix) with ESMTP id 5051742728 for ; Wed, 23 Feb 2022 13:20:51 +0100 (CET) Received: by mail-ed1-f43.google.com with SMTP id bq11so22571486edb.2 for ; Wed, 23 Feb 2022 04:20:51 -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=SDKmmswyzRS8dPZ1m2bCh3rE6PuWSa2rcOndCHjBEXc=; b=oR08VpA4ugIFMtLClEkPdGJVfTs7j29zuWoZj+JoIlPSQsWTrVr4cl/sUTt5KipJZf IU+bVg0LsmEtCNIRkoeNaCJzRIYRZj8aGeR27EaD/vKD2nTnvQkntA7J37ZYj5zk9WSz 0rbQ/0goVmGwv3XdbUWlcUITn6eR6k/Cy27Mwdfrtzh5oJ1UgcfMi/Qu1+fZUemivCoA iLJdti7dAWNTJOP9gMzBKBxb0YS6B5zsxJkSPu5bs4LPwkCqalK7peWKOz8oU/GDfPMM zY+1BUAEWGYojNMRxaiXx4NcbAm61APGAM2otNnMeUBT2ogD8r2XZPZVtUclxHtQDmO5 ZCVQ== 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=SDKmmswyzRS8dPZ1m2bCh3rE6PuWSa2rcOndCHjBEXc=; b=C2syCutJhiM3SDyafzrInPpeKTNwZ57Z//A0ThCjrw4KBDl3uC6PIeZI1PLc/ebZOu KQ9CZr6xWm0SUZCFEsyo1C0HCUwlX5gFumOx8L7KNl8xGEtkp7P1EDUHnkYTasf2aFwt Vi8HQNVBXXU+l0dSmHvxzQpwTGTglTfnbI0lZQGKAl0JRUnGNQFuwBopgMeS6GJp0PhV s20zvB3Q/Myl7+lRM5K2vMB/ryx9hPzZKiDEsq3vxsPGbiVw1tNDWrPTg+MFORwRiVhz X9uGxQSOmm6gymJnS2SpAj30t7cVeAZUCl42QmFd4DqYdJGvoDp7Ciquz6xpaArVlf7W QV9g== X-Gm-Message-State: AOAM533KPrPcdqkJfuO4chJ2JwZ9uHGEBtixKwQ84fnn+Mol7XYeiHsi FfhogAurfCQvAjtuVSgt6yzn0j65d42iyw== X-Google-Smtp-Source: ABdhPJwIzetWE4/InIZ2hnrgu6IN+vl2d6weiTvjQaQCv2uKzmbDNSTi2L2s1M6PYyHkH5hSzsCnoQ== X-Received: by 2002:a05:6402:22ec:b0:410:9214:6dae with SMTP id dn12-20020a05640222ec00b0041092146daemr31030645edb.372.1645618850726; Wed, 23 Feb 2022 04:20:50 -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 v12sm11629224edr.8.2022.02.23.04.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 04:20:50 -0800 (PST) From: Michal Krawczyk To: dev@dpdk.org Cc: ferruh.yigit@intel.com, shaibran@amazon.com, upstream@semihalf.com, Michal Krawczyk , stable@dpdk.org, Dawid Gorecki Subject: [PATCH v3 17/21] net/ena: fix meta-desc DF flag setup Date: Wed, 23 Feb 2022 13:19:40 +0100 Message-Id: <20220223121944.24156-18-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220223121944.24156-1-mk@semihalf.com> References: <20220222181146.28882-1-mk@semihalf.com> <20220223121944.24156-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 0ca4269522..53a8071968 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 */