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 8C045A0C47; Tue, 12 Oct 2021 13:05:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67FF241135; Tue, 12 Oct 2021 13:05:30 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 7B70C4112E for ; Tue, 12 Oct 2021 13:05:29 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="227007845" X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="227007845" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2021 04:05:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="480308367" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga007.jf.intel.com with ESMTP; 12 Oct 2021 04:05:28 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 12 Oct 2021 04:05:28 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 12 Oct 2021 04:05:27 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 12 Oct 2021 04:05:27 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 12 Oct 2021 04:05:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rsa13RCH/9+E6wkU9dWgCMtZiAWT5EQ7c+fn/tgVIz7EDvFzjfO+vAurUSI2P7nA1EcSnoHh9o9VsFD4e34nUViv1Ifgt5nUKpiEQGqrp8Fn90xPUc8B91dHa8OP9n+sszIsLaltUaoqImlpf6UW3UwocZ0Ca39TYVyUBA4E9p1/fD3VnTT8Miqu0fHHrQupwSR6Re/qQ8ThlwrXsG5F6WhSmUqCOCi7fuMTgSxN2wv7bI8TdZDnJgHZMG611q/ZzH7OgBTKjViHTL4eA97M4Y6GQIWZtTJqqQXuTzfcdfpfI2ybgnI/A7JZXBi2qdWGLVdMY+l6j8DCF14G1YaBkg== 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=rCPRawc+xCNBNnEcsD+bfok5IIlN7PD/vccpxjBNh5A=; b=Bdqs9UJasfBobgsRRPjPcpFAjT8RrWmDWZaJoDpXh3OeESK3IhH61PQe9KoN4k8c1Rgrs4cnOjrCHuoB/Vnf7B0ew7uWRlOS7loTfP5F+WMBUpWIM6wk+iBtxl2oitc23Fw318ZAo0OP+75XfTu923Us5sUrC5DF5Aw0bEcmuJobPHhRqfsULTqKHWL9hUEQZW2eEY/FaW5953yA8o/IRgPHmXk0K0LOnZH1Ih31V9C3wLtb4Uz3kVyoaIJn0cvBamlTcXIhxgXcqqL4UmaKF9WLhtD5j93ArZsCzLCtdZQHNs9RlHRH9LGZ0GL5amfhYm8K67Cn53mH3O27lNY5tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rCPRawc+xCNBNnEcsD+bfok5IIlN7PD/vccpxjBNh5A=; b=uyTsARmpPdeQEHalAxVe1XA+l7GjeZpW1L/zzqlEwTn6qhSU7F9Niv+nxVK5QwLIOKhGYXczkQL1LvsE3ZKQYax4StcC1xXpPot7vzyUKJhXrMkXKCnNz8uvwC4m8gxSJmOLf/KralLd3miN2lH6JDUr+yicvn7/k+5GEtF7dhk= Authentication-Results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; Received: from CO1PR11MB4868.namprd11.prod.outlook.com (2603:10b6:303:90::19) by MWHPR11MB1600.namprd11.prod.outlook.com (2603:10b6:301:b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Tue, 12 Oct 2021 11:05:24 +0000 Received: from CO1PR11MB4868.namprd11.prod.outlook.com ([fe80::7c6e:d458:33ed:e579]) by CO1PR11MB4868.namprd11.prod.outlook.com ([fe80::7c6e:d458:33ed:e579%8]) with mapi id 15.20.4587.026; Tue, 12 Oct 2021 11:05:24 +0000 To: "Ananyev, Konstantin" , "Iremonger, Bernard" , "Medvedkin, Vladimir" CC: "dev@dpdk.org" , "mdr@ashroe.eu" , "Richardson, Bruce" , "Zhang, Roy Fan" , "hemant.agrawal@nxp.com" , "gakhil@marvell.com" , "anoobj@marvell.com" , "Doherty, Declan" , "Sinha, Abhijit" , "Buckley, Daniel M" , "marchana@marvell.com" , "ktejasree@marvell.com" , "matan@nvidia.com" References: <20210713133542.3550525-1-radu.nicolau@intel.com> <20211011112945.2876-1-radu.nicolau@intel.com> <20211011112945.2876-5-radu.nicolau@intel.com> From: "Nicolau, Radu" Message-ID: Date: Tue, 12 Oct 2021 12:05:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-ClientProxiedBy: DU2PR04CA0038.eurprd04.prod.outlook.com (2603:10a6:10:234::13) To CO1PR11MB4868.namprd11.prod.outlook.com (2603:10b6:303:90::19) MIME-Version: 1.0 Received: from [192.168.1.21] (109.255.186.106) by DU2PR04CA0038.eurprd04.prod.outlook.com (2603:10a6:10:234::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.24 via Frontend Transport; Tue, 12 Oct 2021 11:05:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c4aca232-93d6-4c8a-6bae-08d98d703074 X-MS-TrafficTypeDiagnostic: MWHPR11MB1600: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BNKf0nYsfTs7ijfnQs8J56Fh45OqwPL5CDYQVE5kii10dZly78yvb1rSjsZ/jqw028Td2CnaVi1mnYst2x9fjz85tu7bCJ78mBhB2neNXwogfWWMh96Ic0e8YbCSVbhACMTIbMjz8ZSKBcrKtxTJ+O5H+8DiVZhx39he/ebsJm3TQ9DESL6jwRYheaErdo+fhHI8hbeO7tx7Zy1yTLPu85gKqe55VANH38q4/x6zGtv9KUZm00Yuq8+ayKujUsZJ1q8EivbkU84L0SzJneltgIlbVWhqk1a45Ju9PTbXBwp0YWTKrm8MQlVNIdDFo7vdCL7hFzTzHT8t+ciUXrPjsdGQHRWg0GaHC0MrXrQgo2hcChBDskffh6VuOnIYBmRV9QWx/R1ciizeQ0PiGI8oCGRrtqio7F4JDoO3lecVu+4XLTvIyRtAFeoWLtaRWCHI1+9z4HusO6Z/wXmvQF9MRE1WI5Bzj66sXUJOSOEK1Ntl0hMu+SF/k8NJyRQkk0sBd80kppG4o7hwEEVmbp20a1n2jh34GYHZk+3jNxRkd7oBVGuVsmqcH40X4ozCz049Wg/rOCswWTtp8yhSUH8vijvlLy5umOld0ViKwzTqUVMI/YioKXfWF58CcwFaQhiDI9fRlEt8k06MxengYt8NStkpqn2Z5DKFfNx3mUHJH+yCcgHlmaD7OTP9Ju2DVLaqypUahd+e06ibRfEllwouCAPnvhiZnivUFXyCFOdlAaI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB4868.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(26005)(4326008)(6636002)(2906002)(31696002)(8936002)(86362001)(186003)(5660300002)(6486002)(8676002)(36756003)(66946007)(6666004)(31686004)(54906003)(66476007)(16576012)(38100700002)(66556008)(83380400001)(110136005)(55236004)(2616005)(956004)(316002)(53546011)(508600001)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?STNhQkJwdkI5aklxL1JQRTk4K2RFYnA4SzllYnN6RklUK000UDlmNDVNY29M?= =?utf-8?B?dlBVbnAyTndiWDg5eE1ZaHVEVDBkZVd1UmRwYmFraHAzOTlVMFM1QXhid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change-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2021 11:05:24.0108 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2KZvDfJqgtiFWhvDqDDY1eiiLHJvvaZOL9JDmgVaLm6XQ55fhytPF6BwiH5nTeTlPqwwxsTQKMmrHfkfaaj2XA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1600 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v8 04/10] ipsec: add support for NAT-T 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 Sender: "dev" On 10/12/2021 11:50 AM, Ananyev, Konstantin wrote: > >> >> >> + memcpy(sa->hdr, prm->tun.hdr, prm->tun.hdr_len); >> + >> + /* insert UDP header if UDP encapsulation is inabled */ >> + if (sa->type & RTE_IPSEC_SATP_NATT_ENABLE) { >> + struct rte_udp_hdr *udph = (struct rte_udp_hdr *) >> + &sa->hdr[prm->tun.hdr_len]; > I think we need a check somewhere here (probably in rte_ipsec_sa_init() or so) > to make sure that new sa->hdr_len wouldn't overrun sizeof(sa->hdr). Yes, I will add a check. > > >> + sa->hdr_len += sizeof(struct rte_udp_hdr); >> + udph->src_port = prm->ipsec_xform.udp.sport; >> + udph->dst_port = prm->ipsec_xform.udp.dport; >> + udph->dgram_cksum = 0; >> + } >> + >> /* update l2_len and l3_len fields for outbound mbuf */ >> sa->tx_offload.val = rte_mbuf_tx_offload(sa->hdr_l3_off, >> sa->hdr_len - sa->hdr_l3_off, 0, 0, 0, 0, 0); > > So for such packets UDP cksum will always be zero, and we don't need to > setup l4_hdr or any TX L4 flags, correct? UDP checksum should be 0 and must not be checked, this is what RFC requires indeed. So from what I can see we don't need to setup the l4 flags. >