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 AB83843272; Fri, 3 Nov 2023 02:31:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 327A640265; Fri, 3 Nov 2023 02:31:50 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2066.outbound.protection.outlook.com [40.107.94.66]) by mails.dpdk.org (Postfix) with ESMTP id 1A5B74021E for ; Fri, 3 Nov 2023 02:31:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jump0S845rAUOcXFlPdHAt58t77U9x9n98JThsbI5af6kpApJ5TkouC7YmQsZSn9N+cw4KAYgHoJOHXo4gXp6aufXpeSwGCtfnoL+1wqOlHOyY+0RHYNrpzF9BQqfqX1YyaC/RaNsplkU8KJpZsUX0dl/YgVI71A5pjZGBDcl/7BSC20bsi5Ata7VJPP1ysZtv6/iuTtLJzMxXoYkp5FtjD2g4JohBF2lZ6FkKvlO9Y9cbVVx+qAwWoNT1os4jwWHds0f2gUNs8tytaSoCrMjDKDIPVN0925TACb3+G0XzU4FPwjw5NFbCbCsf32XK1/cdNl/GmFnOD0+9vUXbXp1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fq40vAxNfs+5+scK6tfyUWaVMXXkKnhISMOeA6hVUoY=; b=OGWifhenW41X9COJdW2GSzkMmIMJEwzC6U+hdxH5M/eyTugkPzPkQ4ADzvAK3+dY+g881AEDI2fARl32zzLcXEcW/lq1tVnRM+MujS10MbdtXRA/XcmDZbEZESom2OniFzeTGMt2EW8uvC52gURBoWDqg7JYDu3f9//2+JNekQWkAQkQF+mQyWxzSX2c/BfVakPz81g7fx4fq1bo+AASaZXLxg2Ch2UcikxLQLJyvtG+RGW4jvCDr+tz8XSch9nxsmfafEnk4Jd2zM69SP+76URGXLcHDnAcajcea+oTtnZGNNw7kSzAUzBkRpaWbeE3rUrBvFW3H9oRhxY6Aa2hOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Fq40vAxNfs+5+scK6tfyUWaVMXXkKnhISMOeA6hVUoY=; b=R6d+OxY9E3envMKsZgESa7ybjgwKvrtDSRzajAFmKWIsY0QjxO6M1yB+zwUmkb68R0L7Nk8nDKqa4gAN2fX2jbuNXLXTpJgqAn3ZF841PUKPUK/0tDNb+6x0hHd88Rvcuukkxj7OT/+JC6vLTgDImCMJuFCYV3nhpYm2pncT3+0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by PH8PR12MB8431.namprd12.prod.outlook.com (2603:10b6:510:25a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 01:31:46 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f%6]) with mapi id 15.20.6954.019; Fri, 3 Nov 2023 01:31:46 +0000 Message-ID: <62dbcb50-31b0-41a2-9d83-a53b01abd0a6@amd.com> Date: Fri, 3 Nov 2023 01:31:36 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] app/testpmd: fix UDP cksum error for UFO enable Content-Language: en-US To: Huisong Li , dev@dpdk.org Cc: thomas@monjalon.net, aman.deep.singh@intel.com, yuying.zhang@intel.com, zhichaox.zeng@intel.com References: <20230728021310.15970-1-lihuisong@huawei.com> <20230802025520.8000-1-lihuisong@huawei.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPt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795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20230802025520.8000-1-lihuisong@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0045.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH8PR12MB8431:EE_ X-MS-Office365-Filtering-Correlation-Id: ae04ec30-e977-462b-0359-08dbdc0ca485 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MjA2cMaoxUA0LRhjZcW8WTGSSquOoBTCDzCnHwm8i9qweWRzdqCMk4EkmUG6zeRjdOKIA4GwV197PlrI37AZjig4Hk/odEZ/FVSl+IAZIkxtqUyT5uDn6BfxB4cMLOF8Opp0Fdxmth5yDu8hxXdpTK9mE2pn5E7K+CduVw+vOtu054S2XjEw/k4o/4aNEBqpU58MZZ1axZvRIWGhkDNfFGVHKU7aZ1a5PnDpDIUJdw390905aEVEaa06CL6m0v5YW01+SWGnCBdNbSX+C0RVLD+/p9dUp65P4VcKmvmHVbS/rZgnYATb8MmG9tlPlv1BhcC3sCJNHlP3ydmTwsRjCCzNcqFAn4WalefgbOyoz53K/oe1g0MMstFY8JKMbG2s0HtvqBOWDnYyUdIuJnPNRt0LkrvWxU2Vs3dtunH2at2PqbflCMRC7niQot9CvuyipgIjKCkbUjIXBkEAmkugH2xzjZnDuS8C7reVA/yIg8rxhZhP1Bbj//PxZAho1JMOUVq2NH2l9VM6E0VFLXp0vOEl3HHAuMSR7O0dht5iOKzH6AQchpqIXukoWwTCcLfKwgj60JYxuXnTI0ICYOMaFlTTqzO5f6LS13WY1HHnmEuGVNj//96dU193JA2NTKBWGxPlZC0nEdiiu6auEVOWUc3yt5VL3WNSTPh32l6SeSrN3XYunLu0a7t3Mt1mB4qM X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(39860400002)(366004)(376002)(346002)(396003)(230173577357003)(230273577357003)(230922051799003)(186009)(451199024)(64100799003)(1800799009)(6512007)(2616005)(26005)(6486002)(44832011)(8676002)(36756003)(4326008)(8936002)(5660300002)(31696002)(41300700001)(2906002)(86362001)(66476007)(66556008)(316002)(66946007)(6666004)(53546011)(6506007)(478600001)(38100700002)(31686004)(83380400001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NTgxdVJjUm1XKzJlNEt1aDYwTmU4K0FHQk1rZ3ZKOFlZbkordS94Rlg2N2o4?= =?utf-8?B?eUh6SkVlN0UvTUZqTXdOQTZvQzM4Z2ZzYTBncVUwczUxV3hNNGJMTUx3VkQ5?= =?utf-8?B?M0gyaHZKTEszT1ZGVEZlK0F3dVpkQlRLMUdRbkU0VUdJbUFnbU1MazYzUFV3?= =?utf-8?B?c0ExbXk4YkdmaWZhMmJLWHhLeExjRGNNN3NtVTFyNWtvbVllemlBZk5KZkZz?= =?utf-8?B?b0F2cG5pcERNd202UEQ2RHVwdDhwNXZOenJWZzMzS0hrNFdZNC9Jc2FhN2RH?= =?utf-8?B?c2lpWnpHRjR4Qk8zU0pjOTNjNE5yM2VMbkN2cHA0OENIWDlyemxXUW9DVzFu?= =?utf-8?B?VGNuK3lvY2FhRGZWUm9STmhudXFSOUlNQVc1bXhjZnQxdnViRWlkQzhjS2NK?= =?utf-8?B?TnM2TG8xbXUzOG1URU1MdS9qSU5aeTdWak13NzFPSHFEMGZJRUw1Q29aRlNp?= =?utf-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kVFajFsRS8y?= =?utf-8?B?emc1djZwdkZxeVFqT1BmeFJnVlFFS3pxQjQxeFU0WkZLb1BEd0xxRW15N01v?= =?utf-8?B?UGRGNnVjQWVLWitaWUxPU0RlaXYrSktiNjlZZGpTTFk5UDAzMHJDNFhhUERa?= =?utf-8?B?YXI4ZnVhQTJFbHR6dm1BSjJqVUVndndDRFV2REdJL1Z4L1JiRnAzL2ZhSzFN?= =?utf-8?B?UWluMlAxS1YwcGVKSmhKczYyWFRxbTFSbzFyTjRBMk9URlg1d2VWRzRwbEM3?= =?utf-8?B?YWFZSmIvRkpvQm1aT2JYZkw2Yit4dVNGaTVVVEM2QkpjUEtGNjNRd25sMzhY?= =?utf-8?B?aHZobnVkOVl4NjlNL20wMHIyQWFTUzZVRWZlRExpVFlFaXFUK1Y1OGVteXN1?= =?utf-8?B?c2Nybmh6WDVBWUUwdTN6RURLYlFFeUt2WjRFMTh4c01aSHlGazZ1TmFkbVNP?= =?utf-8?B?MCs0dE9pMU1Cc2YxbmdnMWhPdmlNY1pXYWhWQytxNzJsSGg5YlU3VXpEVUx3?= =?utf-8?B?L0d4dE8yYUN2TVJSVkhiVGRVMWowTGpGZEt6UzhrdzA4Z1ZlUjFRM295aGpw?= =?utf-8?B?c3BmbFdxaDd3d1JScXJVRTkyYlpSMWZqWW1WZUwrU2pEUGp0a0JBckxaeUhI?= =?utf-8?B?K2krbzZXVGZabU9xQkgycldlbzdVVm95SUlFWGlFb3M2cjg5Q3pkQmpRM1V1?= =?utf-8?B?UTQreDY5dHFmTjJWeFVjYk9ubXlkb1dPYTh1QXhDdHRhRHdDb3A2QkVXbWZt?= =?utf-8?Q?O+GHk8RUBy44saHChhK9f4/QO?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae04ec30-e977-462b-0359-08dbdc0ca485 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 01:31:46.3345 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RwwMhBhW/3I6z5b/NQ40+OSOM6eY6KDX6XcH7cBgJwj+NL7XEVkjx576jCCQp1Ae X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB8431 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 On 8/2/2023 3:55 AM, Huisong Li wrote: > The command "tso set " is used to enable UFO, please > see commit ce8e6e742807 ("app/testpmd: support UFO in checksum engine") > > The above patch configures the RTE_MBUF_F_TX_UDP_SEG to enable UFO only if > tso_segsz is set. > "The above patch sets the RTE_MBUF_F_TX_UDP_SEG in mbuf ol_flags, only by checking if 'tso_segsz' is set, but missing check if UFO offload (RTE_ETH_TX_OFFLOAD_UDP_TSO) supported by device." > Then tx_prepare() may call rte_net_intel_cksum_prepare() > to compute pseudo header checksum (because some PMDs may supports TSO). > Not sure what do you mean by '(because some PMDs may supports TSO)'? Do you mean something like following: "RTE_MBUF_F_TX_UDP_SEG flag causes driver that supports TSO/UFO to compute pseudo header checksum." > As a result, if the peer sends UDP packets, all packets with UDP checksum > error are received for the PMDs only supported TSO. > "As a result, if device only supports TSO, but not UFO, UDP packet checksum will be wrong." > So enabling UFO also depends on if driver has RTE_ETH_TX_OFFLOAD_UDP_TSO > capability. Similarly, TSO also need to do like this. > > In addition, this patch also fixes cmd_tso_set_parsed() for UFO to make > it better to support TSO and UFO. > > Fixes: ce8e6e742807 ("app/testpmd: support UFO in checksum engine") > > Signed-off-by: Huisong Li > --- > v2: add handle for tunnel TSO offload in process_inner_cksums > > --- > app/test-pmd/cmdline.c | 47 +++++++++++++++++++++-------------------- > app/test-pmd/csumonly.c | 11 ++++++++-- > 2 files changed, 33 insertions(+), 25 deletions(-) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 0d0723f659..8be593d405 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -4906,6 +4906,7 @@ cmd_tso_set_parsed(void *parsed_result, > { > struct cmd_tso_set_result *res = parsed_result; > struct rte_eth_dev_info dev_info; > + uint64_t offloads; > int ret; > > if (port_id_is_invalid(res->port_id, ENABLED_WARN)) > @@ -4922,37 +4923,37 @@ cmd_tso_set_parsed(void *parsed_result, > if (ret != 0) > return; > > - if ((ports[res->port_id].tso_segsz != 0) && > - (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_TCP_TSO) == 0) { > - fprintf(stderr, "Error: TSO is not supported by port %d\n", > - res->port_id); > - return; > + if (ports[res->port_id].tso_segsz != 0) { > + if ((dev_info.tx_offload_capa & (RTE_ETH_TX_OFFLOAD_TCP_TSO | > + RTE_ETH_TX_OFFLOAD_UDP_TSO)) == 0) { > + fprintf(stderr, "Error: both TSO and UFO are not supported by port %d\n", > + res->port_id); > + return; > + } > + /* display warnings if configuration is not supported by the NIC */ > + if ((dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_TCP_TSO) == 0) > + fprintf(stderr, "Warning: port %d doesn't support TSO\n", > + res->port_id); > + if ((dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_UDP_TSO) == 0) > + fprintf(stderr, "Warning: port %d doesn't support UFO\n", > + res->port_id); > Requesting TSO/UFO by setting 'tso_segsz', but device capability missing is an error case, so OK to have first message. But only supporting TSO or UFO is not an error case, not sure about logging this. But even it is logged, I think it shouldn't be to stderr or it should say "Warning: ", a regular logging can be done. > } > > if (ports[res->port_id].tso_segsz == 0) { > ports[res->port_id].dev_conf.txmode.offloads &= > - ~RTE_ETH_TX_OFFLOAD_TCP_TSO; > - printf("TSO for non-tunneled packets is disabled\n"); > + ~(RTE_ETH_TX_OFFLOAD_TCP_TSO | RTE_ETH_TX_OFFLOAD_UDP_TSO); > + printf("TSO and UFO for non-tunneled packets is disabled\n"); > } else { > - ports[res->port_id].dev_conf.txmode.offloads |= > - RTE_ETH_TX_OFFLOAD_TCP_TSO; > - printf("TSO segment size for non-tunneled packets is %d\n", > + offloads = (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_TCP_TSO) ? > + RTE_ETH_TX_OFFLOAD_TCP_TSO : 0; > + offloads |= (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_UDP_TSO) ? > + RTE_ETH_TX_OFFLOAD_UDP_TSO : 0; > + ports[res->port_id].dev_conf.txmode.offloads |= offloads; > + printf("segment size for non-tunneled packets is %d\n", > ports[res->port_id].tso_segsz); > } > - cmd_config_queue_tx_offloads(&ports[res->port_id]); > - > - /* display warnings if configuration is not supported by the NIC */ > - ret = eth_dev_info_get_print_err(res->port_id, &dev_info); > - if (ret != 0) > - return; > - > - if ((ports[res->port_id].tso_segsz != 0) && > - (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_TCP_TSO) == 0) { > - fprintf(stderr, > - "Warning: TSO enabled but not supported by port %d\n", > - res->port_id); > - } > Above is redundant check, and introduced with commit [1], I assume by mistake. Since removing above check is not related to UFO, what do you think to separate it to its own patch? [1] Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check") > + cmd_config_queue_tx_offloads(&ports[res->port_id]); > cmd_reconfig_device_queue(res->port_id, 1, 1); > } > > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c > index c103e54111..21210aff43 100644 > --- a/app/test-pmd/csumonly.c > +++ b/app/test-pmd/csumonly.c > @@ -466,6 +466,12 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info, > uint64_t ol_flags = 0; > uint32_t max_pkt_len, tso_segsz = 0; > uint16_t l4_off; > + uint64_t all_tunnel_tso = RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO | > + RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO | > + RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO | > + RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO | > + RTE_ETH_TX_OFFLOAD_IP_TNL_TSO | > + RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO; > > /* ensure packet is large enough to require tso */ > if (!info->is_tunnel) { > @@ -505,7 +511,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info, > udp_hdr = (struct rte_udp_hdr *)((char *)l3_hdr + info->l3_len); > /* do not recalculate udp cksum if it was 0 */ > if (udp_hdr->dgram_cksum != 0) { > - if (tso_segsz) > + if (tso_segsz && (tx_offloads & RTE_ETH_TX_OFFLOAD_UDP_TSO)) > ol_flags |= RTE_MBUF_F_TX_UDP_SEG; > else if (tx_offloads & RTE_ETH_TX_OFFLOAD_UDP_CKSUM) { > ol_flags |= RTE_MBUF_F_TX_UDP_CKSUM; > @@ -528,7 +534,8 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info, > #endif > } else if (info->l4_proto == IPPROTO_TCP) { > tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + info->l3_len); > - if (tso_segsz) > + if (tso_segsz && > + (tx_offloads & (RTE_ETH_TX_OFFLOAD_TCP_TSO | all_tunnel_tso))) > Should we check 'all_tunnel_tso', and why they are checked only for TCP? As far as I can see some tunnel TSO offloads should case setting relevant mbuf flags, like RTE_MBUF_F_TX_TUNNEL_UDP or RTE_ETH_TX_OFFLOAD_IP_TNL_TSO. With above check, if RTE_ETH_TX_OFFLOAD_TCP_TSO not set but only RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO set, we still set 'RTE_MBUF_F_TX_TCP_SEG' flag but not 'RTE_MBUF_F_TX_TUNNEL_UDP' flag. I assume intention is to be close to previous implementation, where only tso_segsz checked, and cover as much as possible TSO offload requests, but not sure if this is accurate with expected usage. > ol_flags |= RTE_MBUF_F_TX_TCP_SEG; > else if (tx_offloads & RTE_ETH_TX_OFFLOAD_TCP_CKSUM) { > ol_flags |= RTE_MBUF_F_TX_TCP_CKSUM;